5-phase-workflow 1.3.0 → 1.4.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 +5 -1
- package/package.json +5 -2
- package/src/commands/5/configure.md +42 -3
- package/src/commands/5/implement-feature.md +40 -3
- package/src/commands/5/quick-implement.md +37 -3
- package/src/commands/5/verify-implementation.md +32 -0
- package/src/hooks/check-updates.js +11 -11
- package/src/settings.json +3 -1
- package/src/skills/configure-project/SKILL.md +11 -2
package/bin/install.js
CHANGED
|
@@ -373,7 +373,11 @@ function getDefaultConfig(projectType) {
|
|
|
373
373
|
command: 'auto',
|
|
374
374
|
testCommand: 'auto'
|
|
375
375
|
},
|
|
376
|
-
reviewTool: 'claude'
|
|
376
|
+
reviewTool: 'claude',
|
|
377
|
+
git: {
|
|
378
|
+
autoCommit: false,
|
|
379
|
+
commitMessage: { pattern: '{ticket-id} {short-description}' }
|
|
380
|
+
}
|
|
377
381
|
};
|
|
378
382
|
|
|
379
383
|
// Project-specific overrides
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5-phase-workflow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A 5-phase feature development workflow for Claude Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"5-phase-workflow": "bin/install.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "bash test/verify-install-js.sh",
|
|
9
|
+
"test": "bash test/verify-install-js.sh && bash test/test-check-updates-hook.sh && bash test/test-update-system.sh",
|
|
10
|
+
"test:install": "bash test/verify-install-js.sh",
|
|
11
|
+
"test:hook": "bash test/test-check-updates-hook.sh",
|
|
12
|
+
"test:update": "bash test/test-update-system.sh",
|
|
10
13
|
"verify": "bash test/verify-install-js.sh"
|
|
11
14
|
},
|
|
12
15
|
"files": [
|
|
@@ -145,6 +145,9 @@ if command -v coderabbit &> /dev/null; then
|
|
|
145
145
|
fi
|
|
146
146
|
|
|
147
147
|
# IDE MCP (JetBrains) - check if MCP tools are available
|
|
148
|
+
|
|
149
|
+
# Context7 - up-to-date documentation MCP server
|
|
150
|
+
# Check if context7 tools are available (resolve-library-id, query-docs)
|
|
148
151
|
```
|
|
149
152
|
|
|
150
153
|
**1e. Check CLAUDE.md:**
|
|
@@ -326,7 +329,21 @@ If "Cancel": Exit immediately with message "Configuration unchanged."
|
|
|
326
329
|
- "Suggested test command: `{command}`. Use this?"
|
|
327
330
|
- Options: "Yes (recommended)", "Customize", "None (no test step)"
|
|
328
331
|
|
|
329
|
-
**2f.
|
|
332
|
+
**2f. Auto-commit during implementation:**
|
|
333
|
+
- "Should Claude make atomic commits during implementation? This creates a commit after each step, enabling progress tracking and easy rollback."
|
|
334
|
+
- Options:
|
|
335
|
+
1. "No (recommended)" → `git.autoCommit: false`
|
|
336
|
+
2. "Yes - commit after each implementation step" → `git.autoCommit: true`
|
|
337
|
+
|
|
338
|
+
**2g. Commit message pattern (only if auto-commit = Yes):**
|
|
339
|
+
- "What commit message format would you like?"
|
|
340
|
+
- Options:
|
|
341
|
+
1. "Default: `{ticket-id} {short-description}` (Recommended)"
|
|
342
|
+
2. "Conventional: `feat({ticket-id}): {short-description}`"
|
|
343
|
+
3. "Custom pattern" → free text
|
|
344
|
+
- Note: "Body will automatically include bullet points of changes."
|
|
345
|
+
|
|
346
|
+
**2h. Review tool preference:**
|
|
330
347
|
- "Which code review tool would you like to use?"
|
|
331
348
|
- Options:
|
|
332
349
|
1. "Claude (built-in, no setup needed)" — always available
|
|
@@ -339,11 +356,24 @@ If "Cancel": Exit immediately with message "Configuration unchanged."
|
|
|
339
356
|
- Then: `coderabbit auth login`
|
|
340
357
|
- Record the preference as `coderabbit` regardless (will prompt at review time if still missing)
|
|
341
358
|
|
|
342
|
-
**
|
|
359
|
+
**2i. Context7 documentation plugin:**
|
|
360
|
+
|
|
361
|
+
Context7 provides up-to-date, version-specific documentation and code examples directly in your prompts. It solves a common problem with LLMs: outdated training data leading to hallucinated APIs and deprecated code patterns.
|
|
362
|
+
|
|
363
|
+
- If Context7 was detected in Step 1d (resolve-library-id and query-docs tools available):
|
|
364
|
+
- "Context7 is already installed. ✓"
|
|
365
|
+
- If Context7 was NOT detected:
|
|
366
|
+
- "Would you like to install Context7? It provides up-to-date, version-specific documentation directly in prompts — helping avoid hallucinated APIs and deprecated patterns."
|
|
367
|
+
- Options:
|
|
368
|
+
1. "Install now (recommended)" — run `claude mcp add context7 -- npx -y @anthropic-ai/claude-code-mcp-server-context7` via Bash
|
|
369
|
+
2. "Skip"
|
|
370
|
+
- If user selects "Install now": execute the install command
|
|
371
|
+
|
|
372
|
+
**2j. Confirm CLAUDE.md generation:**
|
|
343
373
|
- "Generate/update CLAUDE.md? This will analyze your codebase to document structure and conventions."
|
|
344
374
|
- Options: "Yes (recommended)", "Skip"
|
|
345
375
|
|
|
346
|
-
**
|
|
376
|
+
**2k. Review detected patterns for skill generation:**
|
|
347
377
|
|
|
348
378
|
Present ONLY patterns that were actually detected in steps 1g and 1h.
|
|
349
379
|
|
|
@@ -408,7 +438,10 @@ Create `.claude/.5/config.json` with the following values:
|
|
|
408
438
|
- Test timeout: 300000ms
|
|
409
439
|
- CodeRabbit: {available/not-available}, authenticated: {yes/no}
|
|
410
440
|
- IDE integration: {available/not-available}, type: {type}
|
|
441
|
+
- Context7: {available/not-available}
|
|
411
442
|
- Review tool: {claude/coderabbit/none}
|
|
443
|
+
- Auto-commit: {yes/no}
|
|
444
|
+
- Commit message pattern: {pattern or "default"}
|
|
412
445
|
|
|
413
446
|
### Requirement 2: Generate Documentation Files
|
|
414
447
|
Analyze the codebase and generate modular documentation:
|
|
@@ -555,6 +588,12 @@ User: "Yes"
|
|
|
555
588
|
Claude: "Test command: `npm test`. Use this?"
|
|
556
589
|
User: "Yes"
|
|
557
590
|
|
|
591
|
+
Claude: "Should Claude make atomic commits during implementation?"
|
|
592
|
+
User: "No"
|
|
593
|
+
|
|
594
|
+
Claude: "Which code review tool would you like to use?"
|
|
595
|
+
User: "Claude (built-in)"
|
|
596
|
+
|
|
558
597
|
Claude: "Generate CLAUDE.md with codebase analysis?"
|
|
559
598
|
User: "Yes"
|
|
560
599
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
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
|
-
allowed-tools: Task, Read, Write, Glob, Grep
|
|
4
|
+
allowed-tools: Task, Read, Write, Glob, Grep, Bash
|
|
5
5
|
context: fork
|
|
6
6
|
user-invocable: true
|
|
7
7
|
---
|
|
@@ -46,7 +46,7 @@ Do NOT write code directly. Spawn agents to do the work.
|
|
|
46
46
|
|
|
47
47
|
## Process
|
|
48
48
|
|
|
49
|
-
### Step 1: Load Plan
|
|
49
|
+
### Step 1: Load Plan and Config
|
|
50
50
|
|
|
51
51
|
Read `.5/features/{feature-name}/plan.md` (where `{feature-name}` is the argument provided).
|
|
52
52
|
|
|
@@ -58,6 +58,10 @@ Parse:
|
|
|
58
58
|
|
|
59
59
|
If the plan doesn't exist, tell the user to run `/5:plan-implementation` first.
|
|
60
60
|
|
|
61
|
+
Also read `.claude/.5/config.json` and extract:
|
|
62
|
+
- `git.autoCommit` (boolean, default `false`)
|
|
63
|
+
- `git.commitMessage.pattern` (string, default `{ticket-id} {short-description}`)
|
|
64
|
+
|
|
61
65
|
### Step 2: Initialize State
|
|
62
66
|
|
|
63
67
|
Create `.5/features/{feature-name}/state.json`:
|
|
@@ -180,7 +184,39 @@ Update state.json:
|
|
|
180
184
|
}
|
|
181
185
|
```
|
|
182
186
|
|
|
183
|
-
**3e.
|
|
187
|
+
**3e. Auto-Commit Step (if enabled)**
|
|
188
|
+
|
|
189
|
+
Only fires if `git.autoCommit: true` AND at least one component in the step succeeded.
|
|
190
|
+
|
|
191
|
+
1. Stage **only** the specific files from the plan's components table for this step (never `git add .`)
|
|
192
|
+
2. Commit using the configured `git.commitMessage.pattern`:
|
|
193
|
+
- `{ticket-id}` → ticket ID from plan frontmatter
|
|
194
|
+
- `{short-description}` → auto-generated summary of the step (imperative mood, max 50 chars for the full first line)
|
|
195
|
+
- Body: one bullet per completed component
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Stage only specific files from this step's components
|
|
199
|
+
git add {file-1} {file-2} ...
|
|
200
|
+
|
|
201
|
+
# Commit with configured pattern + body
|
|
202
|
+
git commit -m "{ticket-id} {short-description}
|
|
203
|
+
|
|
204
|
+
- {concise change 1}
|
|
205
|
+
- {concise change 2}"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
3. If commit fails → log warning, record in `state.json` under `commitResults` array, continue
|
|
209
|
+
4. If all components in the step failed → skip commit entirely
|
|
210
|
+
|
|
211
|
+
**Example commit:**
|
|
212
|
+
```
|
|
213
|
+
PROJ-1234 add schedule model and types
|
|
214
|
+
|
|
215
|
+
- Create Schedule.ts entity model
|
|
216
|
+
- Create schedule.ts type definitions
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**3f. Handle failures**
|
|
184
220
|
|
|
185
221
|
If any component failed:
|
|
186
222
|
- Log the failure in state.json
|
|
@@ -223,6 +259,7 @@ Implementation complete!
|
|
|
223
259
|
- {N} components created/modified
|
|
224
260
|
- Build: {status}
|
|
225
261
|
- Tests: {status}
|
|
262
|
+
{If git.autoCommit was true: "- Commits: {N} atomic commits created"}
|
|
226
263
|
|
|
227
264
|
{If any failures: list them}
|
|
228
265
|
|
|
@@ -51,7 +51,7 @@ Your job is NOT:
|
|
|
51
51
|
❌ Skip clarifying questions if unclear
|
|
52
52
|
❌ Skip state file updates
|
|
53
53
|
❌ Create feature spec files (use full workflow)
|
|
54
|
-
❌ Commit
|
|
54
|
+
❌ Commit without config - Only commit if git.autoCommit is enabled
|
|
55
55
|
|
|
56
56
|
**This is a FAST PATH for well-understood, small tasks. For anything complex, use the full workflow.**
|
|
57
57
|
|
|
@@ -63,7 +63,7 @@ Your job is NOT:
|
|
|
63
63
|
- ❌ **Skip clarifying questions** - If implementation is unclear, ask first
|
|
64
64
|
- ❌ **Skip state updates** - State file updates are MANDATORY
|
|
65
65
|
- ❌ **Create feature specs** - This is for quick tasks, not full features
|
|
66
|
-
- ❌ **
|
|
66
|
+
- ❌ **Commit without config** - Only commit if git.autoCommit is enabled
|
|
67
67
|
- ❌ **Skip plan approval** - Always show plan and get user approval first
|
|
68
68
|
|
|
69
69
|
**If the task involves more than 5 files or multiple domains, STOP and recommend the full workflow instead.**
|
|
@@ -79,7 +79,7 @@ Use AskUserQuestion:
|
|
|
79
79
|
|
|
80
80
|
Store as `$DESCRIPTION`.
|
|
81
81
|
|
|
82
|
-
### Step 2: Extract Ticket ID
|
|
82
|
+
### Step 2: Extract Ticket ID and Load Config
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
git branch --show-current
|
|
@@ -87,6 +87,10 @@ git branch --show-current
|
|
|
87
87
|
|
|
88
88
|
Extract ticket ID using configurable pattern from config (e.g., `PROJ-\d+` or `\d+`). If not found, ask developer.
|
|
89
89
|
|
|
90
|
+
Also read `.claude/.5/config.json` and extract:
|
|
91
|
+
- `git.autoCommit` (boolean, default `false`)
|
|
92
|
+
- `git.commitMessage.pattern` (string, default `{ticket-id} {short-description}`)
|
|
93
|
+
|
|
90
94
|
### Step 3: Generate Identifiers
|
|
91
95
|
|
|
92
96
|
```bash
|
|
@@ -268,6 +272,32 @@ Skill tool call:
|
|
|
268
272
|
args: "{affected test modules}"
|
|
269
273
|
```
|
|
270
274
|
|
|
275
|
+
### Step 9b: Auto-Commit (if enabled)
|
|
276
|
+
|
|
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
|
|
300
|
+
|
|
271
301
|
### Step 10: Update State and Report (MANDATORY)
|
|
272
302
|
|
|
273
303
|
**CRITICAL**: You MUST update the state file to mark completion.
|
|
@@ -303,10 +333,14 @@ Components created/modified:
|
|
|
303
333
|
|
|
304
334
|
Build: Success
|
|
305
335
|
Tests: {Success | Skipped}
|
|
336
|
+
{If git.autoCommit was true: "Commit: {Success | Failed | Skipped (build failed)}"}
|
|
306
337
|
|
|
307
338
|
State: .5/features/${feature_name}/state.json
|
|
308
339
|
|
|
309
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:}
|
|
310
344
|
1. Review and commit changes
|
|
311
345
|
2. For a new task, run `/clear` before starting
|
|
312
346
|
```
|
|
@@ -70,11 +70,16 @@ Note: feature.md not found — skipping feature completeness checks.
|
|
|
70
70
|
This is normal for quick-implement workflows. Infrastructure and quality checks will still run.
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
Also read `.claude/.5/config.json` and extract:
|
|
74
|
+
- `git.autoCommit` (boolean, default `false`)
|
|
75
|
+
- `git.commitMessage.pattern` (string, default `{ticket-id} {short-description}`)
|
|
76
|
+
|
|
73
77
|
Extract from artifacts:
|
|
74
78
|
- Components table from `plan.md` (step, component, action, file, description, complexity)
|
|
75
79
|
- Build and test commands from `plan.md`
|
|
76
80
|
- Completed/failed components from `state.json`
|
|
77
81
|
- Acceptance criteria and functional requirements from `feature.md` (if present)
|
|
82
|
+
- Number of commits created from `state.json` `commitResults` (if auto-commit was used)
|
|
78
83
|
|
|
79
84
|
### Step 2: Infrastructure Verification (Layer 1)
|
|
80
85
|
|
|
@@ -255,7 +260,11 @@ Layer 2 (Feature Completeness): {N}/{N} criteria satisfied, {N}/{N} requirements
|
|
|
255
260
|
Layer 3 (Quality): {N}/{N} new files have tests
|
|
256
261
|
|
|
257
262
|
Report: .5/{feature-name}/verification.md
|
|
263
|
+
```
|
|
258
264
|
|
|
265
|
+
**If `git.autoCommit: false` (default):** offer to commit.
|
|
266
|
+
|
|
267
|
+
```
|
|
259
268
|
Would you like to commit these changes?
|
|
260
269
|
```
|
|
261
270
|
|
|
@@ -265,6 +274,12 @@ Use AskUserQuestion with options:
|
|
|
265
274
|
|
|
266
275
|
If yes: stage and commit with message format `{TICKET-ID} {description}`.
|
|
267
276
|
|
|
277
|
+
**If `git.autoCommit: true`:** skip the commit offer.
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
Changes were already committed during implementation ({N} atomic commits).
|
|
281
|
+
```
|
|
282
|
+
|
|
268
283
|
Then go to Step 11 (Next Steps).
|
|
269
284
|
|
|
270
285
|
**If PARTIAL or FAILED:**
|
|
@@ -359,6 +374,22 @@ After all fixes are applied, re-run build and tests:
|
|
|
359
374
|
{test-command}
|
|
360
375
|
```
|
|
361
376
|
|
|
377
|
+
**If `git.autoCommit: true` and fixes succeeded (build + tests pass):**
|
|
378
|
+
|
|
379
|
+
Auto-commit the fix files:
|
|
380
|
+
```bash
|
|
381
|
+
# Stage only the specific fix files
|
|
382
|
+
git add {fix-file-1} {fix-file-2} ...
|
|
383
|
+
|
|
384
|
+
# Commit with ticket ID
|
|
385
|
+
git commit -m "{ticket-id} fix verification issues
|
|
386
|
+
|
|
387
|
+
- {concise fix 1}
|
|
388
|
+
- {concise fix 2}"
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
If commit fails → log warning, continue.
|
|
392
|
+
|
|
362
393
|
Update `fix-plan.md` with results:
|
|
363
394
|
- Mark each fix as APPLIED / FAILED
|
|
364
395
|
- Record build and test results after fixes
|
|
@@ -369,6 +400,7 @@ Applied {N} fixes.
|
|
|
369
400
|
|
|
370
401
|
Build: {status}
|
|
371
402
|
Tests: {status}
|
|
403
|
+
{If git.autoCommit was true: "Commit: {Success | Failed | Skipped}"}
|
|
372
404
|
|
|
373
405
|
{If any fixes failed, list them}
|
|
374
406
|
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
|
|
6
|
-
// Read
|
|
7
|
-
let
|
|
8
|
-
process.stdin.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
process.stdin.on('end', async () => {
|
|
6
|
+
// Read JSON from stdin
|
|
7
|
+
let input = '';
|
|
8
|
+
process.stdin.setEncoding('utf8');
|
|
9
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
10
|
+
process.stdin.on('end', () => {
|
|
13
11
|
try {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
let workspaceDir = process.cwd();
|
|
13
|
+
if (input.trim()) {
|
|
14
|
+
const data = JSON.parse(input);
|
|
15
|
+
workspaceDir = data.cwd || data.workspace?.current_dir || workspaceDir;
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
checkForUpdates(workspaceDir).catch(() => process.exit(0));
|
|
19
19
|
} catch (e) {
|
|
20
20
|
// Silent failure - don't block on errors
|
|
21
21
|
process.exit(0);
|
package/src/settings.json
CHANGED
|
@@ -55,14 +55,23 @@ It handles three distinct tasks, invoked with different parameters per component
|
|
|
55
55
|
"ide": {
|
|
56
56
|
"available": false,
|
|
57
57
|
"type": null
|
|
58
|
+
},
|
|
59
|
+
"context7": {
|
|
60
|
+
"available": false
|
|
58
61
|
}
|
|
59
62
|
},
|
|
60
|
-
"reviewTool": "claude" or "coderabbit" or "none"
|
|
63
|
+
"reviewTool": "claude" or "coderabbit" or "none",
|
|
64
|
+
"git": {
|
|
65
|
+
"autoCommit": false,
|
|
66
|
+
"commitMessage": {
|
|
67
|
+
"pattern": "{ticket-id} {short-description}"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
61
70
|
}
|
|
62
71
|
```
|
|
63
72
|
|
|
64
73
|
**Process:**
|
|
65
|
-
1. Read all values from the feature spec (`.5/features/CONFIGURE/feature.md`)
|
|
74
|
+
1. Read all values from the feature spec (`.5/features/CONFIGURE/feature.md`), including `git.autoCommit` and `git.commitMessage.pattern`
|
|
66
75
|
2. Ensure `.claude/.5/` directory exists (create with `mkdir -p` if needed)
|
|
67
76
|
3. Write `config.json` with pretty-printed JSON
|
|
68
77
|
4. Read back to verify correctness
|