You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/review-loop/SKILL.md
+40-7Lines changed: 40 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
name: review-loop
3
3
description: Use this skill whenever the user asks for a review loop, self-review workflow, planner/reviewer/coder/code-reviewer collaboration, plan-before-code process, multi-round agent review, or a stable subagent workflow that must produce a plan, wait for user confirmation, implement code, review the diff, and preserve revision records. This skill requires real subagent support and must not fall back to single-agent roleplay.
4
-
protocolVersion: 1.0.0
4
+
protocolVersion: 2.0.0
5
5
---
6
6
7
7
# Review Loop
@@ -11,7 +11,10 @@ Use this skill to run a two-phase workflow:
11
11
1. Plan loop: `planner` writes or revises `plan.md`; `plan-reviewer` reviews it.
12
12
2. Code loop: after user confirmation, `coder` implements the confirmed plan; `code-reviewer` reviews the resulting diff.
13
13
14
-
The workflow requires real subagents. If the current environment cannot create real subagents, stop and tell the user that `review-loop` cannot run in this session.
14
+
The workflow requires real planner and coder subagents. If the current
15
+
environment cannot create them, stop and tell the user that `review-loop`
16
+
cannot run in this session. Codex and Claude Code reviewers run as standalone
17
+
CLI processes instead of custom subagents.
15
18
16
19
## Required Setup
17
20
@@ -21,23 +24,50 @@ Before doing task work:
21
24
2. Read `references/codex.md` or `references/claude-code.md` when that platform applies.
22
25
3. Create a task id.
23
26
4. Run `scripts/init-workspace.js` to create `.agent-workflows/review-loop/<task-id>/`.
24
-
5. Run `scripts/prepare-agent-roles.js` to prepare real subagent roles.
27
+
5. Run `scripts/prepare-agent-roles.js` to prepare the platform's real subagent roles.
25
28
6. Run `scripts/validate-state.js` before advancing.
26
29
27
30
Default `maxRounds` is `3`. If the user specifies a maximum loop count, pass it to `init-workspace.js`.
28
31
29
32
## Hard Rules
30
33
31
34
- Do not implement code until the plan loop has ended and the user explicitly confirms the plan.
32
-
- Do not let reviewer roles modify `plan.md` or source files; reviewers write JSON review files only.
33
-
- Use `scripts/validate-review-json.js` after every reviewer output.
35
+
- Do not let reviewer roles modify repository files. Reviewers return one strict
36
+
JSON object; the orchestrator persists and validates it with
37
+
`scripts/persist-review-json.js`.
38
+
- Start every reviewer in a fresh context that does not inherit planner/coder conversation history.
39
+
- On Codex or Claude Code, enter the reviewing phase, then run
40
+
`scripts/run-reviewer.js`. It starts a new read-only CLI process with
41
+
state-derived paths, binds every initial input to a SHA-256 digest, writes an
42
+
immutable `runtime/reviewer-runs/*` artifact, validates the strict JSON
43
+
result, and persists the canonical review. Code reviews also bind the
44
+
validated Git snapshot tree. Reviewing-phase advancement fails when any
45
+
bound input, snapshot, or run artifact changes. Confirmation gates check only
46
+
`plan.md` or the Git tree, so later task-workspace patch, scope, review, and
47
+
log edits do not block normal work by themselves. Do not invoke
48
+
`scripts/persist-review-json.js` directly on either platform.
49
+
- Use `scripts/validate-review-json.js` for later read-only revalidation.
34
50
- Use `scripts/snapshot-diff.js` after every code loop implementation round.
51
+
-`coder-complete` reconstructs the current Git tree, path partitions, and
52
+
patches; rerun `snapshot-diff.js` if any code changes after snapshotting.
53
+
- Once the current code reviewer-run artifact exists, do not replace its bound
54
+
snapshot even when canonical review persistence has not completed.
35
55
- Use `scripts/advance-state.js` for every state transition; never hand-edit `state.json`.
36
56
- Stop a loop when the reviewer returns `approved` or when the loop reaches `state.json.maxRounds`.
37
57
- When a loop stops because `maxRounds` is reached, summarize remaining findings and ask the user whether to continue, accept, or revise.
58
+
- If reviewed plan/code changes while waiting at a confirmation gate, prefer a
59
+
new review round. Override only after the user's current message explicitly
60
+
accepts the changed content; pass `--accept-changed-inputs true` with a
61
+
non-empty `--override-reason`. The transition records the accepted drift in
62
+
`state.json.confirmationOverrides`.
63
+
- Increase `maxRounds` only from that `max_rounds_reached` confirmation gate;
64
+
rejecting at that gate cannot resume drafting until the limit is increased,
65
+
after a current user message explicitly supplies a higher limit. Pass
66
+
`--user-confirmed true`; never reuse an earlier general instruction to bypass
67
+
the configured limit.
38
68
- Preserve every round's revision record in `plan.md`.
39
69
40
-
## Subagent Roles
70
+
## Workflow Roles
41
71
42
72
The four required roles are:
43
73
@@ -46,7 +76,10 @@ The four required roles are:
46
76
-`coder`
47
77
-`code-reviewer`
48
78
49
-
Use the templates under `templates/roles/` to prepare role definitions. If project-level roles already exist, reuse them. If not, ask whether to create temporary roles under the task workspace or persist roles to the project agent config.
79
+
Use the templates under `templates/roles/` as role definitions. On Codex and
80
+
Claude Code, only `planner` and `coder` are custom subagents;
81
+
`plan-reviewer` and `code-reviewer` templates are consumed by
82
+
`run-reviewer.js`. Do not create reviewer agent definitions.
only from its personal or project agent directories, so task-workspace
24
+
temporary roles are not supported.
24
25
25
26
## Persistent Agent Format
26
27
@@ -37,7 +38,9 @@ Do not implement code.
37
38
38
39
## Starting Roles
39
40
40
-
Codex does not spawn subagents without an explicit request. After roles are prepared, the orchestrator must explicitly start the four role subagents as the state machine requires.
41
+
Codex does not spawn subagents without an explicit request. After roles are
42
+
prepared, the orchestrator must explicitly start planner and coder as the state
43
+
machine requires. Reviewers are started only through `scripts/run-reviewer.js`.
41
44
42
45
For each role, include:
43
46
@@ -48,10 +51,43 @@ For each role, include:
48
51
- required output path
49
52
- instruction to return a concise summary to the orchestrator
50
53
54
+
After `planner-complete` or `coder-complete`, run the state-derived reviewer:
0 commit comments