ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 ipartington

review-ledger

跨會話保留每個儲存庫的審查結果(H1、M3、L2...),並在 PR 合併時將其勾選掉

ipartington@ipartington

ipartington/claude-mods/tree/main/review-ledger

已翻譯

關於這個 mod

Claude模組

Five Claude Code mods 刪除例程 我一直用手做。每個 one 都來自對我的上一個 30 Claude Code的審核 會議。 mod 是函數鉤子的外掛:它在 Claude Code 內執行並且 可以在提示、窗格、toast 或狀態行上方繪製一條帶,並且可以單步執行 進入提示、工具呼叫以及會話的開始和結束。

|模組 |它消除的習慣 |你所看到的|使用費用| | ---| ---| ---| ---| CI [merge-followthrough](合併後續)|輸入「616 merged」(61次在30會話中),然後Claude花一個回合git checkout main && git pull並刪除分支;會議開始時手動 QXZKQZXCgit checkout main && git pull /prs |無 | | [handoff-on-clear](清除切換)| /clear 之後「提示我重新啟動」、「我遺失了你的回饋,你可以重新顯示嗎」|儲存時吐司;搭配 ↺ Handoff from last session [Load] [Dismiss]; /handoff |每個 /clear 的 QXZXIQ /handoff |每個 /clear 的 QXKQZXIQ 預設值 | bg-task-band | “我們看起來怎麼樣”、“有任何更新嗎”、“預計結束時間是什麼時候?” |樂隊:⏳ Wait for cp-22 recap 12m/25m · TASK [drain];結束後吐司|無 | | [review-ledger](審查分類帳) | “審核還剩下什麼?”,手動更新 H/M/L 列表 |按嚴重性排列的專案窗格 (/review);當某個專案的 PR 合併時祝酒 |無 | | tts-lite |一個 Stop 鉤子在每個回復中啟動一個完整的 claude -p 來進行總結,這留下了 200 雜散的文字記錄 |僅音頻 |簡短回复 無;更長的 git checkout main && git pullQ 完成俳句 |

每個 one 的工作原理

merge-followthrough:每個 60 輪詢 gh pr list --author @me。當公關 它看到 open 已合併,它檢查預設分支 pull --ff-onlys, 只要工作樹是乾淨的,就會刪除本地分支並修剪。開 你的下一個提示會告訴Claude它已經做了什麼,所以Claude不會重做。 鍵入 616 merged 會立即執行相同的步驟。在會話中啟動它 如果你沒有進行任何更改,則快進預設分支。

handoff-on-clear:在 session.end(/clear 或出口)上,它保存最後一個 答案,你最近提出的問題,提到的 PR 號和工件連結,分支, 以及(使用 summarize)來自 one $.model.fork 的 200 字切換,API 主要來自提示快取。它在每個目錄中保留 three 天。它 當你按下 Load、執行 /handoff 或詢問類似問題時,會轉到 Claude “重新顯示”或“提示重新啟動”。

bg-task-band:記錄後台 Bash、Monitor 和 Agent 調用 開始,每隔 10 讀取每個 one 的輸出檔案的最後一行,並對其進行標記 從任務結束時到達的任務通知中完成。一個TaskStop標記它停了下來。已完成的任務會在頻帶上保留 90 秒。

review-ledger:註冊工具 mcp__review-ledger__items,Claude 呼叫記錄結果(H1、M3、L2)及其狀態:開啟、進行中 有了 PR 號碼,要做,或不做。它存儲在每個存儲庫根目錄中,因此 保留 /clear 和新會話。每 5 分鐘都會檢查正在進行的 PR 並在 PR 合併時將專案標記為已完成。提示“評論”或姓名 一個專案將帳本作為上下文。

tts-lite:在 turn.complete 上,它讀取 20 單字或更少的回复 他們是,並向俳句詢問 one 句子關於任何更長的事情。它扮演他們 透過 Piper 和 paplay 或 espeak。它讀取相同的 CLAUDE_TTS, CLAUDE_TTS_SPEED、CLAUDE_TTS_VOICE 和 CLAUDE_TTS_MODEL 變數作為 它取代了 shell 鉤子,並且在該鉤子 (tts-speak.sh) 被激活時保持沉默 仍然是 ~/.claude/settings.json,所以你永遠不會聽到重複。

安裝

要求:Claude Code 2.1.288 或更高版本(功能掛鉤 mods 是早期訪問 並且 API 在版本之間移動),加上 git 和經過驗證的 merge-followthroughQ merge-followthrough 和 review-ledger。 tts-lite 需要 paplay 和 Piper 或說話。

透過在 CLAUDE_CODE_PLUGIN_DIRS 中列出資料夾來為每個會話載入它們 (冒號分隔)在 ~/.claude/settings.json 的 env 區塊中:

s
o
n
{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/code/claude-mods/merge-followthrough:~/code/claude-mods/handoff-on-clear:~/code/claude-mods/bg-task-band:~/code/claude-mods/review-ledger:~/code/claude-mods/tts-lite"
  }
}

僅適用於 one 會話:

s
h
claude --plugin-dir ./merge-followthrough --plugin-dir ./bg-task-band

或將它們複製到會話的熱重載資料夾中:

s
h
scripts/sync.sh ~/.claude/dev-mods/<session-id>

## 佈局

<mod>/
  .claude-plugin/plugin.json   manifest (name, version, options, state contract)
  hooks/hooks.json             { "modules": ["./register.tsx"] }
  hooks/register.tsx           the hooks module
  types/index.d.ts             $.state contract (mods that keep state)
  tests/*.test.ts              claude plugin test
scripts/
  check-mods.sh                validate / test the mods given files touch
  typecheck.sh                 tsc against Claude Code's generated API types
  sync.sh                      copy mods into a load folder

## 發展

s
h
pip install pre-commit && pre-commit install
claude plugin validate <mod>
claude plugin test <mod>
scripts/typecheck.sh            # all mods

預先提交鉤子執行標準衛生、gitleaks、shellcheck,並用於 mods 提交涉及:claude plugin validate,TypeScript 檢查和 claude plugin test。類型檢查需要 API 聲明 Claude Code 載入 mod 時寫入 .claude-plugin/types/。這些是根據每個生成的 構建,git-ignored,並在任何 ~/.claude/dev-mods 副本中自動找到。 如果沒有它們,類型檢查將被跳過並帶有註釋。

請參閱 AGENTS.md 以了解代理人(或個人)應遵循的約定 更改模組時請遵循。

許可證

[麻省理工學院](許可證)

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add ipartington/claude-mods
claude plugin install review-ledger
原文 / README

claude-mods

Five Claude Code mods that remove the routine I kept doing by hand. Each one comes from an audit of my last 30 Claude Code sessions. A mod is a plugin of function hooks: it runs inside Claude Code and can draw a band above the prompt, a pane, a toast or a status line, and can step into prompts, tool calls and the session's start and end.

| Mod | The habit it removes | What you see | Usage cost | | --- | --- | --- | --- | | merge-followthrough | Typing "616 merged" (61 times in 30 sessions), then Claude spending a turn on git checkout main && git pull and deleting the branch; ! git pull by hand at session start | Band of your open PRs with CI ✓ ✗ …; toast when a merge has been pulled; /prs | None | | handoff-on-clear | "give me a prompt to restart", "I've lost your feedback, can you redisplay" after /clear | Toast on save; band ↺ Handoff from last session [Load] [Dismiss]; /handoff | One cached fork per /clear (option summarize, on by default) | | bg-task-band | "how are we looking", "any updates", "when's the estimated end time?" | Band: ⏳ Wait for cp-22 recap 12m/25m · TASK [drain]; toast on finish | None | | review-ledger | "what's left to do from the review?", updating the H/M/L list by hand | Pane of items by severity (/review); toast when an item's PR merges | None | | tts-lite | A Stop hook starting a full claude -p per reply to speak a summary, which left 200 stray transcripts | Audio only | Short replies none; longer ones one bare Haiku completion |

How each one works

merge-followthrough: polls gh pr list --author @me every 60 s. When a PR it saw open is merged, it checks out the default branch, pull --ff-onlys, deletes the local branch and prunes, as long as the working tree is clean. On your next prompt it tells Claude what it already did, so Claude doesn't redo it. Typing 616 merged runs the same steps at once. At session start it fast-forwards the default branch if you're on it with no changes.

handoff-on-clear: on session.end (a /clear or an exit) it saves the last answer, your recent asks, PR numbers and artifact links mentioned, the branch, and (with summarize) a 200-word handoff from one $.model.fork, which the API serves mostly from the prompt cache. It's kept per directory for three days. It goes to Claude when you press Load, run /handoff, or ask something like "redisplay" or "prompt to restart".

bg-task-band: records background Bash, Monitor and Agent calls as they start, reads each one's output file every 10 s for the last line, and marks it done from the task notification that arrives when it ends. A TaskStop marks it stopped. Finished tasks stay on the band for 90 s.

review-ledger: registers the tool mcp__review-ledger__items, which Claude calls to record findings (H1, M3, L2) and their state: open, in-progress with a PR number, done, or won't do. It's stored per repository root, so it survives /clear and new sessions. Every 5 minutes it checks in-progress PRs and marks an item done when its PR merges. A prompt that says "review" or names an item gets the ledger as context.

tts-lite: on turn.complete it reads replies of 20 words or fewer out as they are, and asks Haiku for one sentence about anything longer. It plays them through Piper and paplay, or espeak. It reads the same CLAUDE_TTS, CLAUDE_TTS_SPEED, CLAUDE_TTS_VOICE and CLAUDE_TTS_MODEL variables as the shell hook it replaces, and stays silent while that hook (tts-speak.sh) is still in ~/.claude/settings.json, so you never hear double.

Install

Requirements: Claude Code 2.1.288 or later (function-hook mods are early access and the API moves between releases), plus git and an authenticated gh for merge-followthrough and review-ledger. tts-lite needs paplay and Piper or espeak.

Load them for every session by listing the folders in CLAUDE_CODE_PLUGIN_DIRS (colon-separated) in the env block of ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/code/claude-mods/merge-followthrough:~/code/claude-mods/handoff-on-clear:~/code/claude-mods/bg-task-band:~/code/claude-mods/review-ledger:~/code/claude-mods/tts-lite"
  }
}

For one session only:

claude --plugin-dir ./merge-followthrough --plugin-dir ./bg-task-band

Or copy them into a session's hot-reload folder:

scripts/sync.sh ~/.claude/dev-mods/<session-id>

Layout

<mod>/
  .claude-plugin/plugin.json   manifest (name, version, options, state contract)
  hooks/hooks.json             { "modules": ["./register.tsx"] }
  hooks/register.tsx           the hooks module
  types/index.d.ts             $.state contract (mods that keep state)
  tests/*.test.ts              claude plugin test
scripts/
  check-mods.sh                validate / test the mods given files touch
  typecheck.sh                 tsc against Claude Code's generated API types
  sync.sh                      copy mods into a load folder

Development

pip install pre-commit && pre-commit install
claude plugin validate <mod>
claude plugin test <mod>
scripts/typecheck.sh            # all mods

The pre-commit hooks run standard hygiene, gitleaks, shellcheck, and for the mods a commit touches: claude plugin validate, a TypeScript check and claude plugin test. The type-check needs the API declarations Claude Code writes into .claude-plugin/types/ when it loads a mod. Those are generated per build, git-ignored, and found automatically in any ~/.claude/dev-mods copy. Without them the type-check is skipped with a note.

See AGENTS.md for the conventions an agent (or a person) should follow when changing a mod.

License

MIT

更多類似作品