5-phase-workflow 1.9.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +68 -420
  2. package/bin/install.js +294 -64
  3. package/bin/sync-agents.js +50 -11
  4. package/docs/findings.md +3 -3
  5. package/docs/workflow-guide.md +110 -1046
  6. package/package.json +6 -5
  7. package/src/agents/step-executor-agent.md +49 -0
  8. package/src/agents/step-orchestrator-agent.md +111 -0
  9. package/src/agents/verification-agent.md +78 -0
  10. package/src/commands/5/address-review-findings.md +69 -403
  11. package/src/commands/5/apply-review-findings.md +66 -0
  12. package/src/commands/5/configure.md +110 -76
  13. package/src/commands/5/discuss-feature.md +47 -57
  14. package/src/commands/5/eject.md +7 -6
  15. package/src/commands/5/implement.md +202 -0
  16. package/src/commands/5/plan.md +164 -0
  17. package/src/commands/5/reconfigure.md +30 -29
  18. package/src/commands/5/reply-pr-comments.md +46 -0
  19. package/src/commands/5/review.md +95 -0
  20. package/src/commands/5/split.md +190 -0
  21. package/src/commands/5/synchronize-agents.md +4 -4
  22. package/src/commands/5/triage-pr-comments.md +70 -0
  23. package/src/commands/5/update.md +8 -8
  24. package/src/hooks/check-updates.js +50 -7
  25. package/src/hooks/plan-guard.js +28 -22
  26. package/src/hooks/statusline.js +50 -4
  27. package/src/skills/configure-docs-index/SKILL.md +16 -20
  28. package/src/skills/configure-skills/SKILL.md +12 -12
  29. package/src/templates/AGENTS.md +94 -0
  30. package/src/templates/workflow/FIX-PLAN.md +1 -1
  31. package/src/templates/workflow/PLAN-COMPACT.md +42 -0
  32. package/src/templates/workflow/PLAN.md +58 -34
  33. package/src/templates/workflow/REVIEW-FINDINGS.md +7 -16
  34. package/src/templates/workflow/REVIEW-SUMMARY.md +5 -0
  35. package/src/templates/workflow/STATE.json +32 -3
  36. package/src/agents/component-executor.md +0 -57
  37. package/src/commands/5/implement-feature.md +0 -381
  38. package/src/commands/5/plan-feature.md +0 -293
  39. package/src/commands/5/plan-implementation.md +0 -333
  40. package/src/commands/5/quick-implement.md +0 -375
  41. package/src/commands/5/review-code.md +0 -212
  42. package/src/commands/5/verify-implementation.md +0 -277
  43. package/src/templates/workflow/FEATURE-SPEC.md +0 -100
  44. package/src/templates/workflow/VERIFICATION-REPORT.md +0 -103
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: 5:implement
3
+ description: Executes a unified plan by spawning step-orchestrator-agent, per-step executor agents, and verification-agent.
4
+ allowed-tools: Agent, Read, Write, Glob, Grep, Bash, TaskCreate, TaskUpdate, TaskList
5
+ user-invocable: true
6
+ argument-hint: [feature-name]
7
+ ---
8
+
9
+ <role>
10
+ You are an Implementation Orchestrator. You keep your context lean, delegate all code edits, and use `.5/features/{name}/state.json` as source of truth.
11
+ You do NOT write source code yourself.
12
+ </role>
13
+
14
+ # Implement
15
+
16
+ ## Process
17
+
18
+ ### Step 1: Load Artifacts
19
+
20
+ Read `.5/features/{feature-name}/state.json` first if it exists.
21
+
22
+ Then read only the artifacts needed for the current path:
23
+
24
+ - Resume existing state: `.5/config.json` if needed for baseline, verification, or auto-commit.
25
+ - New state or restart: `plan.md`, `codebase-scan.md` if it exists, and `.5/config.json` if it exists.
26
+ - Final verification: `plan.md`, `state.json`, `.5/config.json` if present, and `codebase-scan.md` only if verification needs missing context.
27
+
28
+ If `plan.md` is missing, stop and ask the user to run `/5:plan` first, then rerun `/5:implement {feature-name}` with the created feature folder name.
29
+
30
+ If state exists:
31
+
32
+ - `completed`: tell the user it is already implemented and verification already ran.
33
+ - `in-progress`: resume from `currentStep`.
34
+ - `failed`: ask whether to resume or restart.
35
+
36
+ ### Step 2: Orchestrate Plan Into State
37
+
38
+ If state does not exist or restart was requested, spawn `step-orchestrator-agent`.
39
+
40
+ In Codex, use `model: gpt-5.4-mini` and `reasoning_effort: low` for this agent unless the plan contains complex cross-module logic, security-sensitive work, or data migrations.
41
+
42
+ Prompt:
43
+
44
+ ```text
45
+ Read `.claude/agents/step-orchestrator-agent.md` for your role and output contract.
46
+
47
+ Feature: {feature-name}
48
+ Plan: .5/features/{feature-name}/plan.md
49
+ Codebase scan: .5/features/{feature-name}/codebase-scan.md
50
+ Config: .5/config.json if present
51
+
52
+ Create `.5/features/{feature-name}/state.json`.
53
+ Derive steps, dependencies, model choices, pattern references, verify commands, and executor prompts from the clean plan.
54
+ Keep steps minimal: group independent components in parallel; split only for real data/order dependencies or same-file conflicts.
55
+ ```
56
+
57
+ Read back `state.json` and verify:
58
+
59
+ - `status` is `in-progress`
60
+ - `steps` is non-empty
61
+ - each pending component has `step`, `mode`, `model`, `patternRefs` or legacy `patternFiles`, and `verifyCommands`
62
+
63
+ Remove `.5/.planning-active` after state is valid.
64
+
65
+ ### Step 3: Establish Baseline
66
+
67
+ Run build/test commands from `.5/config.json` by default. If `state.json` defines an explicit baseline command block, prefer that block. Skip commands explicitly set to `none`.
68
+
69
+ If `state.json.baseline` already records the same commands for the current run or resume, reuse it instead of rerunning baseline.
70
+
71
+ Record compact command results in `state.json.baseline`: command, status, and a one-line summary only. Append full command history to `state-events.jsonl`. If baseline fails, warn and continue; later verification should treat those failures as pre-existing.
72
+
73
+ Command event shape:
74
+
75
+ ```json
76
+ {"type":"command","timestamp":"{ISO}","step":0,"component":null,"status":"passed|failed|skipped","summary":"one line","details":{"command":"{command}","phase":"baseline"}}
77
+ ```
78
+
79
+ ### Step 4: Execute Steps
80
+
81
+ For each step from `currentStep`:
82
+
83
+ 1. Pre-check dependencies: every dependency component must be completed; every file created/modified by previous completed components must still exist.
84
+ 2. Create/update progress tasks for the step.
85
+ 3. Spawn executor agents:
86
+ - Use one agent per component when `mode` is `parallel`.
87
+ - Use one agent at a time when `mode` is `sequential` or when components touch the same file.
88
+ - Give each executor the inline contract below instead of making it read `.claude/agents/step-executor-agent.md`.
89
+ - In Codex, map each component model before spawning:
90
+ - `haiku` -> `model: gpt-5.4-mini`, `reasoning_effort: low`
91
+ - `sonnet` -> `model: gpt-5.4`, `reasoning_effort: medium`
92
+ - missing model -> `model: gpt-5.4-mini`, `reasoning_effort: low`
93
+ 4. Give each executor only its component block from `state.json`, relevant global notes, required pattern references, verify commands, and this inline contract:
94
+
95
+ ```text
96
+ Implement exactly the assigned component. Read only listed patternRefs ranges/symbols and the target file. Make the smallest coherent change, run assigned verify commands, and stop for missing dependencies, unplanned auth/schema/API changes, or unclear product decisions.
97
+
98
+ End with:
99
+ ---RESULT---
100
+ STATUS: success | failed
101
+ FILES_CREATED: [comma-separated paths]
102
+ FILES_MODIFIED: [comma-separated paths]
103
+ VERIFY: passed | failed | skipped
104
+ DEVIATIONS: none | {brief list}
105
+ ERROR: none | {error description}
106
+ ---END---
107
+ ```
108
+
109
+ If a component has legacy `patternFiles`, tell the executor to read only the smallest relevant sections.
110
+ 5. Parse only the `---RESULT---` block from each response.
111
+ 6. Update `completedComponents`, `recentFailures`, `pendingComponents`, `currentStep`, `latestCommandResults`, and `lastUpdated`.
112
+ - Append `component_result`, `retry`, and `command` events to `state-events.jsonl`.
113
+ - Keep only the most recent compact summaries in `state.json`.
114
+ 7. Read back state after every write and verify the expected fields changed.
115
+
116
+ Retry failed components up to two times. Upgrade retries to `sonnet`; in Codex this means `model: gpt-5.4`, `reasoning_effort: medium`. Never fix code in the orchestrator context.
117
+
118
+ Component and retry event shapes:
119
+
120
+ ```json
121
+ {"type":"component_result","timestamp":"{ISO}","step":1,"component":"{name}","status":"success|failed","summary":"one line","details":{"filesCreated":[],"filesModified":[],"verify":"passed|failed|skipped"}}
122
+ {"type":"retry","timestamp":"{ISO}","step":1,"component":"{name}","status":"failed","summary":"retry reason","details":{"attempt":2,"model":"sonnet"}}
123
+ ```
124
+
125
+ ### Step 5: Auto-commit Completed Step
126
+
127
+ After each step completes successfully, check `.5/config.json` for `git.autoCommit`.
128
+
129
+ If `git.autoCommit` is `true`:
130
+
131
+ 1. Stage only files owned by components completed in this step:
132
+ - `file` for create/modify/delete targets.
133
+ - both `sourceFile` and `file` for rename targets.
134
+ - files reported in executor `FILES_CREATED` and `FILES_MODIFIED`.
135
+ 2. Do not stage unrelated working tree changes.
136
+ 3. Build the commit message from `git.commitMessage.pattern`:
137
+ - Replace `{ticket-id}` with `state.ticket` or an empty string.
138
+ - Replace `{short-description}` with `step {number}: {step-name}`.
139
+ - Trim redundant whitespace and punctuation if ticket ID is empty.
140
+ 4. Commit the staged files.
141
+ 5. Append a detailed entry to `state-events.jsonl` and a compact latest entry to `state.json.latestCommitResults`:
142
+
143
+ ```json
144
+ {
145
+ "type": "commit",
146
+ "timestamp": "{ISO-timestamp}",
147
+ "step": 1,
148
+ "component": null,
149
+ "status": "committed|skipped|failed",
150
+ "summary": "{commit-message-or-reason}",
151
+ "details": {
152
+ "commit": "{sha-or-null}",
153
+ "files": ["path/to/file"],
154
+ "error": null
155
+ }
156
+ }
157
+ ```
158
+
159
+ If there are no changed files for the step, skip the commit and record `status: "skipped"`. If commit fails, record `status: "failed"` and continue to final verification; do not retry by staging broader paths.
160
+
161
+ If `git.autoCommit` is missing or `false`, do not commit.
162
+
163
+ ### Step 6: Final Verification
164
+
165
+ After all steps complete, spawn `verification-agent`.
166
+
167
+ In Codex, use `model: gpt-5.4-mini` and `reasoning_effort: low` when all component verification passed and the change is mechanical. Use `model: gpt-5.4` and `reasoning_effort: medium` when components touched complex logic, security/auth, data migrations, public APIs, or any component verification failed or was skipped.
168
+
169
+ Prompt:
170
+
171
+ ```text
172
+ Read `.claude/agents/verification-agent.md` for your role and output contract.
173
+
174
+ Verify feature `{feature-name}` using:
175
+ - .5/features/{feature-name}/plan.md
176
+ - .5/features/{feature-name}/state.json
177
+ - .5/config.json if present
178
+ - .5/features/{feature-name}/codebase-scan.md only if plan/state are insufficient to judge acceptance criteria, patterns, or risks
179
+
180
+ Verify that the implementation is complete and correct, the project builds, tests run, everything from the plan is implemented, and tests are written for the implemented feature where appropriate.
181
+ Reuse `state.json.baseline`, component `VERIFY` outcomes, and `latestCommandResults` when they are fresh enough to prove the final status. Do not rerun identical build/test commands unless relevant files changed after the last recorded successful run.
182
+ Update `.5/features/{feature-name}/state.json` verification fields.
183
+ Do not write a verification report.
184
+ Do not implement fixes.
185
+ ```
186
+
187
+ Parse only the `---VERIFICATION---` block from the response.
188
+
189
+ If final verification passes, set state `status` to `completed`. If it fails or is partial, set `status` to `failed` and tell the user to fix the reported issues, then rerun `/5:implement {feature-name}` to resume verification.
190
+
191
+ ### Step 7: Report
192
+
193
+ Report:
194
+
195
+ - Completed component count
196
+ - Failed component count
197
+ - Verification status
198
+ - Path to `state.json`
199
+ - Auto-commit count and any failed commit attempts, if `git.autoCommit` is true
200
+ - Failed commands, missing tests, or unmet acceptance criteria, if any
201
+
202
+ Stop.
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: 5:plan
3
+ description: Plans a feature end-to-end, combines requirements and technical discovery, and writes a unified plan.md. Single review gate before /5:implement.
4
+ allowed-tools: Bash, Read, Write, Agent, AskUserQuestion, mcp__claude_ai_Atlassian_Rovo__getJiraIssue
5
+ user-invocable: true
6
+ argument-hint: [ticket-id-or-description]
7
+ ---
8
+
9
+ <role>
10
+ You are a Workflow Planner. Your only deliverable is `.5/features/{name}/plan.md`.
11
+ You do NOT implement code. You spawn only Explore agents. You write only `.5/.planning-active`, `.5/features/{name}/codebase-scan.md`, and `.5/features/{name}/plan.md`.
12
+ After creating the plan, output the completion message and stop.
13
+ </role>
14
+
15
+ <constraints>
16
+ HARD CONSTRAINTS:
17
+ - Do NOT write code or pseudo-code.
18
+ - Do NOT create source files.
19
+ - Do NOT create a separate feature.md.
20
+ - Do NOT produce step, skill, model, pattern-file, or verify-command tables in plan.md; the step-orchestrator derives those mechanically during `/5:implement`.
21
+ - Do NOT use Bash to create, write, or modify files.
22
+ - Do NOT call EnterPlanMode.
23
+ - Do NOT spawn implementation agents.
24
+ </constraints>
25
+
26
+ # Plan
27
+
28
+ ## Options
29
+
30
+ - `--github` - Auto-fetch feature description from the GitHub issue linked to the current branch.
31
+ - `--jira` - Auto-fetch feature description from the Jira ticket linked to the current branch.
32
+
33
+ Current branch: !`git branch --show-current`
34
+
35
+ ## Progress Checklist
36
+
37
+ Follow these steps in order and output `✓ Step N complete` after each completed step.
38
+
39
+ - [ ] Step 0: Activate planning guard by writing `.5/.planning-active`
40
+ - [ ] Step 1: Auto-fetch ticket if `--github` or `--jira` was passed
41
+ - [ ] Step 2: Gather or confirm feature description
42
+ - [ ] Step 3: Explore the codebase and cache findings in `codebase-scan.md`
43
+ - [ ] Step 4: Discuss requirements, scope, acceptance criteria, and decisions
44
+ - [ ] Step 5: Write unified `plan.md`
45
+ - [ ] Step 6: Self-check `plan.md`, output completion, and stop
46
+
47
+ ## Step 0: Activate Planning Guard
48
+
49
+ Write `.5/.planning-active`:
50
+
51
+ ```json
52
+ {
53
+ "phase": "plan",
54
+ "startedAt": "{ISO-timestamp}"
55
+ }
56
+ ```
57
+
58
+ ## Step 1: Auto-fetch Ticket
59
+
60
+ Only run this step when `--github` or `--jira` was passed.
61
+
62
+ 1. Read `.5/config.json` if it exists and extract `ticket.pattern`.
63
+ 2. Match the pattern against the branch name above.
64
+ 3. If a ticket ID is found, validate format first:
65
+ - `--github`: digits only (`^[0-9]+$`)
66
+ - `--jira`: key format (`^[A-Z][A-Z0-9]+-[0-9]+$`)
67
+ 4. After validation:
68
+ - `--jira`: fetch via `mcp__claude_ai_Atlassian_Rovo__getJiraIssue` using the validated key as a typed parameter.
69
+ - `--github`: run `gh issue view "$id" --json title,body`.
70
+ 5. If no ticket ID is found, ask the user for the ID, validate it, then fetch.
71
+ 6. If validation or fetching fails, report the reason and continue without fetched content.
72
+
73
+ ## Step 2: Gather Description
74
+
75
+ If fetched content exists, show it and ask whether any context is missing.
76
+ Otherwise ask the user for the feature description.
77
+
78
+ Do not ask technical follow-ups yet.
79
+
80
+ ## Step 3: Explore Codebase
81
+
82
+ Spawn one Explore agent. In Codex, use `agent_type: explorer`, `model: gpt-5.4-mini`, and `reasoning_effort: low`.
83
+
84
+ ```text
85
+ Analyze the codebase for a unified workflow plan.
86
+
87
+ Feature description:
88
+ {feature description}
89
+
90
+ Tasks:
91
+ 1. If `.5/index/` exists, read `.5/index/README.md` first. Use only relevant fresh index files; do not rescan broad project structure. If stale, note it and fall back to targeted Grep/Glob.
92
+ 2. Identify relevant modules, existing patterns, and likely target files.
93
+ 3. Find at most 3 similar implementations and reusable helpers.
94
+ 4. Identify test framework, test file conventions, and the narrowest relevant build/test commands.
95
+ 5. Identify constraints, risks, and places where the user needs to decide.
96
+
97
+ Report:
98
+ - Relevant existing patterns: path + one-line reason
99
+ - Similar implementations: max 3 paths + one-line reason
100
+ - Likely target paths
101
+ - Test/build setup: commands only, with scope
102
+ - Risks or unknowns
103
+
104
+ READ-ONLY. Use only Read, Glob, and Grep.
105
+ Keep the report under 40 lines. Do not include generic project structure, dependency lists, or long file summaries unless directly needed for this feature.
106
+ ```
107
+
108
+ Write the compact result to `.5/features/{name}/codebase-scan.md`. If the Explore result is longer than 40 lines, summarize it before writing.
109
+
110
+ ## Step 4: Collaborative Plan Development
111
+
112
+ Discuss naturally until you can articulate:
113
+
114
+ - The problem and expected outcome
115
+ - Scope in and out
116
+ - Acceptance criteria
117
+ - Key decisions labeled `[DECIDED]`, `[FLEXIBLE]`, or `[DEFERRED]`
118
+ - Existing patterns to follow
119
+ - A clean component checklist with target paths
120
+
121
+ Ask only useful questions. Prefer proposing a concrete understanding and letting the user correct it.
122
+
123
+ ## Step 5: Write `plan.md`
124
+
125
+ Determine a short kebab-case feature folder name. If a ticket ID is known, use `{ticket-id}-{feature-name}`. Sanitize folder names to alphanumeric, dash, and underscore only.
126
+
127
+ Choose the plan template:
128
+
129
+ - Use `.claude/templates/workflow/PLAN-COMPACT.md` for small, low-risk changes with 1-2 components, no data migration, no security/auth change, and no public API contract change.
130
+ - Use `.claude/templates/workflow/PLAN.md` for everything else.
131
+
132
+ Write `.5/features/{name}/plan.md` using the selected template.
133
+
134
+ The component checklist is intentionally lean:
135
+
136
+ - Component name
137
+ - Action (`create`, `modify`, `delete`, `rename`)
138
+ - Target path
139
+ - One-sentence intent
140
+
141
+ For `rename`, use the target path as the destination and describe the original path in the intent.
142
+
143
+ Do not include columns for step, model, skill, pattern file, verify command, complexity, or dependencies. That mechanical wiring is generated by `step-orchestrator-agent` from `plan.md` and `codebase-scan.md`.
144
+
145
+ ## Step 6: Self-check and Stop
146
+
147
+ Verify:
148
+
149
+ - The plan has all required template sections.
150
+ - Optional sections with no useful content were omitted.
151
+ - Acceptance criteria are checkboxes.
152
+ - Decisions are labeled `[DECIDED]`, `[FLEXIBLE]`, or `[DEFERRED]`.
153
+ - Every component traces to scope or acceptance criteria.
154
+ - No implementation code or pseudo-code is present.
155
+
156
+ Output exactly:
157
+
158
+ ```text
159
+ ✓ Plan created at `.5/features/{name}/plan.md`
160
+
161
+ Review the plan, then run `/5:implement {name}`.
162
+ ```
163
+
164
+ Stop immediately.
@@ -3,7 +3,6 @@ name: 5:reconfigure
3
3
  description: Lightweight refresh of project documentation, codebase index, and skills without full Q&A. Re-detects codebase changes, regenerates .5/*.md docs, rebuilds .5/index/, updates AGENTS.md, and refreshes all skills.
4
4
  allowed-tools: Read, Write, Bash, Glob, Grep, Agent, AskUserQuestion
5
5
  user-invocable: true
6
- context: fork
7
6
  ---
8
7
 
9
8
  <role>
@@ -132,40 +131,42 @@ If there are new or stale patterns, use additional `AskUserQuestion` calls with
132
131
 
133
132
  New skills will be created and stale skills removed based on the user's choices.
134
133
 
135
- ### Step 5: Regenerate
134
+ ### Step 5: Build Refresh Manifest
135
+
136
+ Write `.5/reconfigure-manifest.json` with the compact decisions needed by refresh skills:
137
+
138
+ ```json
139
+ {
140
+ "mode": "refresh",
141
+ "docs": ["ARCHITECTURE.md", "TESTING.md", "CONCERNS.md", "index", "AGENTS.md"],
142
+ "skills": {
143
+ "refresh": ["skill names"],
144
+ "create": ["new skill names"],
145
+ "remove": ["stale skill names selected by user"]
146
+ },
147
+ "rules": {
148
+ "refresh": ["rule files"],
149
+ "create": ["new rule files"],
150
+ "remove": ["stale rule files selected by user"]
151
+ }
152
+ }
153
+ ```
154
+
155
+ Keep detection details out of the prompt once they are represented in this manifest.
156
+
157
+ ### Step 6: Regenerate
136
158
 
137
159
  Invoke the refresh skills in **refresh mode** via the Agent tool:
138
160
 
139
161
  ```
140
- Task prompt 1: "Run configure-docs-index skill in REFRESH MODE.
141
-
142
- Refresh the generated documentation, rebuild the codebase index in `.5/index/`, delete legacy docs if they exist, and update `AGENTS.md` (plus CLAUDE.md shim) while preserving user-written sections."
143
-
144
- Task prompt 2: "Run configure-skills skill in REFRESH MODE.
145
-
146
- Refresh ALL existing skills in .claude/skills/:
147
- - Existing create-* skills: [list from Step 2e]
148
- - Existing run-* skills: [list from Step 2e]
149
- - User-created skills: [list from Step 2e]
150
- - New skills to create: [list from user confirmation, if any]
151
- - Skills to remove: [list from user confirmation, if any]
152
-
153
- Refresh rules in .claude/rules/ (if rules.generate is true):
154
- - Existing workflow rules: [list from Step 2f]
155
- - Rules to remove: [list from user confirmation, if any]
156
- - New rules to create: [if applicable]
157
- Re-analyze the codebase and:
158
- 1. Refresh ALL skills in .claude/skills/ — read current conventions from codebase and update each skill
159
- 2. Create new skills for newly-added patterns
160
- 3. Remove skills the user chose to drop
161
- 4. Refresh all workflow-generated rule files in .claude/rules/ with updated conventions
162
- 5. Create new rule files for newly-detected patterns
163
- 6. Remove rule files the user chose to drop"
162
+ Task prompt 1: "Run configure-docs-index skill in REFRESH MODE using `.5/reconfigure-manifest.json`. Refresh generated docs, rebuild `.5/index/`, remove legacy docs, and update `AGENTS.md` plus the CLAUDE.md shim while preserving user sections."
163
+
164
+ Task prompt 2: "Run configure-skills skill in REFRESH MODE using `.5/reconfigure-manifest.json`. Refresh, create, and remove only the skills/rules listed in the manifest."
164
165
  ```
165
166
 
166
167
  Use `subagent_type: "general-purpose"` for the Agent.
167
168
 
168
- ### Step 6: Track
169
+ ### Step 7: Track
169
170
 
170
171
  After the skill completes, update `.5/version.json`:
171
172
 
@@ -174,14 +175,14 @@ After the skill completes, update `.5/version.json`:
174
175
  3. Set `configuredAtCommit` to current short commit hash (`git rev-parse --short HEAD`)
175
176
  4. Write back version.json preserving all other fields
176
177
 
177
- ### Step 7: Clean Up
178
+ ### Step 8: Clean Up
178
179
 
179
180
  Remove the `.5/.reconfig-reminder` flag file if it exists:
180
181
  ```bash
181
182
  rm -f .5/.reconfig-reminder
182
183
  ```
183
184
 
184
- ### Step 8: Report
185
+ ### Step 9: Report
185
186
 
186
187
  Show the user a summary:
187
188
  - List of documentation files updated
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: 5:reply-pr-comments
3
+ description: Posts GitHub PR replies from recorded PR comment decisions.
4
+ allowed-tools: Bash, Read, Write
5
+ user-invocable: false
6
+ model: haiku
7
+ argument-hint: [feature-name]
8
+ ---
9
+
10
+ <role>
11
+ You are a PR Reply Poster. You post concise replies from recorded decisions and do not edit code.
12
+ </role>
13
+
14
+ # Reply PR Comments
15
+
16
+ ## Inputs
17
+
18
+ - `.5/features/{feature}/pr-comment-decisions.json`
19
+ - Current branch PR metadata from `gh`.
20
+
21
+ ## Process
22
+
23
+ 1. Read decisions and skip comments categorized as `skip`.
24
+ 2. Resolve `{owner}`, `{repo}`, and PR number.
25
+ 3. Build concise reply text:
26
+ - `fix`: `Applied fix: {description}. Will be included in the next push.` plus optional note.
27
+ - `wont_fix`: `Reviewed - not addressing: {user_note or "will handle separately"}`
28
+ - `wait`: `Noted for later: {user_note or "deferring for now"}`
29
+ - `duplicate`: `Covered by local review findings - {local_decision}`
30
+ 4. Post replies:
31
+ - Inline: `gh api repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies --method POST --field body="{reply text}"`
32
+ - General: `gh api repos/{owner}/{repo}/issues/{number}/comments --method POST --field body="{reply text}"`
33
+ 5. Log failures and continue. Do not abort for reply failures.
34
+
35
+ ## Output
36
+
37
+ End with:
38
+
39
+ ```text
40
+ ---PR-REPLIES---
41
+ STATUS: success | partial | failed
42
+ POSTED: {N}
43
+ FAILED: {N}
44
+ ERRORS: none | {compact summary}
45
+ ---END-PR-REPLIES---
46
+ ```
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: 5:review
3
+ description: Reviews code changes using native agent review or CodeRabbit CLI. Categorizes findings and saves them for /5:address-review-findings.
4
+ allowed-tools: Bash, Read, Glob, Grep, AskUserQuestion, Agent, mcp__jetbrains__*
5
+ user-invocable: true
6
+ model: sonnet
7
+ ---
8
+
9
+ <role>
10
+ You are a Code Reviewer. You review code, categorize findings, and save them to a findings file.
11
+ You do NOT apply fixes. Fix application is handled by /5:address-review-findings.
12
+ </role>
13
+
14
+ # Review
15
+
16
+ CodeRabbit: !`which coderabbit 2>/dev/null && coderabbit auth status 2>/dev/null || echo "not installed"`
17
+
18
+ ## Step 1: Determine Review Tool
19
+
20
+ Read `.5/config.json` and use `reviewTool`.
21
+
22
+ - Missing, `native`, or legacy `claude`: use native review.
23
+ - `coderabbit`: use CodeRabbit if installed/authenticated; otherwise ask whether to switch to native review or stop for setup.
24
+ - `none`: report that automated review is disabled and stop.
25
+
26
+ ## Step 2: Determine Scope
27
+
28
+ Ask what to review:
29
+
30
+ 1. Staged changes (`git diff --cached`)
31
+ 2. Unstaged changes (`git diff`)
32
+ 3. All changes (`git diff HEAD`)
33
+ 4. Current branch vs main/master (`git diff main...HEAD`)
34
+
35
+ ## Step 3: Spawn Review Agent
36
+
37
+ Spawn one review agent. The main context handles user interaction only.
38
+
39
+ For native review:
40
+
41
+ ```text
42
+ You are a code reviewer. Review the selected diff blind, purely on its merits.
43
+
44
+ Scope: {scope}
45
+ Base branch: {base branch if relevant}
46
+
47
+ Process:
48
+ 1. Get the diff for the selected scope.
49
+ 2. Triage the diff by file and classify each changed file as high, medium, or low risk.
50
+ 3. Read full files only for high-risk changes, public API boundaries, security/auth, data migrations, and files where the diff alone is insufficient.
51
+ 4. For medium-risk files, read targeted symbols or nearby changed sections plus direct imports only when needed.
52
+ 5. For low-risk mechanical/docs/config changes, review the diff without reading full files unless something looks inconsistent.
53
+ 6. Review for bugs, security, performance, code quality, API design, and missing tests.
54
+ 7. Categorize findings as Fixable, Questions, or Manual.
55
+
56
+ Output:
57
+ Status: success | failed
58
+ Error: {if failed}
59
+ Summary: total: {N}, fixable: {N}, questions: {N}, manual: {N}
60
+ Fixable Issues:
61
+ - file: {path}, line: {N}, description: {what}, fix: {suggestion}
62
+ Questions:
63
+ - file: {path}, line: {N}, question: {what}
64
+ Manual Review:
65
+ - file: {path}, line: {N}, description: {what}, severity: {level}
66
+
67
+ Do not apply fixes.
68
+ Keep findings concise and do not include raw diff excerpts unless needed to identify the issue.
69
+ ```
70
+
71
+ For CodeRabbit, run the CLI for the selected scope, then categorize the output into the same format.
72
+
73
+ ## Step 4: Save Findings
74
+
75
+ Determine feature name from the most recent `.5/features/*/state.json`, or ask the user.
76
+
77
+ Write `.5/features/{feature-name}/review-findings-{YYYYMMDD-HHmmss}.md` using `.claude/templates/workflow/REVIEW-FINDINGS.md`.
78
+
79
+ Do not ask the user to edit action markers in the findings file. The findings file is the review record; `/5:address-review-findings` will present each finding interactively and record decisions separately.
80
+
81
+ ## Completion
82
+
83
+ Output:
84
+
85
+ ```text
86
+ Review complete.
87
+
88
+ - Fixable: {N}
89
+ - Questions: {N}
90
+ - Manual review needed: {N}
91
+
92
+ Findings saved at `.5/features/{feature-name}/review-findings-{timestamp}.md`
93
+
94
+ Run `/5:address-review-findings {feature-name}` to decide on each finding interactively, then apply approved fixes.
95
+ ```