From 8c4baacb18c7735675b95a869e59bb01b51eca9b Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 22 Mar 2026 00:02:31 +0900 Subject: [PATCH 1/5] chore(cli): Add review-loop command Iterative review-and-fix cycle that reviews current diff, triages findings as fix/skip, applies fixes, verifies with lint+test, and repeats until clean (max 3 iterations). Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/commands/code/review-loop.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .agents/commands/code/review-loop.md diff --git a/.agents/commands/code/review-loop.md b/.agents/commands/code/review-loop.md new file mode 100644 index 000000000..b683c7ba0 --- /dev/null +++ b/.agents/commands/code/review-loop.md @@ -0,0 +1,13 @@ +--- +description: Iterative review-and-fix loop +--- + +Repeat the following cycle on the current working changes (max 3 iterations): + +1. **Review** the current diff for bugs, security issues, logic errors, and convention violations. +2. **Triage** each finding as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. +3. **Fix** only the "Fix" items. Keep changes minimal. +4. **Verify** with `npm run lint` and `npm run test`. +5. **Re-review** only the newly changed lines. Do not re-raise skipped items. + +Stop when no "Fix" items remain or 3 iterations are reached. Print a summary of what was fixed and what was skipped. From f8396b787e5d95215cb8c378634c1b7da5937bae Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 22 Mar 2026 00:08:13 +0900 Subject: [PATCH 2/5] chore(cli): Add review-loop command Add an iterative review-and-fix command that spawns 5 parallel review agents (correctness, security, performance, conventions, free review), triages findings, fixes actionable items, verifies with lint+test, and repeats until clean (max 3 iterations). Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/commands/code/review-loop.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.agents/commands/code/review-loop.md b/.agents/commands/code/review-loop.md index b683c7ba0..795c007bf 100644 --- a/.agents/commands/code/review-loop.md +++ b/.agents/commands/code/review-loop.md @@ -2,12 +2,17 @@ description: Iterative review-and-fix loop --- -Repeat the following cycle on the current working changes (max 3 iterations): +Repeat the following cycle on the current branch's changes against `main` (max 3 iterations): -1. **Review** the current diff for bugs, security issues, logic errors, and convention violations. -2. **Triage** each finding as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. +1. **Review** — Spawn 5 agents in parallel, each reviewing the current diff from a different angle: + - **Agent 1 — Correctness**: Bugs, logic errors, edge cases, regressions + - **Agent 2 — Security**: Vulnerabilities, injection risks, secret exposure, unsafe patterns + - **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations + - **Agent 4 — Conventions**: Project conventions (CLAUDE.md), naming, structure, test coverage + - **Agent 5 — Free review**: Anything else worth flagging that the other agents may have missed +2. **Triage** — Merge all agent findings and classify each as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. 3. **Fix** only the "Fix" items. Keep changes minimal. -4. **Verify** with `npm run lint` and `npm run test`. +4. **Verify** with `npm run lint` and `npm run test`. Fix any regressions before continuing. 5. **Re-review** only the newly changed lines. Do not re-raise skipped items. Stop when no "Fix" items remain or 3 iterations are reached. Print a summary of what was fixed and what was skipped. From e098690e4a1a8e82fcfaf15c9e10b88e0c55ef48 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 22 Mar 2026 00:37:58 +0900 Subject: [PATCH 3/5] fix(cli): Address review feedback on review-loop command - Reference .agents/rules/base.md instead of CLAUDE.md for conventions - Make verify step explicit about repeating until checks pass Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/commands/code/review-loop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.agents/commands/code/review-loop.md b/.agents/commands/code/review-loop.md index 795c007bf..39c1aa226 100644 --- a/.agents/commands/code/review-loop.md +++ b/.agents/commands/code/review-loop.md @@ -8,11 +8,11 @@ Repeat the following cycle on the current branch's changes against `main` (max 3 - **Agent 1 — Correctness**: Bugs, logic errors, edge cases, regressions - **Agent 2 — Security**: Vulnerabilities, injection risks, secret exposure, unsafe patterns - **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations - - **Agent 4 — Conventions**: Project conventions (CLAUDE.md), naming, structure, test coverage + - **Agent 4 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure, test coverage - **Agent 5 — Free review**: Anything else worth flagging that the other agents may have missed 2. **Triage** — Merge all agent findings and classify each as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. 3. **Fix** only the "Fix" items. Keep changes minimal. -4. **Verify** with `npm run lint` and `npm run test`. Fix any regressions before continuing. +4. **Verify** with `npm run lint` and `npm run test`. Fix any regressions and repeat this step until all checks pass before continuing. 5. **Re-review** only the newly changed lines. Do not re-raise skipped items. Stop when no "Fix" items remain or 3 iterations are reached. Print a summary of what was fixed and what was skipped. From 459164f74535b3cce5fd2542954a90fe6e7d5f39 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 22 Mar 2026 00:42:40 +0900 Subject: [PATCH 4/5] refactor(cli): Align review-loop agents with claude-code-action categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reorganize review agents to match established patterns: - Correctness → Code quality (adds code smells) - Free review → Test coverage (dedicated agent) - Conventions no longer includes test coverage - Add double-filter: agents report only noteworthy findings, triage step re-filters before classifying Fix/Skip Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/commands/code/review-loop.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.agents/commands/code/review-loop.md b/.agents/commands/code/review-loop.md index 39c1aa226..86bb79f36 100644 --- a/.agents/commands/code/review-loop.md +++ b/.agents/commands/code/review-loop.md @@ -5,12 +5,13 @@ description: Iterative review-and-fix loop Repeat the following cycle on the current branch's changes against `main` (max 3 iterations): 1. **Review** — Spawn 5 agents in parallel, each reviewing the current diff from a different angle: - - **Agent 1 — Correctness**: Bugs, logic errors, edge cases, regressions + - **Agent 1 — Code quality**: Bugs, logic errors, edge cases, code smells - **Agent 2 — Security**: Vulnerabilities, injection risks, secret exposure, unsafe patterns - **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations - - **Agent 4 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure, test coverage - - **Agent 5 — Free review**: Anything else worth flagging that the other agents may have missed -2. **Triage** — Merge all agent findings and classify each as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. + - **Agent 4 — Test coverage**: Missing tests, untested edge cases, test quality + - **Agent 5 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure + Each agent should only report noteworthy findings. +2. **Triage** — Review agent findings and keep only what you also deem noteworthy. Classify each as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. 3. **Fix** only the "Fix" items. Keep changes minimal. 4. **Verify** with `npm run lint` and `npm run test`. Fix any regressions and repeat this step until all checks pass before continuing. 5. **Re-review** only the newly changed lines. Do not re-raise skipped items. From e2fca267d0aa466353ea117b1907b4fbf3533b76 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 22 Mar 2026 00:44:53 +0900 Subject: [PATCH 5/5] feat(cli): Add holistic review agent to review-loop command Add Agent 6 for overall design concerns, side effects, and integration risks that the other 5 specialized agents may miss. Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/commands/code/review-loop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.agents/commands/code/review-loop.md b/.agents/commands/code/review-loop.md index 86bb79f36..3b687e611 100644 --- a/.agents/commands/code/review-loop.md +++ b/.agents/commands/code/review-loop.md @@ -4,12 +4,13 @@ description: Iterative review-and-fix loop Repeat the following cycle on the current branch's changes against `main` (max 3 iterations): -1. **Review** — Spawn 5 agents in parallel, each reviewing the current diff from a different angle: +1. **Review** — Spawn 6 agents in parallel, each reviewing the current diff from a different angle: - **Agent 1 — Code quality**: Bugs, logic errors, edge cases, code smells - **Agent 2 — Security**: Vulnerabilities, injection risks, secret exposure, unsafe patterns - **Agent 3 — Performance**: Inefficiencies, resource leaks, unnecessary allocations - **Agent 4 — Test coverage**: Missing tests, untested edge cases, test quality - **Agent 5 — Conventions**: Project conventions (.agents/rules/base.md), naming, structure + - **Agent 6 — Holistic review**: Overall design concerns, side effects of changes, integration risks that individual agents may miss Each agent should only report noteworthy findings. 2. **Triage** — Review agent findings and keep only what you also deem noteworthy. Classify each as **Fix** (clear defects, must fix) or **Skip** (style, nitpicks, scope creep). Show a brief table before changing anything. 3. **Fix** only the "Fix" items. Keep changes minimal.