5-phase-workflow 1.8.9 → 1.9.1

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.
@@ -49,21 +49,34 @@ Use the template structure from `.claude/templates/workflow/FEATURE-SPEC.md`.
49
49
  - Acceptance criteria describe observable behavior, NOT test code
50
50
  </output-format>
51
51
 
52
- <question-strategy>
53
- Ask 5-10 clarifying questions using AskUserQuestion.
54
-
55
- **Rules:**
56
- - ONE question at a time wait for answer before next
57
- - Use sub-agent findings to ask informed questions
58
- - At least 5 questions before creating the spec
59
- - Provide 2-4 options where meaningful
60
-
61
- **Categories:** Requirements clarity, scope boundaries, edge cases, performance expectations,
62
- testing strategy, integration points (from findings), alternative approaches, complexity trade-offs.
63
-
64
- **Challenge assumptions:** "Is this the simplest solution?", "Could we reuse existing X?",
65
- "What happens when Y fails?"
66
- </question-strategy>
52
+ <collaboration-strategy>
53
+ You are a collaborative thought partner, not an interviewer conducting a checklist.
54
+
55
+ **Approach:**
56
+ - After the Explore agent returns, propose a draft understanding of the feature (2-3 sentences).
57
+ Ask the user to confirm, correct, or expand. This anchors the conversation.
58
+ - Use AskUserQuestion one exchange at a time — but frame questions as a colleague's follow-ups,
59
+ not a numbered interrogation.
60
+ - When the codebase exploration reveals an obvious pattern or approach, propose it:
61
+ "Based on how X works, I think this feature would involve Y — does that match your thinking?"
62
+ - When something is genuinely ambiguous, ask openly.
63
+ - Challenge assumptions naturally: "Is this the simplest solution?", "Could we reuse existing X?",
64
+ "What happens when Y fails?"
65
+
66
+ **Adaptive depth:**
67
+ - Simple features (config change, small UI tweak) may need 2-3 exchanges.
68
+ - Complex features (new subsystem, multi-component integration) may need 10+.
69
+ - Let the complexity drive the conversation length, not a fixed question count.
70
+
71
+ **Readiness signal — you are ready to write the spec when you can articulate:**
72
+ 1. The problem being solved
73
+ 2. Clear functional requirements
74
+ 3. Scope boundaries (what is in, what is out)
75
+ 4. Acceptance criteria (how to verify success)
76
+ 5. Key decisions and their labels ([DECIDED], [FLEXIBLE], [DEFERRED])
77
+
78
+ If any of these are unclear, keep discussing.
79
+ </collaboration-strategy>
67
80
 
68
81
  # Plan Feature (Phase 1)
69
82
 
@@ -74,12 +87,11 @@ Follow these steps IN ORDER. Do NOT skip steps. Do NOT proceed to a later step u
74
87
  - [ ] Step 0: Activate planning guard — write `.5/.planning-active`
75
88
  - [ ] Step 1: Gather feature description — ask developer via AskUserQuestion
76
89
  - [ ] Step 2: Explore codebase — spawn Explore sub-agent, wait for results, cache to codebase-scan.md
77
- - [ ] Step 3: Ask 5+ clarifying questions one at a time, minimum 5 before proceeding
78
- - [ ] Step 3b: Pre-write checkpointverify 5 Q&A pairs exist, no code in spec
79
- - [ ] Step 4: Write feature specification — create `.5/features/{name}/feature.md`
90
+ - [ ] Step 3: Collaborative spec developmentdiscuss with the user until the spec is clear
91
+ - [ ] Step 4: Write feature specification create `.5/features/{name}/feature.md` (with optional mermaid diagrams)
80
92
  - [ ] Output completion message and STOP
81
93
 
82
- > **MANDATORY:** After each step, output `✓ Step N complete` before moving on. This is your progress anchor if you cannot say which step you just completed, you are skipping ahead. If Step 3b fails (< 5 Q&A), return to Step 3.
94
+ > **MANDATORY:** After completing Steps 0, 1, 2, and 4, output `✓ Step N complete` before moving on. Step 3 is open-endedit completes when you and the user agree the spec is ready to write.
83
95
 
84
96
  ## Process
85
97
 
@@ -117,12 +129,13 @@ Analyze the codebase for a feature specification session.
117
129
  **Feature Description:** {paste the user's feature description}
118
130
 
119
131
  **Your Task:**
120
- 1. Explore project structure to identify modules/components
121
- 2. Find existing implementations similar to this feature
122
- 3. Identify coding patterns and conventions
123
- 4. Find reusable components or patterns
124
- 5. Identify affected files/modules
125
- 6. Run `git branch --show-current` to get the current branch name
132
+ 1. Check if `.5/index/` exists. If it does, read `.5/index/README.md` first — it includes a generation timestamp. If the index is fresh (under 1 day old), read the relevant index files (e.g., modules.md, routes.md, models.md) as your structural overview and skip broad Glob scans for information already covered. If the index is outdated (over 1 day old), note in your report that the user should run `.5/index/rebuild-index.sh` to refresh it, then use it anyway (stale is better than nothing). If `.5/index/` does not exist at all, note in your report that the user can run `/5:reconfigure` to generate it, then proceed with Glob/Grep exploration as below.
133
+ 2. Explore project structure to identify modules/components
134
+ 3. Find existing implementations similar to this feature
135
+ 4. Identify coding patterns and conventions
136
+ 5. Find reusable components or patterns
137
+ 6. Identify affected files/modules
138
+ 7. Run `git branch --show-current` to get the current branch name
126
139
 
127
140
  **Report Format:**
128
141
  - Current git branch name
@@ -140,11 +153,34 @@ Wait for the sub-agent to return before proceeding.
140
153
 
141
154
  **Cache the results:** Write the Explore agent's full output to `.5/features/{name}/codebase-scan.md` using the Write tool. This saves Phase 2 from re-scanning the same codebase and saves significant tokens.
142
155
 
143
- ### Step 3: Intensive Q&A
156
+ ### Step 3: Collaborative Spec Development
157
+
158
+ > **ROLE CHECK:** You are gathering requirements, NOT designing solutions. Discussion covers WHAT and WHY, never HOW.
159
+
160
+ **Begin by sharing your understanding.** Based on the user's description (Step 1) and the codebase exploration (Step 2), propose a concise summary of the feature:
161
+ - What problem it solves
162
+ - What the key capabilities are
163
+ - Which existing components are relevant
164
+
165
+ Ask the user: "Here's my understanding of the feature — [summary]. Does this capture it, or should I adjust anything?"
166
+
167
+ **Then discuss naturally.** Use AskUserQuestion to explore:
168
+ - Ambiguities or gaps in the description
169
+ - Scope boundaries (what is explicitly NOT included)
170
+ - Edge cases the codebase exploration surfaced
171
+ - Decisions that need to be made now vs. deferred
172
+ - Whether existing patterns can be reused
144
173
 
145
- > **ROLE CHECK:** You are gathering requirements, NOT designing solutions. Questions ask WHAT and WHY, never HOW.
174
+ **Adapt to complexity.** A simple feature may be clear after 2-3 exchanges. A complex one may need extended discussion. Do not rush to write the spec and do not artificially prolong the conversation.
146
175
 
147
- Ask 5-10 clarifying questions using AskUserQuestion. ONE question at a time — wait for the answer before asking the next. Use the sub-agent findings to inform questions. Cover: requirements clarity, scope boundaries, edge cases, performance expectations, testing strategy, integration points, alternative approaches, and complexity trade-offs. Challenge assumptions: "Is this the simplest solution?", "Could we reuse existing X?", "What happens when Y fails?"
176
+ **You are ready to write the spec when you can confidently articulate:**
177
+ 1. The problem being solved (Problem Statement)
178
+ 2. Clear functional requirements
179
+ 3. Scope boundaries (what is in, what is out)
180
+ 4. Acceptance criteria (how to verify success)
181
+ 5. Key decisions and their labels ([DECIDED], [FLEXIBLE], [DEFERRED])
182
+
183
+ If any of these are unclear, keep discussing. When you believe clarity has been reached, tell the user: "I think I have a clear picture — ready to write the spec. Anything else before I do?" Then proceed to Step 4.
148
184
 
149
185
  **Optional re-exploration:** If the user mentions components not covered in the initial report, spawn a targeted Explore agent:
150
186
 
@@ -155,14 +191,6 @@ Targeted exploration for feature planning.
155
191
  **READ-ONLY.** Only use Read, Glob, and Grep tools.
156
192
  ```
157
193
 
158
- ### Step 3b: Pre-Write Checkpoint
159
-
160
- Before writing the feature spec, verify:
161
- 1. You asked at least 5 questions and received answers
162
- 2. You can summarize the feature in 1-2 sentences without mentioning files, classes, or functions
163
-
164
- If you have fewer than 5 Q&A pairs, go back to Step 3 and ask more questions.
165
-
166
194
  ### Step 4: Create Feature Specification
167
195
 
168
196
  > **ROLE CHECK:** You are writing a SPECIFICATION (WHAT/WHY), not a design document (HOW). Zero code, zero file paths to create, zero signatures. After writing feature.md you are DONE — do NOT proceed to implementation planning or coding.
@@ -184,12 +212,22 @@ Use the template structure from `.claude/templates/workflow/FEATURE-SPEC.md`.
184
212
  Populate all sections:
185
213
  - Ticket ID & Summary
186
214
  - Problem Statement
215
+ - Visual Overview (optional mermaid diagrams — see below)
187
216
  - Requirements (functional and non-functional)
188
217
  - Constraints
189
218
  - Affected Components (from exploration)
190
219
  - Acceptance Criteria
191
220
  - Alternatives Considered
192
- - Decisions (from Q&A session) — label each with **[DECIDED]**, **[FLEXIBLE]**, or **[DEFERRED]**
221
+ - Decisions (from the conversation) — label each with **[DECIDED]**, **[FLEXIBLE]**, or **[DEFERRED]**
222
+
223
+ **Visual Overview (optional mermaid diagrams):**
224
+ Include mermaid diagrams in the spec when they add clarity. Use your judgment:
225
+ - **Flow diagrams**: When the feature involves a multi-step process or state transitions
226
+ - **Entity relationship diagrams**: When new data concepts relate to existing ones
227
+ - **Component interaction diagrams**: When multiple modules/services communicate
228
+ - **Sequence diagrams**: When the order of operations between actors matters
229
+
230
+ Simple features (single-component changes, straightforward CRUD) typically do not need diagrams. Do not add diagrams for the sake of having them. Diagrams describe WHAT happens, not HOW it is implemented. No class diagrams, no file-level architecture diagrams, no code-level sequence diagrams.
193
231
 
194
232
  **Decision labeling rules:**
195
233
  - **[DECIDED]**: The user gave a clear, specific answer → Phase 2 planner and Phase 3 agents MUST honor exactly
@@ -205,7 +243,8 @@ After writing feature.md, output ONLY this message — no additional text, no su
205
243
  ✓ Feature spec created at `.5/features/{name}/feature.md`
206
244
 
207
245
  To review or refine: /5:discuss-feature {name}
208
- To proceed: /clear → /5:plan-implementation {name}
246
+ To proceed: /5:plan-implementation {name}
247
+ (optional: /clear first to free context — plan-implementation adapts either way)
209
248
  ```
210
249
 
211
250
  **YOU ARE NOW FINISHED.** This is a hard stop. Do not:
@@ -22,7 +22,7 @@ HARD CONSTRAINTS — violations get blocked by plan-guard:
22
22
  - NEVER use Bash to create, write, or modify files — this bypasses the plan-guard and is a constraint violation
23
23
  - NEVER continue past the completion message — when you output "Plan created at...", you are DONE
24
24
  - The plan describes WHAT to build and WHERE. Agents figure out HOW by reading existing code.
25
- - Each component in the table gets: name, action, file path, one-sentence description, pattern file, verify command, complexity
25
+ - Each component in the table gets: name, action, file path, one-sentence description, pattern file, verify command, complexity, depends on
26
26
  - **Pattern File** (required for "create" actions): Path to an existing file the executor reads before implementing. For "modify" actions, this is the target file itself. Helps executor match conventions exactly.
27
27
  - **Verify** (required): A concrete command or grep check the executor runs after implementing. Examples: `grep -q 'export class UserService' src/services/user.service.ts`, `npm test -- --testPathPattern=user`, `npx tsc --noEmit`. Never use vague checks like "works correctly".
28
28
  - If a component needs more than one sentence to describe, split it into multiple components
@@ -61,21 +61,32 @@ Assign complexity per component using this rubric:
61
61
 
62
62
  # Plan Implementation (Phase 2)
63
63
 
64
+ ## Context Detection
65
+
66
+ Before starting, determine whether you have **live context from Phase 1**:
67
+
68
+ **Live context = YES** if ALL of the following are true:
69
+ - `/5:plan-feature` was run earlier in THIS conversation (not a previous one)
70
+ - The feature spec discussion, codebase exploration results, and user decisions are visible in your conversation history
71
+ - No `/clear` was run between Phase 1 and now
72
+
73
+ **Live context = NO** if any of the above is false (e.g., user ran `/clear`, or this is a fresh conversation).
74
+
64
75
  ## Progress Checklist
65
76
 
66
- Follow these steps IN ORDER. Do NOT skip steps. Do NOT proceed to a later step until the current one is complete. After completing each step, output a status line: `✓ Step N complete`.
77
+ Follow these steps IN ORDER. Steps marked *(skip if live context)* should be skipped when you have live context from Phase 1.
67
78
 
68
79
  - [ ] Step 0: Activate planning guard — write `.5/.planning-active`
69
- - [ ] Step 1: Load feature spec — read `.5/features/{name}/feature.md`
80
+ - [ ] Step 1: Load feature spec *(skip if live context)* — read `.5/features/{name}/feature.md`
70
81
  - [ ] Step 1b: Load project configuration — read `.5/config.json` if it exists
71
- - [ ] Step 2: Load or generate codebase scan — reuse cached scan from Phase 1, or spawn Explore if missing
72
- - [ ] Step 3: Ask 2-3 technical questions — one at a time via AskUserQuestion
82
+ - [ ] Step 2: Load or generate codebase scan *(skip if live context)* — reuse cached scan from Phase 1, or spawn Explore if missing
83
+ - [ ] Step 3: Ask technical questions *(conditional)* only if the feature spec leaves technical ambiguity
73
84
  - [ ] Step 4: Design components — identify files, order, step grouping
74
85
  - [ ] Step 5: Write the plan — create `.5/features/{name}/plan.md`
75
86
  - [ ] Step 5b: Plan self-check — verify format, no code, scope, completeness, tests
76
87
  - [ ] Output completion message and STOP
77
88
 
78
- > **MANDATORY:** After each step, output `✓ Step N complete` before moving on. This is your progress anchor — if you cannot say which step you just completed, you are skipping ahead. If Step 5b fails, fix plan.md before outputting completion.
89
+ > **MANDATORY:** After each step (including skipped ones), output `✓ Step N complete` (or `✓ Step N skipped (live context)`) before moving on. This is your progress anchor — if you cannot say which step you just completed, you are skipping ahead. If Step 5b fails, fix plan.md before outputting completion.
79
90
 
80
91
  ## Output Format
81
92
 
@@ -97,9 +108,11 @@ Write (or refresh) the planning guard marker to `.5/.planning-active` using the
97
108
 
98
109
  This activates (or refreshes) the plan-guard hook which prevents accidental source file edits during planning. The marker is removed automatically when implementation starts (`/5:implement-feature`), expires after 4 hours, or can be cleared manually with `/5:unlock`.
99
110
 
100
- ### Step 1: Load Feature Spec
111
+ ### Step 1: Load Feature Spec *(skip if live context)*
112
+
113
+ **If live context:** You already have the feature spec discussion in your conversation history. Extract ticket ID, requirements, acceptance criteria, affected components, and decisions from what was discussed. Output `✓ Step 1 skipped (live context)` and proceed to Step 1b.
101
114
 
102
- Read `.5/features/{feature-name}/feature.md` (where `{feature-name}` is the argument provided).
115
+ **If no live context:** Read `.5/features/{feature-name}/feature.md` (where `{feature-name}` is the argument provided).
103
116
 
104
117
  Extract: Ticket ID, requirements (functional and non-functional), acceptance criteria, affected components, and **decisions**.
105
118
 
@@ -119,11 +132,13 @@ Read `.5/config.json` if it exists. Extract:
119
132
 
120
133
  If config.json doesn't exist, proceed without it.
121
134
 
122
- ### Step 2: Load or Generate Codebase Scan
135
+ ### Step 2: Load or Generate Codebase Scan *(skip if live context)*
123
136
 
124
137
  > **ROLE CHECK:** You are an Implementation Planner. Your ONLY output is plan.md. You do NOT write code, create source files, or start implementation. If you feel the urge to implement, STOP — that is Phase 3's job.
125
138
 
126
- **First, check for a cached scan from Phase 1:**
139
+ **If live context:** The codebase exploration results from Phase 1 are already in your conversation history. Output `✓ Step 2 skipped (live context)` and proceed to Step 3.
140
+
141
+ **If no live context — first, check for a cached scan from Phase 1:**
127
142
 
128
143
  Read `.5/features/{feature-name}/codebase-scan.md`. If it exists and is non-empty, use it as the codebase scan results. This was generated during Phase 1 (`/5:plan-feature`) and contains project structure, naming conventions, pattern files, and test framework detection.
129
144
 
@@ -145,13 +160,14 @@ Quick codebase scan for implementation planning.
145
160
  Focus scan on {projectType}-relevant directories and patterns.
146
161
 
147
162
  **Your Task:**
148
- 1. Find source directories and understand project structure
149
- 2. Identify where similar components live (models, services, controllers, tests)
150
- 3. Note naming conventions from existing files
151
- 4. Find example files that can serve as patterns for new components
152
- 5. Identify the project's test framework, test file conventions, and test directory structure (e.g., __tests__/, tests/, *.test.ts, *.spec.ts, test_*.py)
153
- 6. Detect e2e test framework and config (Cypress, Playwright, Selenium, Supertest, etc.) look for config files like playwright.config.ts, cypress.config.js, e2e/ directories
154
- 7. Detect integration test patterns (test containers, in-memory DBs, API test helpers, fixtures) — look for setup files, docker-compose.test.yml, test utilities
163
+ 1. Check if `.5/index/` exists. If it does, read `.5/index/README.md` first — it includes a generation timestamp. If the index is fresh (under 1 day old), read the relevant index files (modules.md, models.md, libraries.md, etc.) for project structure and component locations, then focus Glob/Grep on naming conventions, pattern files, and test framework details not covered by the index. If the index is outdated (over 1 day old), note in your report that the user should run `.5/index/rebuild-index.sh` to refresh it, then use it anyway. If `.5/index/` does not exist at all, note in your report that the user can run `/5:reconfigure` to generate it, then scan from scratch as below.
164
+ 2. Find source directories and understand project structure
165
+ 3. Identify where similar components live (models, services, controllers, tests)
166
+ 4. Note naming conventions from existing files
167
+ 5. Find example files that can serve as patterns for new components
168
+ 6. Identify the project's test framework, test file conventions, and test directory structure (e.g., __tests__/, tests/, *.test.ts, *.spec.ts, test_*.py)
169
+ 7. Detect e2e test framework and config (Cypress, Playwright, Selenium, Supertest, etc.) — look for config files like playwright.config.ts, cypress.config.js, e2e/ directories
170
+ 8. Detect integration test patterns (test containers, in-memory DBs, API test helpers, fixtures) — look for setup files, docker-compose.test.yml, test utilities
155
171
 
156
172
  **Report Format:**
157
173
  - Project structure (key directories)
@@ -170,17 +186,19 @@ Wait for the sub-agent to return before proceeding.
170
186
 
171
187
  **If a fresh scan was spawned**, write the results to `.5/features/{feature-name}/codebase-scan.md` for future reference.
172
188
 
173
- ### Step 3: Ask 2-3 Technical Questions (One at a Time)
189
+ ### Step 3: Ask Technical Questions (Conditional)
174
190
 
175
- Use AskUserQuestion to clarify:
176
- - Data layer decisions (if applicable)
177
- - Key implementation choices
178
- - Anything unclear from the feature spec
191
+ **Evaluate whether questions are needed.** Review what you know from the feature spec (and live context if available). Ask questions ONLY if:
192
+ - A technical decision is genuinely ambiguous (not already labeled [DECIDED] or [FLEXIBLE])
193
+ - The feature spec lacks information needed to identify files, components, or ordering
194
+ - The codebase scan revealed multiple conflicting patterns and you need guidance
179
195
 
180
- **Rules:**
181
- - ONE question at a time — wait for answer before next
182
- - Max 3 questions don't over-question
183
- - Don't repeat questions already answered in Phase 1
196
+ **If no ambiguity exists** (all decisions are clear, codebase patterns are obvious), skip this step entirely. Output `✓ Step 3 skipped (no ambiguity)` and proceed to Step 4.
197
+
198
+ **If questions are needed:**
199
+ - Use AskUserQuestion ONE question at a time
200
+ - Max 2 questions — be surgical, don't over-question
201
+ - NEVER re-ask something already answered in Phase 1 or labeled [DECIDED] in the feature spec
184
202
 
185
203
  **Optional re-exploration:** If user mentions patterns not in the initial scan, spawn a targeted Explore agent:
186
204
 
@@ -227,6 +245,8 @@ If no e2e or integration framework was detected, do NOT plan components for them
227
245
 
228
246
  Not every feature needs all non-test steps. Use what makes sense. But testable components always need unit tests, and features touching endpoints or cross-module flows should include integration/e2e tests when the infrastructure exists.
229
247
 
248
+ **Depends On:** For each component, identify if it has a data dependency on a specific component from a prior step. Use the component name from the Depends On column (or `—` if none). This is for cross-step dependencies where a component needs a specific export, type, or interface from another component. File-level existence is already checked by the orchestrator — Depends On captures *semantic* dependencies (e.g., "auth-service depends on auth-types because it imports AuthToken").
249
+
230
250
  **Parallel execution:** Components in the same step run in parallel. Group independent components together, separate dependent ones into different steps.
231
251
 
232
252
  ### Step 5: Write the Plan
@@ -239,9 +259,22 @@ Include:
239
259
  - YAML frontmatter (ticket, feature, created)
240
260
  - One-sentence summary
241
261
  - Components table
242
- - Implementation Notes (references to existing pattern files + business rules)
262
+ - Implementation Notes **scoped by step or component** (see below)
243
263
  - Verification commands
244
264
 
265
+ **Scoped Implementation Notes:**
266
+ Each note MUST be prefixed with a scope tag so the orchestrator can filter notes per agent:
267
+ - `[Step N]` — applies to all components in that step
268
+ - `[component-name]` — applies to a specific component
269
+ - `[global]` — applies to all components (use sparingly: project-wide conventions like DI patterns, naming schemes)
270
+
271
+ Example:
272
+ ```
273
+ - [global] All services use constructor-based dependency injection
274
+ - [Step 1] Follow the pattern from src/models/User.ts for entity definitions
275
+ - [schedule-service] endDate must be > startDate, throw ValidationError if not
276
+ ```
277
+
245
278
  **Verification section — prefer config.json values:**
246
279
  - Build: {build.command from config.json, or explore agent value, or "auto"}
247
280
  - Test: {build.testCommand from config.json, or explore agent value, or "auto"}
@@ -250,7 +283,7 @@ Include:
250
283
 
251
284
  Read plan.md back and verify:
252
285
 
253
- 1. **Format:** Every row in the Components table has all 8 columns filled (Step, Component, Action, File, Description, Pattern File, Verify, Complexity)
286
+ 1. **Format:** Every row in the Components table has all 9 columns filled (Step, Component, Action, File, Description, Pattern File, Verify, Complexity, Depends On)
254
287
  2. **No code:** Implementation Notes contain ONLY references to existing files and business rules
255
288
  3. **Scope:** Every component traces back to a requirement in feature.md — if not, remove it
256
289
  4. **Completeness:** Every functional requirement from feature.md has at least one component
@@ -287,7 +320,7 @@ Plan created at `.5/features/{feature-name}/plan.md`
287
320
 
288
321
  Next steps:
289
322
  1. Review the plan
290
- 2. /clear to reset context
323
+ 2. /clear to reset context (recommended before implementation)
291
324
  3. /5:implement-feature {feature-name}
292
325
  ```
293
326
 
@@ -91,7 +91,7 @@ Check if `.5/features/${feature_name}/state.json` already exists:
91
91
 
92
92
  ### Step 4: Analyze and Scope Check
93
93
 
94
- 1. **Identify affected files** using Glob and Grep
94
+ 1. **Identify affected files:** If `.5/index/` exists, read `.5/index/README.md` first for the generation timestamp — if fresh (under 1 day old), read the relevant index files (modules.md, routes.md, models.md) to quickly locate affected areas, then confirm with targeted Glob/Grep. If the index is outdated, note that the user can run `.5/index/rebuild-index.sh` to refresh it. If no index exists, note that the user can run `/5:reconfigure` to generate it. In both cases, fall back to Glob and Grep directly.
95
95
  2. **Determine skills needed** based on task type
96
96
  3. **List components** (max 5 for quick mode)
97
97
 
@@ -261,6 +261,7 @@ Task tool call:
261
261
  For each component:
262
262
 
263
263
  **If creating a new file:**
264
+ 0. If `.5/index/` exists, check modules.md or libraries.md to find where similar components live — this narrows your Glob search.
264
265
  1. Find a similar file using Glob (e.g., *Service.ts for services)
265
266
  2. Read it to understand the pattern (imports, structure, exports)
266
267
  3. Create the new file following that pattern
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 5:reconfigure
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 CLAUDE.md, and refreshes all skills.
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, Task, AskUserQuestion
5
5
  user-invocable: true
6
6
  context: fork
@@ -117,7 +117,7 @@ Use the existing skills in `.claude/skills/` (from Step 2e) as the source of tru
117
117
 
118
118
  Use `AskUserQuestion` to show a summary and get confirmation. Present:
119
119
 
120
- 1. **Documentation files that will be rewritten** — list `.5/ARCHITECTURE.md`, `.5/TESTING.md`, `.5/CONCERNS.md` (conditional), `.5/index/rebuild-index.sh`, `.5/index/*.md`, and `CLAUDE.md`
120
+ 1. **Documentation files that will be rewritten** — list `.5/ARCHITECTURE.md`, `.5/TESTING.md`, `.5/CONCERNS.md` (conditional), `.5/index/rebuild-index.sh`, `.5/index/*.md`, and `AGENTS.md`
121
121
  2. **Skills that will be refreshed** — list ALL skills found in `.claude/skills/` (both workflow-generated and user-created)
122
122
  3. **Rules that will be refreshed** (if rules enabled) — list workflow-generated rule files in `.claude/rules/`
123
123
  4. **New patterns detected** (if any) — "These patterns were found in your codebase but don't have skills yet: [list]. Create skills for them?"
@@ -139,7 +139,7 @@ Invoke the refresh skills in **refresh mode** via the Task tool:
139
139
  ```
140
140
  Task prompt 1: "Run configure-docs-index skill in REFRESH MODE.
141
141
 
142
- Refresh the generated documentation, rebuild the codebase index in `.5/index/`, delete legacy docs if they exist, and update `CLAUDE.md` while preserving user-written sections."
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
143
 
144
144
  Task prompt 2: "Run configure-skills skill in REFRESH MODE.
145
145
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 5:review-code
3
- description: Reviews code changes using Claude (built-in) or CodeRabbit CLI. Categorizes findings and saves them for /5:address-review-findings.
3
+ description: Reviews code changes using native agent review or CodeRabbit CLI. Categorizes findings and saves them for /5:address-review-findings.
4
4
  allowed-tools: Bash, Read, Glob, Grep, AskUserQuestion, Task, mcp__jetbrains__*
5
5
  user-invocable: true
6
6
  model: sonnet
@@ -21,8 +21,8 @@ After saving the findings file, you are DONE.
21
21
 
22
22
  Two review tools are supported (configured in `.5/config.json` field `reviewTool`):
23
23
 
24
- - **Claude** (default) — Built-in, zero setup. A fresh-context agent reviews code blind.
25
- - **CodeRabbit** — External CLI. Requires `coderabbit` installed and authenticated.
24
+ - **native** (default) — Built-in, zero setup. A fresh-context agent reviews code blind. Works with any AI coding tool (Claude Code, Codex, etc.).
25
+ - **coderabbit** — External CLI. Requires `coderabbit` installed and authenticated.
26
26
 
27
27
  Both produce the same structured output format.
28
28
 
@@ -32,7 +32,7 @@ Both produce the same structured output format.
32
32
 
33
33
  Read `.5/config.json` and check the `reviewTool` field.
34
34
 
35
- - If not set or missing, default to `"claude"`
35
+ - If not set, missing, or `"claude"` (legacy value), default to `"native"`
36
36
  - If `"none"`, inform user that automated review is disabled and STOP
37
37
 
38
38
  **If CodeRabbit:** Check prerequisites via Bash:
@@ -40,7 +40,7 @@ Read `.5/config.json` and check the `reviewTool` field.
40
40
  which coderabbit && coderabbit auth status
41
41
  ```
42
42
  If not installed or not authenticated, ask user via AskUserQuestion:
43
- - "Switch to Claude for this review? (Recommended)" / "I'll install CodeRabbit first"
43
+ - "Switch to native review for this review? (Recommended)" / "I'll install CodeRabbit first"
44
44
  - If they choose CodeRabbit setup, provide install instructions and STOP
45
45
 
46
46
  ### Step 2: Determine What to Review
@@ -102,13 +102,13 @@ Task tool call:
102
102
  - Include ALL findings
103
103
  ```
104
104
 
105
- #### 3B: Claude Review Agent
105
+ #### 3B: Native Review Agent
106
106
 
107
107
  ```
108
108
  Task tool call:
109
109
  subagent_type: general-purpose
110
110
  model: sonnet
111
- description: "Run Claude code review"
111
+ description: "Run native code review"
112
112
  prompt: |
113
113
  You are a code reviewer. You have NO prior knowledge of what was built or why.
114
114
  Review this code blind, purely on its merits.
@@ -100,7 +100,7 @@ For each command found: record exact syntax, note variants (e.g., `test:unit`, `
100
100
  "available": false
101
101
  }
102
102
  },
103
- "reviewTool": "claude",
103
+ "reviewTool": "native",
104
104
  "git": {
105
105
  "autoCommit": false,
106
106
  "commitMessage": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: configure-docs-index
3
- description: Analyzes the codebase, creates project documentation, generates a rebuildable codebase index, and updates CLAUDE.md. Used during /5:implement-feature CONFIGURE.
3
+ description: Analyzes the codebase, creates project documentation, generates a rebuildable codebase index, and updates AGENTS.md. Used during /5:implement-feature CONFIGURE.
4
4
  allowed-tools: Read, Write, Bash, Glob, Grep
5
5
  model: sonnet
6
6
  context: fork
@@ -11,11 +11,11 @@ user-invocable: false
11
11
 
12
12
  ## Overview
13
13
 
14
- This skill handles the documentation and indexing work during Phase 3 (implement-feature) for the CONFIGURE feature. It is called by step-executor to create the project docs, codebase index, and `CLAUDE.md`.
14
+ This skill handles the documentation and indexing work during Phase 3 (implement-feature) for the CONFIGURE feature. It is called by step-executor to create the project docs, codebase index, and `AGENTS.md`.
15
15
 
16
16
  It handles one task:
17
17
 
18
- - **Analyze Codebase and Create/Update Documentation + Index** - Maps codebase, writes `.5/*.md`, generates `.5/index/*`, and updates `CLAUDE.md`
18
+ - **Analyze Codebase and Create/Update Documentation + Index** - Maps codebase, writes `.5/*.md`, generates `.5/index/*`, and updates `AGENTS.md`
19
19
 
20
20
  Note: config.json is written directly by `/5:configure` during the Q&A phase.
21
21
 
@@ -23,28 +23,28 @@ Note: config.json is written directly by `/5:configure` during the Q&A phase.
23
23
 
24
24
  ## Modes
25
25
 
26
- This skill supports two modes. The analysis (A1), template filling (A2-A3), index generation (A3.5), and CLAUDE.md update (A4-A5) logic is the same in both modes — only the **input source** changes.
26
+ This skill supports two modes. The analysis (A1), template filling (A2-A3), index generation (A3.5), and AGENTS.md update (A4-A5) logic is the same in both modes — only the **input source** changes.
27
27
 
28
28
  ### Full Mode (default)
29
29
 
30
30
  Used by `/5:configure` → `/5:implement-feature CONFIGURE` flow.
31
31
 
32
32
  - **Input:** Pattern/command selections from feature spec (`.5/features/CONFIGURE/feature.md`)
33
- - **Behavior:** Creates documentation, index files, and `CLAUDE.md` from scratch based on feature spec requirements
33
+ - **Behavior:** Creates documentation, index files, and `AGENTS.md` from scratch based on feature spec requirements
34
34
 
35
35
  ### Refresh Mode
36
36
 
37
37
  Used by `/5:reconfigure` for lightweight refresh.
38
38
 
39
39
  - **Input:** The Task prompt tells it to refresh documentation and the codebase index
40
- - **Behavior:** Re-analyzes codebase and overwrites docs, index files, and `CLAUDE.md`
40
+ - **Behavior:** Re-analyzes codebase and overwrites docs, index files, and `AGENTS.md`
41
41
  - **Trigger:** Task prompt includes "REFRESH MODE"
42
42
 
43
43
  In both modes, the analysis and generation logic is identical.
44
44
 
45
45
  ---
46
46
 
47
- ## A. Analyze Codebase and Create/Update CLAUDE.md
47
+ ## A. Analyze Codebase and Create/Update AGENTS.md
48
48
 
49
49
  **Process:**
50
50
 
@@ -139,11 +139,11 @@ Generate a repository-local codebase index that stays generic and works for any
139
139
  - Skip categories that do not apply. Do not generate empty placeholder files.
140
140
  - The script should overwrite previously generated index files on each run so rebuild is idempotent.
141
141
 
142
- ### A4. Create CLAUDE.md
142
+ ### A4. Create AGENTS.md
143
143
 
144
- Generate CLAUDE.md:
144
+ Generate `AGENTS.md` — the provider-agnostic instructions file that works with any AI coding tool:
145
145
 
146
- CLAUDE.md structure:
146
+ AGENTS.md structure:
147
147
  - **Project Overview:** 1-2 sentences from README/package.json
148
148
  - **Build & Run Commands:** Build, test, and other detected commands
149
149
  - **Workflow Rules:** Include this section verbatim:
@@ -156,16 +156,33 @@ CLAUDE.md structure:
156
156
  - **Coding Guidelines:** The 6 mandatory principles (types, concise docs, short files, extract methods, SRP/DRY, maintainable/modular)
157
157
  - **Project Documentation:** Links to whichever `.5/` files were created (only list files that exist)
158
158
  - **Codebase Index:** Add a section linking `.5/index/README.md`, the generated index files, and the rebuild script
159
- - **Index Freshness Rule:** State clearly that if the index files are more than one day old, Claude should regenerate them by running `.5/index/rebuild-index.sh` before relying on them
159
+ - **Index Freshness Rule:** State clearly that if the index files are more than one day old, the agent should regenerate them by running `.5/index/rebuild-index.sh` before relying on them
160
160
 
161
- ### A5. Preserve Existing Content
161
+ ### A5. Migrate and Preserve Existing Content
162
162
 
163
- If CLAUDE.md already exists:
163
+ **Run this step BEFORE writing the CLAUDE.md shim** to avoid data loss.
164
+
165
+ **If `AGENTS.md` already exists:**
164
166
  - Read current content
165
167
  - Identify user-written custom sections (not matching template structure)
166
- - Preserve under "Custom Documentation" section in new CLAUDE.md
168
+ - Preserve under "Custom Documentation" section in new AGENTS.md
167
169
  - Ensure 6 mandatory coding guidelines are retained
168
170
 
171
+ **If `CLAUDE.md` already exists with real content (not just `@AGENTS.md`):**
172
+ - Read current CLAUDE.md content
173
+ - Identify user-written custom sections (not matching template structure)
174
+ - Migrate all content into the new AGENTS.md (preserve under "Custom Documentation" section)
175
+
176
+ ### A6. Create CLAUDE.md shim (Claude Code only)
177
+
178
+ After migration is complete (A5), create or overwrite `CLAUDE.md` with only:
179
+
180
+ ```
181
+ @AGENTS.md
182
+ ```
183
+
184
+ This single line uses Claude Code's include syntax to pull in the full AGENTS.md content. This way Claude Code users get the instructions automatically, while other AI tools (Codex, etc.) read AGENTS.md directly.
185
+
169
186
  ---
170
187
 
171
188
  ## Output Contract
@@ -173,13 +190,14 @@ If CLAUDE.md already exists:
173
190
  Returns structured results for each component:
174
191
 
175
192
  ```
176
- Component A (Documentation + Index): SUCCESS - Created documentation files, codebase index, and CLAUDE.md
193
+ Component A (Documentation + Index): SUCCESS - Created documentation files, codebase index, and AGENTS.md
177
194
  - .5/ARCHITECTURE.md (Pattern: Layered, 4 layers identified)
178
195
  - .5/TESTING.md (mocking patterns, gotchas documented)
179
196
  - .5/CONCERNS.md (3 TODO items, 1 security note) [or "skipped — no concerns found"]
180
197
  - .5/index/rebuild-index.sh (generated index rebuild script)
181
198
  - .5/index/*.md (focused codebase index files)
182
- - CLAUDE.md (updated with references)
199
+ - AGENTS.md (updated with references)
200
+ - CLAUDE.md (shim: @AGENTS.md)
183
201
  ```
184
202
 
185
203
  Or on failure:
@@ -190,7 +208,7 @@ Component A (Documentation + Index): FAILED - Unable to read template files
190
208
 
191
209
  ## DO NOT
192
210
 
193
- - DO NOT overwrite existing user-written CLAUDE.md sections
211
+ - DO NOT overwrite existing user-written AGENTS.md sections
194
212
  - DO NOT include `steps` in config.json
195
213
  - DO NOT hardcode conventions - always derive from actual project analysis
196
214
  - DO NOT generate empty or placeholder index files
@@ -219,7 +219,7 @@ For each applicable rule:
219
219
  1. **Derive `paths:` globs** from detected file locations (e.g., if tests are at `src/**/*.test.ts` and `tests/**/*.spec.ts`, use those patterns)
220
220
  2. **Convert analysis observations into imperative directives** — "Use X", "Always Y", "Never Z"
221
221
  3. **Keep each file 15-40 lines** — be concise and actionable
222
- 4. **Do not repeat** the 6 mandatory coding guidelines from `CLAUDE.md`
222
+ 4. **Do not repeat** the 6 mandatory coding guidelines from `AGENTS.md`
223
223
 
224
224
  Write files to `.claude/rules/`:
225
225
 
@@ -311,4 +311,4 @@ Component D (Rules): SKIPPED - rules.generate is false in config
311
311
  - DO NOT hardcode conventions - always derive from actual project analysis
312
312
  - DO NOT generate empty or placeholder skill or rule files
313
313
  - DO NOT assume command syntax - always read from actual config files (package.json, Makefile, etc.)
314
- - DO NOT repeat the 6 mandatory coding guidelines from `CLAUDE.md` in rule files
314
+ - DO NOT repeat the 6 mandatory coding guidelines from `AGENTS.md` in rule files
@@ -78,7 +78,7 @@ Look for patterns in project documentation:
78
78
 
79
79
  - Check `.5/ARCHITECTURE.md` for architectural patterns and non-obvious conventions
80
80
  - Check `.5/TESTING.md` for test patterns and conventions
81
- - Fall back to CLAUDE.md if `.5/` documentation not present
81
+ - Fall back to AGENTS.md if `.5/` documentation not present
82
82
  - Check module-specific documentation
83
83
 
84
84
  Use these patterns to identify what's critical for the module README.