5-phase-workflow 1.2.2 → 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/README.md CHANGED
@@ -33,22 +33,36 @@ npx 5-phase-workflow --global
33
33
  ```
34
34
 
35
35
  The installer will:
36
- - Auto-detect your project type (JavaScript, Python, Java, etc.)
37
36
  - Copy workflow commands, agents, and skills to `.claude/`
38
- - Create a config file at `.claude/.5/config.json`
39
- - Configure build and test commands for your project
37
+ - Set up hooks and settings
38
+ - Create `.5/features/` directory for feature tracking
40
39
 
41
- ## Quick Start
40
+ **After installation, you must configure your project:**
42
41
 
43
- After installation, configure the workflow for your project:
42
+ ## Required: Configure Your Project
44
43
 
45
44
  ```bash
46
45
  # Open Claude Code in your project
47
- # Run the configuration wizard
48
46
  /5:configure
49
47
  ```
50
48
 
51
- Then start your first feature:
49
+ This will:
50
+ - Auto-detect your project type (JavaScript, Python, Java, etc.)
51
+ - Set up build and test commands
52
+ - Configure ticket tracking patterns
53
+ - Generate comprehensive CLAUDE.md documentation
54
+ - Create project-specific skills (create-component, create-service, etc.)
55
+
56
+ Follow the standard workflow after `/5:configure`:
57
+ 1. `/5:plan-implementation CONFIGURE` - Plan the configuration
58
+ 2. `/5:implement-feature CONFIGURE` - Execute configuration
59
+ 3. `/5:verify-implementation` - Verify setup
60
+
61
+ **The workflow is ready to use after completing configuration.**
62
+
63
+ ## Start Your First Feature
64
+
65
+ After configuration is complete, start your first feature:
52
66
 
53
67
  ```bash
54
68
  # Phase 1: Plan the feature
@@ -178,10 +192,10 @@ Claude maps your feature to technical components:
178
192
  - Maps components to implementation steps
179
193
  - Creates dependency graph
180
194
 
181
- The output is an **atomic plan structure** at `.5/{ticket-id}/plan/`:
182
- - `meta.md` - Feature metadata and risks
183
- - `step-1.md`, `step-2.md`, ... - Per-step components with pre-built prompts (YAML format)
184
- - `verification.md` - Build/test configuration
195
+ The output is an **atomic plan structure** at `.5/features/{ticket-id}/`:
196
+ - `feature.md` - Feature specification (Phase 1)
197
+ - `plan.md` - Implementation plan (Phase 2)
198
+ - `state.json` - Implementation state tracking (Phase 3)
185
199
 
186
200
  Each step file is self-contained and independently loadable, making large plans manageable and improving agent efficiency.
187
201
 
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
@@ -467,6 +471,13 @@ function initializeConfig(targetPath) {
467
471
  fs.mkdirSync(configDir, { recursive: true });
468
472
  }
469
473
 
474
+ // Create features subdirectory
475
+ const featuresDir = path.join(configDir, 'features');
476
+ if (!fs.existsSync(featuresDir)) {
477
+ fs.mkdirSync(featuresDir, { recursive: true });
478
+ log.success('Created .5/features/ directory');
479
+ }
480
+
470
481
  const projectType = detectProjectType();
471
482
  const config = getDefaultConfig(projectType);
472
483
 
@@ -583,15 +594,21 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
583
594
  // Merge settings
584
595
  mergeSettings(targetPath, sourcePath);
585
596
 
586
- // Initialize config (local only)
587
- if (!isGlobal) {
588
- initializeConfig(targetPath);
589
- }
590
-
591
597
  // Initialize version tracking
592
598
  initializeVersionJson(targetPath, isGlobal);
593
599
 
594
600
  log.header('Installation Complete!');
601
+ log.info('');
602
+ log.info('Next step: Configure your project');
603
+ log.info('Run: /5:configure');
604
+ log.info('');
605
+ log.info('This will:');
606
+ log.info(' • Detect your project type and build commands');
607
+ log.info(' • Set up ticket tracking conventions');
608
+ log.info(' • Generate comprehensive documentation (CLAUDE.md)');
609
+ log.info(' • Create project-specific skills');
610
+ log.info('');
611
+
595
612
  showCommandsHelp(targetPath);
596
613
  }
597
614
 
@@ -631,6 +648,14 @@ function performUpdate(targetPath, sourcePath, isGlobal, versionInfo) {
631
648
  }
632
649
  fs.writeFileSync(versionFile, JSON.stringify(versionData, null, 2));
633
650
 
651
+ // Create features directory if it doesn't exist
652
+ const featuresDir = path.join(configDir, 'features');
653
+ if (!fs.existsSync(featuresDir)) {
654
+ fs.mkdirSync(featuresDir, { recursive: true });
655
+ log.info('📁 Feature folders now nest under .5/features/');
656
+ log.info('📋 See RELEASE_NOTES.md for migration if you have in-progress features');
657
+ }
658
+
634
659
  log.header('Update Complete!');
635
660
  log.success(`Now running version ${versionInfo.available}`);
636
661
  showCommandsHelp(targetPath);
@@ -48,6 +48,47 @@ For small, well-understood tasks (1-5 files). Uses same state tracking and skill
48
48
 
49
49
  ---
50
50
 
51
+ ## Getting Started
52
+
53
+ ### Installation
54
+
55
+ ```bash
56
+ npx 5-phase-workflow
57
+ ```
58
+
59
+ The installer copies workflow files to `.claude/` directory. **It does NOT create configuration.**
60
+
61
+ ### Required First Step: Configuration
62
+
63
+ ```bash
64
+ /5:configure
65
+ ```
66
+
67
+ **This is a required setup step.** The configure command uses the 5-phase workflow itself:
68
+
69
+ 1. **Phase 1** (`/5:configure`): Analyzes project, gathers preferences, creates feature spec
70
+ 2. **Phase 2** (`/5:plan-implementation CONFIGURE`): Creates implementation plan
71
+ 3. **Phase 3** (`/5:implement-feature CONFIGURE`): Executes configuration
72
+ 4. **Phase 4** (`/5:verify-implementation`): Verifies configuration
73
+
74
+ After completing these steps, you have:
75
+ - `.claude/.5/config.json` with your project settings
76
+ - `CLAUDE.md` with comprehensive project documentation
77
+ - `.5/STRUCTURE.md`, `.5/STACK.md`, etc. with modular documentation
78
+ - Project-specific skills in `.claude/skills/`
79
+
80
+ **Without configuration, workflow commands will fail.**
81
+
82
+ ### Your First Feature
83
+
84
+ After configuration is complete, start your first feature:
85
+
86
+ ```bash
87
+ /5:plan-feature
88
+ ```
89
+
90
+ ---
91
+
51
92
  ## Architecture
52
93
 
53
94
  The workflow uses a **4-layer architecture**:
@@ -110,7 +151,7 @@ Commands used to call skills directly, consuming main context for heavy operatio
110
151
  | |
111
152
  | Developer: /plan-feature |
112
153
  | Claude: Asks 6-10 questions, challenges assumptions |
113
- | Output: .5/{TICKET-ID}-{description}/feature.md |
154
+ | Output: .5/features/{TICKET-ID}-{description}/feature.md |
114
155
  | Developer: Reviews and approves spec |
115
156
  +-----------------------------+-------------------------------------+
116
157
  |
@@ -196,7 +237,7 @@ Understand requirements, challenge assumptions, and create a comprehensive featu
196
237
 
197
238
  5. **Feature Spec Creation**: Claude writes structured spec to:
198
239
  ```
199
- .5/{TICKET-ID}-{description}/feature.md
240
+ .5/features/{TICKET-ID}-{description}/feature.md
200
241
  ```
201
242
 
202
243
  ### Your Role
@@ -258,7 +299,7 @@ Map feature requirements to technical components, skills, and dependency steps.
258
299
 
259
300
  6. **Implementation Plan Creation**: Claude writes an **atomic plan structure** to:
260
301
  ```
261
- .5/{TICKET-ID}-{description}/plan/
302
+ .5/features/{TICKET-ID}-{description}/plan/
262
303
  ├── meta.md # Feature metadata and risks
263
304
  ├── step-1.md # Step 1 components (YAML format)
264
305
  ├── step-2.md # Step 2 components
@@ -315,7 +356,7 @@ Execute the implementation plan with state tracking, using agents in forked cont
315
356
 
316
357
  2. **Initialize State File**: Creates tracking file
317
358
  ```
318
- .5/{TICKET-ID}-{description}/state.json
359
+ .5/features/{TICKET-ID}-{description}/state.json
319
360
  ```
320
361
 
321
362
  3. **Create Task List**: One item per step (default 3 steps, configurable)
@@ -380,7 +421,7 @@ Tracks progress in JSON format:
380
421
 
381
422
  ### Output Files
382
423
 
383
- - **State file**: `.5/{ticket}/state.json`
424
+ - **State file**: `.5/features/{ticket}/state.json`
384
425
  - **All created files**: As specified in implementation plan
385
426
 
386
427
  ### Next Steps
@@ -420,7 +461,7 @@ Systematically verify that the implementation is complete, correct, and ready fo
420
461
  4. **Process Results**: Command receives structured verification data
421
462
 
422
463
  5. **Save Report**: Writes verification report to:
423
- `.5/{ticket}/verification.md`
464
+ `.5/features/{ticket}/verification.md`
424
465
 
425
466
  6. **Update State File**: Marks verification status
426
467
 
@@ -497,7 +538,7 @@ Use automated code review to catch quality issues, apply auto-fixes, and ensure
497
538
 
498
539
  8. **Verify**: Compile and test after applying fixes
499
540
 
500
- 9. **Save Report**: Store review summary in `.5/{feature-name}/`
541
+ 9. **Save Report**: Store review summary in `.5/features/{feature-name}/`
501
542
 
502
543
  ### Your Role
503
544
 
@@ -750,7 +791,7 @@ Tests: All passing
750
791
  2. **Use git branches**: Create feature branch before starting
751
792
  3. **Commit often**: Commit after Phase 3 completes successfully
752
793
  4. **Run verification manually**: Re-run /verify-implementation after fixes
753
- 5. **Review state files**: Check `.5/{feature-name}/state.json` for progress tracking
794
+ 5. **Review state files**: Check `.5/features/{feature-name}/state.json` for progress tracking
754
795
  6. **Save verification reports**: Keep reports for documentation/debugging
755
796
 
756
797
  ---
@@ -798,7 +839,7 @@ Tests: All passing
798
839
  **Symptom**: JSON parse error when reading state file
799
840
 
800
841
  **Solution**:
801
- 1. Open `.5/{ticket}/state.json`
842
+ 1. Open `.5/features/{ticket}/state.json`
802
843
  2. Fix JSON syntax error
803
844
  3. Or delete and re-run /implement-feature (will restart from beginning)
804
845
 
@@ -835,7 +876,7 @@ Tests: All passing
835
876
  ### Resuming Interrupted Implementation
836
877
 
837
878
  If implementation was interrupted:
838
- 1. Check state file: `.5/{ticket}/state.json`
879
+ 1. Check state file: `.5/features/{ticket}/state.json`
839
880
  2. Note `currentStep` value
840
881
  3. Re-run `/implement-feature {ticket}`
841
882
  4. Claude will resume from `currentStep`
@@ -930,11 +971,11 @@ If working on multiple features:
930
971
 
931
972
  | File | Purpose | Committed? |
932
973
  |------|---------|------------|
933
- | `.5/{ticket}/feature.md` | Feature spec | Yes (after approval) |
934
- | `.5/{ticket}/plan/` | Atomic implementation plan (meta.md, step-N.md, verification.md) | Yes (after approval) |
935
- | `.5/{ticket}/state.json` | Progress tracking | No (gitignored) |
936
- | `.5/{ticket}/verification.md` | Verification report | No (gitignored) |
937
- | `.5/{ticket}/review-{timestamp}.md` | CodeRabbit review report | No (gitignored) |
974
+ | `.5/features/{ticket}/feature.md` | Feature spec | Yes (after approval) |
975
+ | `.5/features/{ticket}/plan/` | Atomic implementation plan (meta.md, step-N.md, verification.md) | Yes (after approval) |
976
+ | `.5/features/{ticket}/state.json` | Progress tracking | No (gitignored) |
977
+ | `.5/features/{ticket}/verification.md` | Verification report | No (gitignored) |
978
+ | `.5/features/{ticket}/review-{timestamp}.md` | CodeRabbit review report | No (gitignored) |
938
979
 
939
980
  ### State File Status Values
940
981
 
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "5-phase-workflow",
3
- "version": "1.2.2",
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": [
@@ -59,7 +59,11 @@ Perform all detection silently, collecting results for Step 2.
59
59
  **1a. Check for existing config:**
60
60
  ```bash
61
61
  if [ -f ".claude/.5/config.json" ]; then
62
- # Config exists - will ask user in Step 2
62
+ # Config exists - will ask user in Step 2 what to do
63
+ config_exists=true
64
+ else
65
+ # No config - this is expected for first run after installation
66
+ config_exists=false
63
67
  fi
64
68
  ```
65
69
 
@@ -141,6 +145,9 @@ if command -v coderabbit &> /dev/null; then
141
145
  fi
142
146
 
143
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)
144
151
  ```
145
152
 
146
153
  **1e. Check CLAUDE.md:**
@@ -275,9 +282,24 @@ Only include patterns/commands that are actually detected.
275
282
  ### Step 2: Gather User Preferences (interactive via AskUserQuestion)
276
283
 
277
284
  **2a. If config exists:**
278
- - "Configuration already exists. What would you like to do?"
279
- - Options: "Update existing", "Start fresh", "Cancel"
280
- - If Cancel: stop here
285
+ "Configuration already exists. What would you like to do?"
286
+ - Options:
287
+ - "Update existing configuration" (merge with current values)
288
+ - "Start fresh" (delete and reconfigure from scratch)
289
+ - "Cancel" (exit without changes)
290
+
291
+ If "Start fresh" selected:
292
+ - Confirm: "This will delete existing config. Are you sure?"
293
+ - If confirmed: delete .claude/.5/config.json
294
+ - Proceed to detection and questions
295
+
296
+ If "Update existing configuration":
297
+ - Read current values
298
+ - Pre-fill questions with current values
299
+ - Allow user to change any value
300
+ - Merge updated values back
301
+
302
+ If "Cancel": Exit immediately with message "Configuration unchanged."
281
303
 
282
304
  **2b. Confirm project type:**
283
305
  - "Detected project type: {detected-type}. Is this correct?"
@@ -307,7 +329,21 @@ Only include patterns/commands that are actually detected.
307
329
  - "Suggested test command: `{command}`. Use this?"
308
330
  - Options: "Yes (recommended)", "Customize", "None (no test step)"
309
331
 
310
- **2f. Review tool preference:**
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:**
311
347
  - "Which code review tool would you like to use?"
312
348
  - Options:
313
349
  1. "Claude (built-in, no setup needed)" — always available
@@ -320,11 +356,24 @@ Only include patterns/commands that are actually detected.
320
356
  - Then: `coderabbit auth login`
321
357
  - Record the preference as `coderabbit` regardless (will prompt at review time if still missing)
322
358
 
323
- **2g. Confirm CLAUDE.md generation:**
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:**
324
373
  - "Generate/update CLAUDE.md? This will analyze your codebase to document structure and conventions."
325
374
  - Options: "Yes (recommended)", "Skip"
326
375
 
327
- **2h. Review detected patterns for skill generation:**
376
+ **2k. Review detected patterns for skill generation:**
328
377
 
329
378
  Present ONLY patterns that were actually detected in steps 1g and 1h.
330
379
 
@@ -389,7 +438,10 @@ Create `.claude/.5/config.json` with the following values:
389
438
  - Test timeout: 300000ms
390
439
  - CodeRabbit: {available/not-available}, authenticated: {yes/no}
391
440
  - IDE integration: {available/not-available}, type: {type}
441
+ - Context7: {available/not-available}
392
442
  - Review tool: {claude/coderabbit/none}
443
+ - Auto-commit: {yes/no}
444
+ - Commit message pattern: {pattern or "default"}
393
445
 
394
446
  ### Requirement 2: Generate Documentation Files
395
447
  Analyze the codebase and generate modular documentation:
@@ -491,13 +543,13 @@ Each run-* skill should:
491
543
  - [ ] If CLAUDE.md existed before, user-written sections are preserved
492
544
  ```
493
545
 
494
- **Important:** Use `mkdir -p .5/CONFIGURE` before writing the feature spec.
546
+ **Important:** Use `mkdir -p .5/features/CONFIGURE` before writing the feature spec.
495
547
 
496
548
  ### Step 4: Guide User to Next Phase
497
549
 
498
550
  Tell the user:
499
551
 
500
- 1. "Configuration feature planned at `.5/CONFIGURE/feature.md`"
552
+ 1. "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
501
553
  2. "Next steps:"
502
554
  - "Run `/clear` to reset context"
503
555
  - "Then run `/5:plan-implementation CONFIGURE`"
@@ -536,6 +588,12 @@ User: "Yes"
536
588
  Claude: "Test command: `npm test`. Use this?"
537
589
  User: "Yes"
538
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
+
539
597
  Claude: "Generate CLAUDE.md with codebase analysis?"
540
598
  User: "Yes"
541
599
 
@@ -561,8 +619,8 @@ Claude: "I also found these runnable commands:
561
619
  Which commands would you like `run-*` skills generated for?"
562
620
  User: [Selects test, lint]
563
621
 
564
- Claude: [Writes .5/CONFIGURE/feature.md]
565
- Claude: "Configuration feature planned at `.5/CONFIGURE/feature.md`"
622
+ Claude: [Writes .5/features/CONFIGURE/feature.md]
623
+ Claude: "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
566
624
  Claude: "Next: Run `/clear` followed by `/5:plan-implementation CONFIGURE`"
567
625
  ```
568
626
 
@@ -76,7 +76,7 @@ Before invoking this skill, ensure:
76
76
  ### Step 1: Extract Feature Name
77
77
 
78
78
  If user provides only ticket ID (e.g., "PROJ-1234"), find the feature file:
79
- - Use Glob: `.5/{TICKET-ID}-*-*/feature.md` (pattern from config)
79
+ - Use Glob: `.5/features/{TICKET-ID}-*/feature.md` (pattern from config)
80
80
  - Match the ticket ID
81
81
  - If multiple matches, ask user to specify
82
82
  - If no match found, inform user and suggest running `/plan-feature` first
@@ -85,7 +85,7 @@ If user provides full feature name (e.g., "PROJ-1234-add-feature"), use directly
85
85
 
86
86
  ### Step 2: Read Feature Specification
87
87
 
88
- Read the feature spec from `.5/{feature-name}/feature.md`.
88
+ Read the feature spec from `.5/features/{feature-name}/feature.md`.
89
89
 
90
90
  Extract current state:
91
91
  - Ticket ID
@@ -184,7 +184,7 @@ Allow multiple rounds of discussion until user is satisfied.
184
184
 
185
185
  ### Step 7: Update Feature Specification
186
186
 
187
- When user indicates they're done discussing, update `.5/{feature-name}/feature.md`:
187
+ When user indicates they're done discussing, update `.5/features/{feature-name}/feature.md`:
188
188
 
189
189
  **Update these sections based on discussion:**
190
190
 
@@ -219,7 +219,7 @@ When user indicates they're done discussing, update `.5/{feature-name}/feature.m
219
219
 
220
220
  After updating the spec, tell the developer:
221
221
 
222
- 1. "Feature specification updated at `.5/{feature-name}/feature.md`"
222
+ 1. "Feature specification updated at `.5/features/{feature-name}/feature.md`"
223
223
  2. Summarize key changes:
224
224
  - "Added: {X}"
225
225
  - "Modified: {Y}"
@@ -234,7 +234,7 @@ After updating the spec, tell the developer:
234
234
  Follow these steps **IN ORDER** and **STOP after step 9**:
235
235
 
236
236
  1. **Extract feature name** - From user input or by matching ticket ID
237
- 2. **Read feature spec** - Load current state from `.5/{feature-name}/feature.md`
237
+ 2. **Read feature spec** - Load current state from `.5/features/{feature-name}/feature.md`
238
238
  3. **Ask initial question** - What do they want to discuss?
239
239
  4. **Explore if needed** - Understand codebase context
240
240
  5. **Interactive Q&A** - Multiple rounds of clarifying questions
@@ -1,13 +1,34 @@
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
  ---
8
8
 
9
9
  # Implement Feature (Phase 3)
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
+
11
32
  Execute an implementation plan by delegating work to agents.
12
33
 
13
34
  ## Scope
@@ -25,9 +46,9 @@ Do NOT write code directly. Spawn agents to do the work.
25
46
 
26
47
  ## Process
27
48
 
28
- ### Step 1: Load Plan
49
+ ### Step 1: Load Plan and Config
29
50
 
30
- Read `.5/{feature-name}/plan.md` (where `{feature-name}` is the argument provided).
51
+ Read `.5/features/{feature-name}/plan.md` (where `{feature-name}` is the argument provided).
31
52
 
32
53
  Parse:
33
54
  - YAML frontmatter for ticket and feature name
@@ -37,9 +58,13 @@ Parse:
37
58
 
38
59
  If the plan doesn't exist, tell the user to run `/5:plan-implementation` first.
39
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
+
40
65
  ### Step 2: Initialize State
41
66
 
42
- Create `.5/{feature-name}/state.json`:
67
+ Create `.5/features/{feature-name}/state.json`:
43
68
 
44
69
  ```json
45
70
  {
@@ -159,7 +184,39 @@ Update state.json:
159
184
  }
160
185
  ```
161
186
 
162
- **3e. Handle failures**
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**
163
220
 
164
221
  If any component failed:
165
222
  - Log the failure in state.json
@@ -202,6 +259,7 @@ Implementation complete!
202
259
  - {N} components created/modified
203
260
  - Build: {status}
204
261
  - Tests: {status}
262
+ {If git.autoCommit was true: "- Commits: {N} atomic commits created"}
205
263
 
206
264
  {If any failures: list them}
207
265