5-phase-workflow 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.js +35 -1
- package/package.json +1 -1
- package/src/agents/feature-planner.md +1 -0
- package/src/agents/implementation-planner.md +1 -0
- 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 +31 -59
- package/src/commands/5/plan-implementation.md +33 -14
- 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/hooks/plan-guard.js +16 -2
- package/src/references/configure-tables.md +116 -0
- package/src/settings.json +1 -1
- package/src/skills/configure-project/SKILL.md +6 -0
package/bin/install.js
CHANGED
|
@@ -278,6 +278,11 @@ function getWorkflowManagedFiles() {
|
|
|
278
278
|
'config-guard.js'
|
|
279
279
|
],
|
|
280
280
|
|
|
281
|
+
// References: lookup tables and schemas read on-demand by commands
|
|
282
|
+
references: [
|
|
283
|
+
'configure-tables.md'
|
|
284
|
+
],
|
|
285
|
+
|
|
281
286
|
// Templates: specific template files
|
|
282
287
|
templates: [
|
|
283
288
|
// Project documentation templates
|
|
@@ -384,6 +389,23 @@ function selectiveUpdate(targetPath, sourcePath) {
|
|
|
384
389
|
}
|
|
385
390
|
}
|
|
386
391
|
log.success('Updated templates/ (workflow files only)');
|
|
392
|
+
|
|
393
|
+
// Update specific references
|
|
394
|
+
if (managed.references && managed.references.length > 0) {
|
|
395
|
+
const referencesSrc = path.join(sourcePath, 'references');
|
|
396
|
+
const referencesDest = path.join(targetPath, 'references');
|
|
397
|
+
if (!fs.existsSync(referencesDest)) {
|
|
398
|
+
fs.mkdirSync(referencesDest, { recursive: true });
|
|
399
|
+
}
|
|
400
|
+
for (const ref of managed.references) {
|
|
401
|
+
const src = path.join(referencesSrc, ref);
|
|
402
|
+
const dest = path.join(referencesDest, ref);
|
|
403
|
+
if (fs.existsSync(src)) {
|
|
404
|
+
fs.copyFileSync(src, dest);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
log.success('Updated references/ (workflow files only)');
|
|
408
|
+
}
|
|
387
409
|
}
|
|
388
410
|
|
|
389
411
|
// Ensure .5/.gitignore exists and contains .update-cache.json
|
|
@@ -522,7 +544,7 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
|
|
|
522
544
|
}
|
|
523
545
|
|
|
524
546
|
// Copy directories
|
|
525
|
-
const dirs = ['commands', 'agents', 'skills', 'hooks', 'templates'];
|
|
547
|
+
const dirs = ['commands', 'agents', 'skills', 'hooks', 'templates', 'references'];
|
|
526
548
|
for (const dir of dirs) {
|
|
527
549
|
const src = path.join(sourcePath, dir);
|
|
528
550
|
const dest = path.join(targetPath, dir);
|
|
@@ -550,6 +572,7 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
|
|
|
550
572
|
log.info(' • Generate comprehensive documentation (CLAUDE.md)');
|
|
551
573
|
log.info(' • Create project-specific skills');
|
|
552
574
|
log.info('');
|
|
575
|
+
log.info('Tip: Configure will offer to install helpful plugins like skill-creator');
|
|
553
576
|
|
|
554
577
|
showCommandsHelp(isGlobal);
|
|
555
578
|
}
|
|
@@ -712,6 +735,17 @@ function uninstall() {
|
|
|
712
735
|
}
|
|
713
736
|
log.success('Removed workflow templates (preserved user-created templates)');
|
|
714
737
|
|
|
738
|
+
// Remove only workflow-managed references
|
|
739
|
+
if (managed.references) {
|
|
740
|
+
for (const ref of managed.references) {
|
|
741
|
+
const refPath = path.join(targetPath, 'references', ref);
|
|
742
|
+
if (fs.existsSync(refPath)) {
|
|
743
|
+
fs.unlinkSync(refPath);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
log.success('Removed workflow references (preserved user-created references)');
|
|
747
|
+
}
|
|
748
|
+
|
|
715
749
|
// Remove data directory (.5/)
|
|
716
750
|
const dataDir = getDataPath(false);
|
|
717
751
|
if (fs.existsSync(dataDir)) {
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ HARD CONSTRAINTS — violations waste tokens and get blocked by plan-guard:
|
|
|
18
18
|
- NEVER describe HOW something will be implemented (file contents, signatures, class structures)
|
|
19
19
|
- NEVER spawn Task agents with subagent_type other than Explore
|
|
20
20
|
- NEVER write to any file except .5/features/{name}/feature.md and .5/.planning-active
|
|
21
|
+
- NEVER call EnterPlanMode — the workflow has its own planning process
|
|
21
22
|
- The feature spec describes WHAT and WHY, never HOW
|
|
22
23
|
- If you feel the urge to implement, STOP and ask a clarifying question instead
|
|
23
24
|
- Your output is a SPECIFICATION, not a design document. No code. No file layouts. No API shapes.
|
|
@@ -16,6 +16,7 @@ After creating the plan, you are DONE.
|
|
|
16
16
|
HARD CONSTRAINTS — violations waste tokens and get blocked by plan-guard:
|
|
17
17
|
- NEVER write code, pseudo-code, or implementation snippets
|
|
18
18
|
- NEVER create source files — you create ONE file: plan.md
|
|
19
|
+
- NEVER call EnterPlanMode — the workflow has its own planning process
|
|
19
20
|
- NEVER spawn Task agents with subagent_type other than Explore
|
|
20
21
|
- The plan describes WHAT to build and WHERE. Agents figure out HOW by reading existing code.
|
|
21
22
|
- Each component in the table gets: name, action, file path, one-sentence description, complexity
|
|
@@ -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
|
|
@@ -2,32 +2,33 @@
|
|
|
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
4
|
agent: feature-planner
|
|
5
|
-
allowed-tools: Read, Write, Task, AskUserQuestion
|
|
6
|
-
context: fork
|
|
5
|
+
allowed-tools: Read, Write, Task, AskUserQuestion
|
|
7
6
|
user-invocable: true
|
|
8
7
|
disable-model-invocation: true
|
|
8
|
+
model: opus
|
|
9
|
+
context: fork
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
<role>
|
|
13
|
+
You are a Feature Planner. Your only output is a feature specification file.
|
|
14
|
+
You do NOT implement code. You write NO code. You spawn ONLY Explore agents (subagent_type=Explore).
|
|
15
|
+
You write ONLY to .5/.planning-active and .5/features/{name}/feature.md.
|
|
16
|
+
After creating the spec, you are DONE. Do not continue into implementation planning or coding.
|
|
17
|
+
</role>
|
|
18
|
+
|
|
19
|
+
<constraints>
|
|
20
|
+
HARD CONSTRAINTS — violations waste tokens and get blocked by plan-guard:
|
|
21
|
+
- NEVER write code, pseudo-code, or implementation snippets in any output
|
|
22
|
+
- NEVER describe HOW something will be implemented (file contents, signatures, class structures)
|
|
23
|
+
- NEVER spawn Task agents with subagent_type other than Explore
|
|
24
|
+
- NEVER write to any file except .5/features/{name}/feature.md and .5/.planning-active
|
|
25
|
+
- NEVER call EnterPlanMode — the workflow has its own planning process
|
|
26
|
+
- The feature spec describes WHAT and WHY, never HOW
|
|
27
|
+
- If you feel the urge to implement, STOP and ask a clarifying question instead
|
|
28
|
+
- Your output is a SPECIFICATION, not a design document. No code. No file layouts. No API shapes.
|
|
29
|
+
</constraints>
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
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"
|
|
31
|
+
# Plan Feature (Phase 1)
|
|
31
32
|
|
|
32
33
|
## Process
|
|
33
34
|
|
|
@@ -44,29 +45,8 @@ Write the planning guard marker to `.5/.planning-active` using the Write tool:
|
|
|
44
45
|
|
|
45
46
|
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
47
|
|
|
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
48
|
### Step 1: Gather Feature Description
|
|
67
49
|
|
|
68
|
-
> Task tracking: Mark "Gather feature description" → `in_progress` before, `completed` after.
|
|
69
|
-
|
|
70
50
|
Ask the developer for the feature description using AskUserQuestion:
|
|
71
51
|
|
|
72
52
|
"Please describe the feature you want to develop. Paste the full ticket description or explain it in your own words."
|
|
@@ -76,8 +56,6 @@ Ask the developer for the feature description using AskUserQuestion:
|
|
|
76
56
|
|
|
77
57
|
### Step 2: Extract Ticket ID
|
|
78
58
|
|
|
79
|
-
> Task tracking: Mark "Extract ticket ID" → `in_progress`/`completed`.
|
|
80
|
-
|
|
81
59
|
Extract the ticket ID from the current git branch:
|
|
82
60
|
- Use `git branch --show-current` via a Bash-free approach: spawn a quick Explore agent if needed
|
|
83
61
|
- Branch format: `{TICKET-ID}-description`
|
|
@@ -89,8 +67,6 @@ Extract the ticket ID from the current git branch:
|
|
|
89
67
|
|
|
90
68
|
### Step 3: Spawn Explore Agent for Codebase Analysis
|
|
91
69
|
|
|
92
|
-
> Task tracking: Mark "Explore codebase for patterns" → `in_progress`/`completed` when sub-agent returns.
|
|
93
|
-
|
|
94
70
|
Spawn a Task with `subagent_type=Explore`:
|
|
95
71
|
|
|
96
72
|
```
|
|
@@ -122,9 +98,7 @@ Wait for the sub-agent to return before proceeding.
|
|
|
122
98
|
|
|
123
99
|
### Step 4: Intensive Q&A (5-10 Questions, One at a Time)
|
|
124
100
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Follow the `<question-strategy>` defined in your agent file.
|
|
101
|
+
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
102
|
|
|
129
103
|
**Optional re-exploration:** If the user mentions components not covered in the initial report, spawn a targeted Explore agent:
|
|
130
104
|
|
|
@@ -137,25 +111,25 @@ Targeted exploration for feature planning.
|
|
|
137
111
|
|
|
138
112
|
### Step 4b: Pre-Write Checkpoint
|
|
139
113
|
|
|
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.
|
|
141
|
-
|
|
142
114
|
Before writing the feature spec, verify:
|
|
143
115
|
1. You asked at least 5 questions and received answers
|
|
144
|
-
2. You
|
|
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
|
|
116
|
+
2. You can summarize the feature in 1-2 sentences without mentioning files, classes, or functions
|
|
147
117
|
|
|
148
118
|
If you have fewer than 5 Q&A pairs, go back to Step 4 and ask more questions.
|
|
149
119
|
|
|
150
120
|
### Step 5: Create Feature Specification
|
|
151
121
|
|
|
152
|
-
> Task tracking: Mark "Write feature specification" → `in_progress`/`completed`.
|
|
153
|
-
|
|
154
122
|
Determine a feature name: short, kebab-case (e.g., "add-emergency-schedule").
|
|
155
123
|
|
|
156
124
|
Write to `.5/features/{TICKET-ID}-{description}/feature.md` using Write tool.
|
|
157
125
|
|
|
158
|
-
|
|
126
|
+
Use the template structure from `.claude/templates/workflow/FEATURE-SPEC.md`.
|
|
127
|
+
|
|
128
|
+
**Content rules for feature.md:**
|
|
129
|
+
- Requirements use natural language ("The system shall...")
|
|
130
|
+
- Affected Components lists module/domain names, not file paths
|
|
131
|
+
- Entity definitions describe data concepts, not DB schemas or TypeScript interfaces
|
|
132
|
+
- Acceptance criteria describe observable behavior
|
|
159
133
|
|
|
160
134
|
Populate all sections:
|
|
161
135
|
- Ticket ID & Summary
|
|
@@ -169,8 +143,6 @@ Populate all sections:
|
|
|
169
143
|
|
|
170
144
|
## PLANNING COMPLETE
|
|
171
145
|
|
|
172
|
-
> Task tracking: Mark "Output completion message and STOP" → `in_progress`. Before stopping, call TaskList to verify ALL 8 tasks are `completed`.
|
|
173
|
-
|
|
174
146
|
After writing feature.md, output exactly:
|
|
175
147
|
|
|
176
148
|
```
|
|
@@ -3,24 +3,34 @@ name: 5:plan-implementation
|
|
|
3
3
|
description: Creates an implementation plan from a feature spec. Phase 2 of the 5-phase workflow.
|
|
4
4
|
agent: implementation-planner
|
|
5
5
|
allowed-tools: Read, Write, Task, AskUserQuestion
|
|
6
|
-
context: fork
|
|
7
6
|
user-invocable: true
|
|
8
7
|
disable-model-invocation: true
|
|
8
|
+
model: opus
|
|
9
|
+
context: fork
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<role>
|
|
13
|
+
You are an Implementation Planner. Your only output is a plan.md file.
|
|
14
|
+
You do NOT implement code. You write NO code. You spawn ONLY Explore agents (subagent_type=Explore).
|
|
15
|
+
You write ONLY to .5/.planning-active and .5/features/{name}/plan.md.
|
|
16
|
+
After creating the plan, you are DONE. Do not start implementation.
|
|
17
|
+
</role>
|
|
18
|
+
|
|
19
|
+
<constraints>
|
|
20
|
+
HARD CONSTRAINTS — violations get blocked by plan-guard:
|
|
21
|
+
- NEVER write code, pseudo-code, or implementation snippets
|
|
22
|
+
- NEVER create source files — you create ONE file: plan.md
|
|
23
|
+
- NEVER call EnterPlanMode — the workflow has its own planning process
|
|
24
|
+
- NEVER spawn Task agents with subagent_type other than Explore
|
|
25
|
+
- The plan describes WHAT to build and WHERE. Agents figure out HOW by reading existing code.
|
|
26
|
+
- Each component in the table gets: name, action, file path, one-sentence description, complexity
|
|
27
|
+
- Implementation Notes reference EXISTING pattern files, not new code
|
|
28
|
+
- Every component with action "create" that contains logic MUST have a corresponding test component
|
|
29
|
+
</constraints>
|
|
14
30
|
|
|
15
|
-
|
|
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"
|
|
31
|
+
# Plan Implementation (Phase 2)
|
|
22
32
|
|
|
23
|
-
## Example Plan
|
|
33
|
+
## Example Plan (output format reference)
|
|
24
34
|
|
|
25
35
|
```markdown
|
|
26
36
|
---
|
|
@@ -159,7 +169,9 @@ Not every feature needs all non-test steps. Use what makes sense. But testable c
|
|
|
159
169
|
|
|
160
170
|
Create a single file at `.5/features/{feature-name}/plan.md`.
|
|
161
171
|
|
|
162
|
-
|
|
172
|
+
**Plans are prompts, not documentation.** The plan.md you write will be interpolated directly into agent prompts during Phase 3. Keep descriptions action-oriented: "Create X with Y" not "X needs to support Y". The Description column becomes the agent's task instruction; Implementation Notes become context. Reference EXISTING pattern files in notes, not new code.
|
|
173
|
+
|
|
174
|
+
**Write rules:** You have Write access ONLY for `.5/.planning-active` and `.5/features/{name}/plan.md`. Any other Write target will be blocked by the plan-guard hook.
|
|
163
175
|
|
|
164
176
|
Include:
|
|
165
177
|
- YAML frontmatter (ticket, feature, created)
|
|
@@ -171,7 +183,14 @@ Include:
|
|
|
171
183
|
|
|
172
184
|
### Step 5b: Plan Self-Check
|
|
173
185
|
|
|
174
|
-
|
|
186
|
+
Read plan.md back and verify:
|
|
187
|
+
|
|
188
|
+
1. **Format:** Every row in the Components table has all 6 columns filled
|
|
189
|
+
2. **No code:** Implementation Notes contain ONLY references to existing files and business rules
|
|
190
|
+
3. **Scope:** Every component traces back to a requirement in feature.md — if not, remove it
|
|
191
|
+
4. **Completeness:** Every functional requirement from feature.md has at least one component
|
|
192
|
+
5. **Description length:** Each Description cell is one sentence. If longer, split the component.
|
|
193
|
+
6. **Test coverage:** Every "create" component with logic has a corresponding test component. Declarative-only components (types, interfaces, route wiring) are exempt.
|
|
175
194
|
|
|
176
195
|
Output the verification result:
|
|
177
196
|
```
|
|
@@ -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
|
-
**
|
|
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
|
-
- **
|
|
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
|
-
- **
|
|
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`. **
|
|
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
|
-
**
|
|
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>
|
package/src/commands/5/unlock.md
CHANGED
package/src/commands/5/update.md
CHANGED
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
name: 5:update
|
|
3
3
|
description: Update the 5-Phase Workflow to the latest version
|
|
4
4
|
allowed-tools: Bash, Read, AskUserQuestion
|
|
5
|
-
context: inherit
|
|
6
5
|
user-invocable: true
|
|
7
6
|
disable-model-invocation: true
|
|
7
|
+
model: haiku
|
|
8
|
+
context: fork
|
|
8
9
|
---
|
|
9
10
|
|
|
11
|
+
<role>
|
|
12
|
+
You are a Workflow Updater. You run the upgrade command and optionally commit the updated files.
|
|
13
|
+
You do NOT modify workflow files manually. You do NOT touch user project files.
|
|
14
|
+
After reporting the result, you are DONE.
|
|
15
|
+
</role>
|
|
16
|
+
|
|
10
17
|
# Update 5-Phase Workflow
|
|
11
18
|
|
|
12
19
|
## Step 1: Check Current Version
|
|
@@ -35,7 +42,7 @@ Run `git status` to show the files modified by the upgrade. Summarize the change
|
|
|
35
42
|
Ask the user: "Would you like to commit the upgraded workflow files?"
|
|
36
43
|
|
|
37
44
|
Options:
|
|
38
|
-
1. **Yes** - commit the changes
|
|
45
|
+
1. **Yes** - commit the changes, do not mention claude
|
|
39
46
|
2. **No** - leave changes uncommitted
|
|
40
47
|
|
|
41
48
|
If the user chooses **No**, stop here.
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
name: 5:verify-implementation
|
|
3
3
|
description: Verifies a feature implementation is complete and working with multi-layer checks. Phase 4 of the 5-phase workflow.
|
|
4
4
|
allowed-tools: Read, Glob, Grep, Bash, Write, Task, AskUserQuestion
|
|
5
|
-
context: fork
|
|
6
5
|
user-invocable: true
|
|
7
6
|
disable-model-invocation: true
|
|
7
|
+
model: sonnet
|
|
8
|
+
context: fork
|
|
8
9
|
---
|
|
9
10
|
|
|
11
|
+
<role>
|
|
12
|
+
You are an Implementation Verifier. You check that code meets requirements across 3 layers.
|
|
13
|
+
You read artifacts, run build/tests, cross-reference specs, and generate a verification report.
|
|
14
|
+
You do NOT implement new features. You do NOT refactor code beyond fixing identified verification gaps.
|
|
15
|
+
After the verification report and optional fix application, you are DONE.
|
|
16
|
+
</role>
|
|
17
|
+
|
|
10
18
|
# Verify Implementation (Phase 4)
|
|
11
19
|
|
|
12
20
|
Verify that an implementation is complete, correct, and meets feature requirements through multi-layer verification.
|
package/src/hooks/plan-guard.js
CHANGED
|
@@ -20,8 +20,8 @@ process.stdin.on('end', () => {
|
|
|
20
20
|
const data = JSON.parse(input);
|
|
21
21
|
const toolName = data.tool_name || '';
|
|
22
22
|
|
|
23
|
-
// Short-circuit: only check Task, Write, and
|
|
24
|
-
if (toolName !== 'Task' && toolName !== 'Write' && toolName !== 'Edit') {
|
|
23
|
+
// Short-circuit: only check Task, Write, Edit, and EnterPlanMode tools
|
|
24
|
+
if (toolName !== 'Task' && toolName !== 'Write' && toolName !== 'Edit' && toolName !== 'EnterPlanMode') {
|
|
25
25
|
process.exit(0);
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -41,6 +41,20 @@ process.stdin.on('end', () => {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Planning mode enforcement
|
|
44
|
+
if (toolName === 'EnterPlanMode') {
|
|
45
|
+
const blockCount = incrementBlockCount(workspaceDir);
|
|
46
|
+
const escalation = blockCount >= 3
|
|
47
|
+
? ` WARNING: Block #${blockCount}. Repeated violations. Complete your planning artifact and STOP.`
|
|
48
|
+
: '';
|
|
49
|
+
process.stderr.write(
|
|
50
|
+
`BLOCKED: EnterPlanMode is not allowed during workflow planning phases. ` +
|
|
51
|
+
`The 5-phase workflow has its own planning process. ` +
|
|
52
|
+
`REDIRECT: Continue with your current planning task. ` +
|
|
53
|
+
`Write your output to .5/features/{name}/ and output the completion message when done.${escalation}`
|
|
54
|
+
);
|
|
55
|
+
process.exit(2);
|
|
56
|
+
}
|
|
57
|
+
|
|
44
58
|
if (toolName === 'Task') {
|
|
45
59
|
const agentType = toolInput.subagent_type || '';
|
|
46
60
|
if (agentType && agentType !== 'Explore') {
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Configure Reference Tables
|
|
2
|
+
|
|
3
|
+
## Project Type Detection
|
|
4
|
+
|
|
5
|
+
Check files in this order (first match wins):
|
|
6
|
+
|
|
7
|
+
| File Present | Dependency / Sub-check | Type |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `package.json` | `next` | nextjs |
|
|
10
|
+
| `package.json` | `@nestjs/core` | nestjs |
|
|
11
|
+
| `package.json` | `express` | express |
|
|
12
|
+
| `package.json` | `react` | react |
|
|
13
|
+
| `package.json` | `vue` | vue |
|
|
14
|
+
| `package.json` | *(none matched)* | javascript |
|
|
15
|
+
| `build.gradle(.kts)` | — | gradle-java |
|
|
16
|
+
| `pom.xml` | — | maven-java |
|
|
17
|
+
| `requirements.txt` / `pyproject.toml` | + `manage.py` | django |
|
|
18
|
+
| `requirements.txt` / `pyproject.toml` | + `app.py`/`wsgi.py` | flask |
|
|
19
|
+
| `requirements.txt` / `pyproject.toml` | *(none matched)* | python |
|
|
20
|
+
| `Cargo.toml` | — | rust |
|
|
21
|
+
| `go.mod` | — | go |
|
|
22
|
+
| `Gemfile` | + `config/routes.rb` | rails |
|
|
23
|
+
| `Gemfile` | *(none matched)* | ruby |
|
|
24
|
+
|
|
25
|
+
## Build/Test Commands by Type
|
|
26
|
+
|
|
27
|
+
| Type | Build Command | Test Command |
|
|
28
|
+
|------|--------------|--------------|
|
|
29
|
+
| javascript | `npm run build` | `npm test` |
|
|
30
|
+
| nextjs | `npm run build` | `npm test` |
|
|
31
|
+
| nestjs | `npm run build` | `npm test` |
|
|
32
|
+
| express | `npm run build \|\| tsc` | `npm test` |
|
|
33
|
+
| gradle-java | `./gradlew build -x test -x javadoc --offline` | `./gradlew test --offline` |
|
|
34
|
+
| maven-java | `mvn package -DskipTests` | `mvn test` |
|
|
35
|
+
| python | `python -m py_compile **/*.py` | `pytest` |
|
|
36
|
+
| django | `python manage.py check` | `python manage.py test` |
|
|
37
|
+
| rust | `cargo build` | `cargo test` |
|
|
38
|
+
| go | `go build ./...` | `go test ./...` |
|
|
39
|
+
|
|
40
|
+
## Codebase Pattern Categories to Scan
|
|
41
|
+
|
|
42
|
+
Use Glob to scan for architectural patterns. For each, check both suffix-based (`*{Pattern}.{ts,js,java,py,rb}`) and directory-based (`{patterns}/**`) globs.
|
|
43
|
+
|
|
44
|
+
- **Core:** Controllers, Services, Repositories, Models/Entities, Handlers
|
|
45
|
+
- **Data Transfer:** DTOs, Requests, Responses, Mappers, Validators, Schemas
|
|
46
|
+
- **Frontend:** Components, Hooks, Contexts, Stores, Pages, Layouts
|
|
47
|
+
- **API/Routes:** API Routes, Middleware, Guards, Interceptors, Filters
|
|
48
|
+
- **Testing:** Tests/Specs, Fixtures, Factories, Mocks
|
|
49
|
+
- **Utilities:** Utils, Helpers, Constants, Types/Interfaces, Config
|
|
50
|
+
- **Framework-Specific:** Modules, Pipes, Decorators, Blueprints, Views, Serializers
|
|
51
|
+
- **Background/Async:** Jobs, Workers, Events, Listeners, Commands
|
|
52
|
+
- **Database:** Migrations, Seeds
|
|
53
|
+
- **Error Handling:** Exceptions, Errors
|
|
54
|
+
|
|
55
|
+
For each pattern found: count matching files, identify primary location, sample 1 filename.
|
|
56
|
+
|
|
57
|
+
## Runnable Command Categories
|
|
58
|
+
|
|
59
|
+
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:
|
|
60
|
+
|
|
61
|
+
Build, Test, Lint, Format, Type Check, Dev Server, Database (migrate/seed), Docker, Deploy, Clean, Generate
|
|
62
|
+
|
|
63
|
+
Skill naming: `run-{category}` (e.g., `run-build`, `run-tests`, `run-lint`).
|
|
64
|
+
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
## Config Schema
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"projectType": "{type}",
|
|
72
|
+
"ticket": {
|
|
73
|
+
"pattern": "{regex-pattern-or-null}",
|
|
74
|
+
"extractFromBranch": true
|
|
75
|
+
},
|
|
76
|
+
"branch": {
|
|
77
|
+
"convention": "{convention}"
|
|
78
|
+
},
|
|
79
|
+
"build": {
|
|
80
|
+
"command": "{build-command}",
|
|
81
|
+
"testCommand": "{test-command}",
|
|
82
|
+
"timeout": {
|
|
83
|
+
"compile": 120000,
|
|
84
|
+
"test": 300000
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"tools": {
|
|
88
|
+
"coderabbit": {
|
|
89
|
+
"available": false,
|
|
90
|
+
"authenticated": false
|
|
91
|
+
},
|
|
92
|
+
"ide": {
|
|
93
|
+
"available": false,
|
|
94
|
+
"type": null
|
|
95
|
+
},
|
|
96
|
+
"context7": {
|
|
97
|
+
"available": false
|
|
98
|
+
},
|
|
99
|
+
"skillCreator": {
|
|
100
|
+
"available": false
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"reviewTool": "claude",
|
|
104
|
+
"git": {
|
|
105
|
+
"autoCommit": false,
|
|
106
|
+
"commitMessage": {
|
|
107
|
+
"pattern": "{ticket-id} {short-description}"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"dotFiveFolder": {
|
|
111
|
+
"gitignore": true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Fill all values from user responses. Write with pretty-printed JSON. Read back to verify correctness.
|
package/src/settings.json
CHANGED
|
@@ -181,6 +181,12 @@ If CLAUDE.md already exists:
|
|
|
181
181
|
|
|
182
182
|
## B. Generate Project-Specific Skills
|
|
183
183
|
|
|
184
|
+
### Using skill-creator plugin
|
|
185
|
+
|
|
186
|
+
If `tools.skillCreator.available` is `true` in `.5/config.json`, use the skill-creator plugin's tools (e.g., `create-skill`, `scaffold-skill`) to generate each SKILL.md instead of the template-based approach below. Pass the extracted patterns, conventions, and example file paths as context to the skill-creator tool so it can produce structured, high-quality skill files.
|
|
187
|
+
|
|
188
|
+
If skill-creator is not available, use the existing template-based generation below — no degradation in workflow behavior.
|
|
189
|
+
|
|
184
190
|
**Reads:** Pattern selections from feature spec (`.5/CONFIGURE/feature.md`)
|
|
185
191
|
|
|
186
192
|
**Creates:** SKILL.md files in `.claude/skills/{name}/SKILL.md`
|