5-phase-workflow 1.4.3 → 1.5.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/README.md +18 -10
- package/bin/install.js +177 -218
- package/docs/workflow-guide.md +4 -4
- package/package.json +1 -1
- package/src/commands/5/configure.md +124 -328
- package/src/commands/5/discuss-feature.md +7 -172
- package/src/commands/5/implement-feature.md +40 -152
- package/src/commands/5/plan-feature.md +15 -8
- package/src/commands/5/plan-implementation.md +14 -10
- package/src/commands/5/quick-implement.md +41 -142
- package/src/commands/5/review-code.md +4 -14
- package/src/commands/5/unlock.md +23 -0
- package/src/commands/5/update.md +41 -4
- package/src/commands/5/verify-implementation.md +34 -201
- package/src/hooks/check-updates.js +4 -3
- package/src/hooks/config-guard.js +30 -0
- package/src/hooks/plan-guard.js +79 -32
- package/src/hooks/statusline.js +4 -3
- package/src/settings.json +11 -1
- package/src/skills/build-project/SKILL.md +6 -132
- package/src/skills/configure-project/SKILL.md +26 -215
- package/src/skills/run-tests/SKILL.md +7 -210
- package/src/templates/workflow/QUICK-PLAN.md +0 -17
|
@@ -8,27 +8,6 @@ user-invocable: true
|
|
|
8
8
|
|
|
9
9
|
# Quick Implement
|
|
10
10
|
|
|
11
|
-
## Prerequisites Check
|
|
12
|
-
|
|
13
|
-
**CRITICAL: Check for configuration before proceeding**
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
if [ ! -f ".claude/.5/config.json" ]; then
|
|
17
|
-
echo "❌ Configuration not found"
|
|
18
|
-
echo ""
|
|
19
|
-
echo "Please run /5:configure first to set up your project."
|
|
20
|
-
echo ""
|
|
21
|
-
echo "The configure command will:"
|
|
22
|
-
echo " • Detect your project type and build commands"
|
|
23
|
-
echo " • Set up ticket tracking conventions"
|
|
24
|
-
echo " • Generate documentation (CLAUDE.md)"
|
|
25
|
-
echo " • Create project-specific skills"
|
|
26
|
-
exit 1
|
|
27
|
-
fi
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**If config doesn't exist, STOP IMMEDIATELY. Do not proceed with the workflow.**
|
|
31
|
-
|
|
32
11
|
Fast path for small, well-understood tasks (1-5 files). Skips extensive planning phases but preserves state tracking and skill-based implementation.
|
|
33
12
|
|
|
34
13
|
## ⚠️ CRITICAL SCOPE CONSTRAINT
|
|
@@ -46,27 +25,10 @@ Your job in this command:
|
|
|
46
25
|
✅ Report completion
|
|
47
26
|
|
|
48
27
|
Your job is NOT:
|
|
49
|
-
❌ Handle complex features (6+ files)
|
|
50
|
-
❌
|
|
51
|
-
❌
|
|
52
|
-
❌
|
|
53
|
-
❌ Create feature spec files (use full workflow)
|
|
54
|
-
❌ Commit without config - Only commit if git.autoCommit is enabled
|
|
55
|
-
|
|
56
|
-
**This is a FAST PATH for well-understood, small tasks. For anything complex, use the full workflow.**
|
|
57
|
-
|
|
58
|
-
## ❌ Boundaries: What This Command Does NOT Do
|
|
59
|
-
|
|
60
|
-
**CRITICAL:** This command has a LIMITED scope. Do NOT:
|
|
61
|
-
|
|
62
|
-
- ❌ **Use for complex features** - 6+ files or multiple domains → use full workflow
|
|
63
|
-
- ❌ **Skip clarifying questions** - If implementation is unclear, ask first
|
|
64
|
-
- ❌ **Skip state updates** - State file updates are MANDATORY
|
|
65
|
-
- ❌ **Create feature specs** - This is for quick tasks, not full features
|
|
66
|
-
- ❌ **Commit without config** - Only commit if git.autoCommit is enabled
|
|
67
|
-
- ❌ **Skip plan approval** - Always show plan and get user approval first
|
|
68
|
-
|
|
69
|
-
**If the task involves more than 5 files or multiple domains, STOP and recommend the full workflow instead.**
|
|
28
|
+
❌ Handle complex features (6+ files or multiple domains → use full workflow)
|
|
29
|
+
❌ Skip clarifying questions, state file updates, or plan approval
|
|
30
|
+
❌ Create feature spec files
|
|
31
|
+
❌ Commit without config (only if git.autoCommit is enabled)
|
|
70
32
|
|
|
71
33
|
## Process
|
|
72
34
|
|
|
@@ -87,16 +49,22 @@ git branch --show-current
|
|
|
87
49
|
|
|
88
50
|
Extract ticket ID using configurable pattern from config (e.g., `PROJ-\d+` or `\d+`). If not found, ask developer.
|
|
89
51
|
|
|
90
|
-
|
|
52
|
+
**Sanitize the ticket ID:** Only allow alphanumeric characters, dashes (`-`), and underscores (`_`). Strip any other characters (especially `/`, `..`, `~`, spaces). If the sanitized result is empty, ask the user for a valid ticket ID.
|
|
53
|
+
|
|
54
|
+
Also read `.5/config.json` and extract:
|
|
91
55
|
- `git.autoCommit` (boolean, default `false`)
|
|
92
56
|
- `git.commitMessage.pattern` (string, default `{ticket-id} {short-description}`)
|
|
93
57
|
|
|
94
58
|
### Step 3: Generate Identifiers
|
|
95
59
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
60
|
+
Generate a slug from `$DESCRIPTION` using string manipulation (do NOT use bash for this — avoid shell injection):
|
|
61
|
+
1. Convert to lowercase
|
|
62
|
+
2. Replace any non-alphanumeric character with a dash (`-`)
|
|
63
|
+
3. Collapse consecutive dashes into one
|
|
64
|
+
4. Remove leading/trailing dashes
|
|
65
|
+
5. Truncate to 40 characters
|
|
66
|
+
|
|
67
|
+
Set `feature_name` to `${TICKET_ID}-${slug}`.
|
|
100
68
|
|
|
101
69
|
### Step 4: Analyze and Plan
|
|
102
70
|
|
|
@@ -115,14 +83,15 @@ feature_name="${TICKET_ID}-${slug}"
|
|
|
115
83
|
|
|
116
84
|
Write plan to `.5/features/${feature_name}/plan.md` using the template structure.
|
|
117
85
|
|
|
118
|
-
**Template Reference:** Use the structure from `.claude/templates/workflow/
|
|
86
|
+
**Template Reference:** Use the structure from `.claude/templates/workflow/PLAN.md`
|
|
119
87
|
|
|
120
88
|
The template contains placeholders for:
|
|
89
|
+
- **YAML frontmatter:** ticket, feature, created
|
|
121
90
|
- **Header:** `# Quick Implementation: {TICKET-ID}`
|
|
122
|
-
- **Task:**
|
|
123
|
-
- **Components table:** Columns for
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
91
|
+
- **Task description:** One sentence summary
|
|
92
|
+
- **Components table:** Columns for Step, Component, Action, File, Description, Complexity
|
|
93
|
+
- **Implementation Notes:** Key details and patterns
|
|
94
|
+
- **Verification:** Build and test commands
|
|
126
95
|
|
|
127
96
|
### Step 6: Present Plan and Iterate
|
|
128
97
|
|
|
@@ -155,29 +124,15 @@ Use AskUserQuestion:
|
|
|
155
124
|
|
|
156
125
|
**CRITICAL**: You MUST create the state file before starting implementation. This enables resumability if work is interrupted.
|
|
157
126
|
|
|
158
|
-
Create state file at `.5/features/${feature_name}/state.json`
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
"ticketId": "${TICKET_ID}",
|
|
163
|
-
"featureName": "${feature_name}",
|
|
164
|
-
"phase": "quick-implementation",
|
|
165
|
-
"status": "in-progress",
|
|
166
|
-
"currentWave": 1,
|
|
167
|
-
"totalWaves": 1,
|
|
168
|
-
"completedComponents": [],
|
|
169
|
-
"pendingComponents": [/* from plan */],
|
|
170
|
-
"failedAttempts": [],
|
|
171
|
-
"verificationResults": {},
|
|
172
|
-
"startedAt": "{ISO timestamp}",
|
|
173
|
-
"lastUpdated": "{ISO timestamp}"
|
|
174
|
-
}
|
|
175
|
-
```
|
|
127
|
+
Create state file at `.5/features/${feature_name}/state.json` with fields: `ticket`, `feature`, `phase: "quick-implementation"`, `status: "in-progress"`, `currentStep: 1`, `totalSteps: 1`, `completed: []`, `pending: [from plan]`, `failed: []`, `verificationResults: {}`, `startedAt`, `lastUpdated`.
|
|
128
|
+
|
|
129
|
+
Verify the file was written correctly with Read tool. If creation fails, stop and report error.
|
|
176
130
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
131
|
+
Then remove the planning guard marker (implementation is starting):
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
rm -f .5/.planning-active
|
|
135
|
+
```
|
|
181
136
|
|
|
182
137
|
### Step 8: Execute Implementation
|
|
183
138
|
|
|
@@ -192,7 +147,7 @@ For each component:
|
|
|
192
147
|
1. Invoke appropriate skill using Skill tool
|
|
193
148
|
2. **Update state file after each component** (MANDATORY):
|
|
194
149
|
- Read current state file
|
|
195
|
-
- Move component from `
|
|
150
|
+
- Move component from `pending` to `completed`
|
|
196
151
|
- Update `lastUpdated` timestamp
|
|
197
152
|
- Write back to state file
|
|
198
153
|
- Verify write succeeded
|
|
@@ -200,12 +155,17 @@ For each component:
|
|
|
200
155
|
|
|
201
156
|
#### Step-Executor Delegation
|
|
202
157
|
|
|
158
|
+
Determine the model based on the highest complexity in the plan's components:
|
|
159
|
+
- All components `simple` → `haiku`
|
|
160
|
+
- Any component `moderate` → `sonnet`
|
|
161
|
+
- Any component `complex` → `sonnet`
|
|
162
|
+
|
|
203
163
|
Spawn an agent with inline instructions:
|
|
204
164
|
|
|
205
165
|
```
|
|
206
166
|
Task tool call:
|
|
207
167
|
subagent_type: general-purpose
|
|
208
|
-
model: haiku
|
|
168
|
+
model: {haiku or sonnet based on complexity above}
|
|
209
169
|
description: "Execute quick implementation for ${feature_name}"
|
|
210
170
|
prompt: |
|
|
211
171
|
Implement components for a feature by finding patterns in existing code.
|
|
@@ -242,8 +202,8 @@ Task tool call:
|
|
|
242
202
|
|
|
243
203
|
Process results and **update state file** (MANDATORY):
|
|
244
204
|
- Read current state file
|
|
245
|
-
- Move completed components from `
|
|
246
|
-
- Record any failures in `
|
|
205
|
+
- Move completed components from `pending` to `completed`
|
|
206
|
+
- Record any failures in `failed`
|
|
247
207
|
- Update `lastUpdated` timestamp
|
|
248
208
|
- Write back to state file
|
|
249
209
|
- Verify write succeeded
|
|
@@ -274,76 +234,15 @@ Skill tool call:
|
|
|
274
234
|
|
|
275
235
|
### Step 9b: Auto-Commit (if enabled)
|
|
276
236
|
|
|
277
|
-
Only fires if `git.autoCommit: true` AND build passed
|
|
278
|
-
|
|
279
|
-
Creates a **single commit** for all components (not per-component — quick-implement is for small tasks):
|
|
280
|
-
|
|
281
|
-
1. Stage **only** the specific files from the plan's components (never `git add .`)
|
|
282
|
-
2. Commit using the configured `git.commitMessage.pattern`:
|
|
283
|
-
- `{ticket-id}` → ticket ID
|
|
284
|
-
- `{short-description}` → auto-generated summary (imperative mood, max 50 chars for full first line)
|
|
285
|
-
- Body: one bullet per component
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
# Stage only specific files
|
|
289
|
-
git add {file-1} {file-2} ...
|
|
290
|
-
|
|
291
|
-
# Commit with configured pattern + body
|
|
292
|
-
git commit -m "{ticket-id} {short-description}
|
|
293
|
-
|
|
294
|
-
- {concise change 1}
|
|
295
|
-
- {concise change 2}"
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
3. If commit fails → log warning, record in `state.json`, continue
|
|
299
|
-
4. If build failed in Step 9 → skip commit entirely
|
|
237
|
+
Only fires if `git.autoCommit: true` AND build passed. Creates a single commit: stage only plan files (never `git add .`), commit with configured `git.commitMessage.pattern` (body: one bullet per component). If commit fails, log warning and continue.
|
|
300
238
|
|
|
301
239
|
### Step 10: Update State and Report (MANDATORY)
|
|
302
240
|
|
|
303
241
|
**CRITICAL**: You MUST update the state file to mark completion.
|
|
304
242
|
|
|
305
|
-
|
|
306
|
-
2. **Update to completed status**:
|
|
307
|
-
```json
|
|
308
|
-
{
|
|
309
|
-
"status": "completed",
|
|
310
|
-
"phase": "completed",
|
|
311
|
-
"verificationResults": {
|
|
312
|
-
"buildStatus": "success",
|
|
313
|
-
"testStatus": "success | skipped",
|
|
314
|
-
"timestamp": "{ISO timestamp}"
|
|
315
|
-
},
|
|
316
|
-
"completedAt": "{ISO timestamp}",
|
|
317
|
-
"lastUpdated": "{ISO timestamp}"
|
|
318
|
-
}
|
|
319
|
-
```
|
|
320
|
-
3. **Write back using Write tool**
|
|
321
|
-
4. **Verify the update** by reading file again
|
|
322
|
-
|
|
323
|
-
Report to user:
|
|
324
|
-
|
|
325
|
-
```
|
|
326
|
-
✅ Quick implementation complete!
|
|
327
|
-
|
|
328
|
-
${TICKET_ID}: ${DESCRIPTION}
|
|
243
|
+
Update state file to `status: "completed"`, `phase: "completed"`, with `verificationResults` (buildStatus, testStatus, timestamp), `completedAt`, `lastUpdated`. Verify the write.
|
|
329
244
|
|
|
330
|
-
|
|
331
|
-
- {file1}
|
|
332
|
-
- {file2}
|
|
333
|
-
|
|
334
|
-
Build: Success
|
|
335
|
-
Tests: {Success | Skipped}
|
|
336
|
-
{If git.autoCommit was true: "Commit: {Success | Failed | Skipped (build failed)}"}
|
|
337
|
-
|
|
338
|
-
State: .5/features/${feature_name}/state.json
|
|
339
|
-
|
|
340
|
-
Next steps:
|
|
341
|
-
{If auto-commit fired successfully:}
|
|
342
|
-
1. For a new task, run `/clear` before starting
|
|
343
|
-
{If auto-commit not enabled or commit skipped:}
|
|
344
|
-
1. Review and commit changes
|
|
345
|
-
2. For a new task, run `/clear` before starting
|
|
346
|
-
```
|
|
245
|
+
Report: ticket, description, files created/modified, build/test status, commit status (if auto-commit), and next steps (commit if needed, `/clear` before new task).
|
|
347
246
|
|
|
348
247
|
**🛑 YOUR JOB IS COMPLETE. DO NOT START NEW TASKS.**
|
|
349
248
|
|
|
@@ -18,19 +18,9 @@ After saving the review report, you are DONE.
|
|
|
18
18
|
|
|
19
19
|
# Review Code (Phase 5)
|
|
20
20
|
|
|
21
|
-
## Prerequisites
|
|
22
|
-
|
|
23
|
-
If the feature argument is `CONFIGURE`, skip this check.
|
|
24
|
-
|
|
25
|
-
For all other features: Read `.claude/.5/config.json`. If the file does not exist, STOP immediately and tell the user:
|
|
26
|
-
|
|
27
|
-
"Configuration not found. Please run `/5:configure` first to set up your project."
|
|
28
|
-
|
|
29
|
-
Do NOT proceed without configuration.
|
|
30
|
-
|
|
31
21
|
## Review Tools
|
|
32
22
|
|
|
33
|
-
Two review tools are supported (configured in `.
|
|
23
|
+
Two review tools are supported (configured in `.5/config.json` field `reviewTool`):
|
|
34
24
|
|
|
35
25
|
- **Claude** (default) — Built-in, zero setup. A fresh-context agent reviews code blind.
|
|
36
26
|
- **CodeRabbit** — External CLI. Requires `coderabbit` installed and authenticated.
|
|
@@ -41,7 +31,7 @@ Both produce the same structured output format.
|
|
|
41
31
|
|
|
42
32
|
### Step 1: Determine Review Tool
|
|
43
33
|
|
|
44
|
-
Read `.
|
|
34
|
+
Read `.5/config.json` and check the `reviewTool` field.
|
|
45
35
|
|
|
46
36
|
- If not set or missing, default to `"claude"`
|
|
47
37
|
- If `"none"`, inform user that automated review is disabled and STOP
|
|
@@ -237,7 +227,7 @@ If "Ask me each": Present each question individually via AskUserQuestion. If the
|
|
|
237
227
|
|
|
238
228
|
For "Save to file" mode only.
|
|
239
229
|
|
|
240
|
-
Determine feature name from `.5/features/*/state.json` (most recent) or ask user.
|
|
230
|
+
Determine feature name from `.5/features/*/state.json` (most recent by `startedAt` field) or ask user.
|
|
241
231
|
|
|
242
232
|
Write to `.5/features/{feature-name}/review-{YYYYMMDD-HHmmss}-findings.md`.
|
|
243
233
|
|
|
@@ -251,7 +241,7 @@ Skip to REVIEW COMPLETE.
|
|
|
251
241
|
|
|
252
242
|
When invoked with `apply`:
|
|
253
243
|
|
|
254
|
-
1. Determine feature name from `.5/features/*/state.json` or ask user
|
|
244
|
+
1. Determine feature name from `.5/features/*/state.json` (most recent by `startedAt` field) or ask user
|
|
255
245
|
2. Find most recent `review-*-findings.md` in the feature folder
|
|
256
246
|
3. If none found, tell user to run `/5:review-code` first and STOP
|
|
257
247
|
4. Parse each finding and its action marker: `[FIX]`, `[SKIP]`, `[MANUAL]`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 5:unlock
|
|
3
|
+
description: Remove the planning guard lock to allow edits outside the workflow
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
context: inherit
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Unlock Planning Guard
|
|
10
|
+
|
|
11
|
+
Remove the `.planning-active` marker file that restricts Write/Edit operations during planning phases.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
Run this bash command to check and remove the marker in one step:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
if [ -f .5/.planning-active ]; then rm .5/.planning-active && echo "REMOVED"; else echo "ABSENT"; fi
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Based on the output, confirm to the user:
|
|
22
|
+
- If output contains "REMOVED": "Planning guard removed. You can now edit files freely."
|
|
23
|
+
- If output contains "ABSENT": "No planning guard was active. You're already free to edit files."
|
package/src/commands/5/update.md
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: 5:update
|
|
3
3
|
description: Update the 5-Phase Workflow to the latest version
|
|
4
|
-
allowed-tools: Bash
|
|
4
|
+
allowed-tools: Bash, Read, AskUserQuestion
|
|
5
5
|
context: inherit
|
|
6
6
|
user-invocable: true
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Update 5-Phase Workflow
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Step 1: Check Current Version
|
|
12
|
+
|
|
13
|
+
Read `.5/version.json` and note the current `installedVersion`.
|
|
14
|
+
|
|
15
|
+
## Step 2: Run Upgrade
|
|
12
16
|
|
|
13
17
|
```bash
|
|
14
|
-
npx 5-phase-workflow --upgrade
|
|
18
|
+
npx 5-phase-workflow@latest --upgrade
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
## Step 3: Confirm Upgrade
|
|
22
|
+
|
|
23
|
+
Read `.5/version.json` again. Compare the new `installedVersion` to the previous one.
|
|
24
|
+
|
|
25
|
+
- If the version **did not change**: tell the user they're already on the latest version. Stop here.
|
|
26
|
+
- If the version **changed**: continue to Step 4.
|
|
27
|
+
|
|
28
|
+
## Step 4: Show What Changed
|
|
29
|
+
|
|
30
|
+
Run `git status` to show the files modified by the upgrade. Summarize the changes for the user (e.g., "Updated 12 files in `.claude/commands/5/`, `.claude/skills/`, `.claude/hooks/`").
|
|
31
|
+
|
|
32
|
+
## Step 5: Ask to Commit
|
|
33
|
+
|
|
34
|
+
Ask the user: "Would you like to commit the upgraded workflow files?"
|
|
35
|
+
|
|
36
|
+
Options:
|
|
37
|
+
1. **Yes** - commit the changes
|
|
38
|
+
2. **No** - leave changes uncommitted
|
|
39
|
+
|
|
40
|
+
If the user chooses **No**, stop here.
|
|
41
|
+
|
|
42
|
+
## Step 6: Commit
|
|
43
|
+
|
|
44
|
+
Read `.5/config.json` if it exists and extract `git.commitMessage.pattern` (default: `{ticket-id} {short-description}`).
|
|
45
|
+
|
|
46
|
+
Build the commit message by applying the pattern:
|
|
47
|
+
- Replace `{ticket-id}` with an empty string (no ticket for upgrades) and trim any leading/trailing whitespace
|
|
48
|
+
- Replace `{short-description}` with `update 5-Phase Workflow to {new-version}`
|
|
49
|
+
- If the pattern is the conventional format (`feat({ticket-id}): {short-description}`), use: `chore: update 5-Phase Workflow to {new-version}`
|
|
50
|
+
- If no config or no pattern, use: `update 5-Phase Workflow to {new-version}`
|
|
51
|
+
|
|
52
|
+
Stage **only** the workflow-managed files shown in `git status` (inside `.claude/commands/5/`, `.claude/skills/`, `.claude/hooks/`, `.claude/templates/`, `.claude/settings.json`, and `.5/version.json`). Never use `git add .` or `git add -A`.
|
|
53
|
+
|
|
54
|
+
Create the commit. Report success to the user.
|
|
@@ -8,31 +8,6 @@ user-invocable: true
|
|
|
8
8
|
|
|
9
9
|
# Verify Implementation (Phase 4)
|
|
10
10
|
|
|
11
|
-
## Prerequisites Check
|
|
12
|
-
|
|
13
|
-
**CRITICAL: Check for configuration before proceeding (skip for CONFIGURE feature)**
|
|
14
|
-
|
|
15
|
-
If the feature argument is `CONFIGURE`, skip this check entirely — the CONFIGURE workflow is what creates the config file.
|
|
16
|
-
|
|
17
|
-
For all other features, run this check:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
if [ ! -f ".claude/.5/config.json" ]; then
|
|
21
|
-
echo "❌ Configuration not found"
|
|
22
|
-
echo ""
|
|
23
|
-
echo "Please run /5:configure first to set up your project."
|
|
24
|
-
echo ""
|
|
25
|
-
echo "The configure command will:"
|
|
26
|
-
echo " • Detect your project type and build commands"
|
|
27
|
-
echo " • Set up ticket tracking conventions"
|
|
28
|
-
echo " • Generate documentation (CLAUDE.md)"
|
|
29
|
-
echo " • Create project-specific skills"
|
|
30
|
-
exit 1
|
|
31
|
-
fi
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**If config doesn't exist and the feature is NOT `CONFIGURE`, STOP IMMEDIATELY. Do not proceed with the workflow.**
|
|
35
|
-
|
|
36
11
|
Verify that an implementation is complete, correct, and meets feature requirements through multi-layer verification.
|
|
37
12
|
|
|
38
13
|
## Scope
|
|
@@ -74,7 +49,7 @@ Note: feature.md not found — skipping feature completeness checks.
|
|
|
74
49
|
This is normal for quick-implement workflows. Infrastructure and quality checks will still run.
|
|
75
50
|
```
|
|
76
51
|
|
|
77
|
-
Also read `.
|
|
52
|
+
Also read `.5/config.json` and extract:
|
|
78
53
|
- `git.autoCommit` (boolean, default `false`)
|
|
79
54
|
- `git.commitMessage.pattern` (string, default `{ticket-id} {short-description}`)
|
|
80
55
|
|
|
@@ -95,7 +70,7 @@ For each component in the plan:
|
|
|
95
70
|
|
|
96
71
|
#### 2b. Run Build
|
|
97
72
|
|
|
98
|
-
Execute the build command from the plan (or auto-detect from `.
|
|
73
|
+
Execute the build command from the plan (or auto-detect from `.5/config.json`):
|
|
99
74
|
|
|
100
75
|
```bash
|
|
101
76
|
{build-command}
|
|
@@ -127,7 +102,7 @@ Task tool call:
|
|
|
127
102
|
model: sonnet
|
|
128
103
|
description: "Verify feature completeness for {feature-name}"
|
|
129
104
|
prompt: |
|
|
130
|
-
|
|
105
|
+
Verify that an implementation satisfies its feature specification.
|
|
131
106
|
|
|
132
107
|
## Feature Specification
|
|
133
108
|
{full text of feature.md}
|
|
@@ -136,61 +111,33 @@ Task tool call:
|
|
|
136
111
|
{full text of plan.md}
|
|
137
112
|
|
|
138
113
|
## Instructions
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
2. **Check acceptance criteria** from the feature spec.
|
|
144
|
-
For each acceptance criterion, determine:
|
|
145
|
-
- SATISFIED — code clearly implements this criterion (cite file:line as evidence)
|
|
146
|
-
- NOT SATISFIED — no code found that implements this criterion
|
|
147
|
-
|
|
148
|
-
3. **Check functional requirements** from the feature spec.
|
|
149
|
-
For each requirement, determine:
|
|
150
|
-
- IMPLEMENTED — code implements this requirement (cite file:line)
|
|
151
|
-
- NOT IMPLEMENTED — no code found for this requirement
|
|
152
|
-
|
|
153
|
-
4. **Check component completeness** from the plan.
|
|
154
|
-
For each component in the table, read the file and determine:
|
|
155
|
-
- COMPLETE — file exists and implements what the description says
|
|
156
|
-
- PARTIAL — file exists but is missing described functionality
|
|
157
|
-
- MISSING — file does not exist
|
|
114
|
+
1. Read each file in the components table
|
|
115
|
+
2. For each acceptance criterion: SATISFIED (cite file:line) or NOT_SATISFIED
|
|
116
|
+
3. For each requirement: IMPLEMENTED (cite file:line) or NOT_IMPLEMENTED
|
|
117
|
+
4. For each component: COMPLETE, PARTIAL (note what's missing), or MISSING
|
|
158
118
|
|
|
159
119
|
## Output Format
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
file: "{file path}"
|
|
177
|
-
status: COMPLETE | PARTIAL | MISSING
|
|
178
|
-
notes: "{what's missing if partial}"
|
|
179
|
-
|
|
180
|
-
SUMMARY:
|
|
181
|
-
- criteria_satisfied: {N}/{M}
|
|
182
|
-
- requirements_implemented: {N}/{M}
|
|
183
|
-
- components_complete: {N}/{M}
|
|
184
|
-
|
|
185
|
-
## Rules
|
|
186
|
-
- Read every file referenced in the components table
|
|
187
|
-
- Be precise with evidence — cite actual file paths and line numbers
|
|
188
|
-
- PARTIAL means the file exists but is missing specific functionality described in the plan
|
|
189
|
-
- Do NOT interact with the user
|
|
190
|
-
- Do NOT modify any files
|
|
120
|
+
End with a results block:
|
|
121
|
+
|
|
122
|
+
---VERIFICATION---
|
|
123
|
+
---ACCEPTANCE_CRITERIA---
|
|
124
|
+
{SATISFIED | NOT_SATISFIED | criterion text | file:line or "none"} (one per line)
|
|
125
|
+
---REQUIREMENTS---
|
|
126
|
+
{IMPLEMENTED | NOT_IMPLEMENTED | requirement text | file:line or "none"} (one per line)
|
|
127
|
+
---COMPONENTS---
|
|
128
|
+
{COMPLETE | PARTIAL | MISSING | component name | file path | notes} (one per line)
|
|
129
|
+
---SUMMARY---
|
|
130
|
+
criteria_satisfied: {N}/{M}
|
|
131
|
+
requirements_implemented: {N}/{M}
|
|
132
|
+
components_complete: {N}/{M}
|
|
133
|
+
---END_VERIFICATION---
|
|
134
|
+
|
|
135
|
+
Rules: Read every file. Cite file:line evidence. Do NOT modify files or interact with user.
|
|
191
136
|
```
|
|
192
137
|
|
|
193
|
-
Parse the
|
|
138
|
+
Parse the `---VERIFICATION---` ... `---END_VERIFICATION---` block. If malformed, fall back to extracting summary counts from prose.
|
|
139
|
+
|
|
140
|
+
From the parsed output, collect:
|
|
194
141
|
- Acceptance criteria results (satisfied/not satisfied counts)
|
|
195
142
|
- Requirements results (implemented/not implemented counts)
|
|
196
143
|
- Component completeness results (complete/partial/missing counts)
|
|
@@ -254,53 +201,10 @@ Update `.5/features/{feature-name}/state.json`:
|
|
|
254
201
|
|
|
255
202
|
### Step 8: Handle Results
|
|
256
203
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
```
|
|
260
|
-
Verification passed!
|
|
261
|
-
|
|
262
|
-
Layer 1 (Infrastructure): All files exist, build OK, tests OK
|
|
263
|
-
Layer 2 (Feature Completeness): {N}/{N} criteria satisfied, {N}/{N} requirements implemented
|
|
264
|
-
Layer 3 (Quality): {N}/{N} new files have tests
|
|
265
|
-
|
|
266
|
-
Report: .5/{feature-name}/verification.md
|
|
267
|
-
```
|
|
204
|
+
Report the status with layer-by-layer summary and link to `verification.md`.
|
|
268
205
|
|
|
269
|
-
**If `git.autoCommit: false
|
|
270
|
-
|
|
271
|
-
```
|
|
272
|
-
Would you like to commit these changes?
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
Use AskUserQuestion with options:
|
|
276
|
-
1. "Yes - commit now (Recommended)"
|
|
277
|
-
2. "No - I'll commit later"
|
|
278
|
-
|
|
279
|
-
If yes: stage and commit with message format `{TICKET-ID} {description}`.
|
|
280
|
-
|
|
281
|
-
**If `git.autoCommit: true`:** skip the commit offer.
|
|
282
|
-
|
|
283
|
-
```
|
|
284
|
-
Changes were already committed during implementation ({N} atomic commits).
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Then go to Step 11 (Next Steps).
|
|
288
|
-
|
|
289
|
-
**If PARTIAL or FAILED:**
|
|
290
|
-
|
|
291
|
-
```
|
|
292
|
-
Verification {status}.
|
|
293
|
-
|
|
294
|
-
Layer 1 (Infrastructure): {summary}
|
|
295
|
-
Layer 2 (Feature Completeness): {summary}
|
|
296
|
-
Layer 3 (Quality): {summary}
|
|
297
|
-
|
|
298
|
-
{Count} issue(s) found. Generating fix plan...
|
|
299
|
-
|
|
300
|
-
Report: .5/{feature-name}/verification.md
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Continue to Step 9.
|
|
206
|
+
- **PASSED:** If `git.autoCommit: false`, offer to commit via AskUserQuestion. If `git.autoCommit: true`, note commits were already made. Go to Step 11.
|
|
207
|
+
- **PARTIAL or FAILED:** Note issue count, continue to Step 9.
|
|
304
208
|
|
|
305
209
|
### Step 9: Generate Fix Plan (PARTIAL or FAILED only)
|
|
306
210
|
|
|
@@ -337,86 +241,15 @@ Use AskUserQuestion:
|
|
|
337
241
|
|
|
338
242
|
**If user selects "Apply fixes automatically":**
|
|
339
243
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
- **simple** fixes → `haiku` model
|
|
343
|
-
- **moderate** fixes → `haiku` or `sonnet` depending on context
|
|
344
|
-
- **complex** fixes → `sonnet` model
|
|
345
|
-
|
|
346
|
-
Group independent fixes for parallel execution. Fixes modifying the same file must be sequential.
|
|
347
|
-
|
|
348
|
-
```
|
|
349
|
-
Task tool call:
|
|
350
|
-
subagent_type: general-purpose
|
|
351
|
-
model: {based on complexity}
|
|
352
|
-
description: "Fix: {short description}"
|
|
353
|
-
prompt: |
|
|
354
|
-
You are fixing a verification issue in a codebase.
|
|
355
|
-
|
|
356
|
-
## Issue
|
|
357
|
-
Category: {infrastructure | feature-gap | quality}
|
|
358
|
-
File: {file-path}
|
|
359
|
-
Issue: {description of what's wrong}
|
|
360
|
-
Fix: {description of what to do}
|
|
361
|
-
|
|
362
|
-
## Context
|
|
363
|
-
{relevant section from plan.md or feature.md}
|
|
364
|
-
|
|
365
|
-
## Instructions
|
|
366
|
-
1. If creating a new file: find a similar existing file using Glob, read it to understand the pattern, create the new file following that pattern
|
|
367
|
-
2. If modifying a file: read the file, make the described change
|
|
368
|
-
3. Verify the file exists after changes
|
|
369
|
-
4. Report what you did
|
|
370
|
-
|
|
371
|
-
Use Glob to find similar files. Use Read to understand patterns. Use Write/Edit to create/modify files.
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
After all fixes are applied, re-run build and tests:
|
|
375
|
-
|
|
376
|
-
```bash
|
|
377
|
-
{build-command}
|
|
378
|
-
{test-command}
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
**If `git.autoCommit: true` and fixes succeeded (build + tests pass):**
|
|
244
|
+
Spawn agents following `implement-feature` patterns (simple→haiku, moderate→haiku/sonnet, complex→sonnet). Group independent fixes for parallel execution; same-file fixes must be sequential.
|
|
382
245
|
|
|
383
|
-
|
|
384
|
-
```bash
|
|
385
|
-
# Stage only the specific fix files
|
|
386
|
-
git add {fix-file-1} {fix-file-2} ...
|
|
246
|
+
Each agent prompt includes: category, file path, issue description, fix description, and relevant context from plan/feature spec. Agent finds similar files via Glob, reads patterns, applies fix with Write/Edit.
|
|
387
247
|
|
|
388
|
-
|
|
389
|
-
git commit -m "{ticket-id} fix verification issues
|
|
248
|
+
After fixes: re-run build and tests. If `git.autoCommit: true` and fixes succeeded, commit fix files with `{ticket-id} fix verification issues`. Update `fix-plan.md` with APPLIED/FAILED status per fix.
|
|
390
249
|
|
|
391
|
-
|
|
392
|
-
- {concise fix 2}"
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
If commit fails → log warning, continue.
|
|
250
|
+
**If user selects manual fix:** save `fix-plan.md` and exit with re-run guidance.
|
|
396
251
|
|
|
397
|
-
|
|
398
|
-
- Mark each fix as APPLIED / FAILED
|
|
399
|
-
- Record build and test results after fixes
|
|
400
|
-
|
|
401
|
-
Report to user:
|
|
402
|
-
```
|
|
403
|
-
Applied {N} fixes.
|
|
404
|
-
|
|
405
|
-
Build: {status}
|
|
406
|
-
Tests: {status}
|
|
407
|
-
{If git.autoCommit was true: "Commit: {Success | Failed | Skipped}"}
|
|
408
|
-
|
|
409
|
-
{If any fixes failed, list them}
|
|
410
|
-
|
|
411
|
-
Updated: .5/{feature-name}/fix-plan.md
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
**If user selects manual fix:** exit with guidance.
|
|
415
|
-
```
|
|
416
|
-
Fix plan saved: .5/{feature-name}/fix-plan.md
|
|
417
|
-
|
|
418
|
-
When ready, re-run: /5:verify-implementation {feature-name}
|
|
419
|
-
```
|
|
252
|
+
**Iteration limit:** On 3rd+ verify+fix cycle, warn user to consider manual fixes or revisiting the plan.
|
|
420
253
|
|
|
421
254
|
### Step 11: Next Steps
|
|
422
255
|
|