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.
- package/bin/install.js +35 -3
- package/package.json +1 -1
- package/src/commands/5/address-review-findings.md +2 -4
- package/src/commands/5/configure.md +38 -111
- package/src/commands/5/discuss-feature.md +10 -66
- package/src/commands/5/implement-feature.md +15 -51
- package/src/commands/5/plan-feature.md +79 -76
- package/src/commands/5/plan-implementation.md +117 -63
- package/src/commands/5/quick-implement.md +15 -42
- package/src/commands/5/reconfigure.md +20 -1
- package/src/commands/5/review-code.md +2 -2
- package/src/commands/5/unlock.md +1 -1
- package/src/commands/5/update.md +9 -2
- package/src/commands/5/verify-implementation.md +9 -1
- package/src/references/configure-tables.md +116 -0
- package/src/skills/configure-project/SKILL.md +6 -0
- package/src/templates/workflow/PLAN.md +11 -2
- package/src/agents/feature-planner.md +0 -69
- package/src/agents/implementation-planner.md +0 -73
package/bin/install.js
CHANGED
|
@@ -256,8 +256,6 @@ function getWorkflowManagedFiles() {
|
|
|
256
256
|
|
|
257
257
|
// Agents: separate agent files referenced by commands via agent: frontmatter
|
|
258
258
|
agents: [
|
|
259
|
-
'feature-planner.md',
|
|
260
|
-
'implementation-planner.md',
|
|
261
259
|
'component-executor.md'
|
|
262
260
|
],
|
|
263
261
|
|
|
@@ -278,6 +276,11 @@ function getWorkflowManagedFiles() {
|
|
|
278
276
|
'config-guard.js'
|
|
279
277
|
],
|
|
280
278
|
|
|
279
|
+
// References: lookup tables and schemas read on-demand by commands
|
|
280
|
+
references: [
|
|
281
|
+
'configure-tables.md'
|
|
282
|
+
],
|
|
283
|
+
|
|
281
284
|
// Templates: specific template files
|
|
282
285
|
templates: [
|
|
283
286
|
// Project documentation templates
|
|
@@ -384,6 +387,23 @@ function selectiveUpdate(targetPath, sourcePath) {
|
|
|
384
387
|
}
|
|
385
388
|
}
|
|
386
389
|
log.success('Updated templates/ (workflow files only)');
|
|
390
|
+
|
|
391
|
+
// Update specific references
|
|
392
|
+
if (managed.references && managed.references.length > 0) {
|
|
393
|
+
const referencesSrc = path.join(sourcePath, 'references');
|
|
394
|
+
const referencesDest = path.join(targetPath, 'references');
|
|
395
|
+
if (!fs.existsSync(referencesDest)) {
|
|
396
|
+
fs.mkdirSync(referencesDest, { recursive: true });
|
|
397
|
+
}
|
|
398
|
+
for (const ref of managed.references) {
|
|
399
|
+
const src = path.join(referencesSrc, ref);
|
|
400
|
+
const dest = path.join(referencesDest, ref);
|
|
401
|
+
if (fs.existsSync(src)) {
|
|
402
|
+
fs.copyFileSync(src, dest);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
log.success('Updated references/ (workflow files only)');
|
|
406
|
+
}
|
|
387
407
|
}
|
|
388
408
|
|
|
389
409
|
// Ensure .5/.gitignore exists and contains .update-cache.json
|
|
@@ -522,7 +542,7 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
|
|
|
522
542
|
}
|
|
523
543
|
|
|
524
544
|
// Copy directories
|
|
525
|
-
const dirs = ['commands', 'agents', 'skills', 'hooks', 'templates'];
|
|
545
|
+
const dirs = ['commands', 'agents', 'skills', 'hooks', 'templates', 'references'];
|
|
526
546
|
for (const dir of dirs) {
|
|
527
547
|
const src = path.join(sourcePath, dir);
|
|
528
548
|
const dest = path.join(targetPath, dir);
|
|
@@ -550,6 +570,7 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
|
|
|
550
570
|
log.info(' • Generate comprehensive documentation (CLAUDE.md)');
|
|
551
571
|
log.info(' • Create project-specific skills');
|
|
552
572
|
log.info('');
|
|
573
|
+
log.info('Tip: Configure will offer to install helpful plugins like skill-creator');
|
|
553
574
|
|
|
554
575
|
showCommandsHelp(isGlobal);
|
|
555
576
|
}
|
|
@@ -712,6 +733,17 @@ function uninstall() {
|
|
|
712
733
|
}
|
|
713
734
|
log.success('Removed workflow templates (preserved user-created templates)');
|
|
714
735
|
|
|
736
|
+
// Remove only workflow-managed references
|
|
737
|
+
if (managed.references) {
|
|
738
|
+
for (const ref of managed.references) {
|
|
739
|
+
const refPath = path.join(targetPath, 'references', ref);
|
|
740
|
+
if (fs.existsSync(refPath)) {
|
|
741
|
+
fs.unlinkSync(refPath);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
log.success('Removed workflow references (preserved user-created references)');
|
|
745
|
+
}
|
|
746
|
+
|
|
715
747
|
// Remove data directory (.5/)
|
|
716
748
|
const dataDir = getDataPath(false);
|
|
717
749
|
if (fs.existsSync(dataDir)) {
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
name: 5:address-review-findings
|
|
3
3
|
description: Applies annotated review findings and/or addresses GitHub PR review comments. Use --github to process PR comments only.
|
|
4
4
|
allowed-tools: Bash, Read, Edit, Write, Glob, Grep, AskUserQuestion, Task, Skill, 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>
|
|
@@ -36,8 +36,6 @@ Check if the command was invoked with `--github`.
|
|
|
36
36
|
|
|
37
37
|
Regardless of mode, read `.5/features/*/state.json` using Glob to find all state files. Select the one with the most recent `startedAt` (or `lastUpdated` if present).
|
|
38
38
|
|
|
39
|
-
Read `.5/features/*/state.json` using Glob to find all state files. Select the one with the most recent `startedAt` (or `lastUpdated` if present).
|
|
40
|
-
|
|
41
39
|
Extract:
|
|
42
40
|
- `feature` — feature directory name
|
|
43
41
|
- `ticket` — ticket ID
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
name: 5:configure
|
|
3
3
|
description: Configures the project. Analyzes project, gathers preferences, writes config.json, and creates feature spec for remaining setup. Follow up with /5:plan-implementation CONFIGURE.
|
|
4
4
|
allowed-tools: Read, Write, Bash, Glob, Grep, AskUserQuestion
|
|
5
|
-
context: inherit
|
|
6
5
|
user-invocable: true
|
|
7
6
|
disable-model-invocation: true
|
|
7
|
+
model: opus
|
|
8
|
+
context: fork
|
|
8
9
|
---
|
|
9
10
|
|
|
11
|
+
<role>
|
|
12
|
+
You are a Project Configurator. You analyze a project, gather preferences, and write config.json plus a feature spec.
|
|
13
|
+
You do NOT generate CLAUDE.md, documentation files, or skills directly — those are Phase 3's job.
|
|
14
|
+
You write ONLY to: .5/config.json, .5/version.json, .5/features/CONFIGURE/feature.md, and .gitignore.
|
|
15
|
+
After writing config.json and the feature spec, you are DONE. Exit immediately.
|
|
16
|
+
</role>
|
|
17
|
+
|
|
10
18
|
# Configure (Phase 1 - Plan Feature for Project Configuration)
|
|
11
19
|
|
|
12
20
|
## Overview
|
|
@@ -59,40 +67,9 @@ else
|
|
|
59
67
|
fi
|
|
60
68
|
```
|
|
61
69
|
|
|
62
|
-
**1b. Detect project type**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|---|---|---|
|
|
66
|
-
| `package.json` | `next` | nextjs |
|
|
67
|
-
| `package.json` | `@nestjs/core` | nestjs |
|
|
68
|
-
| `package.json` | `express` | express |
|
|
69
|
-
| `package.json` | `react` | react |
|
|
70
|
-
| `package.json` | `vue` | vue |
|
|
71
|
-
| `package.json` | *(none matched)* | javascript |
|
|
72
|
-
| `build.gradle(.kts)` | — | gradle-java |
|
|
73
|
-
| `pom.xml` | — | maven-java |
|
|
74
|
-
| `requirements.txt` / `pyproject.toml` | + `manage.py` | django |
|
|
75
|
-
| `requirements.txt` / `pyproject.toml` | + `app.py`/`wsgi.py` | flask |
|
|
76
|
-
| `requirements.txt` / `pyproject.toml` | *(none matched)* | python |
|
|
77
|
-
| `Cargo.toml` | — | rust |
|
|
78
|
-
| `go.mod` | — | go |
|
|
79
|
-
| `Gemfile` | + `config/routes.rb` | rails |
|
|
80
|
-
| `Gemfile` | *(none matched)* | ruby |
|
|
81
|
-
|
|
82
|
-
**1c. Detect build/test commands** based on project type:
|
|
83
|
-
|
|
84
|
-
| Type | Build Command | Test Command |
|
|
85
|
-
|------|--------------|--------------|
|
|
86
|
-
| javascript | `npm run build` | `npm test` |
|
|
87
|
-
| nextjs | `npm run build` | `npm test` |
|
|
88
|
-
| nestjs | `npm run build` | `npm test` |
|
|
89
|
-
| express | `npm run build \|\| tsc` | `npm test` |
|
|
90
|
-
| gradle-java | `./gradlew build -x test -x javadoc --offline` | `./gradlew test --offline` |
|
|
91
|
-
| maven-java | `mvn package -DskipTests` | `mvn test` |
|
|
92
|
-
| python | `python -m py_compile **/*.py` | `pytest` |
|
|
93
|
-
| django | `python manage.py check` | `python manage.py test` |
|
|
94
|
-
| rust | `cargo build` | `cargo test` |
|
|
95
|
-
| go | `go build ./...` | `go test ./...` |
|
|
70
|
+
**1b. Detect project type** — Read `.claude/references/configure-tables.md` section "Project Type Detection" for the lookup table.
|
|
71
|
+
|
|
72
|
+
**1c. Detect build/test commands** — Read `.claude/references/configure-tables.md` section "Build/Test Commands by Type" for the lookup table.
|
|
96
73
|
|
|
97
74
|
**1d. Detect available tools:**
|
|
98
75
|
|
|
@@ -109,6 +86,11 @@ fi
|
|
|
109
86
|
|
|
110
87
|
# Context7 - up-to-date documentation MCP server
|
|
111
88
|
# Check if context7 tools are available (resolve-library-id, query-docs)
|
|
89
|
+
|
|
90
|
+
# skill-creator plugin — helps create better project-specific skills
|
|
91
|
+
# Check if skill-creator tools are available by looking for known tool names
|
|
92
|
+
# in the current session (e.g., create-skill, scaffold-skill).
|
|
93
|
+
# Set skill_creator_available=true if any skill-creator tool is found.
|
|
112
94
|
```
|
|
113
95
|
|
|
114
96
|
**1e. Check CLAUDE.md:**
|
|
@@ -117,33 +99,9 @@ fi
|
|
|
117
99
|
**1f. Scan existing skills:**
|
|
118
100
|
- Check `.claude/skills/` for existing project-specific skills
|
|
119
101
|
|
|
120
|
-
**1g. Detect codebase patterns** for
|
|
121
|
-
|
|
122
|
-
Use Glob to scan for architectural patterns. For each, check both suffix-based (`*{Pattern}.{ts,js,java,py,rb}`) and directory-based (`{patterns}/**`) globs.
|
|
123
|
-
|
|
124
|
-
**Pattern categories to scan:**
|
|
125
|
-
- **Core:** Controllers, Services, Repositories, Models/Entities, Handlers
|
|
126
|
-
- **Data Transfer:** DTOs, Requests, Responses, Mappers, Validators, Schemas
|
|
127
|
-
- **Frontend:** Components, Hooks, Contexts, Stores, Pages, Layouts
|
|
128
|
-
- **API/Routes:** API Routes, Middleware, Guards, Interceptors, Filters
|
|
129
|
-
- **Testing:** Tests/Specs, Fixtures, Factories, Mocks
|
|
130
|
-
- **Utilities:** Utils, Helpers, Constants, Types/Interfaces, Config
|
|
131
|
-
- **Framework-Specific:** Modules, Pipes, Decorators, Blueprints, Views, Serializers
|
|
132
|
-
- **Background/Async:** Jobs, Workers, Events, Listeners, Commands
|
|
133
|
-
- **Database:** Migrations, Seeds
|
|
134
|
-
- **Error Handling:** Exceptions, Errors
|
|
135
|
-
|
|
136
|
-
For each pattern found: count matching files, identify primary location, sample 1 filename.
|
|
137
|
-
|
|
138
|
-
**1h. Detect runnable commands** for potential command skills:
|
|
139
|
-
|
|
140
|
-
Scan config files (`package.json` scripts, `Makefile` targets, `pyproject.toml` scripts, `Cargo.toml`, `build.gradle` tasks, `composer.json` scripts, `Rakefile` tasks) for commands in these categories:
|
|
141
|
-
|
|
142
|
-
Build, Test, Lint, Format, Type Check, Dev Server, Database (migrate/seed), Docker, Deploy, Clean, Generate
|
|
102
|
+
**1g. Detect codebase patterns** — Read `.claude/references/configure-tables.md` section "Codebase Pattern Categories to Scan" for the full list and scanning approach.
|
|
143
103
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
For each command found: record exact syntax, note variants (e.g., `test:unit`, `test:e2e`), and environment requirements. Only include commands that are actually detected.
|
|
104
|
+
**1h. Detect runnable commands** — Read `.claude/references/configure-tables.md` section "Runnable Command Categories" for categories and scanning approach.
|
|
147
105
|
|
|
148
106
|
### Step 2: Gather User Preferences (interactive via AskUserQuestion)
|
|
149
107
|
|
|
@@ -235,11 +193,26 @@ Context7 provides up-to-date, version-specific documentation and code examples d
|
|
|
235
193
|
2. "Skip"
|
|
236
194
|
- If user selects "Install now": execute the install command
|
|
237
195
|
|
|
238
|
-
**2j.
|
|
196
|
+
**2j. skill-creator plugin:**
|
|
197
|
+
|
|
198
|
+
The skill-creator plugin from the official Claude store helps generate higher-quality project-specific skills with structured authoring guidance.
|
|
199
|
+
|
|
200
|
+
- If skill-creator was detected in Step 1d:
|
|
201
|
+
- "skill-creator plugin is already installed. ✓"
|
|
202
|
+
- Set `tools.skillCreator.available = true` in the config
|
|
203
|
+
- If skill-creator was NOT detected:
|
|
204
|
+
- "Would you like to install the skill-creator plugin? It helps generate higher-quality project-specific skills."
|
|
205
|
+
- Options:
|
|
206
|
+
1. "Install now (recommended)" — run `claude plugin install skill-creator@claude-plugins-official` via Bash
|
|
207
|
+
2. "Skip"
|
|
208
|
+
- If user selects "Install now": execute the install command, then set `tools.skillCreator.available = true` in the config
|
|
209
|
+
- If user selects "Skip": `tools.skillCreator.available` remains `false`
|
|
210
|
+
|
|
211
|
+
**2k. Confirm CLAUDE.md generation:**
|
|
239
212
|
- "Generate/update CLAUDE.md? This will analyze your codebase to document structure and conventions."
|
|
240
213
|
- Options: "Yes (recommended)", "Skip"
|
|
241
214
|
|
|
242
|
-
**
|
|
215
|
+
**2l. Review detected patterns for skill generation:**
|
|
243
216
|
|
|
244
217
|
Present ONLY patterns that were actually detected in steps 1g and 1h.
|
|
245
218
|
|
|
@@ -280,7 +253,7 @@ If no patterns/commands detected:
|
|
|
280
253
|
- Inform user: "No common patterns detected. Would you like to specify patterns manually?"
|
|
281
254
|
- Allow manual entry of pattern names/locations or command names
|
|
282
255
|
|
|
283
|
-
**
|
|
256
|
+
**2m. Git-ignore `.5/features/` folder:**
|
|
284
257
|
- "The `.5/features/` folder will contain feature specs, implementation plans, and state files. Would you like to add it to `.gitignore`?"
|
|
285
258
|
- Options:
|
|
286
259
|
1. "Yes, add to .gitignore (recommended)" — workflow artifacts stay local, not tracked in version control
|
|
@@ -298,53 +271,7 @@ Using the values gathered from Steps 1 and 2, write `.5/config.json` directly.
|
|
|
298
271
|
mkdir -p .5
|
|
299
272
|
```
|
|
300
273
|
|
|
301
|
-
**Schema:**
|
|
302
|
-
|
|
303
|
-
```json
|
|
304
|
-
{
|
|
305
|
-
"projectType": "{type}",
|
|
306
|
-
"ticket": {
|
|
307
|
-
"pattern": "{regex-pattern-or-null}",
|
|
308
|
-
"extractFromBranch": true
|
|
309
|
-
},
|
|
310
|
-
"branch": {
|
|
311
|
-
"convention": "{convention}"
|
|
312
|
-
},
|
|
313
|
-
"build": {
|
|
314
|
-
"command": "{build-command}",
|
|
315
|
-
"testCommand": "{test-command}",
|
|
316
|
-
"timeout": {
|
|
317
|
-
"compile": 120000,
|
|
318
|
-
"test": 300000
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
"tools": {
|
|
322
|
-
"coderabbit": {
|
|
323
|
-
"available": false,
|
|
324
|
-
"authenticated": false
|
|
325
|
-
},
|
|
326
|
-
"ide": {
|
|
327
|
-
"available": false,
|
|
328
|
-
"type": null
|
|
329
|
-
},
|
|
330
|
-
"context7": {
|
|
331
|
-
"available": false
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
"reviewTool": "claude",
|
|
335
|
-
"git": {
|
|
336
|
-
"autoCommit": false,
|
|
337
|
-
"commitMessage": {
|
|
338
|
-
"pattern": "{ticket-id} {short-description}"
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"dotFiveFolder": {
|
|
342
|
-
"gitignore": true
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
Fill all values from user responses. Write with pretty-printed JSON. Read back to verify correctness.
|
|
274
|
+
**Schema:** Read `.claude/references/configure-tables.md` section "Config Schema" for the full JSON structure. Fill all values from user responses. Write with pretty-printed JSON. Read back to verify correctness.
|
|
348
275
|
|
|
349
276
|
**Update `.5/version.json` with configure timestamp:**
|
|
350
277
|
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
name: 5:discuss-feature
|
|
3
3
|
description: Discusses and refines an existing feature specification through iterative Q&A. Use after /plan-feature when requirements need clarification or changes. Updates the feature spec based on discussion.
|
|
4
4
|
allowed-tools: Read, Write, Glob, Grep, Task, AskUserQuestion
|
|
5
|
-
context: inherit
|
|
6
5
|
user-invocable: true
|
|
7
6
|
disable-model-invocation: true
|
|
7
|
+
model: opus
|
|
8
|
+
context: inherit
|
|
8
9
|
---
|
|
9
10
|
|
|
11
|
+
<role>
|
|
12
|
+
You are a Feature Discussion Facilitator. You refine existing feature specifications through Q&A.
|
|
13
|
+
You do NOT create new feature specs, create implementation plans, write code, or start implementation.
|
|
14
|
+
You read an existing feature.md, discuss it with the user, and update only the changed sections.
|
|
15
|
+
After updating the spec and informing the user, you are DONE.
|
|
16
|
+
</role>
|
|
17
|
+
|
|
10
18
|
# Discuss Feature Specification (Phase 1 - Optional Iteration)
|
|
11
19
|
|
|
12
20
|
## Overview
|
|
@@ -126,37 +134,7 @@ Use Task tool with subagent_type=Explore for complex exploration.
|
|
|
126
134
|
|
|
127
135
|
Based on the discussion topic, ask targeted follow-up questions using AskUserQuestion.
|
|
128
136
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
**Clarify Requirements:**
|
|
132
|
-
- "The current requirement says X. Should it also handle Y scenario?"
|
|
133
|
-
- "How should the system behave when Z happens?"
|
|
134
|
-
- "Are there edge cases we haven't considered?"
|
|
135
|
-
|
|
136
|
-
**Add Requirements:**
|
|
137
|
-
- "What is the expected behavior for this new requirement?"
|
|
138
|
-
- "How does this interact with existing requirement X?"
|
|
139
|
-
- "Should this be in scope or future work?"
|
|
140
|
-
|
|
141
|
-
**Simplify/Remove:**
|
|
142
|
-
- "If we remove X, what's the minimum viable version?"
|
|
143
|
-
- "Can we defer Y to a future iteration?"
|
|
144
|
-
- "Would simpler approach Z meet the core need?"
|
|
145
|
-
|
|
146
|
-
**Change Approach:**
|
|
147
|
-
- "What are the pros/cons of approach A vs B?"
|
|
148
|
-
- "Have you considered alternative C?"
|
|
149
|
-
- "What's the trade-off we're trying to optimize?"
|
|
150
|
-
|
|
151
|
-
**Technical Constraints:**
|
|
152
|
-
- "Is performance constraint X realistic?"
|
|
153
|
-
- "Should we use existing component Y instead?"
|
|
154
|
-
- "How will this integrate with system Z?"
|
|
155
|
-
|
|
156
|
-
**Acceptance Criteria:**
|
|
157
|
-
- "How will we verify requirement X is met?"
|
|
158
|
-
- "What does success look like for this feature?"
|
|
159
|
-
- "Are there specific test scenarios?"
|
|
137
|
+
Ask targeted follow-up questions informed by the feature spec and any codebase exploration. Focus on: requirements clarity, scope boundaries, edge cases, technical constraints, and acceptance criteria. Challenge assumptions constructively — suggest simpler alternatives when appropriate.
|
|
160
138
|
|
|
161
139
|
### Step 6: Iterative Refinement
|
|
162
140
|
|
|
@@ -217,38 +195,4 @@ After updating the spec, tell the developer:
|
|
|
217
195
|
- "Proceed to implementation planning (run `/clear` followed by `/5:plan-implementation {feature-name}`)"
|
|
218
196
|
- "Review the updated spec first"
|
|
219
197
|
|
|
220
|
-
## Key Principles
|
|
221
|
-
|
|
222
|
-
1. **User-driven** - Follow user's focus areas, don't prescribe
|
|
223
|
-
2. **Iterative** - Allow multiple discussion rounds
|
|
224
|
-
3. **Contextual** - Explore codebase when relevant
|
|
225
|
-
4. **Challenge constructively** - Question complexity, suggest alternatives
|
|
226
|
-
5. **Document evolution** - Track how requirements changed
|
|
227
|
-
6. **Preserve history** - Keep previous Q&A, add new discussions
|
|
228
|
-
7. **Clear next steps** - Guide user on what to do next
|
|
229
198
|
|
|
230
|
-
|
|
231
|
-
## Example Workflow
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
User: /discuss-feature PROJ-1234-add-feature
|
|
235
|
-
|
|
236
|
-
Skill: [Reads feature spec]
|
|
237
|
-
Skill: "What would you like to discuss or change about this feature?"
|
|
238
|
-
User: "Clarify existing requirements"
|
|
239
|
-
|
|
240
|
-
Skill: "The current spec mentions 'emergency schedule window'. Should this support single or multiple windows? Recurring schedules?"
|
|
241
|
-
User: "Just single window per product for now"
|
|
242
|
-
|
|
243
|
-
Skill: "Should we support updating/deleting the window after it's set?"
|
|
244
|
-
User: "Yes, full CRUD"
|
|
245
|
-
|
|
246
|
-
Skill: "Would you like to discuss anything else?"
|
|
247
|
-
User: "No, update the spec"
|
|
248
|
-
|
|
249
|
-
Skill: [Updates Requirements and Acceptance Criteria sections]
|
|
250
|
-
Skill: "Feature spec updated. Changes:
|
|
251
|
-
- Clarified: Single emergency window per product
|
|
252
|
-
- Added: Full CRUD operations
|
|
253
|
-
Next: /clear then /5:plan-implementation PROJ-1234-add-feature"
|
|
254
|
-
```
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
name: 5:implement-feature
|
|
3
3
|
description: Executes an implementation plan by delegating to agents. Phase 3 of the 5-phase workflow.
|
|
4
4
|
allowed-tools: Task, Read, Write, Glob, Grep, Bash, TaskCreate, TaskUpdate, TaskList
|
|
5
|
-
context: fork
|
|
6
5
|
user-invocable: true
|
|
7
6
|
disable-model-invocation: true
|
|
7
|
+
model: opus
|
|
8
|
+
context: fork
|
|
8
9
|
---
|
|
9
10
|
|
|
11
|
+
<role>
|
|
12
|
+
You are an Implementation Orchestrator. You delegate work to agents — you do not write code directly.
|
|
13
|
+
You read the plan, spawn agents per step, track state, and report completion.
|
|
14
|
+
You NEVER write source code yourself. You NEVER skip state file updates between steps.
|
|
15
|
+
After all steps complete and you report to the user, you are DONE.
|
|
16
|
+
</role>
|
|
17
|
+
|
|
10
18
|
# Implement Feature (Phase 3)
|
|
11
19
|
|
|
12
20
|
Execute an implementation plan by delegating work to agents.
|
|
@@ -22,19 +30,14 @@ You are a thin orchestrator:
|
|
|
22
30
|
- Track progress
|
|
23
31
|
- Report completion
|
|
24
32
|
|
|
25
|
-
**DO NOT:**
|
|
26
|
-
- Write code directly — spawn agents
|
|
27
|
-
- Skip state file updates between steps
|
|
28
|
-
- Mark a step complete before writing state
|
|
29
|
-
- Proceed to next step if state write fails
|
|
30
|
-
- Use `git add .` at any point
|
|
31
|
-
|
|
32
33
|
**Key Principles:**
|
|
33
34
|
- Thin orchestrator: read, delegate, track, report
|
|
34
35
|
- State is the source of truth: write it before moving on
|
|
35
36
|
- Forward progress: failed components are logged, not blocking
|
|
36
37
|
- Resumable: state enables restart from any interrupted step
|
|
37
38
|
|
|
39
|
+
**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)**.
|
|
40
|
+
|
|
38
41
|
## Process
|
|
39
42
|
|
|
40
43
|
### Step 1: Load Plan and Config
|
|
@@ -88,8 +91,7 @@ Create `.5/features/{feature-name}/state.json` with the full components table pa
|
|
|
88
91
|
|
|
89
92
|
`pendingComponents` is populated by parsing the full components table from plan.md at startup — one entry per row.
|
|
90
93
|
|
|
91
|
-
**
|
|
92
|
-
If the read fails or content is wrong, stop: "Failed to initialize state file. Cannot proceed safely."
|
|
94
|
+
**(verify write)** — confirm `status` is `"in-progress"` and `pendingComponents` is non-empty.
|
|
93
95
|
|
|
94
96
|
Then remove the planning guard marker (planning is over, implementation is starting):
|
|
95
97
|
|
|
@@ -170,8 +172,7 @@ Update state.json:
|
|
|
170
172
|
- Increment `currentStep`
|
|
171
173
|
- Update `lastUpdated`
|
|
172
174
|
|
|
173
|
-
**
|
|
174
|
-
If verify fails, stop: "State write failed after step {N}. Cannot proceed safely."
|
|
175
|
+
**(verify write)** — confirm `lastUpdated` changed.
|
|
175
176
|
|
|
176
177
|
Mark the current step's TaskCreate task as `completed`. Mark the next step's task as `in_progress`.
|
|
177
178
|
|
|
@@ -247,7 +248,7 @@ For each non-test component with action "create" that contains logic:
|
|
|
247
248
|
- Check if its corresponding test component exists in the plan
|
|
248
249
|
- If a test was planned but is in `failedAttempts`, flag it prominently
|
|
249
250
|
|
|
250
|
-
**
|
|
251
|
+
**(verify write)** — confirm `verificationResults.builtAt` is set.
|
|
251
252
|
|
|
252
253
|
If build or tests fail:
|
|
253
254
|
- Record in state.json
|
|
@@ -266,8 +267,7 @@ Update state.json:
|
|
|
266
267
|
}
|
|
267
268
|
```
|
|
268
269
|
|
|
269
|
-
**
|
|
270
|
-
If read fails, warn the user but do not re-attempt — the implementation work is done; only tracking failed.
|
|
270
|
+
**(verify write)** — confirm `status` is `"completed"`. If this one fails, warn the user but continue — the implementation work is done.
|
|
271
271
|
|
|
272
272
|
Tell the user:
|
|
273
273
|
```
|
|
@@ -299,39 +299,3 @@ If implementation is interrupted, the state file enables resuming:
|
|
|
299
299
|
4. Skip steps where ALL components are in `completedComponents` AND their files are verified present on disk
|
|
300
300
|
5. Write reconciled state (update `lastUpdated`) before re-executing any steps
|
|
301
301
|
|
|
302
|
-
## Example Flow
|
|
303
|
-
|
|
304
|
-
```
|
|
305
|
-
Step 1: 2 simple components → 2 parallel haiku agents → update state → verify write
|
|
306
|
-
Step 2: 2 moderate components → 2 parallel agents → update state → verify write
|
|
307
|
-
Step 3: 1 complex component → 1 sonnet agent → update state → verify write
|
|
308
|
-
Step 4: Verify (build + test) → update verificationResults → verify write → report
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
## Instructions Summary
|
|
312
|
-
|
|
313
|
-
### Before starting:
|
|
314
|
-
1. Check for existing state.json → handle resume / restart / completed cases
|
|
315
|
-
2. Read plan.md → parse components table, implementation notes, verification commands
|
|
316
|
-
3. Read config.json → extract `git.autoCommit`, `git.commitMessage.pattern`
|
|
317
|
-
4. Initialize state.json with richer schema → **MANDATORY: verify write**
|
|
318
|
-
5. Create TaskCreate tasks for all steps + verification → mark step 1 `in_progress`
|
|
319
|
-
|
|
320
|
-
### For each step:
|
|
321
|
-
1. Determine parallelism (same-step components = parallel)
|
|
322
|
-
2. Determine model per component (simple→haiku, complex→sonnet)
|
|
323
|
-
3. Spawn agents (one per component, parallel when possible)
|
|
324
|
-
4. Collect results, parse `---RESULT---` blocks
|
|
325
|
-
5. Run per-step file existence check (Glob) on `FILES_CREATED`
|
|
326
|
-
6. Run retry logic for failures (max 2 retries per component)
|
|
327
|
-
7. Update state.json → **MANDATORY: verify write**
|
|
328
|
-
8. Run auto-commit if enabled and step had successes (stage specific files only)
|
|
329
|
-
9. Mark step task `completed`, mark next step task `in_progress`
|
|
330
|
-
|
|
331
|
-
### After all steps:
|
|
332
|
-
1. Run build command
|
|
333
|
-
2. Run test command
|
|
334
|
-
3. Update `verificationResults` in state.json → **verify write**
|
|
335
|
-
4. Update `status: "completed"` in state.json → **MANDATORY: verify write**
|
|
336
|
-
5. Mark verification task `completed`
|
|
337
|
-
6. Report to user
|