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

reviewer2

一个 Claude Code skills-directory 插件,会在每次回答后让 Reviewer 2 的一句旁白出现在提示输入框上方的对话气泡中,并使用模型选择的头像。

dalbom@dalbom

dalbom/rev2agent/tree/main/.claude/skills/reviewer2

已翻译

关于这个 mod

reviewer2 是一个 Claude Code mod,从工作阶段主工作目录的 .claude/skills/reviewer2/ 以 <name>@skills-dir 的形式加载。在 Rev2Agent 根目录打开的工作阶段中,每次主循环回答后,它都会调用一个小模型生成 Reviewer 2 的一句旁白,并在提示输入框上方显示对话气泡,旁边是模型选择的头像。钩子包括:turn.start 清除气泡,turn.complete 启动后台模型调用;子代理工作阶段、中断、拒绝和错误都不会显示旁白。模型调用使用 $.model.complete,effort 为 low,输出 300 个 token,超时 30s,最多同时运行两个。回复的第一行会在方括号中写出头像([skeptical]);显示 SKIP 时不显示任何内容;未知 id 会回退到清单默认值。气泡按工作阶段存储在 $.store 中(保留最近 20 个工作阶段),从不加入对话。.claude-plugin/plugin.json 中的 userConfig 暴露 enabled 和 model(sonnet 或 haiku)的 /config 行;命令包括 /reviewer2、/reviewer2 status、/reviewer2 on|off 和 /reviewer2 again。文件包括:hooks/register.ts(事件连接、命令、存储)、hooks/bubble.ts(载荷、回复解析、头像目录、SVG、存储索引)、prompts/system.txt、avatars/(128px 圆形 PNG 和 manifest.json)以及 tests/。需要 Claude Code 2.1.287 或更高版本。

安装

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

claude plugin marketplace add dalbom/rev2agent
claude plugin install reviewer2
原文 / README

reviewer2

A Claude Code mod. In a session opened at a Rev2Agent checkout's root, after each main-loop answer it asks a small model for Reviewer 2's one-line aside and shows it in a speech bubble above the prompt, beside an avatar the model picks for the line. User-facing notes are in the repository README under "Reviewer 2 bubble".

How it is loaded

The folder is a skills-directory plugin: Claude Code loads .claude/skills/<name>/ of the session's primary working directory as <name>@skills-dir once the folder is trusted. So the mod runs only for sessions opened at the repository root, and nobody installs it. As a second guard, hooks/register.ts serves a session only when its project root has prompts/agent_workflow.md and prompts/conventions.md.

Mods need Claude Code 2.1.287 or later. Older builds skip the hooks module.

Behaviour

  • turn.start keeps the prompt and takes the bubble down. turn.complete starts the model call in the background and returns at once. Subagent turns, interruptions, refusals and errors get no aside.
  • The model call is $.model.complete on the session's own client: the model option (sonnet by default), effort low, 300 output tokens, 30 s timeout. At most two run at once.
  • The reply's first line names an avatar in brackets ([skeptical]); the rest is the aside. SKIP shows nothing. An unknown id falls back to the manifest's default.
  • While the model drafts, the band shows the thinking avatar with … (terminal: a dim line). Nothing shows while the assistant is working.
  • The bubble is saved per session in $.store, so a resume or a reload shows it again until the next prompt. The 20 most recent sessions are kept.
  • The aside is drawn only. It never enters the conversation.

Settings and commands

userConfig in .claude-plugin/plugin.json gives two /config rows:

| Option | Default | | | --- | --- | --- | | enabled | true | Draft an aside after each answer | | model | sonnet | sonnet or haiku |

/reviewer2 (or /reviewer2 status) shows the state and the last result. /reviewer2 on|off changes the enabled row through $.config.set, which reloads the module with the new value. /reviewer2 again drafts an aside for the last answer once more, even when off.

Files

| File | What it holds | | --- | --- | | hooks/register.ts | Event wiring: turns, the bubble, /reviewer2, storage | | hooks/bubble.ts | Pure logic: payload, reply parsing, avatar catalog, SVG, storage index | | prompts/system.txt | Reviewer 2's system prompt (the mod appends the reply format and avatar list) | | avatars/ | 128 px round PNGs and manifest.json, exported by assets/avatars/slice_avatars.py | | tests/ | claude plugin test suites |

Development

claude plugin validate .claude/skills/reviewer2
claude plugin test .claude/skills/reviewer2

An interactive session watches a skills-directory plugin and reloads the hooks module on save. To redraw or add avatars, generate 3x3 sheets into assets/avatars/sheets/ with the prompts in assets/avatars/PROMPTS.md (the sheets are not in git), update SHEETS in assets/avatars/slice_avatars.py, and run it; it rewrites avatars/ here.

更多类似作品