5-phase-workflow 1.4.2 → 1.4.4

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.
@@ -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
- Work across multiple domains
51
- Skip clarifying questions if unclear
52
- Skip state file updates
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
 
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
+
90
54
  Also read `.claude/.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
- ```bash
97
- slug=$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-40)
98
- feature_name="${TICKET_ID}-${slug}"
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/QUICK-PLAN.md`
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:** The task description
123
- - **Components table:** Columns for #, Type, Name, Skill, Module
124
- - **Affected Modules:** List of modules that will be modified
125
- - **Execution:** Mode (parallel, sequential, or direct)
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,9 @@ 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` using Write tool:
159
-
160
- ```json
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`.
176
128
 
177
- **After creating the file:**
178
- 1. Use Read tool to verify the file was written correctly
179
- 2. Report to user: "State tracking initialized"
180
- 3. If file creation fails, stop and report error
129
+ Verify the file was written correctly with Read tool. If creation fails, stop and report error.
181
130
 
182
131
  ### Step 8: Execute Implementation
183
132
 
@@ -192,7 +141,7 @@ For each component:
192
141
  1. Invoke appropriate skill using Skill tool
193
142
  2. **Update state file after each component** (MANDATORY):
194
143
  - Read current state file
195
- - Move component from `pendingComponents` to `completedComponents`
144
+ - Move component from `pending` to `completed`
196
145
  - Update `lastUpdated` timestamp
197
146
  - Write back to state file
198
147
  - Verify write succeeded
@@ -200,12 +149,17 @@ For each component:
200
149
 
201
150
  #### Step-Executor Delegation
202
151
 
152
+ Determine the model based on the highest complexity in the plan's components:
153
+ - All components `simple` → `haiku`
154
+ - Any component `moderate` → `sonnet`
155
+ - Any component `complex` → `sonnet`
156
+
203
157
  Spawn an agent with inline instructions:
204
158
 
205
159
  ```
206
160
  Task tool call:
207
161
  subagent_type: general-purpose
208
- model: haiku
162
+ model: {haiku or sonnet based on complexity above}
209
163
  description: "Execute quick implementation for ${feature_name}"
210
164
  prompt: |
211
165
  Implement components for a feature by finding patterns in existing code.
@@ -242,8 +196,8 @@ Task tool call:
242
196
 
243
197
  Process results and **update state file** (MANDATORY):
244
198
  - Read current state file
245
- - Move completed components from `pendingComponents` to `completedComponents`
246
- - Record any failures in `failedAttempts`
199
+ - Move completed components from `pending` to `completed`
200
+ - Record any failures in `failed`
247
201
  - Update `lastUpdated` timestamp
248
202
  - Write back to state file
249
203
  - Verify write succeeded
@@ -274,76 +228,15 @@ Skill tool call:
274
228
 
275
229
  ### Step 9b: Auto-Commit (if enabled)
276
230
 
277
- Only fires if `git.autoCommit: true` AND build passed in Step 9.
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
231
+ 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
232
 
301
233
  ### Step 10: Update State and Report (MANDATORY)
302
234
 
303
235
  **CRITICAL**: You MUST update the state file to mark completion.
304
236
 
305
- 1. **Read current state file**
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
237
+ Update state file to `status: "completed"`, `phase: "completed"`, with `verificationResults` (buildStatus, testStatus, timestamp), `completedAt`, `lastUpdated`. Verify the write.
322
238
 
323
- Report to user:
324
-
325
- ```
326
- ✅ Quick implementation complete!
327
-
328
- ${TICKET_ID}: ${DESCRIPTION}
329
-
330
- Components created/modified:
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
- ```
239
+ 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
240
 
348
241
  **🛑 YOUR JOB IS COMPLETE. DO NOT START NEW TASKS.**
349
242
 
@@ -18,16 +18,6 @@ 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
23
  Two review tools are supported (configured in `.claude/.5/config.json` field `reviewTool`):
@@ -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,17 @@
1
+ ---
2
+ name: 5:update
3
+ description: Update the 5-Phase Workflow to the latest version
4
+ allowed-tools: Bash
5
+ context: inherit
6
+ user-invocable: true
7
+ ---
8
+
9
+ # Update 5-Phase Workflow
10
+
11
+ Run the upgrade command to update to the latest version:
12
+
13
+ ```bash
14
+ npx 5-phase-workflow --upgrade
15
+ ```
16
+
17
+ After the upgrade completes, confirm the new version was installed by checking `.claude/.5/version.json`.
@@ -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
@@ -127,7 +102,7 @@ Task tool call:
127
102
  model: sonnet
128
103
  description: "Verify feature completeness for {feature-name}"
129
104
  prompt: |
130
- You are verifying that an implementation satisfies its feature specification.
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
- 1. **Read each implemented file** listed in the components table below:
141
- {components table from plan.md}
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
- Return EXACTLY this structure:
161
-
162
- ACCEPTANCE_CRITERIA:
163
- - criterion: "{text of criterion}"
164
- status: SATISFIED | NOT SATISFIED
165
- evidence: "{file:line}" or "none"
166
- notes: "{brief explanation}"
167
-
168
- REQUIREMENTS:
169
- - requirement: "{text of requirement}"
170
- status: IMPLEMENTED | NOT IMPLEMENTED
171
- evidence: "{file:line}" or "none"
172
- notes: "{brief explanation}"
173
-
174
- COMPONENTS:
175
- - component: "{component name}"
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 agent's structured output into:
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
- **If PASSED:**
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` (default):** offer to commit.
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
- For each fix in the fix plan, spawn an agent following the same pattern as `implement-feature`:
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
- Auto-commit the fix files:
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
- # Commit with ticket ID
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
- - {concise fix 1}
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
- Update `fix-plan.md` with results:
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
 
@@ -53,24 +53,21 @@ async function checkForUpdates(workspaceDir) {
53
53
 
54
54
  // Update last check time
55
55
  versionData.updateCheckLastRun = new Date().toISOString();
56
- fs.writeFileSync(versionFile, JSON.stringify(versionData, null, 2));
57
56
 
58
57
  // Compare versions
59
58
  const installed = versionData.installedVersion;
60
59
  const latestVersion = await getLatestVersion();
61
60
 
62
- if (!latestVersion || installed === latestVersion) {
63
- // No update available
64
- process.exit(0);
65
- }
66
-
67
- // Check if update is available (installed < latest)
68
- if (compareVersions(installed, latestVersion) < 0) {
69
- // Show update notification
70
- console.log(`\n\x1b[34mℹ\x1b[0m Update available: ${installed} → ${latestVersion}`);
71
- console.log(` Run: \x1b[1mnpx 5-phase-workflow --upgrade\x1b[0m\n`);
61
+ if (latestVersion && compareVersions(installed, latestVersion) < 0) {
62
+ // Update available — persist for statusline to display
63
+ versionData.latestAvailableVersion = latestVersion;
64
+ } else {
65
+ // No update (or network failure) — clear any stale value
66
+ versionData.latestAvailableVersion = null;
72
67
  }
73
68
 
69
+ // Single consolidated write
70
+ fs.writeFileSync(versionFile, JSON.stringify(versionData, null, 2));
74
71
  process.exit(0);
75
72
  }
76
73
 
@@ -107,9 +104,10 @@ async function getLatestVersion() {
107
104
  }
108
105
 
109
106
  // Compare semver versions
107
+ // Uses parseInt to handle pre-release tags (e.g., "2-beta" → 2)
110
108
  function compareVersions(v1, v2) {
111
- const parts1 = v1.split('.').map(Number);
112
- const parts2 = v2.split('.').map(Number);
109
+ const parts1 = v1.split('.').map(p => parseInt(p, 10) || 0);
110
+ const parts2 = v2.split('.').map(p => parseInt(p, 10) || 0);
113
111
 
114
112
  for (let i = 0; i < 3; i++) {
115
113
  if (parts1[i] > parts2[i]) return 1;
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ let input = '';
6
+ process.stdin.setEncoding('utf8');
7
+ process.stdin.on('data', chunk => input += chunk);
8
+ process.stdin.on('end', () => {
9
+ try {
10
+ const data = JSON.parse(input);
11
+ const cwd = data.cwd || process.cwd();
12
+ const configFile = path.join(cwd, '.claude', '.5', 'config.json');
13
+
14
+ if (fs.existsSync(configFile)) {
15
+ process.exit(0);
16
+ }
17
+
18
+ // No config — block with helpful message
19
+ process.stderr.write(
20
+ 'Configuration not found. Please run /5:configure first to set up your project.\n\n' +
21
+ 'The configure command will:\n' +
22
+ ' - Detect your project type and build commands\n' +
23
+ ' - Set up ticket tracking conventions\n' +
24
+ ' - Write project configuration'
25
+ );
26
+ process.exit(2);
27
+ } catch (e) {
28
+ process.exit(0); // Silent failure — don't block on parse errors
29
+ }
30
+ });