5-phase-workflow 1.2.2 → 1.3.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
@@ -467,6 +467,13 @@ function initializeConfig(targetPath) {
467
467
  fs.mkdirSync(configDir, { recursive: true });
468
468
  }
469
469
 
470
+ // Create features subdirectory
471
+ const featuresDir = path.join(configDir, 'features');
472
+ if (!fs.existsSync(featuresDir)) {
473
+ fs.mkdirSync(featuresDir, { recursive: true });
474
+ log.success('Created .5/features/ directory');
475
+ }
476
+
470
477
  const projectType = detectProjectType();
471
478
  const config = getDefaultConfig(projectType);
472
479
 
@@ -583,15 +590,21 @@ function performFreshInstall(targetPath, sourcePath, isGlobal) {
583
590
  // Merge settings
584
591
  mergeSettings(targetPath, sourcePath);
585
592
 
586
- // Initialize config (local only)
587
- if (!isGlobal) {
588
- initializeConfig(targetPath);
589
- }
590
-
591
593
  // Initialize version tracking
592
594
  initializeVersionJson(targetPath, isGlobal);
593
595
 
594
596
  log.header('Installation Complete!');
597
+ log.info('');
598
+ log.info('Next step: Configure your project');
599
+ log.info('Run: /5:configure');
600
+ log.info('');
601
+ log.info('This will:');
602
+ log.info(' • Detect your project type and build commands');
603
+ log.info(' • Set up ticket tracking conventions');
604
+ log.info(' • Generate comprehensive documentation (CLAUDE.md)');
605
+ log.info(' • Create project-specific skills');
606
+ log.info('');
607
+
595
608
  showCommandsHelp(targetPath);
596
609
  }
597
610
 
@@ -631,6 +644,14 @@ function performUpdate(targetPath, sourcePath, isGlobal, versionInfo) {
631
644
  }
632
645
  fs.writeFileSync(versionFile, JSON.stringify(versionData, null, 2));
633
646
 
647
+ // Create features directory if it doesn't exist
648
+ const featuresDir = path.join(configDir, 'features');
649
+ if (!fs.existsSync(featuresDir)) {
650
+ fs.mkdirSync(featuresDir, { recursive: true });
651
+ log.info('📁 Feature folders now nest under .5/features/');
652
+ log.info('📋 See RELEASE_NOTES.md for migration if you have in-progress features');
653
+ }
654
+
634
655
  log.header('Update Complete!');
635
656
  log.success(`Now running version ${versionInfo.available}`);
636
657
  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,6 +1,6 @@
1
1
  {
2
2
  "name": "5-phase-workflow",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "A 5-phase feature development workflow for Claude Code",
5
5
  "bin": {
6
6
  "5-phase-workflow": "bin/install.js"
@@ -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
 
@@ -275,9 +279,24 @@ Only include patterns/commands that are actually detected.
275
279
  ### Step 2: Gather User Preferences (interactive via AskUserQuestion)
276
280
 
277
281
  **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
282
+ "Configuration already exists. What would you like to do?"
283
+ - Options:
284
+ - "Update existing configuration" (merge with current values)
285
+ - "Start fresh" (delete and reconfigure from scratch)
286
+ - "Cancel" (exit without changes)
287
+
288
+ If "Start fresh" selected:
289
+ - Confirm: "This will delete existing config. Are you sure?"
290
+ - If confirmed: delete .claude/.5/config.json
291
+ - Proceed to detection and questions
292
+
293
+ If "Update existing configuration":
294
+ - Read current values
295
+ - Pre-fill questions with current values
296
+ - Allow user to change any value
297
+ - Merge updated values back
298
+
299
+ If "Cancel": Exit immediately with message "Configuration unchanged."
281
300
 
282
301
  **2b. Confirm project type:**
283
302
  - "Detected project type: {detected-type}. Is this correct?"
@@ -491,13 +510,13 @@ Each run-* skill should:
491
510
  - [ ] If CLAUDE.md existed before, user-written sections are preserved
492
511
  ```
493
512
 
494
- **Important:** Use `mkdir -p .5/CONFIGURE` before writing the feature spec.
513
+ **Important:** Use `mkdir -p .5/features/CONFIGURE` before writing the feature spec.
495
514
 
496
515
  ### Step 4: Guide User to Next Phase
497
516
 
498
517
  Tell the user:
499
518
 
500
- 1. "Configuration feature planned at `.5/CONFIGURE/feature.md`"
519
+ 1. "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
501
520
  2. "Next steps:"
502
521
  - "Run `/clear` to reset context"
503
522
  - "Then run `/5:plan-implementation CONFIGURE`"
@@ -561,8 +580,8 @@ Claude: "I also found these runnable commands:
561
580
  Which commands would you like `run-*` skills generated for?"
562
581
  User: [Selects test, lint]
563
582
 
564
- Claude: [Writes .5/CONFIGURE/feature.md]
565
- Claude: "Configuration feature planned at `.5/CONFIGURE/feature.md`"
583
+ Claude: [Writes .5/features/CONFIGURE/feature.md]
584
+ Claude: "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
566
585
  Claude: "Next: Run `/clear` followed by `/5:plan-implementation CONFIGURE`"
567
586
  ```
568
587
 
@@ -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
@@ -8,6 +8,27 @@ user-invocable: true
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
@@ -27,7 +48,7 @@ Do NOT write code directly. Spawn agents to do the work.
27
48
 
28
49
  ### Step 1: Load Plan
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
@@ -39,7 +60,7 @@ If the plan doesn't exist, tell the user to run `/5:plan-implementation` first.
39
60
 
40
61
  ### Step 2: Initialize State
41
62
 
42
- Create `.5/{feature-name}/state.json`:
63
+ Create `.5/features/{feature-name}/state.json`:
43
64
 
44
65
  ```json
45
66
  {
@@ -1,13 +1,34 @@
1
1
  ---
2
2
  name: 5:plan-feature
3
3
  description: Plans feature implementation by analyzing requirements, identifying affected modules, and creating a structured feature specification. Use at the start of any new feature to ensure systematic implementation. This is Phase 1 of the 5-phase workflow.
4
- allowed-tools: Read, Glob, Grep, Task, AskUserQuestion
4
+ allowed-tools: Bash, Write, Task, AskUserQuestion
5
5
  context: fork
6
6
  user-invocable: true
7
7
  ---
8
8
 
9
9
  # Plan Feature Implementation (Phase 1)
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
  ## Overview
12
33
 
13
34
  This skill is the **first phase** of the 5-phase workflow:
@@ -19,13 +40,26 @@ This skill is the **first phase** of the 5-phase workflow:
19
40
 
20
41
  This skill guides intensive collaboration with the developer to understand requirements, challenge assumptions, and create a comprehensive feature specification.
21
42
 
43
+ ## ⚠️ CRITICAL ARCHITECTURE
44
+
45
+ **This command uses a READ-ONLY sub-agent for codebase exploration.**
46
+
47
+ You (the main agent) orchestrate the process:
48
+ - You ask questions via AskUserQuestion
49
+ - You spawn a read-only Explore agent to analyze the codebase
50
+ - You receive findings from the sub-agent
51
+ - You create the feature.md file
52
+ - You inform the user of next steps
53
+
54
+ **The sub-agent CANNOT write files or implement anything. It can only read and report.**
55
+
22
56
  ## ⚠️ CRITICAL SCOPE CONSTRAINT
23
57
 
24
58
  **THIS COMMAND ONLY CREATES THE FEATURE SPECIFICATION. IT DOES NOT IMPLEMENT.**
25
59
 
26
60
  Your job in this phase:
27
61
  ✅ Ask questions
28
- Explore codebase
62
+ Spawn read-only sub-agent to explore codebase
29
63
  ✅ Create feature.md file
30
64
  ✅ Tell user to run /5:plan-implementation
31
65
 
@@ -80,35 +114,84 @@ Automatically extract the ticket ID from the current git branch:
80
114
  - Ask the developer if the ticket ID is correct
81
115
  - If no ticket ID found, ask developer for it
82
116
 
83
- ### Step 3: Analyze Existing Codebase
117
+ ### Step 3: Spawn Read-Only Explore Agent
118
+
119
+ **CRITICAL: Delegate ALL codebase exploration to a sub-agent.**
84
120
 
85
- Explore the codebase to understand existing patterns and identify affected modules:
121
+ Spawn a Task with `subagent_type=Explore` with the following prompt structure:
86
122
 
87
123
  ```
88
- 1. Explore the project structure to identify modules/components
89
- - Use Glob to discover relevant directories
90
- - Look for patterns that indicate module organization
124
+ Analyze the codebase for a feature planning session.
91
125
 
92
- 2. Check existing implementations in relevant modules
93
- - Search for similar features or components
94
- - Identify coding patterns and conventions
126
+ **Feature Description:** {paste the user's feature description here}
95
127
 
96
- 3. Check for similar patterns across the codebase
97
- - Search for class/function patterns that might be reusable
128
+ **Your Task:**
129
+ 1. Explore the project structure to identify modules/components
130
+ 2. Find existing implementations similar to this feature
131
+ 3. Identify coding patterns and conventions used
132
+ 4. Find reusable components or patterns
133
+ 5. Identify which existing files/modules would be affected
134
+
135
+ **Report Format:**
136
+ Return a structured report with:
137
+ - Project structure overview
138
+ - Relevant existing patterns found
139
+ - Similar implementations discovered
140
+ - Affected modules/files
141
+ - Reusable components identified
142
+ - Potential integration points
143
+
144
+ **IMPORTANT:** You are a READ-ONLY agent. Only use Read, Glob, and Grep tools. Do NOT suggest implementations or write any code.
98
145
  ```
99
146
 
100
- Use Task tool with subagent_type=Explore for complex exploration.
101
-
102
- **Goal:** Understand what already exists so you can ask informed questions.
147
+ **Wait for the sub-agent to return its findings before proceeding.**
103
148
 
104
149
  ### Step 4: Intensive Collaboration (5-10 Questions, ONE AT A TIME)
105
150
 
106
- **CRITICAL:** After exploring the codebase, engage in intensive Q&A. This is NOT optional.
151
+ **CRITICAL:** After receiving the exploration report, engage in intensive Q&A. This is NOT optional.
107
152
 
108
153
  - Ask 5-10 clarifying questions using AskUserQuestion
109
154
  - **ONE question at a time** - wait for answer before next question
110
155
  - Do NOT list multiple questions in one message
111
156
  - Do NOT skip to creating feature.md before asking at least 5 questions
157
+ - **Use the sub-agent's findings to inform your questions**
158
+
159
+ #### Step 4b: Optional Targeted Re-Exploration
160
+
161
+ During Q&A, the user may mention components, modules, or patterns that weren't covered in the initial exploration. You MAY spawn additional targeted Explore agents to gather more specific information.
162
+
163
+ **When to trigger re-exploration:**
164
+ - User mentions a specific file, module, or service by name that wasn't in the initial report
165
+ - User's answer reveals a dependency or integration point not previously identified
166
+ - User asks "have you looked at X?" or "what about the Y module?"
167
+ - Understanding a specific component is critical for accurate feature specification
168
+
169
+ **How to re-explore:**
170
+
171
+ Spawn a targeted Task with `subagent_type=Explore`:
172
+
173
+ ```
174
+ Targeted exploration for feature planning.
175
+
176
+ **Context:** During Q&A, the user mentioned {specific component/module/pattern}.
177
+
178
+ **Focused Task:**
179
+ 1. Find and analyze {specific component} mentioned by user
180
+ 2. Understand how it works and its patterns
181
+ 3. Identify how it might relate to the planned feature
182
+
183
+ **Report:** Provide a focused summary of:
184
+ - How this component works
185
+ - Relevant patterns or conventions
186
+ - How it could integrate with the planned feature
187
+
188
+ **IMPORTANT:** READ-ONLY. Only use Read, Glob, and Grep tools.
189
+ ```
190
+
191
+ **Guidelines:**
192
+ - Keep re-explorations focused and specific (not broad searches)
193
+ - Use findings to ask better follow-up questions
194
+ - Document relevant discoveries in the final feature spec
112
195
 
113
196
  **Question categories to explore:**
114
197
 
@@ -137,12 +220,12 @@ Use Task tool with subagent_type=Explore for complex exploration.
137
220
  - What are the acceptance criteria?
138
221
  - What test scenarios should be covered?
139
222
 
140
- 6. **Integration Points**
223
+ 6. **Integration Points** (informed by sub-agent findings)
141
224
  - Which existing components/modules are affected?
142
225
  - Are there API changes?
143
226
  - How does this interact with existing features?
144
227
 
145
- 7. **Alternative Approaches**
228
+ 7. **Alternative Approaches** (informed by sub-agent findings)
146
229
  - Have you considered approach X instead?
147
230
  - Is this the simplest solution?
148
231
  - Could we reuse existing components?
@@ -156,7 +239,7 @@ Use Task tool with subagent_type=Explore for complex exploration.
156
239
  - "Is this the simplest solution?"
157
240
  - "Have you considered X alternative?"
158
241
  - "What happens when Y fails?"
159
- - "Could we use existing Z component instead?"
242
+ - "Could we use existing Z component instead?" (reference sub-agent findings)
160
243
  - "Is a full factory needed or just simple creation?"
161
244
 
162
245
  **Ask questions ONE AT A TIME.** Use AskUserQuestion for each question. For clarifying questions, provide 2-4 options where meaningful. Wait for the user's answer before asking the next question. Open questions (like feature description) can use free text.
@@ -169,7 +252,7 @@ Based on the feature description and discussion:
169
252
 
170
253
  ### Step 6: Create Feature Specification
171
254
 
172
- Write a comprehensive feature spec to `.5/{TICKET-ID}-{description}/feature.md` using the template structure.
255
+ Write a comprehensive feature spec to `.5/features/{TICKET-ID}-{description}/feature.md` using the Write tool.
173
256
 
174
257
  **THIS IS YOUR FINAL OUTPUT. After creating this file, proceed immediately to Step 7.**
175
258
 
@@ -182,7 +265,7 @@ Key sections to populate:
182
265
  - **Problem Statement** - Why this feature is needed
183
266
  - **Requirements** - Functional and non-functional requirements from discussion
184
267
  - **Constraints** - Business, technical, and time constraints identified
185
- - **Affected Components** - Discovered from codebase exploration
268
+ - **Affected Components** - From sub-agent exploration report
186
269
  - **Entity Definitions** - If the feature involves new data structures
187
270
  - **Acceptance Criteria** - Verifiable criteria for success
188
271
  - **Alternatives Considered** - Options discussed and why chosen approach was selected
@@ -195,11 +278,12 @@ Follow these steps **IN ORDER** and **STOP after step 8**:
195
278
 
196
279
  1. **Ask for feature description** - Request task description and additional information from developer
197
280
  2. **Extract Ticket ID** - Get current branch name and extract ticket ID using configured pattern
198
- 3. **Explore the codebase** - Understand existing patterns and affected modules
199
- 4. **Ask 5-10 clarifying questions** - Based on findings, ask informed questions using AskUserQuestion - This is MANDATORY
281
+ 3. **Spawn Explore sub-agent** - Delegate codebase analysis to read-only agent, wait for report
282
+ 4. **Ask 5-10 clarifying questions** - Based on sub-agent findings, ask informed questions using AskUserQuestion - This is MANDATORY
283
+ - **4b. Re-explore as needed** - If user mentions unknown components during Q&A, spawn targeted Explore agents
200
284
  5. **Challenge assumptions** - Present alternatives, question complexity
201
285
  6. **Determine feature name** - Create short kebab-case description
202
- 7. **Create feature specification** in `.5/{TICKET-ID}-{description}/feature.md`
286
+ 7. **Create feature specification** in `.5/features/{TICKET-ID}-{description}/feature.md` using Write tool
203
287
  8. **Inform the developer** to review the spec, run `/clear` to reset context, and then run `/5:plan-implementation {TICKET-ID}-{description}`
204
288
 
205
289
  **🛑 STOP HERE. YOUR JOB IS COMPLETE. DO NOT PROCEED TO IMPLEMENTATION.**
@@ -208,12 +292,13 @@ Follow these steps **IN ORDER** and **STOP after step 8**:
208
292
 
209
293
  1. **Feature description first** - Get context before asking detailed questions
210
294
  2. **Auto-extract ticket ID** - Parse from branch name automatically
211
- 3. **Explore before questioning** - Understand codebase to ask informed questions
212
- 4. **Challenge assumptions** - Don't accept requirements at face value
213
- 5. **Explore alternatives** - Present options and trade-offs
214
- 6. **Document decisions** - Capture why choices were made
215
- 7. **Structured output** - Use the feature spec template consistently
216
- 8. **Clear handoff** - Tell developer what to do next
295
+ 3. **Delegate exploration** - Use read-only sub-agent for codebase analysis
296
+ 4. **Explore before questioning** - Wait for sub-agent report before asking questions
297
+ 5. **Challenge assumptions** - Don't accept requirements at face value
298
+ 6. **Explore alternatives** - Present options and trade-offs
299
+ 7. **Document decisions** - Capture why choices were made
300
+ 8. **Structured output** - Use the feature spec template consistently
301
+ 9. **Clear handoff** - Tell developer what to do next
217
302
 
218
303
 
219
304
  ## Common Feature Types
@@ -236,16 +321,21 @@ Follow these steps **IN ORDER** and **STOP after step 8**:
236
321
 
237
322
  ## Example Workflow
238
323
 
239
- 1. User runs: `/plan-feature`
240
- 2. Skill asks: "Please describe the feature you want to develop"
324
+ 1. User runs: `/5:plan-feature`
325
+ 2. Main agent asks: "Please describe the feature you want to develop"
241
326
  3. User: "I want to add emergency schedule tracking to products. It should allow marking products as emergency and setting a schedule window."
242
- 4. Skill extracts: Ticket ID `PROJ-1234` from branch `PROJ-1234-add-emergency-schedule`
243
- 5. Skill explores: Checks Product model, related components, existing scheduling infrastructure
244
- 6. Skill asks 8 informed questions about requirements, scope, validation, API, etc.
245
- 7. Skill challenges: "Could we reuse existing scheduling infrastructure instead of creating new one?"
246
- 8. Skill determines: Feature name `add-emergency-schedule`
247
- 9. Skill creates: `.5/PROJ-1234-add-emergency-schedule/feature.md`
248
- 10. Skill tells user: "✅ Feature spec created at `.5/PROJ-1234-add-emergency-schedule/feature.md`
327
+ 4. Main agent extracts: Ticket ID `PROJ-1234` from branch `PROJ-1234-add-emergency-schedule`
328
+ 5. **Main agent spawns Explore sub-agent** with feature description
329
+ 6. **Sub-agent returns report:** Found Product model at src/models/Product.ts, existing ScheduleService at src/services/ScheduleService.ts, similar pattern in src/models/Promotion.ts...
330
+ 7. Main agent asks Question 1: "Should emergency schedules support recurring patterns or just one-time windows?"
331
+ 8. User answers: "One-time for now, but we have the NotificationService that should trigger alerts"
332
+ 9. **Main agent spawns targeted Re-Explore** for NotificationService (wasn't in initial report)
333
+ 10. **Sub-agent returns:** Found NotificationService at src/services/NotificationService.ts with event-based triggers...
334
+ 11. Main agent continues Q&A with better context about notifications
335
+ 12. Main agent challenges: "The sub-agent found existing ScheduleService - could we reuse it instead of creating new scheduling infrastructure?"
336
+ 13. Main agent determines: Feature name `add-emergency-schedule`
337
+ 14. Main agent creates: `.5/features/PROJ-1234-add-emergency-schedule/feature.md` using Write tool
338
+ 15. Main agent tells user: "✅ Feature spec created at `.5/features/PROJ-1234-add-emergency-schedule/feature.md`
249
339
 
250
340
  **Next steps:**
251
341
  1. Review the feature spec
@@ -1,26 +1,71 @@
1
1
  ---
2
2
  name: 5:plan-implementation
3
3
  description: Creates an implementation plan from a feature spec. Phase 2 of the 5-phase workflow.
4
- allowed-tools: Read, Glob, Grep, Task, AskUserQuestion, Write
4
+ allowed-tools: Bash, Read, Write, Task, AskUserQuestion
5
5
  context: fork
6
6
  user-invocable: true
7
7
  ---
8
8
 
9
9
  # Plan Implementation (Phase 2)
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
  Create an implementation plan that maps a feature spec to concrete components.
12
33
 
34
+ ## ⚠️ CRITICAL ARCHITECTURE
35
+
36
+ **This command uses a READ-ONLY sub-agent for codebase exploration.**
37
+
38
+ You (the main agent) orchestrate the process:
39
+ - You read ONLY `.5/{feature-name}/feature.md` using Read tool
40
+ - You spawn a read-only Explore agent to scan the codebase
41
+ - You receive findings from the sub-agent
42
+ - You ask 2-3 technical questions
43
+ - You write ONLY `.5/{feature-name}/plan.md` using Write tool
44
+
45
+ **The sub-agent CANNOT write files. It can only read and report.**
46
+
47
+ **YOU may only write to `.5/{feature-name}/plan.md` - NO other files.**
48
+
13
49
  ## Scope
14
50
 
15
51
  **This command creates the plan. It does NOT implement.**
16
52
 
17
53
  After creating the plan, tell the user to run `/5:implement-feature`.
18
54
 
55
+ ## ❌ Boundaries
56
+
57
+ - ❌ **Do NOT read source code files directly** - Use Explore sub-agent
58
+ - ❌ **Do NOT write any file except plan.md** - No source code, no other files
59
+ - ❌ **Do NOT start implementation** - That's Phase 3
60
+ - ❌ **Do NOT write complete code in the plan** - Only describe WHAT to build
61
+
19
62
  ## Process
20
63
 
21
64
  ### Step 1: Load Feature Spec
22
65
 
23
- Read `.5/{feature-name}/feature.md` (where `{feature-name}` is the argument provided).
66
+ Read `.5/features/{feature-name}/feature.md` (where `{feature-name}` is the argument provided).
67
+
68
+ **This is the ONLY file you may read directly.**
24
69
 
25
70
  Extract:
26
71
  - Ticket ID
@@ -30,14 +75,36 @@ Extract:
30
75
 
31
76
  If the file doesn't exist, tell the user to run `/5:plan-feature` first.
32
77
 
33
- ### Step 2: Quick Codebase Scan
78
+ ### Step 2: Spawn Read-Only Explore Agent for Codebase Scan
79
+
80
+ **CRITICAL: Delegate ALL codebase exploration to a sub-agent.**
34
81
 
35
- Understand the project structure:
36
- - Use Glob to find source directories
37
- - Identify where similar components live (models, services, controllers, tests)
38
- - Note naming conventions from existing files
82
+ Spawn a Task with `subagent_type=Explore` with the following prompt:
39
83
 
40
- This is a quick scan, not deep analysis. The executor agent will do detailed pattern matching.
84
+ ```
85
+ Quick codebase scan for implementation planning.
86
+
87
+ **Feature:** {one-line summary from feature.md}
88
+ **Affected Components:** {list from feature.md}
89
+
90
+ **Your Task:**
91
+ 1. Find source directories and understand project structure
92
+ 2. Identify where similar components live (models, services, controllers, tests)
93
+ 3. Note naming conventions from existing files
94
+ 4. Find example files that can serve as patterns for new components
95
+
96
+ **Report Format:**
97
+ Return a structured report with:
98
+ - Project structure (key directories)
99
+ - Naming conventions observed
100
+ - Pattern files for each component type (e.g., "services follow pattern in src/services/UserService.ts")
101
+ - Where new files should be placed
102
+
103
+ **IMPORTANT:** This is a QUICK scan, not deep analysis. Focus on structure and patterns.
104
+ **READ-ONLY:** Only use Read, Glob, and Grep tools.
105
+ ```
106
+
107
+ **Wait for the sub-agent to return its findings before proceeding.**
41
108
 
42
109
  ### Step 3: Ask 2-3 Technical Questions (ONE AT A TIME)
43
110
 
@@ -54,11 +121,34 @@ Keep it brief. Don't over-question. Don't ask feature questions already answered
54
121
 
55
122
  - **ONE question at a time** - wait for answer before next question
56
123
  - Do NOT list multiple questions in one message
57
- - Do NOT skip to creating plan.md before asking your questions
124
+ - Do NOT skip to creating plan.md before asking your questions
125
+
126
+ #### Step 3b: Optional Targeted Re-Exploration
127
+
128
+ If during Q&A the user mentions specific patterns, files, or conventions not covered in the initial scan, you MAY spawn additional targeted Explore agents.
129
+
130
+ **When to trigger:**
131
+ - User mentions a specific file as a pattern to follow
132
+ - User asks about a component not in the initial report
133
+ - Understanding a specific pattern is critical for the plan
134
+
135
+ **How to re-explore:**
136
+
137
+ ```
138
+ Targeted scan for implementation planning.
139
+
140
+ **Context:** User mentioned {specific pattern/file/convention}.
141
+
142
+ **Task:** Find and analyze {specific target} to understand the pattern.
143
+
144
+ **Report:** How this pattern works and how to apply it.
145
+
146
+ **READ-ONLY:** Only use Read, Glob, and Grep tools.
147
+ ```
58
148
 
59
149
  ### Step 4: Design Components
60
150
 
61
- Based on the feature spec and codebase scan, identify:
151
+ Based on the feature spec and sub-agent's codebase scan, identify:
62
152
  - What files need to be created
63
153
  - What files need to be modified
64
154
  - The order of implementation (dependencies)
@@ -73,7 +163,9 @@ Not every feature needs all steps. Use what makes sense.
73
163
 
74
164
  ### Step 5: Write the Plan
75
165
 
76
- Create a single file at `.5/{feature-name}/plan.md`:
166
+ Create a single file at `.5/features/{feature-name}/plan.md`:
167
+
168
+ **THIS IS THE ONLY FILE YOU MAY WRITE.**
77
169
 
78
170
  ```markdown
79
171
  ---
@@ -134,7 +226,7 @@ created: {ISO-timestamp}
134
226
 
135
227
  Tell the user:
136
228
  ```
137
- Plan created at `.5/{feature-name}/plan.md`
229
+ Plan created at `.5/features/{feature-name}/plan.md`
138
230
 
139
231
  {N} components across {M} steps.
140
232
 
@@ -143,6 +235,23 @@ Review the plan, then:
143
235
  2. Run `/5:implement-feature {feature-name}`
144
236
  ```
145
237
 
238
+ **🛑 STOP HERE. YOUR JOB IS COMPLETE. DO NOT PROCEED TO IMPLEMENTATION.**
239
+
240
+ ## Example Workflow
241
+
242
+ 1. User runs: `/5:plan-implementation PROJ-1234-add-emergency-schedule`
243
+ 2. Main agent reads: `.5/features/PROJ-1234-add-emergency-schedule/feature.md`
244
+ 3. **Main agent spawns Explore sub-agent** for codebase scan
245
+ 4. **Sub-agent returns:** Project uses src/{models,services,controllers}, services follow UserService.ts pattern...
246
+ 5. Main agent asks: "Should the schedule validation be in the service or a separate validator?"
247
+ 6. User: "In the service, like we do in OrderService"
248
+ 7. **Main agent spawns targeted Re-Explore** for OrderService pattern
249
+ 8. Main agent asks one more question about testing approach
250
+ 9. Main agent creates: `.5/features/PROJ-1234-add-emergency-schedule/plan.md`
251
+ 10. Main agent tells user the plan is ready and to run `/5:implement-feature`
252
+
253
+ **🛑 COMMAND COMPLETE.**
254
+
146
255
  ## Example Plan
147
256
 
148
257
  ```markdown
@@ -215,8 +324,9 @@ Components in the same step run in parallel. Structure your plan accordingly:
215
324
  - Don't write complete code in the plan
216
325
  - Don't spend time on "haiku-ready prompts"
217
326
  - Don't create multiple plan files (meta.md, step-N.md, etc.)
218
- - Don't over-analyze the codebase - the executor will do detailed pattern matching
327
+ - Don't read source code directly - use Explore sub-agent
219
328
  - Don't ask more than 3 questions
220
329
  - Don't create unnecessary sequential steps - group independent work together
221
330
  - **Don't skip to implementation** - This command ONLY creates the plan
222
331
  - **Don't batch questions** - Ask one question at a time
332
+ - **Don't write any file except plan.md** - No source code files
@@ -8,6 +8,27 @@ 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
+
11
32
  Fast path for small, well-understood tasks (1-5 files). Skips extensive planning phases but preserves state tracking and skill-based implementation.
12
33
 
13
34
  ## ⚠️ CRITICAL SCOPE CONSTRAINT
@@ -88,7 +109,7 @@ feature_name="${TICKET_ID}-${slug}"
88
109
 
89
110
  ### Step 5: Create Plan
90
111
 
91
- Write plan to `.5/${feature_name}/plan.md` using the template structure.
112
+ Write plan to `.5/features/${feature_name}/plan.md` using the template structure.
92
113
 
93
114
  **Template Reference:** Use the structure from `.claude/templates/workflow/QUICK-PLAN.md`
94
115
 
@@ -130,7 +151,7 @@ Use AskUserQuestion:
130
151
 
131
152
  **CRITICAL**: You MUST create the state file before starting implementation. This enables resumability if work is interrupted.
132
153
 
133
- Create state file at `.5/${feature_name}/state.json` using Write tool:
154
+ Create state file at `.5/features/${feature_name}/state.json` using Write tool:
134
155
 
135
156
  ```json
136
157
  {
@@ -283,7 +304,7 @@ Components created/modified:
283
304
  Build: Success
284
305
  Tests: {Success | Skipped}
285
306
 
286
- State: .5/${feature_name}/state.json
307
+ State: .5/features/${feature_name}/state.json
287
308
 
288
309
  Next steps:
289
310
  1. Review and commit changes
@@ -9,6 +9,27 @@ user-invocable: true
9
9
 
10
10
  # Review Code (Phase 5)
11
11
 
12
+ ## Prerequisites Check
13
+
14
+ **CRITICAL: Check for configuration before proceeding**
15
+
16
+ ```bash
17
+ if [ ! -f ".claude/.5/config.json" ]; then
18
+ echo "❌ Configuration not found"
19
+ echo ""
20
+ echo "Please run /5:configure first to set up your project."
21
+ echo ""
22
+ echo "The configure command will:"
23
+ echo " • Detect your project type and build commands"
24
+ echo " • Set up ticket tracking conventions"
25
+ echo " • Generate documentation (CLAUDE.md)"
26
+ echo " • Create project-specific skills"
27
+ exit 1
28
+ fi
29
+ ```
30
+
31
+ **If config doesn't exist, STOP IMMEDIATELY. Do not proceed with the workflow.**
32
+
12
33
  ## Overview
13
34
 
14
35
  This command automates code review using a configurable review tool. The review tool is set in `.claude/.5/config.json` (`reviewTool` field). Two tools are supported:
@@ -27,7 +48,7 @@ Both tools produce the same structured output format, so all downstream steps (p
27
48
  6. Reports results
28
49
 
29
50
  **Workflow B: File-Based Annotation** (user preference)
30
- 1. Runs review and saves findings to `.5/{feature-name}/review-{timestamp}-findings.md`
51
+ 1. Runs review and saves findings to `.5/features/{feature-name}/review-{timestamp}-findings.md`
31
52
  2. User edits the file to mark which findings to fix ([FIX], [SKIP], [MANUAL])
32
53
  3. User runs `/review-code apply` to read annotations and apply marked fixes
33
54
 
@@ -395,13 +416,13 @@ The template contains placeholders for:
395
416
  When user selects "Save to file", create a structured findings file that allows user annotation.
396
417
 
397
418
  **Determine feature name:**
398
- - Check most recent state file in `.5/*/state.json` to find current feature
419
+ - Check most recent state file in `.5/features/*/state.json` to find current feature
399
420
  - Or ask user which feature they're reviewing
400
421
  - Use feature name for organizing review files
401
422
 
402
423
  **Create directory if needed:**
403
424
  ```bash
404
- mkdir -p .5/{feature-name}
425
+ mkdir -p .5/features/{feature-name}
405
426
  ```
406
427
 
407
428
  **Generate timestamp:**
@@ -412,7 +433,7 @@ Example: 20260128-103045
412
433
 
413
434
  **File path:**
414
435
  ```
415
- .5/{feature-name}/review-{timestamp}-findings.md
436
+ .5/features/{feature-name}/review-{timestamp}-findings.md
416
437
  ```
417
438
 
418
439
  **File format:**
@@ -433,7 +454,7 @@ The template contains:
433
454
  - **Next Steps:** Instructions to edit and run `/review-code apply`
434
455
 
435
456
  **After saving file:**
436
- - Inform user: "Findings saved to .5/{feature-name}/review-{timestamp}-findings.md"
457
+ - Inform user: "Findings saved to .5/features/{feature-name}/review-{timestamp}-findings.md"
437
458
  - Provide instructions: "Edit the file to mark findings, then run: /review-code apply"
438
459
  - Skip remaining steps (don't apply fixes interactively)
439
460
 
@@ -442,13 +463,13 @@ The template contains:
442
463
  When user runs `/review-code apply`, read the most recent findings file and apply marked fixes.
443
464
 
444
465
  **Determine feature name:**
445
- - Check most recent state file in `.5/*/state.json` to find current feature
466
+ - Check most recent state file in `.5/features/*/state.json` to find current feature
446
467
  - Or ask user which feature they're reviewing
447
468
 
448
469
  **Find the most recent findings file:**
449
470
  ```bash
450
471
  # Find most recent review findings file in the feature folder
451
- ls -t .5/{feature-name}/review-*-findings.md | head -1
472
+ ls -t .5/features/{feature-name}/review-*-findings.md | head -1
452
473
  ```
453
474
 
454
475
  **If no findings file exists:**
@@ -528,7 +549,7 @@ After applying fixes from an annotated file, update the findings file with resul
528
549
 
529
550
  For interactive mode only, save the review summary to:
530
551
  ```
531
- .5/{feature-name}/review-{timestamp}.md
552
+ .5/features/{feature-name}/review-{timestamp}.md
532
553
  ```
533
554
 
534
555
  ## Error Handling
@@ -614,7 +635,7 @@ Action: Please review the suggested fix manually.
614
635
 
615
636
  ## Configuration
616
637
 
617
- **Directory:** `.5/{feature-name}/` (organized by feature)
638
+ **Directory:** `.5/features/{feature-name}/` (organized by feature)
618
639
 
619
640
  **File Types:**
620
641
  - `review-{timestamp}-findings.md` - Annotatable findings (file-based mode)
@@ -623,7 +644,7 @@ Action: Please review the suggested fix manually.
623
644
  **Timestamp Format:** Custom format `YYYYMMDD-HHmmss` (e.g., `20260128-103045`)
624
645
 
625
646
  **Feature Detection:** Review files are organized by feature. The command will:
626
- - Check most recent state file in `.5/*/state.json` to find current feature
647
+ - Check most recent state file in `.5/features/*/state.json` to find current feature
627
648
  - Or ask user which feature they're reviewing if unclear
628
649
 
629
650
  ## Related Documentation
@@ -8,6 +8,27 @@ user-invocable: true
8
8
 
9
9
  # Verify Implementation (Phase 4)
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
  Verify that an implementation is complete, correct, and meets feature requirements through multi-layer verification.
12
33
 
13
34
  ## Scope
@@ -26,11 +47,11 @@ If verification finds gaps, it generates a fix plan and offers to apply fixes au
26
47
  Read all workflow artifacts for the feature:
27
48
 
28
49
  **Required:**
29
- - `.5/{feature-name}/plan.md` — implementation plan (Phase 2)
30
- - `.5/{feature-name}/state.json` — implementation state (Phase 3)
50
+ - `.5/features/{feature-name}/plan.md` — implementation plan (Phase 2)
51
+ - `.5/features/{feature-name}/state.json` — implementation state (Phase 3)
31
52
 
32
53
  **Optional:**
33
- - `.5/{feature-name}/feature.md` — feature spec (Phase 1)
54
+ - `.5/features/{feature-name}/feature.md` — feature spec (Phase 1)
34
55
 
35
56
  **If `plan.md` or `state.json` is missing:** hard stop.
36
57
  ```
@@ -198,7 +219,7 @@ Evaluate all three layers:
198
219
 
199
220
  ### Step 6: Generate Verification Report
200
221
 
201
- Write `.5/{feature-name}/verification.md` using the template structure from `.claude/templates/workflow/VERIFICATION-REPORT.md`.
222
+ Write `.5/features/{feature-name}/verification.md` using the template structure from `.claude/templates/workflow/VERIFICATION-REPORT.md`.
202
223
 
203
224
  The report covers:
204
225
  - **Header:** ticket, feature, status, timestamp
@@ -209,7 +230,7 @@ The report covers:
209
230
 
210
231
  ### Step 7: Update State
211
232
 
212
- Update `.5/{feature-name}/state.json`:
233
+ Update `.5/features/{feature-name}/state.json`:
213
234
  ```json
214
235
  {
215
236
  "verificationStatus": "passed | partial | failed",
@@ -264,7 +285,7 @@ Continue to Step 9.
264
285
 
265
286
  ### Step 9: Generate Fix Plan (PARTIAL or FAILED only)
266
287
 
267
- Write `.5/{feature-name}/fix-plan.md` using the template structure from `.claude/templates/workflow/FIX-PLAN.md`.
288
+ Write `.5/features/{feature-name}/fix-plan.md` using the template structure from `.claude/templates/workflow/FIX-PLAN.md`.
268
289
 
269
290
  Build fix entries from verification results:
270
291
 
@@ -62,7 +62,7 @@ It handles three distinct tasks, invoked with different parameters per component
62
62
  ```
63
63
 
64
64
  **Process:**
65
- 1. Read all values from the feature spec (`.5/CONFIGURE/feature.md`)
65
+ 1. Read all values from the feature spec (`.5/features/CONFIGURE/feature.md`)
66
66
  2. Ensure `.claude/.5/` directory exists (create with `mkdir -p` if needed)
67
67
  3. Write `config.json` with pretty-printed JSON
68
68
  4. Read back to verify correctness