5-phase-workflow 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.js +81 -188
- package/package.json +1 -1
- package/src/commands/5/configure.md +122 -326
- package/src/commands/5/discuss-feature.md +7 -172
- package/src/commands/5/implement-feature.md +33 -151
- package/src/commands/5/plan-feature.md +2 -8
- package/src/commands/5/plan-implementation.md +0 -10
- package/src/commands/5/quick-implement.md +34 -141
- package/src/commands/5/review-code.md +2 -12
- package/src/commands/5/update.md +17 -0
- package/src/commands/5/verify-implementation.md +32 -199
- package/src/hooks/check-updates.js +11 -13
- package/src/hooks/config-guard.js +30 -0
- package/src/hooks/plan-guard.js +52 -28
- package/src/hooks/statusline.js +29 -3
- package/src/settings.json +11 -1
- package/src/skills/build-project/SKILL.md +4 -130
- package/src/skills/configure-project/SKILL.md +26 -215
- package/src/skills/run-tests/SKILL.md +5 -208
- package/src/templates/workflow/QUICK-PLAN.md +0 -17
package/src/hooks/plan-guard.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// Plan Guard - PreToolUse Hook
|
|
4
4
|
// Prevents LLM breakout from planning phases by blocking:
|
|
5
5
|
// - Task agents other than Explore (when not in implementation mode)
|
|
6
|
-
// - Write operations outside .5/ (when not in implementation mode)
|
|
6
|
+
// - Write/Edit operations outside .5/ (when not in implementation mode)
|
|
7
7
|
//
|
|
8
|
-
// Planning mode is detected by
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// Planning mode is detected per-feature by checking if that specific feature's
|
|
9
|
+
// state.json exists. Only the feature in implementation mode gets unrestricted
|
|
10
|
+
// tool access. Other features remain in planning mode.
|
|
11
11
|
|
|
12
12
|
const fs = require('fs');
|
|
13
13
|
const path = require('path');
|
|
@@ -20,17 +20,18 @@ process.stdin.on('end', () => {
|
|
|
20
20
|
const data = JSON.parse(input);
|
|
21
21
|
const toolName = data.tool_name || '';
|
|
22
22
|
|
|
23
|
-
// Short-circuit: only check Task and
|
|
24
|
-
if (toolName !== 'Task' && toolName !== 'Write') {
|
|
23
|
+
// Short-circuit: only check Task, Write, and Edit tools
|
|
24
|
+
if (toolName !== 'Task' && toolName !== 'Write' && toolName !== 'Edit') {
|
|
25
25
|
process.exit(0);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const workspaceDir = data.cwd || data.workspace?.current_dir || process.cwd();
|
|
29
29
|
const toolInput = data.tool_input || {};
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
// Determine which feature is being targeted and check its state
|
|
32
|
+
const targetFeature = getTargetFeature(toolName, toolInput, workspaceDir);
|
|
33
|
+
if (targetFeature && isFeatureInImplementationMode(workspaceDir, targetFeature)) {
|
|
34
|
+
process.exit(0); // Tools allowed for features in implementation mode
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
// Planning mode enforcement
|
|
@@ -46,14 +47,14 @@ process.stdin.on('end', () => {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
if (toolName === 'Write') {
|
|
50
|
+
if (toolName === 'Write' || toolName === 'Edit') {
|
|
50
51
|
const filePath = toolInput.file_path || '';
|
|
51
52
|
if (filePath && !isInsideDotFive(filePath, workspaceDir)) {
|
|
52
53
|
process.stderr.write(
|
|
53
|
-
`BLOCKED:
|
|
54
|
+
`BLOCKED: ${toolName} outside .5/ is not allowed during planning phases. ` +
|
|
54
55
|
`Attempted: "${filePath}". ` +
|
|
55
56
|
`Planning commands may only write to .5/features/. ` +
|
|
56
|
-
`To
|
|
57
|
+
`To modify source files, start implementation with /5:implement-feature.`
|
|
57
58
|
);
|
|
58
59
|
process.exit(2);
|
|
59
60
|
}
|
|
@@ -76,28 +77,51 @@ function isInsideDotFive(filePath, workspaceDir) {
|
|
|
76
77
|
resolved === claudeDotFiveDir;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
function
|
|
80
|
-
//
|
|
81
|
-
// state.json is created in Phase 3 (implement-feature) and persists
|
|
82
|
-
// through Phase 4 (verify) and Phase 5 (review) with status "completed".
|
|
80
|
+
function getTargetFeature(toolName, toolInput, workspaceDir) {
|
|
81
|
+
// Extract the feature name from the tool input context
|
|
83
82
|
const featuresDir = path.join(workspaceDir, '.claude', '.5', 'features');
|
|
84
83
|
|
|
85
|
-
if (
|
|
86
|
-
|
|
84
|
+
if (toolName === 'Write' || toolName === 'Edit') {
|
|
85
|
+
// Check if the file path is inside a feature directory
|
|
86
|
+
const filePath = toolInput.file_path || '';
|
|
87
|
+
const resolved = path.resolve(workspaceDir, filePath);
|
|
88
|
+
if (resolved.startsWith(featuresDir + path.sep)) {
|
|
89
|
+
// Extract feature name: .claude/.5/features/{feature-name}/...
|
|
90
|
+
const relative = resolved.slice(featuresDir.length + 1);
|
|
91
|
+
const featureName = relative.split(path.sep)[0];
|
|
92
|
+
if (featureName) return featureName;
|
|
93
|
+
}
|
|
87
94
|
}
|
|
88
95
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
if (toolName === 'Task') {
|
|
97
|
+
// Check the task prompt for feature name references
|
|
98
|
+
const prompt = toolInput.prompt || '';
|
|
99
|
+
const desc = toolInput.description || '';
|
|
100
|
+
const combined = prompt + ' ' + desc;
|
|
101
|
+
|
|
102
|
+
// Try to match a feature directory that exists
|
|
103
|
+
try {
|
|
104
|
+
if (fs.existsSync(featuresDir)) {
|
|
105
|
+
const features = fs.readdirSync(featuresDir, { withFileTypes: true });
|
|
106
|
+
for (const entry of features) {
|
|
107
|
+
if (!entry.isDirectory()) continue;
|
|
108
|
+
if (combined.includes(entry.name)) {
|
|
109
|
+
return entry.name;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
96
112
|
}
|
|
113
|
+
} catch (e) {
|
|
114
|
+
// Ignore read errors
|
|
97
115
|
}
|
|
98
|
-
} catch (e) {
|
|
99
|
-
// Can't read features dir - assume planning mode (safe default)
|
|
100
116
|
}
|
|
101
117
|
|
|
102
|
-
return
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function isFeatureInImplementationMode(workspaceDir, featureName) {
|
|
122
|
+
// Check if this specific feature has a state.json (created in Phase 3)
|
|
123
|
+
const stateFile = path.join(
|
|
124
|
+
workspaceDir, '.claude', '.5', 'features', featureName, 'state.json'
|
|
125
|
+
);
|
|
126
|
+
return fs.existsSync(stateFile);
|
|
103
127
|
}
|
package/src/hooks/statusline.js
CHANGED
|
@@ -43,11 +43,37 @@ process.stdin.on('end', () => {
|
|
|
43
43
|
// Shorten directory path for display
|
|
44
44
|
const shortDir = dir.replace(os.homedir(), '~');
|
|
45
45
|
|
|
46
|
-
//
|
|
47
|
-
|
|
46
|
+
// Check for available update
|
|
47
|
+
let updateIndicator = '';
|
|
48
|
+
try {
|
|
49
|
+
const versionFile = path.join(dir, '.claude', '.5', 'version.json');
|
|
50
|
+
const versionData = JSON.parse(fs.readFileSync(versionFile, 'utf8'));
|
|
51
|
+
const latest = versionData.latestAvailableVersion;
|
|
52
|
+
const installed = versionData.installedVersion;
|
|
53
|
+
if (latest && installed && compareVersions(installed, latest) < 0) {
|
|
54
|
+
updateIndicator = ` | \x1b[33m↑${latest} → /5:update\x1b[0m`;
|
|
55
|
+
}
|
|
56
|
+
} catch (e) {
|
|
57
|
+
// No version file or parse error — no indicator
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Build and output statusline: model | directory | context | update
|
|
61
|
+
const statusline = `\x1b[36m${model}\x1b[0m | \x1b[90m${shortDir}\x1b[0m${ctx}${updateIndicator}`;
|
|
48
62
|
process.stdout.write(statusline);
|
|
49
63
|
|
|
50
64
|
} catch (e) {
|
|
51
65
|
// Silent fail - don't break statusline on parse errors
|
|
52
66
|
}
|
|
53
|
-
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Compare semver versions: returns -1 if v1 < v2, 0 if equal, 1 if v1 > v2
|
|
70
|
+
// Uses parseInt to handle pre-release tags (e.g., "2-beta" → 2)
|
|
71
|
+
function compareVersions(v1, v2) {
|
|
72
|
+
const parts1 = v1.split('.').map(p => parseInt(p, 10) || 0);
|
|
73
|
+
const parts2 = v2.split('.').map(p => parseInt(p, 10) || 0);
|
|
74
|
+
for (let i = 0; i < 3; i++) {
|
|
75
|
+
if (parts1[i] > parts2[i]) return 1;
|
|
76
|
+
if (parts1[i] < parts2[i]) return -1;
|
|
77
|
+
}
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
package/src/settings.json
CHANGED
|
@@ -18,7 +18,17 @@
|
|
|
18
18
|
],
|
|
19
19
|
"PreToolUse": [
|
|
20
20
|
{
|
|
21
|
-
"matcher": "",
|
|
21
|
+
"matcher": "Task",
|
|
22
|
+
"hooks": [
|
|
23
|
+
{
|
|
24
|
+
"type": "command",
|
|
25
|
+
"command": "node .claude/hooks/config-guard.js",
|
|
26
|
+
"timeout": 5
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"matcher": "Task|Write|Edit",
|
|
22
32
|
"hooks": [
|
|
23
33
|
{
|
|
24
34
|
"type": "command",
|
|
@@ -62,46 +62,7 @@ If commands are specified, use them. Otherwise, auto-detect.
|
|
|
62
62
|
|
|
63
63
|
### 2. Detect Build System
|
|
64
64
|
|
|
65
|
-
If no config,
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
# Check for package.json
|
|
69
|
-
if [ -f "package.json" ]; then
|
|
70
|
-
# Check for lock files to determine package manager
|
|
71
|
-
if [ -f "pnpm-lock.yaml" ]; then
|
|
72
|
-
BUILD_TOOL="pnpm"
|
|
73
|
-
elif [ -f "yarn.lock" ]; then
|
|
74
|
-
BUILD_TOOL="yarn"
|
|
75
|
-
else
|
|
76
|
-
BUILD_TOOL="npm"
|
|
77
|
-
fi
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
# Check for Gradle
|
|
81
|
-
if [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
|
|
82
|
-
BUILD_TOOL="gradle"
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
# Check for Maven
|
|
86
|
-
if [ -f "pom.xml" ]; then
|
|
87
|
-
BUILD_TOOL="mvn"
|
|
88
|
-
fi
|
|
89
|
-
|
|
90
|
-
# Check for Cargo
|
|
91
|
-
if [ -f "Cargo.toml" ]; then
|
|
92
|
-
BUILD_TOOL="cargo"
|
|
93
|
-
fi
|
|
94
|
-
|
|
95
|
-
# Check for Go
|
|
96
|
-
if [ -f "go.mod" ]; then
|
|
97
|
-
BUILD_TOOL="go"
|
|
98
|
-
fi
|
|
99
|
-
|
|
100
|
-
# Check for Make
|
|
101
|
-
if [ -f "Makefile" ]; then
|
|
102
|
-
BUILD_TOOL="make"
|
|
103
|
-
fi
|
|
104
|
-
```
|
|
65
|
+
If no config, detect by checking project files: `package.json` + lock files (npm/yarn/pnpm), `build.gradle` (gradle), `pom.xml` (mvn), `Cargo.toml` (cargo), `go.mod` (go), `Makefile` (make).
|
|
105
66
|
|
|
106
67
|
### 3. Determine Build Command
|
|
107
68
|
|
|
@@ -133,45 +94,7 @@ Execute the command and capture output.
|
|
|
133
94
|
|
|
134
95
|
### 5. Parse Build Output
|
|
135
96
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#### Success Indicators
|
|
139
|
-
|
|
140
|
-
Tool-specific success patterns:
|
|
141
|
-
- npm/yarn/pnpm: No error messages, process exits with 0
|
|
142
|
-
- Gradle: `BUILD SUCCESSFUL`
|
|
143
|
-
- Maven: `BUILD SUCCESS`
|
|
144
|
-
- Cargo: `Finished` or `Compiling`
|
|
145
|
-
- Go: No error output
|
|
146
|
-
- Make: No error messages
|
|
147
|
-
|
|
148
|
-
#### Error Types
|
|
149
|
-
|
|
150
|
-
**Compilation Errors**:
|
|
151
|
-
```
|
|
152
|
-
/path/to/file.ext:42: error: ...
|
|
153
|
-
```
|
|
154
|
-
Extract: file path, line number, error message
|
|
155
|
-
|
|
156
|
-
**Dependency Issues**:
|
|
157
|
-
```
|
|
158
|
-
Could not resolve dependencies
|
|
159
|
-
Module not found
|
|
160
|
-
```
|
|
161
|
-
Suggest: `npm install`, `./gradlew --refresh-dependencies`, etc.
|
|
162
|
-
|
|
163
|
-
**Out of Memory**:
|
|
164
|
-
```
|
|
165
|
-
JavaScript heap out of memory
|
|
166
|
-
Java heap space
|
|
167
|
-
```
|
|
168
|
-
Suggest: Increase memory allocation
|
|
169
|
-
|
|
170
|
-
**Tool Not Found**:
|
|
171
|
-
```
|
|
172
|
-
command not found: npm
|
|
173
|
-
```
|
|
174
|
-
Suggest: Install the build tool
|
|
97
|
+
Determine success/failure from tool-specific patterns (exit code, `BUILD SUCCESSFUL`, `BUILD SUCCESS`, `Finished`, etc.). For failures, extract file paths, line numbers, and error messages. Identify error type (compilation, dependency, memory, tool not found) and suggest appropriate fix.
|
|
175
98
|
|
|
176
99
|
### 6. Format Output
|
|
177
100
|
|
|
@@ -200,28 +123,6 @@ SUGGESTIONS:
|
|
|
200
123
|
- {actionable suggestion based on error type}
|
|
201
124
|
```
|
|
202
125
|
|
|
203
|
-
## Common Build Scenarios
|
|
204
|
-
|
|
205
|
-
### First-Time Build
|
|
206
|
-
|
|
207
|
-
May fail with dependency issues. Suggestions:
|
|
208
|
-
- npm: `npm install`
|
|
209
|
-
- gradle: Remove `--offline` flag temporarily
|
|
210
|
-
- cargo: `cargo fetch`
|
|
211
|
-
|
|
212
|
-
### Incremental Build Issues
|
|
213
|
-
|
|
214
|
-
Stale cache or artifacts. Suggestions:
|
|
215
|
-
- Try `clean` target
|
|
216
|
-
- Clear cache manually
|
|
217
|
-
|
|
218
|
-
### Memory Issues
|
|
219
|
-
|
|
220
|
-
Build runs out of memory. Suggestions:
|
|
221
|
-
- npm: `export NODE_OPTIONS="--max-old-space-size=4096"`
|
|
222
|
-
- gradle: Add `org.gradle.jvmargs=-Xmx4g` to `gradle.properties`
|
|
223
|
-
- maven: `export MAVEN_OPTS="-Xmx4g"`
|
|
224
|
-
|
|
225
126
|
## Error Handling
|
|
226
127
|
|
|
227
128
|
- If build tool cannot be detected, return error with list of checked locations
|
|
@@ -237,38 +138,11 @@ Build runs out of memory. Suggestions:
|
|
|
237
138
|
- DO NOT assume a specific build system - always detect or use config
|
|
238
139
|
- DO NOT use overly short timeouts (builds can be slow)
|
|
239
140
|
|
|
240
|
-
##
|
|
241
|
-
|
|
242
|
-
### Example 1: Auto-detect npm and build
|
|
141
|
+
## Example
|
|
243
142
|
|
|
244
143
|
```
|
|
245
144
|
User: /build-project
|
|
246
|
-
|
|
247
|
-
Skill: [Detects package.json, uses npm]
|
|
248
|
-
Skill: [Runs: npm run build]
|
|
249
|
-
Skill: [Reports success with duration]
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Example 2: Gradle with module
|
|
253
|
-
|
|
254
|
-
```
|
|
255
|
-
User: /build-project module=user-service
|
|
256
|
-
|
|
257
|
-
Skill: [Detects build.gradle]
|
|
258
|
-
Skill: [Runs: ./gradlew :user-service:build -x test --offline]
|
|
259
|
-
Skill: [Reports success]
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Example 3: Build failure
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
User: /build-project
|
|
266
|
-
|
|
267
|
-
Skill: [Detects Cargo.toml]
|
|
268
|
-
Skill: [Runs: cargo build]
|
|
269
|
-
Skill: [Detects compilation error]
|
|
270
|
-
Skill: [Reports: File src/main.rs:42, Error: mismatched types]
|
|
271
|
-
Skill: [Suggests: Fix type error in src/main.rs:42]
|
|
145
|
+
Skill: [Detects npm] → [Runs: npm run build] → [Reports success with duration]
|
|
272
146
|
```
|
|
273
147
|
|
|
274
148
|
## Related Documentation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: configure-project
|
|
3
|
-
description:
|
|
3
|
+
description: Analyzes codebase for CLAUDE.md and generates project-specific skills. Used during /5:implement-feature CONFIGURE.
|
|
4
4
|
allowed-tools: Read, Write, Bash, Glob, Grep
|
|
5
5
|
model: sonnet
|
|
6
6
|
context: fork
|
|
@@ -13,76 +13,20 @@ user-invocable: false
|
|
|
13
13
|
|
|
14
14
|
This skill does the heavy lifting during Phase 3 (implement-feature) for the CONFIGURE feature. It is called by step-executor to create the actual configuration files.
|
|
15
15
|
|
|
16
|
-
It handles
|
|
16
|
+
It handles two distinct tasks, invoked with different parameters per component:
|
|
17
17
|
|
|
18
|
-
- **A.
|
|
19
|
-
- **B.
|
|
20
|
-
- **C. Generate Project-Specific Skills** - Creates SKILL.md files for common project patterns
|
|
18
|
+
- **A. Analyze Codebase and Create/Update CLAUDE.md** - Maps codebase and documents conventions
|
|
19
|
+
- **B. Generate Project-Specific Skills** - Creates SKILL.md files for common project patterns
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## A. Write config.json
|
|
25
|
-
|
|
26
|
-
**Receives:** project type, ticket config, branch config, build/test commands, tool availability
|
|
27
|
-
|
|
28
|
-
**Creates:** `.claude/.5/config.json`
|
|
29
|
-
|
|
30
|
-
**Schema (no `steps` array):**
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
{
|
|
34
|
-
"projectType": "{type}",
|
|
35
|
-
"ticket": {
|
|
36
|
-
"pattern": "{regex-pattern-or-null}",
|
|
37
|
-
"extractFromBranch": true
|
|
38
|
-
},
|
|
39
|
-
"branch": {
|
|
40
|
-
"convention": "{convention}"
|
|
41
|
-
},
|
|
42
|
-
"build": {
|
|
43
|
-
"command": "{build-command}",
|
|
44
|
-
"testCommand": "{test-command}",
|
|
45
|
-
"timeout": {
|
|
46
|
-
"compile": 120000,
|
|
47
|
-
"test": 300000
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"tools": {
|
|
51
|
-
"coderabbit": {
|
|
52
|
-
"available": false,
|
|
53
|
-
"authenticated": false
|
|
54
|
-
},
|
|
55
|
-
"ide": {
|
|
56
|
-
"available": false,
|
|
57
|
-
"type": null
|
|
58
|
-
},
|
|
59
|
-
"context7": {
|
|
60
|
-
"available": false
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"reviewTool": "claude" or "coderabbit" or "none",
|
|
64
|
-
"git": {
|
|
65
|
-
"autoCommit": false,
|
|
66
|
-
"commitMessage": {
|
|
67
|
-
"pattern": "{ticket-id} {short-description}"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Process:**
|
|
74
|
-
1. Read all values from the feature spec (`.5/features/CONFIGURE/feature.md`), including `git.autoCommit` and `git.commitMessage.pattern`
|
|
75
|
-
2. Ensure `.claude/.5/` directory exists (create with `mkdir -p` if needed)
|
|
76
|
-
3. Write `config.json` with pretty-printed JSON
|
|
77
|
-
4. Read back to verify correctness
|
|
21
|
+
Note: config.json is written directly by `/5:configure` during the Q&A phase.
|
|
78
22
|
|
|
79
23
|
---
|
|
80
24
|
|
|
81
|
-
##
|
|
25
|
+
## A. Analyze Codebase and Create/Update CLAUDE.md
|
|
82
26
|
|
|
83
27
|
**Process:**
|
|
84
28
|
|
|
85
|
-
###
|
|
29
|
+
### A1. Unified Codebase Analysis
|
|
86
30
|
|
|
87
31
|
Perform comprehensive analysis once to gather data for ALL templates:
|
|
88
32
|
|
|
@@ -140,7 +84,7 @@ Perform comprehensive analysis once to gather data for ALL templates:
|
|
|
140
84
|
- Identify deprecated dependencies (check for warnings in package manifests)
|
|
141
85
|
- Look for complex code sections (deeply nested conditionals, long functions)
|
|
142
86
|
|
|
143
|
-
###
|
|
87
|
+
### A2. Fill Templates
|
|
144
88
|
|
|
145
89
|
For each template in `src/templates/`:
|
|
146
90
|
|
|
@@ -177,7 +121,7 @@ INTEGRATIONS.md:
|
|
|
177
121
|
CONCERNS.md:
|
|
178
122
|
- `{file paths}` → Actual file paths from grep results
|
|
179
123
|
|
|
180
|
-
###
|
|
124
|
+
### A3. Write Documentation Files
|
|
181
125
|
|
|
182
126
|
Write filled templates to `.5/` folder:
|
|
183
127
|
|
|
@@ -191,63 +135,18 @@ Write filled templates to `.5/` folder:
|
|
|
191
135
|
- `.5/INTEGRATIONS.md`
|
|
192
136
|
- `.5/CONCERNS.md`
|
|
193
137
|
|
|
194
|
-
###
|
|
138
|
+
### A4. Create Master CLAUDE.md
|
|
195
139
|
|
|
196
140
|
Generate CLAUDE.md as a navigation hub:
|
|
197
141
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
## Quick Reference
|
|
205
|
-
|
|
206
|
-
- [Technology Stack](./.5/STACK.md) - Languages, frameworks, dependencies
|
|
207
|
-
- [Codebase Structure](./.5/STRUCTURE.md) - Directory layout and organization
|
|
208
|
-
- [Architecture](./.5/ARCHITECTURE.md) - Patterns, layers, and data flow
|
|
209
|
-
- [Coding Conventions](./.5/CONVENTIONS.md) - Naming, style, and patterns
|
|
210
|
-
- [Testing Patterns](./.5/TESTING.md) - Test framework and patterns
|
|
211
|
-
- [External Integrations](./.5/INTEGRATIONS.md) - APIs, databases, services
|
|
212
|
-
- [Codebase Concerns](./.5/CONCERNS.md) - Tech debt, bugs, and risks
|
|
213
|
-
|
|
214
|
-
## Project Overview
|
|
215
|
-
|
|
216
|
-
{1-2 paragraph summary from README or package.json description}
|
|
217
|
-
|
|
218
|
-
## Build & Run Commands
|
|
219
|
-
|
|
220
|
-
- Build: `{build-command}`
|
|
221
|
-
- Test: `{test-command}`
|
|
222
|
-
- {Other detected scripts}
|
|
223
|
-
|
|
224
|
-
## Coding Guidelines
|
|
225
|
-
|
|
226
|
-
When working with this codebase, follow these principles:
|
|
227
|
-
|
|
228
|
-
1. Types should be clear and types should be available when possible
|
|
229
|
-
2. Use doc (jsdoc, javadoc, pydoc, etc) concisely. No doc is better than meaningless doc
|
|
230
|
-
3. Keep files short and structured
|
|
231
|
-
4. Extract methods, classes
|
|
232
|
-
5. Respect SRP and DRY
|
|
233
|
-
6. Make code maintainable and modular
|
|
234
|
-
|
|
235
|
-
## Getting Started
|
|
236
|
-
|
|
237
|
-
**For new developers:**
|
|
238
|
-
1. Review [Stack](./.5/STACK.md) for technology overview
|
|
239
|
-
2. Read [Structure](./.5/STRUCTURE.md) to understand organization
|
|
240
|
-
3. Study [Conventions](./.5/CONVENTIONS.md) for coding standards
|
|
241
|
-
4. Check [Architecture](./.5/ARCHITECTURE.md) for design patterns
|
|
242
|
-
|
|
243
|
-
**For specific tasks:**
|
|
244
|
-
- Adding features → See [Architecture](./.5/ARCHITECTURE.md)
|
|
245
|
-
- Writing tests → See [Testing](./.5/TESTING.md)
|
|
246
|
-
- Integration work → See [Integrations](./.5/INTEGRATIONS.md)
|
|
247
|
-
- Reviewing concerns → See [Concerns](./.5/CONCERNS.md)
|
|
248
|
-
```
|
|
142
|
+
CLAUDE.md structure:
|
|
143
|
+
- **Quick Reference:** Links to all 7 `.5/*.md` files (STACK, STRUCTURE, ARCHITECTURE, CONVENTIONS, TESTING, INTEGRATIONS, CONCERNS)
|
|
144
|
+
- **Project Overview:** 1-2 paragraphs from README/package.json
|
|
145
|
+
- **Build & Run Commands:** Build, test, and other detected commands
|
|
146
|
+
- **Coding Guidelines:** The 6 mandatory principles (types, concise docs, short files, extract methods, SRP/DRY, maintainable/modular)
|
|
147
|
+
- **Getting Started:** Links to relevant `.5/` files for new devs and specific tasks
|
|
249
148
|
|
|
250
|
-
###
|
|
149
|
+
### A5. Preserve Existing Content
|
|
251
150
|
|
|
252
151
|
If CLAUDE.md already exists:
|
|
253
152
|
- Read current content
|
|
@@ -257,7 +156,7 @@ If CLAUDE.md already exists:
|
|
|
257
156
|
|
|
258
157
|
---
|
|
259
158
|
|
|
260
|
-
##
|
|
159
|
+
## B. Generate Project-Specific Skills
|
|
261
160
|
|
|
262
161
|
**Reads:** Pattern selections from feature spec (`.5/CONFIGURE/feature.md`)
|
|
263
162
|
|
|
@@ -324,85 +223,11 @@ Based on {example-file}, new {patterns} should follow:
|
|
|
324
223
|
|
|
325
224
|
### Pattern to Skill Name Mapping
|
|
326
225
|
|
|
327
|
-
|
|
328
|
-
|------------------|------------|
|
|
329
|
-
| **Core Architecture** | |
|
|
330
|
-
| controller | create-controller |
|
|
331
|
-
| service | create-service |
|
|
332
|
-
| repository | create-repository |
|
|
333
|
-
| model/entity | create-model |
|
|
334
|
-
| handler | create-handler |
|
|
335
|
-
| **Data Transfer** | |
|
|
336
|
-
| dto | create-dto |
|
|
337
|
-
| request | create-request |
|
|
338
|
-
| response | create-response |
|
|
339
|
-
| mapper | create-mapper |
|
|
340
|
-
| validator | create-validator |
|
|
341
|
-
| schema | create-schema |
|
|
342
|
-
| **Frontend** | |
|
|
343
|
-
| component | create-component |
|
|
344
|
-
| hook | create-hook |
|
|
345
|
-
| context | create-context |
|
|
346
|
-
| store | create-store |
|
|
347
|
-
| page | create-page |
|
|
348
|
-
| layout | create-layout |
|
|
349
|
-
| **API/Routes** | |
|
|
350
|
-
| api-route | create-api-route |
|
|
351
|
-
| middleware | create-middleware |
|
|
352
|
-
| guard | create-guard |
|
|
353
|
-
| interceptor | create-interceptor |
|
|
354
|
-
| filter | create-filter |
|
|
355
|
-
| **Testing** | |
|
|
356
|
-
| test | create-test |
|
|
357
|
-
| spec | create-spec |
|
|
358
|
-
| fixture | create-fixture |
|
|
359
|
-
| factory | create-factory |
|
|
360
|
-
| mock | create-mock |
|
|
361
|
-
| **Utilities** | |
|
|
362
|
-
| util | create-util |
|
|
363
|
-
| helper | create-helper |
|
|
364
|
-
| constant | create-constant |
|
|
365
|
-
| type | create-type |
|
|
366
|
-
| config | create-config |
|
|
367
|
-
| **Framework-Specific** | |
|
|
368
|
-
| module | create-module |
|
|
369
|
-
| pipe | create-pipe |
|
|
370
|
-
| decorator | create-decorator |
|
|
371
|
-
| blueprint | create-blueprint |
|
|
372
|
-
| view | create-view |
|
|
373
|
-
| serializer | create-serializer |
|
|
374
|
-
| **Background/Async** | |
|
|
375
|
-
| job | create-job |
|
|
376
|
-
| worker | create-worker |
|
|
377
|
-
| event | create-event |
|
|
378
|
-
| listener | create-listener |
|
|
379
|
-
| command | create-command |
|
|
380
|
-
| **Database** | |
|
|
381
|
-
| migration | create-migration |
|
|
382
|
-
| seed | create-seed |
|
|
383
|
-
| **Error Handling** | |
|
|
384
|
-
| exception | create-exception |
|
|
385
|
-
| error | create-error |
|
|
386
|
-
|
|
387
|
-
### Why `user-invocable: true`
|
|
388
|
-
|
|
389
|
-
Generated skills are user-invocable so users can invoke them directly:
|
|
390
|
-
- `/create-controller UserController`
|
|
391
|
-
- `/create-component Button`
|
|
392
|
-
- `/create-service AuthService`
|
|
393
|
-
|
|
394
|
-
This is more useful than internal-only skills.
|
|
395
|
-
|
|
396
|
-
### Why `model: haiku`
|
|
397
|
-
|
|
398
|
-
Pattern-following is simple once conventions are documented:
|
|
399
|
-
- Faster and cheaper than sonnet
|
|
400
|
-
- Deep analysis already happened during generation
|
|
401
|
-
- The skill just needs to follow the documented template
|
|
226
|
+
**Rule:** Skill name is `create-{pattern}` (e.g., `controller` → `create-controller`, `component` → `create-component`, `dto` → `create-dto`). For compound patterns, use the short form: `model/entity` → `create-model`, `api-route` → `create-api-route`.
|
|
402
227
|
|
|
403
228
|
---
|
|
404
229
|
|
|
405
|
-
##
|
|
230
|
+
## B2. Generate Command Skills (run-*)
|
|
406
231
|
|
|
407
232
|
**Reads:** Command selections from feature spec (`.5/CONFIGURE/feature.md`)
|
|
408
233
|
|
|
@@ -469,20 +294,7 @@ Executes the project's {command} command.
|
|
|
469
294
|
|
|
470
295
|
### Command to Skill Name Mapping
|
|
471
296
|
|
|
472
|
-
|
|
473
|
-
|------------------|------------|
|
|
474
|
-
| build | run-build |
|
|
475
|
-
| test, spec | run-tests |
|
|
476
|
-
| lint, eslint | run-lint |
|
|
477
|
-
| format, prettier | run-format |
|
|
478
|
-
| typecheck, tsc | run-typecheck |
|
|
479
|
-
| dev, start | run-dev |
|
|
480
|
-
| db:migrate, migrate | run-migrate |
|
|
481
|
-
| db:seed, seed | run-seed |
|
|
482
|
-
| docker:build | run-docker-build |
|
|
483
|
-
| docker:up, compose up | run-docker-up |
|
|
484
|
-
| clean | run-clean |
|
|
485
|
-
| generate, codegen | run-generate |
|
|
297
|
+
**Rule:** Skill name is `run-{category}` (e.g., `build` → `run-build`, `test`/`spec` → `run-tests`, `lint` → `run-lint`). Group variants under the primary category name.
|
|
486
298
|
|
|
487
299
|
---
|
|
488
300
|
|
|
@@ -491,8 +303,7 @@ Executes the project's {command} command.
|
|
|
491
303
|
Returns structured results for each component:
|
|
492
304
|
|
|
493
305
|
```
|
|
494
|
-
Component A (
|
|
495
|
-
Component B (Documentation): SUCCESS - Created 7 documentation files + index
|
|
306
|
+
Component A (Documentation): SUCCESS - Created 7 documentation files + index
|
|
496
307
|
- .5/ARCHITECTURE.md (Pattern: Layered, 4 layers identified)
|
|
497
308
|
- .5/STACK.md (TypeScript + Express, 23 dependencies)
|
|
498
309
|
- .5/STRUCTURE.md (8 top-level directories mapped)
|
|
@@ -501,15 +312,15 @@ Component B (Documentation): SUCCESS - Created 7 documentation files + index
|
|
|
501
312
|
- .5/INTEGRATIONS.md (PostgreSQL, 2 APIs, GitHub Actions)
|
|
502
313
|
- .5/CONCERNS.md (3 TODO items, 1 deprecated dependency)
|
|
503
314
|
- CLAUDE.md (index with references)
|
|
504
|
-
Component
|
|
505
|
-
Component
|
|
315
|
+
Component B (Pattern Skills): SUCCESS - Generated 3 create-* skills (create-component, create-hook, create-context)
|
|
316
|
+
Component C (Command Skills): SUCCESS - Generated 2 run-* skills (run-tests, run-lint)
|
|
506
317
|
```
|
|
507
318
|
|
|
508
319
|
Or on failure:
|
|
509
320
|
|
|
510
321
|
```
|
|
511
|
-
Component A (
|
|
512
|
-
Component B (
|
|
322
|
+
Component A (Documentation): FAILED - Unable to read template files
|
|
323
|
+
Component B (Pattern Skills): FAILED - No patterns found in codebase
|
|
513
324
|
```
|
|
514
325
|
|
|
515
326
|
## DO NOT
|