ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 shabier

dashboard

侧边窗格中的 Bento 网格:时钟、待办、上下文预测、git、Hacker News。`/dash` 打开它。

shabier@shabier

shabier/claude-plugins/tree/main/plugins/dashboard

已翻译

关于这个 mod

dashboard

侧边窗格中的 Bento 网格:时钟、待办、上下文预测、git、Hacker News。/dash 打开它。

命令

| 命令 | 作用 | |---|---| | /dash | 打开或关闭 | | /dash list | 列出每个小组件、其大小以及它占用的大小 | | /dash add <widget> [WxH] | 添加一个小组件;未提供时使用默认大小 | | /dash rm <widget> | 移除一个;其数据会保留 | | /dash size <widget> <WxH> | 调整大小 | | /dash reset | 恢复默认布局 | | /dash autostart on\|off | 在工作阶段开始时打开。默认关闭 |

按键

点击窗格或按 ctrl+x tab 将按键交给它,按 Esc 交还按键。

待办磁贴拥有这些按键:j、k 移动,x 完成,d 删除。最后一行也会显示这些说明。当第二个磁贴拥有按键后,n 会移动焦点。

在提示列中输入 + buy milk 会新增待办事项,绝不会传给 Claude。只接受单行,因此即使粘贴 diff 也仍然有效。

小组件

| 小组件 | 大小 | 显示内容 | |---|---|---| | clock | 2x1, 1x1 | 点阵时间、日期、秒数 | | todo | 2x2, 2x1, 4x1 | 列表 | | context | 2x1, 2x2 | 压缩点所占比例、剩余 token、按当前速度估算的剩余回合。API key 显示成本;订阅中隐藏,因为那里没有意义 | | git | 2x2, 4x2, 2x1 | 分支、领先/落后、最近提交、带 +/- 条的变更文件 | | hn | 2x2, 4x2, 2x1 | 排名前 10 的故事,每 5 分钟更新。点击标题打开讨论串 |

布局顺序就是打包顺序。磁贴会拉伸以填满窗格。

Git 从设计上就是只读的:每次 Claude 编辑后以及每 10s,宿主都会运行 4 条固定的读取命令,不做其他操作。磁贴跟随 Claude 运行所在的文件夹。

编写小组件

  1. hooks/widgets/<id>.ts,使用 hooks/contract.ts 中的 defineWidget 构建。
  2. 将它加入 hooks/widgets/index.ts。
  3. claude plugin test plugins/dashboard。

小组件是纯的:init、update、draw、persist。没有 $,没有计时器。宿主拥有所有副作用(tick、工作阶段编号、git、fetch、存储),并把数据传入。颜色使用色调而不是十六进制:fg dim faint accent add mod del info link。链接通过 tile.link,只允许 https。

测试套件会让每个已注册小组件在每种大小下经过 19 个输入:不得抛出异常,每次绘制少于 50ms,不得越出自己的磁贴,状态要能通过 JSON 往返。运行时抛出异常的小组件会得到错误磁贴;其余小组件继续运行。

contract: 1。只允许新增内容。破坏性变更会是 v2,宿主会拒绝它不知道的版本。

限制

  • 仅调整高度的窗口大小变化不会重新适配;Claude Code 会在宽度变化时重绘。切换 /dash。
  • 新工作阶段会在第一次响应后显示上下文。
  • 剩余回合需要回答 2 个回合后才有速度基线。

致谢:CREDITS.md。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add shabier/claude-plugins
claude plugin install dashboard
原文 / README

dashboard

A bento grid in the side pane: clock, todo, context forecast, git, Hacker News. /dash opens it.

Commands

| Command | Does | |---|---| | /dash | open or close | | /dash list | every widget, its size, the sizes it takes | | /dash add <widget> [WxH] | add one, default size unless given | | /dash rm <widget> | remove one; its data stays | | /dash size <widget> <WxH> | resize | | /dash reset | back to the default layout | | /dash autostart on\|off | open at session start. Off by default |

Keys

Click the pane or ctrl+x tab to give it the keys, Esc to hand them back.

The todo tile owns them: j k move, x done, d delete. Its last row says so too. n moves focus once a second tile has keys.

+ buy milk in the prompt adds a todo and never reaches Claude. Single lines only, so a pasted diff still does.

Widgets

| Widget | Sizes | Shows | |---|---|---| | clock | 2x1, 1x1 | time in dot-matrix, date, seconds | | todo | 2x2, 2x1, 4x1 | the list | | context | 2x1, 2x2 | share of the compaction point, tokens left, turns left at the current pace. Cost on API keys; hidden on subscriptions, where it means nothing | | git | 2x2, 4x2, 2x1 | branch, ahead/behind, recent commits, changed files with +/- bars | | hn | 2x2, 4x2, 2x1 | top 10 stories, every 5 min. Click a title for the thread |

Layout order is packing order. Tiles stretch to fill the pane.

Git is read-only by construction: the host runs 4 fixed read commands and nothing else, after every edit Claude makes and every 10s. The tile follows the folder Claude runs in.

Writing a widget

  1. hooks/widgets/<id>.ts, built with defineWidget from hooks/contract.ts.
  2. Add it to hooks/widgets/index.ts.
  3. claude plugin test plugins/dashboard.

Widgets are pure: init, update, draw, persist. No $, no timers. The host owns every effect (ticks, session numbers, git, fetches, storage) and hands the data in. Colours are tones, never hex: fg dim faint accent add mod del info link. Links go through tile.link, https only.

The suite runs every registered widget through 19 inputs at every size: no throws, under 50ms a draw, nothing outside its tile, state through a JSON round trip. A widget that throws at runtime gets an error tile; the rest carry on.

contract: 1. Additions only. A break would be v2, and the host refuses versions it doesn't know.

Limits

  • Height-only window resizes don't refit; Claude Code redraws on width. Toggle /dash.
  • A fresh session shows context after its first response.
  • Turns left needs 2 answered turns to have a pace.

Credits: CREDITS.md.

其他同名作品

更多类似作品