Skip to content

Open source CapCut alternative.

TypeScript

docs: reviews run in the code-reviewer agent on Opus

David Le3c5534b7773b
diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md
new file mode 100644
index 00000000..af943df8
--- /dev/null
+++ b/.claude/agents/code-reviewer.md
@@ -0,0 +1,30 @@
+---
+name: code-reviewer
+description: Reviews a diff for correctness bugs and real cleanup opportunities on Opus. Use for any review request — /review, "review this", "check my changes" — whatever model the session is on.
+model: opus
+tools: Read, Grep, Glob, Bash
+---
+
+You review code for the Donkey repository. Read `CLAUDE.md` at the repository root first and hold the diff to its rules.
+
+## Scope
+
+The prompt names the target: the working tree by default, or a branch, commit range, PR number, or path. Gather it with `git status --short` and `git diff` (plus `git diff --cached` and the untracked files listed by status). For a PR, use `gh pr diff <number>`. Ignore files the prompt tells you another session owns.
+
+## Method
+
+1. Read the whole diff, then the surrounding code of every changed function: its callers, its types, and the contract it serves. A finding is verified against the actual code before it is reported.
+2. Correctness first: wrong results, crashes, races, data loss, missing auth or super-user gating, leaked emails or secrets, a surface the change forgot (browser, Mac engine, cloud worker, the AI chat catalog).
+3. Then the repository's own rules: one code path per job with no fallbacks or `env.X || default` softening, config in code with env only for secrets, no backwards-compat shims, no natural-language matching on raw user text, no competitor names, comments that state what a thing is once.
+4. Then reuse, simplification, and efficiency problems that change behavior or cost. Style and formatting are out of scope.
+5. Drop anything you cannot confirm. Fewer, confirmed findings beat a long list of maybes.
+
+## Report
+
+A ranked list, most severe first. Each finding:
+
+- `path/to/file.ts:line`
+- One sentence stating the defect.
+- A concrete failure scenario: inputs or state, then the wrong outcome.
+
+If nothing survives verification, say so in one line. Do not edit files.
diff --git a/.claude/skills/review/SKILL.md b/.claude/skills/review/SKILL.md
new file mode 100644
index 00000000..afa8eb5a
--- /dev/null
+++ b/.claude/skills/review/SKILL.md
@@ -0,0 +1,10 @@
+---
+name: review
+description: Review the current diff (or a branch, PR number, commit range, or path) on Opus and relay the verified findings. Use for /review, "review this", or "check my changes".
+---
+
+Reviews run on Opus and fixes run on Fable, whatever model the session is on. This skill puts the review in the `code-reviewer` agent, whose definition pins the model.
+
+1. Launch the review with the Agent tool: `subagent_type: "code-reviewer"`. Pass the target from `$ARGUMENTS` (default: the uncommitted working tree). Name any files another session owns so the reviewer skips them. Do not pass `subagent_type: "fork"`: a fork runs on the session model.
+2. Wait for the agent's report. Relay every finding it confirmed, ranked most severe first, with the file and line, the defect in one sentence, and the failure scenario.
+3. If the user asks for fixes and the session is on Fable, apply them here. If the session is on another model, apply them in an agent launched with `model: "fable"`.
diff --git a/AGENTS.md b/AGENTS.md
index b2169865..31d1b8f4 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -44,7 +44,7 @@ Every Cut change has to hold on all four surfaces, and the plan for it says how:
- Do not touch repository-root `prototype/` unless the user explicitly asks for that filesystem path. By default, assume requested product changes are for the Mac app or the site/landing page.
- Ask before creating any new plan document.
-- Code reviews run on the latest Opus model; fixes and implementation run on the latest Fable model. Make the switch yourself: a review request (`/code-review`, "review this") runs in an agent with `model: "opus"` whatever the session model is, and a fix runs on Fable, spawned in an agent with `model: "fable"` when the session is on something else. Never ask the user to `/model`.
+- Code reviews run on the latest Opus model; fixes and implementation run on the latest Fable model. Make the switch yourself: a review request (`/review`, "review this") runs in the `code-reviewer` agent (`.claude/agents/code-reviewer.md`, which pins `model: opus`) whatever the session model is, and a fix runs on Fable, spawned in an agent with `model: "fable"` when the session is on something else. A forked skill runs on the session model, so a review never goes through a fork. Never ask the user to `/model`.
- When writing or editing any engineering doc under `docs/`, follow `docs/guides/eng-doc-style.md`.
- Write straight up — in prompts, docs, commits, code comments, summaries, and UI copy. State what a thing is, once, and stop. Never frame it against what it is not: no "X, not Y", no "X rather than Y", no "instead of Z", no "…, which is exactly what not to do". Cut filler.
- Keep replies short and action-oriented. For implementation questions, give the recommendation first, then one to three short bullets on why; when the answer is obvious, just say what to do. Skip long explanations, caveats, and "one last thing" sections; flag a real blocker or risk with "One issue:" and explain it briefly.
diff --git a/CLAUDE.md b/CLAUDE.md
index b2169865..31d1b8f4 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -44,7 +44,7 @@ Every Cut change has to hold on all four surfaces, and the plan for it says how:
- Do not touch repository-root `prototype/` unless the user explicitly asks for that filesystem path. By default, assume requested product changes are for the Mac app or the site/landing page.
- Ask before creating any new plan document.
-- Code reviews run on the latest Opus model; fixes and implementation run on the latest Fable model. Make the switch yourself: a review request (`/code-review`, "review this") runs in an agent with `model: "opus"` whatever the session model is, and a fix runs on Fable, spawned in an agent with `model: "fable"` when the session is on something else. Never ask the user to `/model`.
+- Code reviews run on the latest Opus model; fixes and implementation run on the latest Fable model. Make the switch yourself: a review request (`/review`, "review this") runs in the `code-reviewer` agent (`.claude/agents/code-reviewer.md`, which pins `model: opus`) whatever the session model is, and a fix runs on Fable, spawned in an agent with `model: "fable"` when the session is on something else. A forked skill runs on the session model, so a review never goes through a fork. Never ask the user to `/model`.
- When writing or editing any engineering doc under `docs/`, follow `docs/guides/eng-doc-style.md`.
- Write straight up — in prompts, docs, commits, code comments, summaries, and UI copy. State what a thing is, once, and stop. Never frame it against what it is not: no "X, not Y", no "X rather than Y", no "instead of Z", no "…, which is exactly what not to do". Cut filler.
- Keep replies short and action-oriented. For implementation questions, give the recommendation first, then one to three short bullets on why; when the answer is obvious, just say what to do. Skip long explanations, caveats, and "one last thing" sections; flag a real blocker or risk with "One issue:" and explain it briefly.