ClaudeMods
☰
ZH-TW
● 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.

其他同名作品

更多類似作品