ClaudeMods
☰
ZH-CN
● 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 或状态行上方绘制一条带,并且可以单步执行 进入提示、工具调用以及会话的开始和结束。

|模组 |它消除的习惯 |你所看到的|使用费用| | ---| ---| ---| ---| | [merge-followthrough](合并后续)|输入“616 merged”(61次在30会话中),然后Claude花一个回合git checkout main && git pull并删除分支;会议开始时手动 ! git pull |您的 CI 公开 PR 范围 ✓ ✗ …;当合并被拉取时祝酒; /prs |无 | | [handoff-on-clear](清除切换)| /clear 之后“提示我重新启动”、“我丢失了您的反馈,您可以重新显示吗”|保存时吐司;带 ↺ Handoff from last session [Load] [Dismiss]; /handoff |每个 /clear 的 One 缓存分叉(选项 summarize,默认情况下打开)| | 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

更多类似作品