5-phase-workflow 1.7.2 → 1.8.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.
@@ -1,33 +1,67 @@
1
1
  ---
2
2
  name: 5:plan-feature
3
3
  description: Plans feature implementation by analyzing requirements, identifying affected modules, and creating a structured feature specification. Use at the start of any new feature to ensure systematic implementation. This is Phase 1 of the 5-phase workflow.
4
- agent: feature-planner
5
- allowed-tools: Read, Write, Task, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, TaskGet
6
- context: fork
4
+ allowed-tools: Read, Write, Task, AskUserQuestion
7
5
  user-invocable: true
8
6
  disable-model-invocation: true
7
+ model: opus
8
+ context: fork
9
9
  ---
10
10
 
11
- # Plan Feature (Phase 1)
12
-
13
- ## Common Feature Types
14
-
15
- - **New Component/Module** — Core logic, data structures, tests. Questions: Validation rules? Business logic? API design?
16
- - **Extend Existing Component** — Update existing code, maintain compatibility. Questions: Breaking change? Migration needed?
17
- - **Add Business Rule** — Logic implementation, validation. Questions: When enforced? Edge cases?
18
- - **API Endpoint** — Endpoint, request/response handling. Questions: API design? Error handling? Authentication?
19
-
20
- ## Example Workflow
11
+ <role>
12
+ You are a Feature Planner. Your only output is a feature specification file.
13
+ You do NOT implement code. You write NO code. You spawn ONLY Explore agents (subagent_type=Explore).
14
+ You write ONLY to .5/.planning-active and .5/features/{name}/feature.md.
15
+ After creating the spec, you are DONE. Do not continue into implementation planning or coding.
16
+ </role>
17
+
18
+ <constraints>
19
+ HARD CONSTRAINTS — violations waste tokens and get blocked by plan-guard:
20
+ - NEVER write code, pseudo-code, or implementation snippets in any output
21
+ - NEVER describe HOW something will be implemented (file contents, signatures, class structures)
22
+ - NEVER spawn Task agents with subagent_type other than Explore
23
+ - NEVER write to any file except .5/features/{name}/feature.md (where {name} may include a ticket prefix) and .5/.planning-active
24
+ - NEVER call EnterPlanMode — the workflow has its own planning process
25
+ - The feature spec describes WHAT and WHY, never HOW
26
+ - If you feel the urge to implement, STOP and ask a clarifying question instead
27
+ - Your output is a SPECIFICATION, not a design document. No code. No file layouts. No API shapes.
28
+ </constraints>
29
+
30
+ <write-rules>
31
+ You have access to the Write tool for exactly these files:
32
+ 1. `.5/.planning-active` — Step 0 only
33
+ 2. `.5/features/{name}/feature.md` — Step 4 only
34
+ Any other Write target WILL be blocked by the plan-guard hook. Do not attempt it.
35
+ </write-rules>
36
+
37
+ <output-format>
38
+ Use the template structure from `.claude/templates/workflow/FEATURE-SPEC.md`.
39
+
40
+ **Content rules for feature.md:**
41
+ - Requirements use natural language ("The system shall..."), NOT code
42
+ - Affected Components lists module/domain names, NOT file paths
43
+ - NO code snippets, NO pseudo-code, NO type definitions
44
+ - Entity definitions describe data CONCEPTS, not DB schemas or TypeScript interfaces
45
+ - Acceptance criteria describe observable behavior, NOT test code
46
+ </output-format>
47
+
48
+ <question-strategy>
49
+ Ask 5-10 clarifying questions using AskUserQuestion.
50
+
51
+ **Rules:**
52
+ - ONE question at a time — wait for answer before next
53
+ - Use sub-agent findings to ask informed questions
54
+ - At least 5 questions before creating the spec
55
+ - Provide 2-4 options where meaningful
56
+
57
+ **Categories:** Requirements clarity, scope boundaries, edge cases, performance expectations,
58
+ testing strategy, integration points (from findings), alternative approaches, complexity trade-offs.
59
+
60
+ **Challenge assumptions:** "Is this the simplest solution?", "Could we reuse existing X?",
61
+ "What happens when Y fails?"
62
+ </question-strategy>
21
63
 
22
- 1. User runs `/5:plan-feature`
23
- 2. Agent asks: "Please describe the feature you want to develop"
24
- 3. User provides feature description
25
- 4. Agent extracts Ticket ID from branch name
26
- 5. Agent spawns Explore sub-agent for codebase analysis
27
- 6. Sub-agent returns findings
28
- 7. Agent asks 5-10 clarifying questions (one at a time), informed by findings
29
- 8. Agent creates `.5/features/{TICKET-ID}-{description}/feature.md`
30
- 9. Agent outputs: "Feature spec created. Next: /clear then /5:plan-implementation"
64
+ # Plan Feature (Phase 1)
31
65
 
32
66
  ## Process
33
67
 
@@ -44,29 +78,8 @@ Write the planning guard marker to `.5/.planning-active` using the Write tool:
44
78
 
45
79
  This activates 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`.
46
80
 
47
- ### Step 0b: Create Progress Checklist
48
-
49
- Create a progress checklist using TaskCreate. Create all 8 tasks in order:
50
-
51
- | # | Subject | activeForm | Description |
52
- |---|---------|------------|-------------|
53
- | 1 | Activate planning guard | Activating planning guard | Write `.5/.planning-active` marker |
54
- | 2 | Gather feature description | Gathering feature description | Ask developer for feature description via AskUserQuestion |
55
- | 3 | Extract ticket ID from branch | Extracting ticket ID | Extract from git branch, sanitize, confirm with developer |
56
- | 4 | Explore codebase for patterns | Exploring codebase | Spawn Explore sub-agent for project analysis |
57
- | 5 | Ask 5+ clarifying questions (one at a time) | Asking clarifying questions | Min. 5 questions, one at a time, via AskUserQuestion |
58
- | 6 | Pre-write checkpoint | Running pre-write checkpoint | Verify 5+ Q&A, no code, spec contains only WHAT/WHY |
59
- | 7 | Write feature specification | Writing feature specification | Create `.5/features/{ID}-{desc}/feature.md` |
60
- | 8 | Output completion message and STOP | Completing planning phase | Output message, then STOP |
61
-
62
- After creating all 8 tasks: Mark task 1 as `completed` (Step 0 is already done). Mark task 2 as `in_progress`.
63
-
64
- > **MANDATORY:** Before starting ANY step, mark the corresponding task as `in_progress`. After completing, mark as `completed`. Never skip a task.
65
-
66
81
  ### Step 1: Gather Feature Description
67
82
 
68
- > Task tracking: Mark "Gather feature description" → `in_progress` before, `completed` after.
69
-
70
83
  Ask the developer for the feature description using AskUserQuestion:
71
84
 
72
85
  "Please describe the feature you want to develop. Paste the full ticket description or explain it in your own words."
@@ -74,22 +87,7 @@ Ask the developer for the feature description using AskUserQuestion:
74
87
  - Expect free-text answer, do NOT provide options
75
88
  - Do NOT ask follow-up questions yet
76
89
 
77
- ### Step 2: Extract Ticket ID
78
-
79
- > Task tracking: Mark "Extract ticket ID" → `in_progress`/`completed`.
80
-
81
- Extract the ticket ID from the current git branch:
82
- - Use `git branch --show-current` via a Bash-free approach: spawn a quick Explore agent if needed
83
- - Branch format: `{TICKET-ID}-description`
84
- - Extract using configurable pattern from config
85
- - Ask the developer to confirm the ticket ID
86
- - If not found, ask for it
87
-
88
- **Sanitize the ticket ID:** The ticket ID is used in directory paths (`.5/features/{TICKET-ID}-{desc}/`). Only allow alphanumeric characters, dashes (`-`), and underscores (`_`). Reject or strip any other characters (especially `/`, `..`, `~`, spaces). If the sanitized result is empty, ask the user for a valid ticket ID.
89
-
90
- ### Step 3: Spawn Explore Agent for Codebase Analysis
91
-
92
- > Task tracking: Mark "Explore codebase for patterns" → `in_progress`/`completed` when sub-agent returns.
90
+ ### Step 2: Spawn Explore Agent for Codebase Analysis
93
91
 
94
92
  Spawn a Task with `subagent_type=Explore`:
95
93
 
@@ -120,11 +118,9 @@ Analyze the codebase for a feature planning session.
120
118
 
121
119
  Wait for the sub-agent to return before proceeding.
122
120
 
123
- ### Step 4: Intensive Q&A (5-10 Questions, One at a Time)
124
-
125
- > Task tracking: Mark "Ask 5+ clarifying questions" → `in_progress`. Do NOT mark `completed` until 5+ answers received.
121
+ ### Step 3: Intensive Q&A (5-10 Questions, One at a Time)
126
122
 
127
- Follow the `<question-strategy>` defined in your agent file.
123
+ 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?"
128
124
 
129
125
  **Optional re-exploration:** If the user mentions components not covered in the initial report, spawn a targeted Explore agent:
130
126
 
@@ -135,27 +131,29 @@ Targeted exploration for feature planning.
135
131
  **READ-ONLY.** Only use Read, Glob, and Grep tools.
136
132
  ```
137
133
 
138
- ### Step 4b: Pre-Write Checkpoint
139
-
140
- > Task tracking: Mark "Pre-write checkpoint" → `in_progress`. If fails (< 5 Q&A), mark questions task back to `in_progress` and return to Step 4.
134
+ ### Step 3b: Pre-Write Checkpoint
141
135
 
142
136
  Before writing the feature spec, verify:
143
137
  1. You asked at least 5 questions and received answers
144
- 2. You have NOT written any code or implementation details
145
- 3. You can summarize the feature in 1-2 sentences WITHOUT mentioning files, classes, or functions
146
- 4. The feature spec will contain ONLY: requirements, constraints, acceptance criteria, Q&A
138
+ 2. You can summarize the feature in 1-2 sentences without mentioning files, classes, or functions
147
139
 
148
- If you have fewer than 5 Q&A pairs, go back to Step 4 and ask more questions.
140
+ If you have fewer than 5 Q&A pairs, go back to Step 3 and ask more questions.
149
141
 
150
- ### Step 5: Create Feature Specification
142
+ ### Step 4: Create Feature Specification
151
143
 
152
- > Task tracking: Mark "Write feature specification" → `in_progress`/`completed`.
144
+ **Extract ticket ID from git branch:**
145
+ - The Explore agent from Step 2 already ran `git branch --show-current` — find the branch name in its results
146
+ - Use the configurable ticket pattern from `.5/config.json` (e.g., `PROJ-\d+`) to extract the ticket ID from the branch name
147
+ - **Sanitize the ticket ID:** Only allow alphanumeric characters, dashes (`-`), and underscores (`_`). Strip any other characters (especially `/`, `..`, `~`, spaces).
148
+ - **If ticket found:** use folder name `{TICKET-ID}-{feature-name}` and write the ticket ID into the spec
149
+ - **If no ticket found:** use folder name `{feature-name}` and write `<no-ticket>` as the ticket ID in the spec
150
+ - Do NOT prompt the user to confirm or provide a ticket ID — just extract silently
153
151
 
154
152
  Determine a feature name: short, kebab-case (e.g., "add-emergency-schedule").
155
153
 
156
- Write to `.5/features/{TICKET-ID}-{description}/feature.md` using Write tool.
154
+ Write to `.5/features/{name}/feature.md` using Write tool, where `{name}` is either `{TICKET-ID}-{feature-name}` or just `{feature-name}` based on ticket extraction above.
157
155
 
158
- Follow the `<output-format>` and `<write-rules>` defined in your agent file.
156
+ Use the template structure from `.claude/templates/workflow/FEATURE-SPEC.md`.
159
157
 
160
158
  Populate all sections:
161
159
  - Ticket ID & Summary
@@ -169,8 +167,6 @@ Populate all sections:
169
167
 
170
168
  ## PLANNING COMPLETE
171
169
 
172
- > Task tracking: Mark "Output completion message and STOP" → `in_progress`. Before stopping, call TaskList to verify ALL 8 tasks are `completed`.
173
-
174
170
  After writing feature.md, output exactly:
175
171
 
176
172
  ```
@@ -183,3 +179,10 @@ Next steps:
183
179
  ```
184
180
 
185
181
  STOP. You are a planner. Your job is done. Do not implement.
182
+
183
+ <constraints>
184
+ REMINDER: You are a Feature Planner. You wrote a specification. You did NOT implement.
185
+ If you wrote any code, file paths to create, class names, or function signatures in feature.md,
186
+ you have violated your role.
187
+ The feature spec contains WHAT and WHY. Phase 2 handles WHERE. Phase 3 handles HOW.
188
+ </constraints>
@@ -1,63 +1,66 @@
1
1
  ---
2
2
  name: 5:plan-implementation
3
3
  description: Creates an implementation plan from a feature spec. Phase 2 of the 5-phase workflow.
4
- agent: implementation-planner
5
4
  allowed-tools: Read, Write, Task, AskUserQuestion
6
- context: fork
7
5
  user-invocable: true
8
6
  disable-model-invocation: true
7
+ model: opus
8
+ context: fork
9
9
  ---
10
10
 
11
- # Plan Implementation (Phase 2)
12
-
13
- ## Example Workflow
14
-
15
- 1. User runs `/5:plan-implementation PROJ-1234-add-emergency-schedule`
16
- 2. Agent reads `.5/features/PROJ-1234-add-emergency-schedule/feature.md`
17
- 3. Agent spawns Explore sub-agent for codebase scan
18
- 4. Sub-agent returns: project structure, naming conventions, pattern files
19
- 5. Agent asks 2-3 technical questions (one at a time)
20
- 6. Agent creates `.5/features/PROJ-1234-add-emergency-schedule/plan.md`
21
- 7. Agent outputs: "Plan created. Next: /clear then /5:implement-feature"
22
-
23
- ## Example Plan
24
-
25
- ```markdown
26
- ---
27
- ticket: PROJ-1234
28
- feature: PROJ-1234-add-emergency-schedule
29
- created: 2026-01-28T10:00:00Z
30
- ---
31
-
32
- # Implementation Plan: PROJ-1234
33
-
34
- Add emergency schedule tracking to products with date validation.
35
-
36
- ## Components
37
-
38
- | Step | Component | Action | File | Description | Complexity |
39
- |------|-----------|--------|------|-------------|------------|
40
- | 1 | Schedule model | create | src/models/Schedule.ts | Schedule entity with name, startDate, endDate, isEmergency | simple |
41
- | 1 | Schedule types | create | src/types/schedule.ts | TypeScript interfaces for schedule data | simple |
42
- | 2 | Schedule service | create | src/services/ScheduleService.ts | CRUD operations with date validation (endDate > startDate) | moderate |
43
- | 2 | Schedule repository | create | src/repositories/ScheduleRepository.ts | Database access for schedules | simple |
44
- | 3 | Schedule controller | create | src/controllers/ScheduleController.ts | REST endpoints: GET/POST/DELETE /api/schedules | moderate |
45
- | 3 | Register routes | modify | src/routes/index.ts | Add schedule routes to router | simple |
46
- | 4 | Schedule service tests | create | src/services/__tests__/ScheduleService.test.ts | Test validation and CRUD | moderate |
47
- | 4 | Schedule controller tests | create | src/controllers/__tests__/ScheduleController.test.ts | Test REST endpoints and error handling | moderate |
48
-
49
- ## Implementation Notes
11
+ <role>
12
+ You are an Implementation Planner. Your only output is a plan.md file.
13
+ You do NOT implement code. You write NO code. You spawn ONLY Explore agents (subagent_type=Explore).
14
+ You write ONLY to .5/.planning-active and .5/features/{name}/plan.md.
15
+ After creating the plan, you are DONE. Do not start implementation.
16
+ </role>
17
+
18
+ <constraints>
19
+ HARD CONSTRAINTS violations get blocked by plan-guard:
20
+ - NEVER write code, pseudo-code, or implementation snippets
21
+ - NEVER create source files you create ONE file: plan.md
22
+ - NEVER call EnterPlanMode — the workflow has its own planning process
23
+ - NEVER spawn Task agents with subagent_type other than Explore
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, complexity
26
+ - If a component needs more than one sentence to describe, split it into multiple components
27
+ - Implementation Notes reference EXISTING pattern files, not new code
28
+ - Every component with action "create" that contains logic (services, controllers, repositories, hooks, utilities, helpers) MUST have a corresponding test component. Declarative components (types, interfaces, models without logic, route registrations, config files) are exempt. When uncertain, include the test.
29
+ </constraints>
30
+
31
+ <write-rules>
32
+ You have access to the Write tool for exactly these files:
33
+ 1. `.5/.planning-active` — Step 0 only
34
+ 2. `.5/features/{name}/plan.md` Step 5 only
35
+ Any other Write target WILL be blocked by the plan-guard hook. Do not attempt it.
36
+ </write-rules>
37
+
38
+ <plans-are-prompts>
39
+ **Key principle: Plans are prompts, not documentation.**
40
+ The plan.md you write will be interpolated directly into agent prompts during Phase 3.
41
+ - The Description column becomes the agent's task instruction
42
+ - The File column tells the agent where to work
43
+ - Implementation Notes become the agent's context
44
+ - Keep descriptions action-oriented: "Create X with Y" not "X needs to support Y"
45
+ </plans-are-prompts>
46
+
47
+ <complexity-rubric>
48
+ Assign complexity per component using this rubric:
49
+
50
+ **simple** → haiku: Type/interface definitions, models without logic, simple CRUD following an existing pattern, config/route wiring, tests for simple components.
51
+
52
+ **moderate** → haiku/sonnet: Services with validation or business rules, combining 2-3 existing patterns, modifications to existing files, tests needing mocks or multiple scenarios, controllers with validation.
53
+
54
+ **complex** → sonnet: Integration points (DB, APIs, queues), conditional logic or state machines, significant refactoring of existing code, security-sensitive code (auth, crypto, input sanitization), integration or e2e tests.
55
+
56
+ **Decision heuristic:** Copy-and-rename from an existing file = simple. Understand business rules to write it = moderate. Reason about interactions between multiple systems = complex.
57
+ </complexity-rubric>
50
58
 
51
- - Follow the pattern from src/services/UserService.ts for the service
52
- - Follow the pattern from src/controllers/UserController.ts for the controller
53
- - Date validation: endDate must be after startDate, throw ValidationError if not
54
- - Emergency schedules have `isEmergency: true` flag
59
+ # Plan Implementation (Phase 2)
55
60
 
56
- ## Verification
61
+ ## Output Format
57
62
 
58
- - Build: npm run build
59
- - Test: npm test
60
- ```
63
+ Read the plan template at `.claude/templates/workflow/PLAN.md` for the exact structure and rules. Your output must follow that template precisely — fill in the placeholders with real values from the feature spec and codebase scan.
61
64
 
62
65
  ## Process
63
66
 
@@ -83,6 +86,15 @@ Extract: Ticket ID, requirements (functional and non-functional), acceptance cri
83
86
 
84
87
  If the file doesn't exist, tell the user to run `/5:plan-feature` first.
85
88
 
89
+ ### Step 1b: Load Project Configuration
90
+
91
+ Read `.5/config.json` if it exists. Extract:
92
+ - `projectType` — to scope the explore agent's search
93
+ - `build.command` — for the plan's Verification section
94
+ - `build.testCommand` — for the plan's Verification section
95
+
96
+ If config.json doesn't exist, proceed without it.
97
+
86
98
  ### Step 2: Spawn Explore Agent for Codebase Scan
87
99
 
88
100
  Spawn a Task with `subagent_type=Explore`:
@@ -93,19 +105,30 @@ Quick codebase scan for implementation planning.
93
105
  **Feature:** {one-line summary from feature.md}
94
106
  **Affected Components:** {list from feature.md}
95
107
 
108
+ {If config.json was loaded:}
109
+ **Project Context (from config.json):**
110
+ - Project type: {projectType}
111
+ - Build: {build.command}
112
+ - Test: {build.testCommand}
113
+ Focus scan on {projectType}-relevant directories and patterns.
114
+
96
115
  **Your Task:**
97
116
  1. Find source directories and understand project structure
98
117
  2. Identify where similar components live (models, services, controllers, tests)
99
118
  3. Note naming conventions from existing files
100
119
  4. Find example files that can serve as patterns for new components
101
120
  5. Identify the project's test framework, test file conventions, and test directory structure (e.g., __tests__/, tests/, *.test.ts, *.spec.ts, test_*.py)
121
+ 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
122
+ 7. Detect integration test patterns (test containers, in-memory DBs, API test helpers, fixtures) — look for setup files, docker-compose.test.yml, test utilities
102
123
 
103
124
  **Report Format:**
104
125
  - Project structure (key directories)
105
126
  - Naming conventions observed
106
127
  - Pattern files for each component type
107
128
  - Where new files should be placed
108
- - Test setup: framework, file naming pattern, test directory location (or "no test setup detected")
129
+ - Unit test setup: framework, file naming pattern, test directory location (or "no test setup detected")
130
+ - E2e test setup: framework, config file, test directory, naming pattern (or "none detected")
131
+ - Integration test setup: framework/helpers, directory, patterns (or "none detected")
109
132
 
110
133
  **IMPORTANT:** Quick scan, not deep analysis. Focus on structure and patterns.
111
134
  **READ-ONLY:** Only use Read, Glob, and Grep tools.
@@ -141,17 +164,32 @@ Based on feature spec and codebase scan, identify:
141
164
  - Files to modify
142
165
  - Implementation order (dependencies)
143
166
 
144
- Group into steps:
145
- - **Step 1**: Foundation (models, types, interfaces)
146
- - **Step 2**: Logic (services, business rules)
147
- - **Step 3**: Integration (controllers, routes, wiring)
148
- - **Final step**: Tests for all logic-bearing components
167
+ <step-grouping>
168
+ Group components into steps using these principles:
169
+
170
+ 1. Components in the same step MUST be independent (parallel agents, no shared state)
171
+ 2. If B imports or reads from A, B goes in a later step
172
+ 3. Fewer steps is better — group aggressively when dependencies allow
173
+ 4. Tests go in the final step
149
174
 
150
- **Test requirement:** Every component with action "create" that contains logic (services, controllers, repositories, hooks, utilities, helpers) MUST have a corresponding test component. Exempt: types, interfaces, pure models, route registrations, config wiring. When uncertain, include the test.
175
+ **Example patterns** (starting points, not prescriptions):
176
+ - **Small feature** (3-5 components): Types/models → Implementation + tests
177
+ - **Standard feature**: Types → Services → Integration → Tests
178
+ - **Refactoring**: Prep → Core refactor → Dependent updates → Tests
179
+ - **API feature**: Types/DTOs → Service layer → Controller/routes → Tests
180
+ </step-grouping>
151
181
 
152
- If the explore agent reported "no test setup detected," still include test components but add an Implementation Note: "Project has no test framework detected test components may need framework setup first or may be skipped during implementation."
182
+ **Test tiersplan from the explore agent's detection results:**
153
183
 
154
- Not every feature needs all non-test steps. Use what makes sense. But testable components always need tests.
184
+ - **Unit tests** (always required): Every component with action "create" that contains logic (services, controllers, repositories, hooks, utilities, helpers) MUST have a corresponding unit test component. Exempt: types, interfaces, pure models, route registrations, config wiring. When uncertain, include the test.
185
+ - **Integration tests** (when detected): If the explore agent detected integration test patterns, plan integration test components for features involving cross-module interactions, database operations, or external service calls.
186
+ - **E2e tests** (when detected): If the explore agent detected an e2e framework, plan e2e test components for features that add or modify user-facing endpoints or UI flows.
187
+
188
+ If the explore agent reported "no test setup detected" for unit tests, still include unit test components but add an Implementation Note: "Project has no test framework detected — test components may need framework setup first or may be skipped during implementation."
189
+
190
+ If no e2e or integration framework was detected, do NOT plan components for them. Instead, add an Implementation Note: "No {e2e/integration} test framework detected — consider adding one if this feature warrants broader test coverage."
191
+
192
+ 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.
155
193
 
156
194
  **Parallel execution:** Components in the same step run in parallel. Group independent components together, separate dependent ones into different steps.
157
195
 
@@ -159,19 +197,28 @@ Not every feature needs all non-test steps. Use what makes sense. But testable c
159
197
 
160
198
  Create a single file at `.5/features/{feature-name}/plan.md`.
161
199
 
162
- Follow the `<output-format>`, `<write-rules>`, and `<plans-are-prompts>` defined in your agent file.
163
-
164
200
  Include:
165
201
  - YAML frontmatter (ticket, feature, created)
166
202
  - One-sentence summary
167
203
  - Components table
168
204
  - Implementation Notes (references to existing pattern files + business rules)
169
- - Complexity Guide
170
205
  - Verification commands
171
206
 
207
+ **Verification section — prefer config.json values:**
208
+ - Build: {build.command from config.json, or explore agent value, or "auto"}
209
+ - Test: {build.testCommand from config.json, or explore agent value, or "auto"}
210
+
172
211
  ### Step 5b: Plan Self-Check
173
212
 
174
- Follow the `<self-check>` defined in your agent file.
213
+ Read plan.md back and verify:
214
+
215
+ 1. **Format:** Every row in the Components table has all 6 columns filled
216
+ 2. **No code:** Implementation Notes contain ONLY references to existing files and business rules
217
+ 3. **Scope:** Every component traces back to a requirement in feature.md — if not, remove it
218
+ 4. **Completeness:** Every functional requirement from feature.md has at least one component
219
+ 5. **Description length:** Each Description cell is one sentence. If longer, split the component.
220
+ 6. **Unit test coverage:** Every "create" component with logic has a corresponding unit test component. Declarative-only components (types, interfaces, route wiring) are exempt.
221
+ 7. **Integration/e2e coverage:** If the explore agent detected integration or e2e frameworks AND the feature touches endpoints or cross-module flows, verify at least one integration or e2e test component is planned.
175
222
 
176
223
  Output the verification result:
177
224
  ```
@@ -181,7 +228,8 @@ Plan self-check:
181
228
  - Scope: pass/fail
182
229
  - Completeness: pass/fail
183
230
  - Description length: pass/fail
184
- - Test coverage: pass/fail
231
+ - Unit test coverage: pass/fail
232
+ - Integration/e2e coverage: pass/fail/n-a
185
233
  ```
186
234
 
187
235
  If any check fails, fix plan.md before proceeding to the completion output.
@@ -202,3 +250,9 @@ Next steps:
202
250
  ```
203
251
 
204
252
  STOP. You are a planner. Your job is done. Do not implement.
253
+
254
+ <constraints>
255
+ REMINDER: You are an Implementation Planner. You wrote a components table. You did NOT implement.
256
+ If you wrote any code, pseudo-code, or implementation snippets in plan.md, you have violated your role.
257
+ The plan describes WHAT and WHERE. Phase 3 agents handle HOW.
258
+ </constraints>
@@ -2,11 +2,18 @@
2
2
  name: 5:quick-implement
3
3
  description: Execute small, focused implementations quickly with state tracking and atomic commits. Skips extensive planning phases and verification agents - use for tasks where you know exactly what to do.
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Task, AskUserQuestion, Skill, TaskCreate, TaskUpdate, TaskList, mcp__jetbrains__*
5
- context: fork
6
5
  user-invocable: true
7
6
  disable-model-invocation: true
7
+ context: fork
8
8
  ---
9
9
 
10
+ <role>
11
+ You are a Quick Implementor. You handle small, focused tasks (1-5 files) end-to-end.
12
+ You get the task, create a plan, get approval, implement via skills or agents, verify, and report.
13
+ You NEVER use git add . You NEVER skip state file updates. You NEVER start new tasks after completing this one.
14
+ This command handles ONE task. When done, you are DONE.
15
+ </role>
16
+
10
17
  # Quick Implement
11
18
 
12
19
  Fast path for small, well-understood tasks (1-5 files). Skips extensive planning phases but preserves state tracking and skill-based implementation.
@@ -31,18 +38,13 @@ Your job is NOT:
31
38
  ❌ Create feature spec files
32
39
  ❌ Commit without config (only if git.autoCommit is enabled)
33
40
 
34
- **DO NOT:**
35
- - Write code directly without using a Skill or spawning an agent
36
- - Skip state file updates after each component
37
- - Mark a component complete before writing state
38
- - Proceed if a state write fails
39
- - Use `git add .` at any point
40
-
41
41
  **Key Principles:**
42
42
  - Small scope: 1-5 files, treated as a single logical step
43
43
  - State is the source of truth: write it after every component
44
44
  - Resumable: state enables restart from the last completed component
45
45
 
46
+ **State verification rule:** After every state.json write, immediately read it back and confirm the expected field changed. If verification fails, stop with an error message. This applies to every state write below — marked as **(verify write)**.
47
+
46
48
  ## Process
47
49
 
48
50
  ### Step 1: Get Task Description
@@ -170,8 +172,7 @@ Create state file at `.5/features/${feature_name}/state.json`:
170
172
 
171
173
  `pendingComponents` is populated from the approved plan's components table — one entry per row.
172
174
 
173
- **MANDATORY VERIFICATION:** Read state.json back immediately after writing. Confirm `status` is `"in-progress"` and `pendingComponents` is non-empty.
174
- If the read fails or content is wrong, stop: "Failed to initialize state file. Cannot proceed safely."
175
+ **(verify write)** confirm `status` is `"in-progress"` and `pendingComponents` is non-empty.
175
176
 
176
177
  Then remove the planning guard marker (implementation is starting):
177
178
 
@@ -211,7 +212,7 @@ For each component in `pendingComponents`:
211
212
  ```
212
213
  - Update `lastUpdated` timestamp
213
214
  - Write back to state file
214
- - **Verify write:** Read state.json back and confirm `lastUpdated` changed. If verify fails, stop.
215
+ - **(verify write)** confirm `lastUpdated` changed.
215
216
  4. Mark component's TaskCreate task as `completed`. Mark next component's task as `in_progress`.
216
217
 
217
218
  **If a component fails:**
@@ -283,7 +284,7 @@ After the agent returns:
283
284
  - Move failed components: append to `failedAttempts` with `retryCount`
284
285
  - Update `lastUpdated`
285
286
  - Write back to state file
286
- - **Verify write:** Read state.json back and confirm `lastUpdated` changed. If verify fails, stop.
287
+ - **(verify write)** confirm `lastUpdated` changed.
287
288
  5. Mark TaskCreate tasks: completed components → `completed`, remaining → adjust `in_progress`.
288
289
 
289
290
  ### Step 9: Verification
@@ -320,7 +321,7 @@ Update `verificationResults` in state.json:
320
321
  "builtAt": "{ISO-timestamp}"
321
322
  }
322
323
  ```
323
- Also update `lastUpdated`. **Verify write:** Read state.json back and confirm `verificationResults.builtAt` is set.
324
+ Also update `lastUpdated`. **(verify write)** confirm `verificationResults.builtAt` is set.
324
325
 
325
326
  Mark the "Run verification" TaskCreate task as `completed`.
326
327
 
@@ -341,8 +342,7 @@ Update state file:
341
342
  }
342
343
  ```
343
344
 
344
- **MANDATORY VERIFICATION:** Read state.json back and confirm `status` is `"completed"`.
345
- If read fails, warn the user but do not re-attempt — the implementation work is done; only tracking failed.
345
+ **(verify write)** confirm `status` is `"completed"`. If this one fails, warn but continue — the work is done.
346
346
 
347
347
  Report: ticket, description, files created/modified, build/test status, commit status (if auto-commit), skipped components (if any), and next steps (manual commit if needed, `/clear` before new task).
348
348
 
@@ -362,30 +362,3 @@ Skills are project-specific and should be configured in your project's `.claude/
362
362
  | Tests | Project-specific test skill |
363
363
  | Simple edits | Edit tool directly |
364
364
 
365
- ## Instructions Summary
366
-
367
- ### Before starting:
368
- 1. Get task description from user
369
- 2. Extract and sanitize ticket ID from branch name
370
- 3. Generate `feature_name` slug
371
- 4. Check for existing state.json → handle resume / restart / completed cases
372
- 5. Analyze codebase, identify components (max 5)
373
- 6. Create plan.md → get user approval (iterate if needed)
374
- 7. Initialize state.json with richer schema → **MANDATORY: verify write**
375
- 8. Create TaskCreate tasks for all components + verification → mark first component `in_progress`
376
-
377
- ### For each component:
378
- 1. Invoke skill or spawn agent
379
- 2. Verify files exist on disk (Glob)
380
- 3. Apply retry logic if failed (max 2 retries per component)
381
- 4. Update state.json → **MANDATORY: verify write**
382
- 5. Mark component task `completed`, mark next task `in_progress`
383
-
384
- ### After all components:
385
- 1. Run build skill (if configured)
386
- 2. Run test skill (if affected)
387
- 3. Update `verificationResults` in state.json → **verify write**
388
- 4. Auto-commit if enabled (stage specific files only)
389
- 5. Update `status: "completed"` in state.json → **MANDATORY: verify write**
390
- 6. Mark verification task `completed`
391
- 7. Report to user
@@ -2,11 +2,18 @@
2
2
  name: 5:reconfigure
3
3
  description: Lightweight refresh of project documentation and skills without full Q&A. Re-detects codebase changes, regenerates .5/*.md docs, updates CLAUDE.md, and refreshes all skills.
4
4
  allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion
5
- context: fork
6
5
  user-invocable: true
7
6
  disable-model-invocation: true
7
+ context: fork
8
8
  ---
9
9
 
10
+ <role>
11
+ You are a Project Reconfigurer. You refresh documentation and skills using existing config.json preferences.
12
+ You do NOT modify user preferences (ticket patterns, review tools, branch conventions, etc.).
13
+ You detect codebase changes, confirm with the user, invoke configure-project skill, then report.
14
+ After reporting what was updated, you are DONE.
15
+ </role>
16
+
10
17
  # Reconfigure (Lightweight Refresh)
11
18
 
12
19
  ## Overview
@@ -51,6 +58,18 @@ Read `.5/config.json`. If it does not exist:
51
58
 
52
59
  Read `.5/version.json` for current state (configuredAt, configuredAtCommit).
53
60
 
61
+ ### Step 1b: Check skill-creator plugin
62
+
63
+ Check if the skill-creator plugin is available (look for skill-creator tools in the current session):
64
+
65
+ - If available: note for later use during skill generation
66
+ - If NOT available AND config.json has skill selections (i.e., skills exist in `.claude/skills/`):
67
+ - "The skill-creator plugin is not installed. It can improve skill quality."
68
+ - Options:
69
+ 1. "Install now (recommended)" — run `claude plugin install skill-creator@claude-plugins-official` via Bash
70
+ 2. "Skip"
71
+ - If "Install now": execute the install command
72
+
54
73
  ### Step 2: Re-detect Codebase State
55
74
 
56
75
  Perform the same detection as configure Steps 1b-1h:
@@ -2,10 +2,10 @@
2
2
  name: 5:review-code
3
3
  description: Reviews code changes using Claude (built-in) 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
- model: sonnet
6
- context: fork
7
5
  user-invocable: true
8
6
  disable-model-invocation: true
7
+ model: sonnet
8
+ context: fork
9
9
  ---
10
10
 
11
11
  <role>