5-phase-workflow 1.2.1 → 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 +25 -11
- package/bin/install.js +26 -5
- package/docs/workflow-guide.md +56 -15
- package/package.json +1 -1
- package/src/commands/5/configure.md +259 -21
- package/src/commands/5/discuss-feature.md +5 -5
- package/src/commands/5/implement-feature.md +23 -2
- package/src/commands/5/plan-feature.md +129 -39
- package/src/commands/5/plan-implementation.md +123 -13
- package/src/commands/5/quick-implement.md +24 -3
- package/src/commands/5/review-code.md +31 -10
- package/src/commands/5/verify-implementation.md +27 -6
- package/src/skills/configure-project/SKILL.md +210 -51
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
|
-
-
|
|
39
|
-
-
|
|
37
|
+
- Set up hooks and settings
|
|
38
|
+
- Create `.5/features/` directory for feature tracking
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
**After installation, you must configure your project:**
|
|
42
41
|
|
|
43
|
-
|
|
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
|
-
|
|
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}
|
|
182
|
-
- `
|
|
183
|
-
- `
|
|
184
|
-
- `
|
|
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);
|
package/docs/workflow-guide.md
CHANGED
|
@@ -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
|
@@ -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
|
|
|
@@ -149,12 +153,150 @@ fi
|
|
|
149
153
|
**1f. Scan existing skills:**
|
|
150
154
|
- Check `.claude/skills/` for existing project-specific skills
|
|
151
155
|
|
|
156
|
+
**1g. Detect codebase patterns** for potential skills:
|
|
157
|
+
|
|
158
|
+
Use Glob to count files matching common architectural patterns:
|
|
159
|
+
|
|
160
|
+
| Pattern | Glob Patterns | Typical Location |
|
|
161
|
+
|---------|-------------------------------------------------------------------------------|------------------|
|
|
162
|
+
| **Core Architecture** | | |
|
|
163
|
+
| Controllers | `**/*Controller.{ts,js,java,py,rb}`, `**/controllers/**` | src/controllers/ |
|
|
164
|
+
| Services | `**/*Service.{ts,js,java,py,rb}`, `**/services/**` | src/services/ |
|
|
165
|
+
| Repositories | `**/*Repository.{ts,js,java,py}`, `**/repositories/**` | src/repositories/ |
|
|
166
|
+
| Models/Entities | `**/*Model.{ts,js}`, `**/*Entity.java`, `**/models/**` | src/models/ |
|
|
167
|
+
| Handlers | `**/*Handler.{ts,js,java,go}`, `**/handlers/**` | src/handlers/ |
|
|
168
|
+
| **Data Transfer** | | |
|
|
169
|
+
| DTOs | `**/*Dto.{ts,js,java}`, `**/*DTO.{ts,js,java}`, `**/dto/**` | src/dto/ |
|
|
170
|
+
| Requests | `**/*Request.{ts,js,java}`, `**/requests/**` | src/requests/ |
|
|
171
|
+
| Responses | `**/*Response.{ts,js,java}`, `**/responses/**` | src/responses/ |
|
|
172
|
+
| Mappers | `**/*Mapper.{ts,js,java}`, `**/mappers/**` | src/mappers/ |
|
|
173
|
+
| Validators | `**/*Validator.{ts,js,java}`, `**/validators/**` | src/validators/ |
|
|
174
|
+
| Schemas | `**/*Schema.{ts,js}`, `**/schemas/**` | src/schemas/ |
|
|
175
|
+
| **Frontend (React/Vue)** | | |
|
|
176
|
+
| Components | `**/components/**/*.{tsx,jsx,vue}` | src/components/ |
|
|
177
|
+
| Hooks | `**/hooks/**/*.{ts,js}`, `**/use*.{ts,js}` | src/hooks/ |
|
|
178
|
+
| Contexts | `**/contexts/**/*.{tsx,jsx}`, `**/*Context.{tsx,jsx}` | src/contexts/ |
|
|
179
|
+
| Stores | `**/stores/**/*.{ts,js}`, `**/*Store.{ts,js}` | src/stores/ |
|
|
180
|
+
| Pages | `**/pages/**/*.{tsx,jsx}`, `**/app/**/page.{tsx,jsx}` | pages/, app/ |
|
|
181
|
+
| Layouts | `**/layouts/**/*.{tsx,jsx,vue}`, `**/*Layout.{tsx,jsx}` | src/layouts/ |
|
|
182
|
+
| **API/Routes** | | |
|
|
183
|
+
| API Routes | `**/api/**/*.{ts,js}`, `**/routes/**` | src/api/, pages/api/ |
|
|
184
|
+
| Middleware | `**/*Middleware.{ts,js,java}`, `**/middleware/**` | src/middleware/ |
|
|
185
|
+
| Guards | `**/*.guard.{ts,js}`, `**/guards/**` | src/guards/ |
|
|
186
|
+
| Interceptors | `**/*.interceptor.{ts,js}`, `**/interceptors/**` | src/interceptors/ |
|
|
187
|
+
| Filters | `**/*.filter.{ts,js}`, `**/*Filter.java` | src/filters/ |
|
|
188
|
+
| **Testing** | | |
|
|
189
|
+
| Tests | `**/*.test.{ts,js,tsx,jsx}`, `**/*.spec.{ts,js,tsx,jsx}`, `**/tests/**` | src/, tests/ |
|
|
190
|
+
| Specs | `**/*_spec.rb`, `**/spec/**/*.rb`, `**/*_test.go`, `**/test_*.py` | spec/, tests/ |
|
|
191
|
+
| Test Fixtures | `**/fixtures/**`,`**/testFixtures/**`, `**/__fixtures__/**`, `**/testdata/**` | fixtures/, testdata/ |
|
|
192
|
+
| Factories | `**/*Factory.{ts,js,java,rb}`, `**/factories/**` | factories/ |
|
|
193
|
+
| Mocks | `**/__mocks__/**`, `**/mocks/**`, `**/*Mock.{ts,js}` | __mocks__/, mocks/ |
|
|
194
|
+
| **Utilities** | | |
|
|
195
|
+
| Utils | `**/utils/**/*.{ts,js,java,py}`, `**/*Utils.{ts,js,java}` | src/utils/ |
|
|
196
|
+
| Helpers | `**/helpers/**/*.{ts,js,java,py,rb}`, `**/*Helper.{ts,js,java}` | src/helpers/ |
|
|
197
|
+
| Constants | `**/constants/**/*.{ts,js}`, `**/*Constants.{ts,js}` | src/constants/ |
|
|
198
|
+
| Types/Interfaces | `**/types/**/*.{ts,js}`, `**/interfaces/**/*.{ts,java}` | src/types/ |
|
|
199
|
+
| Config | `**/config/**/*.{ts,js,py}`, `**/*Config.{ts,js}` | src/config/ |
|
|
200
|
+
| **Framework-Specific** | | |
|
|
201
|
+
| Modules (NestJS/Angular) | `**/*.module.{ts,js}` | src/modules/ |
|
|
202
|
+
| Pipes (NestJS) | `**/*.pipe.{ts,js}`, `**/pipes/**` | src/pipes/ |
|
|
203
|
+
| Decorators | `**/decorators/**/*.{ts,js}`, `**/*.decorator.{ts,js}` | src/decorators/ |
|
|
204
|
+
| Blueprints (Flask) | `**/blueprints/**/*.py` | blueprints/ |
|
|
205
|
+
| Views (Django) | `**/views.py`, `**/views/**/*.py` | app/views/ |
|
|
206
|
+
| Serializers (Django) | `**/serializers.py`, `**/serializers/**/*.py` | app/serializers/ |
|
|
207
|
+
| **Background/Async** | | |
|
|
208
|
+
| Jobs | `**/jobs/**/*.{ts,js,rb}`, `**/*Job.{ts,js,rb}` | src/jobs/ |
|
|
209
|
+
| Workers | `**/workers/**/*.{ts,js}`, `**/*Worker.{ts,js}` | src/workers/ |
|
|
210
|
+
| Events | `**/events/**/*.{ts,js,java}`, `**/*Event.{ts,js,java}` | src/events/ |
|
|
211
|
+
| Listeners | `**/listeners/**/*.{ts,js,java}`, `**/*Listener.{ts,js}` | src/listeners/ |
|
|
212
|
+
| Commands (CLI) | `**/commands/**/*.{ts,js,java}`, `**/*Command.{ts,js}` | src/commands/ |
|
|
213
|
+
| **Database** | | |
|
|
214
|
+
| Migrations | `**/migrations/**/*.{ts,js,sql,rb,py}` | migrations/ |
|
|
215
|
+
| Seeds | `**/seeds/**/*.{ts,js,rb}`, `**/seeders/**` | seeds/ |
|
|
216
|
+
| **Error Handling** | | |
|
|
217
|
+
| Exceptions | `**/exceptions/**/*.{ts,js,java}`, `**/*Exception.{ts,js,java}` | src/exceptions/ |
|
|
218
|
+
| Errors | `**/errors/**/*.{ts,js}`, `**/*Error.{ts,js}` | src/errors/ |
|
|
219
|
+
|
|
220
|
+
For each pattern found:
|
|
221
|
+
- Count matching files
|
|
222
|
+
- Identify primary location (most common directory)
|
|
223
|
+
- Sample 1 file name to show convention
|
|
224
|
+
|
|
225
|
+
**1h. Detect runnable commands** for potential command skills:
|
|
226
|
+
|
|
227
|
+
Scan project configuration files for commands that can become skills:
|
|
228
|
+
|
|
229
|
+
| Source | How to Detect | Example Commands |
|
|
230
|
+
|--------|---------------|------------------|
|
|
231
|
+
| package.json | Read `scripts` object | build, test, lint, format, dev, start, typecheck |
|
|
232
|
+
| Makefile | Grep for targets (lines ending with `:`) | build, test, lint, clean, docker-build |
|
|
233
|
+
| pyproject.toml | Read `[tool.poetry.scripts]` or `[project.scripts]` | test, lint, format, typecheck |
|
|
234
|
+
| Cargo.toml | Check for `[[bin]]` sections, common cargo commands | build, test, clippy, fmt |
|
|
235
|
+
| build.gradle | Grep for `task` definitions | build, test, lint, spotlessApply |
|
|
236
|
+
| composer.json | Read `scripts` object | test, lint, format, analyse |
|
|
237
|
+
| Rakefile | Grep for `task :name` patterns | test, lint, db:migrate, db:seed |
|
|
238
|
+
|
|
239
|
+
**Common command categories to detect:**
|
|
240
|
+
|
|
241
|
+
| Category | Common Names | Skill Name |
|
|
242
|
+
|----------|--------------|------------|
|
|
243
|
+
| **Build** | build, compile, bundle, pack | run-build |
|
|
244
|
+
| **Test** | test, test:unit, test:integration, test:e2e, spec | run-tests |
|
|
245
|
+
| **Lint** | lint, eslint, pylint, rubocop, clippy | run-lint |
|
|
246
|
+
| **Format** | format, prettier, fmt, black, gofmt | run-format |
|
|
247
|
+
| **Type Check** | typecheck, tsc, mypy, type-check | run-typecheck |
|
|
248
|
+
| **Dev Server** | dev, start, serve, watch | run-dev |
|
|
249
|
+
| **Database** | db:migrate, migrate, db:seed, seed, db:reset | run-db-migrate, run-db-seed |
|
|
250
|
+
| **Docker** | docker:build, docker:up, docker:down, compose | run-docker |
|
|
251
|
+
| **Deploy** | deploy, release, publish | run-deploy |
|
|
252
|
+
| **Clean** | clean, reset, purge | run-clean |
|
|
253
|
+
| **Generate** | generate, codegen, gen | run-generate |
|
|
254
|
+
|
|
255
|
+
For each command found:
|
|
256
|
+
- Record the exact command syntax
|
|
257
|
+
- Identify any required environment or flags
|
|
258
|
+
- Note if it has watch/CI variants
|
|
259
|
+
|
|
260
|
+
Store results internally as:
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"detectedPatterns": {
|
|
264
|
+
"controller": { "count": 12, "location": "src/controllers/", "example": "UserController.ts" },
|
|
265
|
+
"service": { "count": 8, "location": "src/services/", "example": "AuthService.ts" },
|
|
266
|
+
"component": { "count": 25, "location": "src/components/", "example": "Button.tsx" }
|
|
267
|
+
},
|
|
268
|
+
"detectedCommands": {
|
|
269
|
+
"build": { "source": "package.json", "command": "npm run build", "variants": ["build:prod", "build:dev"] },
|
|
270
|
+
"test": { "source": "package.json", "command": "npm test", "variants": ["test:unit", "test:e2e"] },
|
|
271
|
+
"lint": { "source": "package.json", "command": "npm run lint", "variants": ["lint:fix"] },
|
|
272
|
+
"format": { "source": "package.json", "command": "npm run format", "variants": [] }
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Only include patterns/commands that are actually detected.
|
|
278
|
+
|
|
152
279
|
### Step 2: Gather User Preferences (interactive via AskUserQuestion)
|
|
153
280
|
|
|
154
281
|
**2a. If config exists:**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
-
|
|
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."
|
|
158
300
|
|
|
159
301
|
**2b. Confirm project type:**
|
|
160
302
|
- "Detected project type: {detected-type}. Is this correct?"
|
|
@@ -201,10 +343,46 @@ fi
|
|
|
201
343
|
- "Generate/update CLAUDE.md? This will analyze your codebase to document structure and conventions."
|
|
202
344
|
- Options: "Yes (recommended)", "Skip"
|
|
203
345
|
|
|
204
|
-
**2h.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
346
|
+
**2h. Review detected patterns for skill generation:**
|
|
347
|
+
|
|
348
|
+
Present ONLY patterns that were actually detected in steps 1g and 1h.
|
|
349
|
+
|
|
350
|
+
**Part 1: Architectural patterns (create-* skills)**
|
|
351
|
+
|
|
352
|
+
"I analyzed your codebase and found these architectural patterns:
|
|
353
|
+
|
|
354
|
+
| Pattern | Files Found | Location | Example |
|
|
355
|
+
|---------|-------------|----------|---------|
|
|
356
|
+
| Controller | 12 files | src/controllers/ | UserController.ts |
|
|
357
|
+
| Service | 8 files | src/services/ | AuthService.ts |
|
|
358
|
+
| Component | 25 files | src/components/ | Button.tsx |
|
|
359
|
+
|
|
360
|
+
Which patterns would you like `create-*` skills generated for?"
|
|
361
|
+
|
|
362
|
+
- Options: Multi-select checkboxes for each detected pattern (use AskUserQuestion with multiSelect: true)
|
|
363
|
+
- Include descriptions like: "Controller (12 files) - Generate `create-controller` skill"
|
|
364
|
+
- Plus "Other" option for patterns not detected but desired
|
|
365
|
+
|
|
366
|
+
**Part 2: Command skills (run-* skills)**
|
|
367
|
+
|
|
368
|
+
"I also found these runnable commands:
|
|
369
|
+
|
|
370
|
+
| Command | Source | Full Command | Variants |
|
|
371
|
+
|---------|--------|--------------|----------|
|
|
372
|
+
| build | package.json | npm run build | build:prod, build:dev |
|
|
373
|
+
| test | package.json | npm test | test:unit, test:e2e |
|
|
374
|
+
| lint | package.json | npm run lint | lint:fix |
|
|
375
|
+
| format | Makefile | make format | - |
|
|
376
|
+
|
|
377
|
+
Which commands would you like `run-*` skills generated for?"
|
|
378
|
+
|
|
379
|
+
- Options: Multi-select checkboxes for each detected command
|
|
380
|
+
- Include descriptions like: "test - Generate `run-tests` skill"
|
|
381
|
+
- Plus "Other" option for commands not detected
|
|
382
|
+
|
|
383
|
+
If no patterns/commands detected:
|
|
384
|
+
- Inform user: "No common patterns detected. Would you like to specify patterns manually?"
|
|
385
|
+
- Allow manual entry of pattern names/locations or command names
|
|
208
386
|
|
|
209
387
|
### Step 3: Create Feature Spec
|
|
210
388
|
|
|
@@ -260,18 +438,59 @@ Analyze the codebase and generate modular documentation:
|
|
|
260
438
|
- If CLAUDE.md already exists, preserve user-written custom sections
|
|
261
439
|
|
|
262
440
|
### Requirement 3: Generate Project-Specific Skills
|
|
263
|
-
Generate the following skills in `.claude/skills/`:
|
|
264
|
-
{List of confirmed skills, e.g.:}
|
|
265
|
-
- create-component: Creates a React component following project conventions
|
|
266
|
-
- create-hook: Creates a custom React hook following project conventions
|
|
267
|
-
- create-context: Creates a React context provider following project conventions
|
|
268
441
|
|
|
269
|
-
|
|
442
|
+
#### 3a. Create-* Skills (Architectural Patterns)
|
|
443
|
+
|
|
444
|
+
Generate skills based on detected file patterns:
|
|
445
|
+
|
|
446
|
+
| Pattern | Files | Location | Skill Name | Generate |
|
|
447
|
+
|---------|-------|----------|------------|----------|
|
|
448
|
+
| Controller | {count} | {location} | create-controller | ✓ |
|
|
449
|
+
| Service | {count} | {location} | create-service | ✓ |
|
|
450
|
+
| Component | {count} | {location} | create-component | ✓ |
|
|
451
|
+
| {pattern} | {count} | {location} | create-{pattern} | ✗ (user skipped) |
|
|
452
|
+
|
|
453
|
+
{Include only patterns where user selected "Generate = ✓"}
|
|
454
|
+
|
|
455
|
+
For each selected pattern skill:
|
|
456
|
+
1. Analyze 2-3 existing files from the pattern location
|
|
457
|
+
2. Extract naming conventions, file structure, imports
|
|
458
|
+
3. Generate SKILL.md with project-specific template
|
|
459
|
+
|
|
460
|
+
Each create-* skill should:
|
|
270
461
|
- Follow standard SKILL.md frontmatter pattern
|
|
462
|
+
- Set `user-invocable: true` so users can invoke directly (e.g., `/create-controller UserController`)
|
|
463
|
+
- Set `model: haiku` for fast, cheap pattern-following
|
|
271
464
|
- Derive patterns from existing code in the project
|
|
272
465
|
- Include file naming and location conventions
|
|
273
466
|
- Include template/pattern based on existing examples
|
|
274
467
|
|
|
468
|
+
#### 3b. Run-* Skills (Command Skills)
|
|
469
|
+
|
|
470
|
+
Generate skills based on detected commands:
|
|
471
|
+
|
|
472
|
+
| Command | Source | Full Command | Skill Name | Generate |
|
|
473
|
+
|---------|--------|--------------|------------|----------|
|
|
474
|
+
| build | {source} | {command} | run-build | ✓ |
|
|
475
|
+
| test | {source} | {command} | run-tests | ✓ |
|
|
476
|
+
| lint | {source} | {command} | run-lint | ✓ |
|
|
477
|
+
| {command} | {source} | {full-command} | run-{command} | ✗ (user skipped) |
|
|
478
|
+
|
|
479
|
+
{Include only commands where user selected "Generate = ✓"}
|
|
480
|
+
|
|
481
|
+
For each selected command skill:
|
|
482
|
+
1. Document the exact command and any variants
|
|
483
|
+
2. Include common flags and options
|
|
484
|
+
3. Document expected output and error handling
|
|
485
|
+
|
|
486
|
+
Each run-* skill should:
|
|
487
|
+
- Follow standard SKILL.md frontmatter pattern
|
|
488
|
+
- Set `user-invocable: true` so users can invoke directly (e.g., `/run-tests`, `/run-lint`)
|
|
489
|
+
- Set `model: haiku` for simple command execution
|
|
490
|
+
- Include the exact command syntax
|
|
491
|
+
- Document any environment requirements
|
|
492
|
+
- Include common options/flags
|
|
493
|
+
|
|
275
494
|
## Acceptance Criteria
|
|
276
495
|
- [ ] `.claude/.5/config.json` exists with correct values (no `steps` array)
|
|
277
496
|
- [ ] `.5/` directory created
|
|
@@ -291,13 +510,13 @@ Each skill should:
|
|
|
291
510
|
- [ ] If CLAUDE.md existed before, user-written sections are preserved
|
|
292
511
|
```
|
|
293
512
|
|
|
294
|
-
**Important:** Use `mkdir -p .5/CONFIGURE` before writing the feature spec.
|
|
513
|
+
**Important:** Use `mkdir -p .5/features/CONFIGURE` before writing the feature spec.
|
|
295
514
|
|
|
296
515
|
### Step 4: Guide User to Next Phase
|
|
297
516
|
|
|
298
517
|
Tell the user:
|
|
299
518
|
|
|
300
|
-
1. "Configuration feature planned at `.5/CONFIGURE/feature.md`"
|
|
519
|
+
1. "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
|
|
301
520
|
2. "Next steps:"
|
|
302
521
|
- "Run `/clear` to reset context"
|
|
303
522
|
- "Then run `/5:plan-implementation CONFIGURE`"
|
|
@@ -339,11 +558,30 @@ User: "Yes"
|
|
|
339
558
|
Claude: "Generate CLAUDE.md with codebase analysis?"
|
|
340
559
|
User: "Yes"
|
|
341
560
|
|
|
342
|
-
Claude: "
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
561
|
+
Claude: "I analyzed your codebase and found these patterns:
|
|
562
|
+
| Pattern | Files | Location | Example |
|
|
563
|
+
|---------|-------|----------|---------|
|
|
564
|
+
| Component | 25 files | src/components/ | Button.tsx |
|
|
565
|
+
| Hook | 8 files | src/hooks/ | useAuth.ts |
|
|
566
|
+
| API Route | 12 files | pages/api/ | users.ts |
|
|
567
|
+
| Page | 15 files | pages/ | index.tsx |
|
|
568
|
+
|
|
569
|
+
Which patterns would you like `create-*` skills generated for?"
|
|
570
|
+
User: [Selects Component, Hook, API Route]
|
|
571
|
+
|
|
572
|
+
Claude: "I also found these runnable commands:
|
|
573
|
+
| Command | Source | Full Command |
|
|
574
|
+
|---------|--------|--------------|
|
|
575
|
+
| build | package.json | npm run build |
|
|
576
|
+
| test | package.json | npm test |
|
|
577
|
+
| lint | package.json | npm run lint |
|
|
578
|
+
| typecheck | package.json | npm run typecheck |
|
|
579
|
+
|
|
580
|
+
Which commands would you like `run-*` skills generated for?"
|
|
581
|
+
User: [Selects test, lint]
|
|
582
|
+
|
|
583
|
+
Claude: [Writes .5/features/CONFIGURE/feature.md]
|
|
584
|
+
Claude: "Configuration feature planned at `.5/features/CONFIGURE/feature.md`"
|
|
347
585
|
Claude: "Next: Run `/clear` followed by `/5:plan-implementation CONFIGURE`"
|
|
348
586
|
```
|
|
349
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}
|
|
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
|