5-phase-workflow 1.5.4 → 1.7.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 +21 -7
- package/bin/install.js +10 -7
- package/package.json +1 -1
- package/src/agents/implementation-planner.md +2 -0
- package/src/commands/5/address-review-findings.md +364 -0
- package/src/commands/5/configure.md +32 -0
- package/src/commands/5/discuss-feature.md +1 -0
- package/src/commands/5/implement-feature.md +13 -0
- package/src/commands/5/plan-feature.md +1 -0
- package/src/commands/5/plan-implementation.md +11 -2
- package/src/commands/5/quick-implement.md +1 -0
- package/src/commands/5/reconfigure.md +156 -0
- package/src/commands/5/review-code.md +30 -102
- package/src/commands/5/unlock.md +1 -0
- package/src/commands/5/update.md +1 -0
- package/src/commands/5/verify-implementation.md +11 -2
- package/src/hooks/check-reconfig.js +88 -0
- package/src/hooks/statusline.js +12 -3
- package/src/settings.json +10 -0
- package/src/skills/configure-project/SKILL.md +23 -0
- package/src/templates/workflow/PLAN.md +3 -0
- package/src/templates/workflow/REVIEW-FINDINGS.md +3 -3
- package/src/templates/workflow/VERIFICATION-REPORT.md +12 -4
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 5:reconfigure
|
|
3
|
+
description: Lightweight refresh of project documentation and skills without full Q&A. Re-detects codebase changes, regenerates .5/*.md docs, updates CLAUDE.md, and refreshes all skills.
|
|
4
|
+
allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion
|
|
5
|
+
context: fork
|
|
6
|
+
user-invocable: true
|
|
7
|
+
disable-model-invocation: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Reconfigure (Lightweight Refresh)
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Single-command refresh that skips the full Q&A of `/5:configure`. Re-detects codebase state, regenerates documentation and skills based on existing `config.json` preferences.
|
|
15
|
+
|
|
16
|
+
**When to use which:**
|
|
17
|
+
|
|
18
|
+
| Scenario | Command |
|
|
19
|
+
|----------|---------|
|
|
20
|
+
| First-time setup | `/5:configure` |
|
|
21
|
+
| Change preferences (ticket pattern, review tool, etc.) | `/5:configure` |
|
|
22
|
+
| Codebase evolved, refresh docs/skills | **`/5:reconfigure`** |
|
|
23
|
+
| Add new skill patterns | `/5:configure` |
|
|
24
|
+
|
|
25
|
+
## ⚠️ CRITICAL SCOPE CONSTRAINT
|
|
26
|
+
|
|
27
|
+
**THIS COMMAND REGENERATES DOCS AND SKILLS. IT DOES NOT CHANGE USER PREFERENCES.**
|
|
28
|
+
|
|
29
|
+
Your job:
|
|
30
|
+
✅ Validate that config.json exists
|
|
31
|
+
✅ Re-detect codebase patterns and commands (same as configure Steps 1b-1h)
|
|
32
|
+
✅ Compare detected state with config.json skill selections
|
|
33
|
+
✅ Show summary and ask for confirmation
|
|
34
|
+
✅ Invoke configure-project skill in refresh mode
|
|
35
|
+
✅ Update version.json with artifacts and timestamps
|
|
36
|
+
✅ Clean up .reconfig-reminder flag
|
|
37
|
+
✅ Report what was updated
|
|
38
|
+
|
|
39
|
+
Your job is NOT:
|
|
40
|
+
❌ Ask preference questions (ticket pattern, branch convention, review tool, etc.)
|
|
41
|
+
❌ Modify config.json preferences (only the `skills` section may be updated if user confirms new patterns)
|
|
42
|
+
❌ Skip confirmation — always show what will be regenerated
|
|
43
|
+
|
|
44
|
+
## Process
|
|
45
|
+
|
|
46
|
+
### Step 1: Validate Config
|
|
47
|
+
|
|
48
|
+
Read `.5/config.json`. If it does not exist:
|
|
49
|
+
- Tell the user: "No configuration found. Please run `/5:configure` first to set up your project."
|
|
50
|
+
- **EXIT IMMEDIATELY**
|
|
51
|
+
|
|
52
|
+
Read `.5/version.json` for current state (configuredAt, configuredAtCommit).
|
|
53
|
+
|
|
54
|
+
### Step 2: Re-detect Codebase State
|
|
55
|
+
|
|
56
|
+
Perform the same detection as configure Steps 1b-1h:
|
|
57
|
+
|
|
58
|
+
**2a. Detect project type** — same table as configure Step 1b (package.json deps, build files, etc.)
|
|
59
|
+
|
|
60
|
+
**2b. Detect build/test commands** — same as configure Step 1c
|
|
61
|
+
|
|
62
|
+
**2c. Detect codebase patterns** — same as configure Step 1g:
|
|
63
|
+
- Scan for architectural patterns (Controllers, Services, Components, etc.)
|
|
64
|
+
- Use both suffix-based and directory-based globs
|
|
65
|
+
- For each pattern: count files, identify location, sample filename
|
|
66
|
+
|
|
67
|
+
**2d. Detect runnable commands** — same as configure Step 1h:
|
|
68
|
+
- Scan package.json scripts, Makefile targets, etc.
|
|
69
|
+
- Categorize: Build, Test, Lint, Format, Type Check, etc.
|
|
70
|
+
|
|
71
|
+
**2e. Scan existing skills** — list ALL skills in `.claude/skills/`:
|
|
72
|
+
- Read each skill's SKILL.md frontmatter
|
|
73
|
+
- Categorize as workflow-generated (create-*, run-*) or user-created
|
|
74
|
+
|
|
75
|
+
### Step 3: Compare and Prepare Summary
|
|
76
|
+
|
|
77
|
+
Use the existing skills in `.claude/skills/` (from Step 2e) as the source of truth — not config.json. Compare what's installed with what's detected in the codebase:
|
|
78
|
+
|
|
79
|
+
- **Existing `create-*` skills** — extract the pattern name from each (e.g., `create-controller` → `controller`)
|
|
80
|
+
- **Existing `run-*` skills** — extract the command name from each (e.g., `run-tests` → `tests`)
|
|
81
|
+
- **New patterns**: detected in codebase (Step 2c) but no matching `create-*` skill exists → offer to create
|
|
82
|
+
- **Stale patterns**: a `create-*` skill exists but the pattern is no longer detected in the codebase → offer to remove or keep
|
|
83
|
+
- **New commands**: detected (Step 2d) but no matching `run-*` skill exists → offer to create
|
|
84
|
+
- **Stale commands**: a `run-*` skill exists but the command is no longer detected → offer to remove or keep
|
|
85
|
+
- **User-created skills** (not matching `create-*` or `run-*` naming) → always refresh with current conventions, never remove
|
|
86
|
+
|
|
87
|
+
### Step 4: Confirm with User
|
|
88
|
+
|
|
89
|
+
Use `AskUserQuestion` to show a summary and get confirmation. Present:
|
|
90
|
+
|
|
91
|
+
1. **Documentation files that will be rewritten** — list all 7 `.5/*.md` files + CLAUDE.md
|
|
92
|
+
2. **Skills that will be refreshed** — list ALL skills found in `.claude/skills/` (both workflow-generated and user-created)
|
|
93
|
+
3. **New patterns detected** (if any) — "These patterns were found in your codebase but don't have skills yet: [list]. Create skills for them?"
|
|
94
|
+
4. **Stale patterns** (if any) — "These patterns are in your config but weren't found in the codebase: [list]. Remove them?"
|
|
95
|
+
|
|
96
|
+
Options:
|
|
97
|
+
- "Proceed with refresh" — regenerate everything as shown
|
|
98
|
+
- "Cancel" — exit without changes
|
|
99
|
+
|
|
100
|
+
If there are new or stale patterns, use additional `AskUserQuestion` calls with multiSelect to let the user pick which new patterns to add and which stale patterns to remove.
|
|
101
|
+
|
|
102
|
+
New skills will be created and stale skills removed based on the user's choices.
|
|
103
|
+
|
|
104
|
+
### Step 5: Regenerate
|
|
105
|
+
|
|
106
|
+
Invoke the `configure-project` skill in **refresh mode** via the Task tool:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Task prompt: "Run configure-project skill in REFRESH MODE.
|
|
110
|
+
|
|
111
|
+
Refresh ALL existing skills in .claude/skills/:
|
|
112
|
+
- Existing create-* skills: [list from Step 2e]
|
|
113
|
+
- Existing run-* skills: [list from Step 2e]
|
|
114
|
+
- User-created skills: [list from Step 2e]
|
|
115
|
+
- New skills to create: [list from user confirmation, if any]
|
|
116
|
+
- Skills to remove: [list from user confirmation, if any]
|
|
117
|
+
|
|
118
|
+
Re-analyze the entire codebase (A1 analysis) and:
|
|
119
|
+
1. Rewrite all 7 .5/*.md documentation files
|
|
120
|
+
2. Update CLAUDE.md (preserve user-written sections)
|
|
121
|
+
3. Refresh ALL skills in .claude/skills/ — read current conventions from codebase and update each skill
|
|
122
|
+
4. Create new skills for newly-added patterns
|
|
123
|
+
5. Remove skills the user chose to drop"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Use `subagent_type: "general-purpose"` for the Task.
|
|
127
|
+
|
|
128
|
+
### Step 6: Track
|
|
129
|
+
|
|
130
|
+
After the skill completes, update `.5/version.json`:
|
|
131
|
+
|
|
132
|
+
1. Read current version.json
|
|
133
|
+
2. Set `configuredAt` to current ISO timestamp
|
|
134
|
+
3. Set `configuredAtCommit` to current short commit hash (`git rev-parse --short HEAD`)
|
|
135
|
+
4. Write back version.json preserving all other fields
|
|
136
|
+
|
|
137
|
+
### Step 7: Clean Up
|
|
138
|
+
|
|
139
|
+
Remove the `.5/.reconfig-reminder` flag file if it exists:
|
|
140
|
+
```bash
|
|
141
|
+
rm -f .5/.reconfig-reminder
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Step 8: Report
|
|
145
|
+
|
|
146
|
+
Show the user a summary:
|
|
147
|
+
- List of documentation files updated
|
|
148
|
+
- List of skills refreshed
|
|
149
|
+
- List of new skills created (if any)
|
|
150
|
+
- List of skills removed (if any)
|
|
151
|
+
- Timestamp of reconfiguration
|
|
152
|
+
- Suggest running `/clear` to reset context
|
|
153
|
+
|
|
154
|
+
## Related Documentation
|
|
155
|
+
- [configure command](./configure.md) — full Q&A configuration
|
|
156
|
+
- [configure-project skill](../../skills/configure-project/SKILL.md) — the skill that does the heavy lifting
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: 5:review-code
|
|
3
|
-
description: Reviews code changes using Claude (built-in) or CodeRabbit CLI.
|
|
4
|
-
allowed-tools: Bash, Read,
|
|
3
|
+
description: Reviews code changes using Claude (built-in) or CodeRabbit CLI. Categorizes findings and saves them for /5:address-review-findings.
|
|
4
|
+
allowed-tools: Bash, Read, Glob, Grep, AskUserQuestion, Task, mcp__jetbrains__*
|
|
5
5
|
model: sonnet
|
|
6
6
|
context: fork
|
|
7
7
|
user-invocable: true
|
|
8
|
+
disable-model-invocation: true
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
<role>
|
|
11
|
-
You are a Code Reviewer.
|
|
12
|
-
You do NOT implement new features. You do NOT refactor
|
|
13
|
-
|
|
14
|
-
You ALWAYS verify changes after applying fixes (build + test).
|
|
12
|
+
You are a Code Reviewer. Your job is to review code, categorize findings, and save them to a findings file.
|
|
13
|
+
You do NOT apply fixes. You do NOT implement new features. You do NOT refactor code.
|
|
14
|
+
Fix application is handled by /5:address-review-findings.
|
|
15
15
|
You follow the exact step sequence below. Do not skip or reorder steps.
|
|
16
|
-
After saving the
|
|
16
|
+
After saving the findings file, you are DONE.
|
|
17
17
|
</role>
|
|
18
18
|
|
|
19
19
|
# Review Code (Phase 5)
|
|
@@ -44,35 +44,23 @@ If not installed or not authenticated, ask user via AskUserQuestion:
|
|
|
44
44
|
- "Switch to Claude for this review? (Recommended)" / "I'll install CodeRabbit first"
|
|
45
45
|
- If they choose CodeRabbit setup, provide install instructions and STOP
|
|
46
46
|
|
|
47
|
-
### Step 2:
|
|
48
|
-
|
|
49
|
-
If user invoked with `apply` argument (`/5:review-code apply`):
|
|
50
|
-
- Skip to Step 10 (Apply Annotated Findings)
|
|
51
|
-
- Do NOT run a new review
|
|
52
|
-
|
|
53
|
-
Otherwise, continue with new review.
|
|
54
|
-
|
|
55
|
-
### Step 3: Determine What to Review
|
|
47
|
+
### Step 2: Determine What to Review
|
|
56
48
|
|
|
57
49
|
Ask the user via AskUserQuestion:
|
|
58
50
|
|
|
59
|
-
**Question
|
|
51
|
+
**Question: What to review?**
|
|
60
52
|
1. Staged changes (`git diff --cached`) — default
|
|
61
53
|
2. Unstaged changes (`git diff`)
|
|
62
54
|
3. All changes (`git diff HEAD`)
|
|
63
55
|
4. Current branch vs main/master (`git diff main...HEAD`)
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
1. Interactive (show findings, apply fixes immediately) — default
|
|
67
|
-
2. Save to file (for later annotation with `[FIX]`/`[SKIP]`/`[MANUAL]`)
|
|
68
|
-
|
|
69
|
-
### Step 4: Spawn Review Agent
|
|
57
|
+
### Step 3: Spawn Review Agent
|
|
70
58
|
|
|
71
59
|
Spawn a single agent to execute the review. Do NOT run the review yourself.
|
|
72
60
|
|
|
73
|
-
**Architecture:** You (main agent) handle user interaction
|
|
61
|
+
**Architecture:** You (main agent) handle user interaction. The spawned agent runs the review and categorizes findings.
|
|
74
62
|
|
|
75
|
-
####
|
|
63
|
+
#### 3A: CodeRabbit Review Agent
|
|
76
64
|
|
|
77
65
|
```
|
|
78
66
|
Task tool call:
|
|
@@ -83,7 +71,7 @@ Task tool call:
|
|
|
83
71
|
Run CodeRabbit CLI and categorize findings.
|
|
84
72
|
|
|
85
73
|
## Review Scope
|
|
86
|
-
Scope: {scope from Step
|
|
74
|
+
Scope: {scope from Step 2}
|
|
87
75
|
Base Branch: {branch-name if scope is "branch"}
|
|
88
76
|
|
|
89
77
|
## Process
|
|
@@ -115,7 +103,7 @@ Task tool call:
|
|
|
115
103
|
- Include ALL findings
|
|
116
104
|
```
|
|
117
105
|
|
|
118
|
-
####
|
|
106
|
+
#### 3B: Claude Review Agent
|
|
119
107
|
|
|
120
108
|
```
|
|
121
109
|
Task tool call:
|
|
@@ -127,7 +115,7 @@ Task tool call:
|
|
|
127
115
|
Review this code blind, purely on its merits.
|
|
128
116
|
|
|
129
117
|
## Review Scope
|
|
130
|
-
Scope: {scope from Step
|
|
118
|
+
Scope: {scope from Step 2}
|
|
131
119
|
Base Branch: {branch-name if scope is "branch"}
|
|
132
120
|
|
|
133
121
|
## Process
|
|
@@ -169,17 +157,13 @@ Task tool call:
|
|
|
169
157
|
- Be thorough but practical — focus on real issues, not style nitpicks
|
|
170
158
|
```
|
|
171
159
|
|
|
172
|
-
### Step
|
|
160
|
+
### Step 4: Process Agent Results
|
|
173
161
|
|
|
174
162
|
Receive structured results from the agent. If agent returned failure, report error and STOP.
|
|
175
163
|
|
|
176
|
-
|
|
164
|
+
### Step 5: Present Findings
|
|
177
165
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
### Step 6: Present Overview and Ask User
|
|
181
|
-
|
|
182
|
-
Present ALL findings to the user first. Do NOT apply anything yet.
|
|
166
|
+
Present ALL findings to the user.
|
|
183
167
|
|
|
184
168
|
```
|
|
185
169
|
Code Review Results:
|
|
@@ -200,87 +184,31 @@ Manual Review Needed:
|
|
|
200
184
|
- {file}:{line} - {description}
|
|
201
185
|
```
|
|
202
186
|
|
|
203
|
-
|
|
204
|
-
- Options: All / Selected / None
|
|
205
|
-
|
|
206
|
-
### Step 7: Apply User-Approved Fixes
|
|
207
|
-
|
|
208
|
-
**ONLY apply fixes the user has agreed to.**
|
|
209
|
-
|
|
210
|
-
- If "All": Apply all fixable issues
|
|
211
|
-
- If "Selected": Ask which specific fixes, then apply only those
|
|
212
|
-
- If "None": Skip to Step 8
|
|
213
|
-
|
|
214
|
-
For each fix:
|
|
215
|
-
1. Read the file
|
|
216
|
-
2. Apply the fix using Edit tool
|
|
217
|
-
3. Track applied fixes
|
|
218
|
-
|
|
219
|
-
### Step 8: Handle Questions
|
|
220
|
-
|
|
221
|
-
If there are questions from the reviewer, ask via AskUserQuestion:
|
|
222
|
-
- "Ask me each question" / "Skip all questions"
|
|
223
|
-
|
|
224
|
-
If "Ask me each": Present each question individually via AskUserQuestion. If the answer requires a code change, apply it.
|
|
225
|
-
|
|
226
|
-
### Step 9: Save Findings to File (File-Based Mode)
|
|
227
|
-
|
|
228
|
-
For "Save to file" mode only.
|
|
187
|
+
### Step 6: Save Findings to File
|
|
229
188
|
|
|
230
189
|
Determine feature name from `.5/features/*/state.json` (most recent by `startedAt` field) or ask user.
|
|
231
190
|
|
|
232
|
-
Write to `.5/features/{feature-name}/review-{YYYYMMDD-HHmmss}
|
|
233
|
-
|
|
234
|
-
Use the template structure from `.claude/templates/workflow/REVIEW-FINDINGS.md`. Include all findings with `[FIX]`/`[SKIP]`/`[MANUAL]` action markers.
|
|
235
|
-
|
|
236
|
-
Tell user: "Findings saved. Edit the file to mark actions, then run `/5:review-code apply`"
|
|
237
|
-
|
|
238
|
-
Skip to REVIEW COMPLETE.
|
|
239
|
-
|
|
240
|
-
### Step 10: Apply Annotated Findings (Apply Mode)
|
|
241
|
-
|
|
242
|
-
When invoked with `apply`:
|
|
243
|
-
|
|
244
|
-
1. Determine feature name from `.5/features/*/state.json` (most recent by `startedAt` field) or ask user
|
|
245
|
-
2. Find most recent `review-*-findings.md` in the feature folder
|
|
246
|
-
3. If none found, tell user to run `/5:review-code` first and STOP
|
|
247
|
-
4. Parse each finding and its action marker: `[FIX]`, `[SKIP]`, `[MANUAL]`
|
|
248
|
-
5. Apply `[FIX]` findings using Edit tool
|
|
249
|
-
6. Apply `[MANUAL]` findings using custom instructions from the file
|
|
250
|
-
7. Skip `[SKIP]` findings
|
|
251
|
-
8. Continue to Step 11
|
|
191
|
+
Write to `.5/features/{feature-name}/review-findings-{YYYYMMDD-HHmmss}.md`.
|
|
252
192
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
1. **Build:** Use the `/build-project` skill: `Skill tool: skill="build-project", args="target=compile"`
|
|
258
|
-
2. **Test:** Use the `/run-tests` skill: `Skill tool: skill="run-tests", args="target=all"`
|
|
259
|
-
3. If build fails: report which fixes caused issues
|
|
260
|
-
4. If tests fail: report which tests failed
|
|
261
|
-
|
|
262
|
-
### Step 12: Save Review Report
|
|
263
|
-
|
|
264
|
-
**Interactive mode:** Save summary to `.5/features/{feature-name}/review-{YYYYMMDD-HHmmss}.md`
|
|
265
|
-
|
|
266
|
-
Use the template structure from `.claude/templates/workflow/REVIEW-SUMMARY.md`.
|
|
267
|
-
|
|
268
|
-
**Apply mode:** Append application results to the findings file with: fixes applied count, custom fixes count, skipped count, build/test status.
|
|
193
|
+
Use the template structure from `.claude/templates/workflow/REVIEW-FINDINGS.md`. All findings get their default action markers:
|
|
194
|
+
- Fixable items → `[FIX]`
|
|
195
|
+
- Manual items → `[MANUAL]`
|
|
196
|
+
- Questions → `[FIX]` (with the question as the suggested fix instruction)
|
|
269
197
|
|
|
270
198
|
## REVIEW COMPLETE
|
|
271
199
|
|
|
272
|
-
|
|
200
|
+
Output exactly:
|
|
273
201
|
|
|
274
202
|
```
|
|
275
203
|
Review complete.
|
|
276
204
|
|
|
277
|
-
-
|
|
278
|
-
- Questions
|
|
205
|
+
- Fixable: {N}
|
|
206
|
+
- Questions: {N}
|
|
279
207
|
- Manual review needed: {N}
|
|
280
|
-
- Build: {passed/failed}
|
|
281
|
-
- Tests: {passed/failed}
|
|
282
208
|
|
|
283
|
-
|
|
209
|
+
Findings saved at `.5/features/{feature-name}/review-findings-{timestamp}.md`
|
|
210
|
+
|
|
211
|
+
Edit the file to adjust actions ([FIX] / [SKIP] / [MANUAL]), then run `/5:address-review-findings {feature-name}` to apply fixes and optionally address GitHub PR comments.
|
|
284
212
|
```
|
|
285
213
|
|
|
286
214
|
STOP. You are a reviewer. Your job is done. Do not implement new features.
|
package/src/commands/5/unlock.md
CHANGED
package/src/commands/5/update.md
CHANGED
|
@@ -4,6 +4,7 @@ description: Verifies a feature implementation is complete and working with mult
|
|
|
4
4
|
allowed-tools: Read, Glob, Grep, Bash, Write, Task, AskUserQuestion
|
|
5
5
|
context: fork
|
|
6
6
|
user-invocable: true
|
|
7
|
+
disable-model-invocation: true
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Verify Implementation (Phase 4)
|
|
@@ -154,6 +155,12 @@ For each component with action `create` in the plan:
|
|
|
154
155
|
|
|
155
156
|
This is a lightweight check — it only verifies test files exist for new code, not test quality.
|
|
156
157
|
|
|
158
|
+
**Test requirement enforcement:**
|
|
159
|
+
- Components with logic (services, controllers, repositories, hooks, utilities, helpers) without tests → MISSING_REQUIRED_TEST (error-level)
|
|
160
|
+
- Declarative components (types, interfaces, models without logic) without tests → MISSING_OPTIONAL_TEST (info-level, not counted as issues)
|
|
161
|
+
|
|
162
|
+
If no test framework detected (no test runner in config, no existing test files found via Glob for `**/*.test.*`, `**/*.spec.*`, `**/test_*.*`), downgrade all MISSING_REQUIRED_TEST to warnings with note: "No test framework detected."
|
|
163
|
+
|
|
157
164
|
### Step 5: Determine Status
|
|
158
165
|
|
|
159
166
|
Evaluate all three layers:
|
|
@@ -168,10 +175,11 @@ Evaluate all three layers:
|
|
|
168
175
|
|
|
169
176
|
**PARTIAL** — infrastructure OK but gaps exist:
|
|
170
177
|
- All files exist AND build succeeds AND tests pass
|
|
171
|
-
- BUT: some acceptance criteria not satisfied, OR some requirements not implemented, OR some components partial, OR
|
|
178
|
+
- BUT: some acceptance criteria not satisfied, OR some requirements not implemented, OR some components partial, OR logic-bearing components lack tests but project has no test framework
|
|
172
179
|
|
|
173
180
|
**FAILED** — infrastructure problems:
|
|
174
181
|
- Any files missing, OR build fails, OR tests fail
|
|
182
|
+
- Any logic-bearing components lack test files (MISSING_REQUIRED_TEST) AND project has a test framework
|
|
175
183
|
|
|
176
184
|
### Step 6: Generate Verification Report
|
|
177
185
|
|
|
@@ -223,7 +231,8 @@ Build fix entries from verification results:
|
|
|
223
231
|
- Partial components → fix: describe what's missing from the component
|
|
224
232
|
|
|
225
233
|
**From Layer 3 (Quality):**
|
|
226
|
-
- Missing test files → fix: create test file for the component
|
|
234
|
+
- Missing required test files (logic-bearing components) → fix: create test file for the component (priority: high)
|
|
235
|
+
- Missing optional test files (declarative components) → note in report, no fix entry
|
|
227
236
|
|
|
228
237
|
Each fix entry follows the same table format as `plan.md`:
|
|
229
238
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
// Read JSON from stdin
|
|
8
|
+
let input = '';
|
|
9
|
+
process.stdin.setEncoding('utf8');
|
|
10
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
11
|
+
process.stdin.on('end', () => {
|
|
12
|
+
try {
|
|
13
|
+
let workspaceDir = process.cwd();
|
|
14
|
+
if (input.trim()) {
|
|
15
|
+
const data = JSON.parse(input);
|
|
16
|
+
workspaceDir = data.cwd || data.workspace?.current_dir || workspaceDir;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
checkReconfigure(workspaceDir);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
// Silent failure - don't block on errors
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function checkReconfigure(workspaceDir) {
|
|
27
|
+
const versionFile = path.join(workspaceDir, '.5', 'version.json');
|
|
28
|
+
const flagFile = path.join(workspaceDir, '.5', '.reconfig-reminder');
|
|
29
|
+
|
|
30
|
+
if (!fs.existsSync(versionFile)) {
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let versionData;
|
|
35
|
+
try {
|
|
36
|
+
versionData = JSON.parse(fs.readFileSync(versionFile, 'utf8'));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const { configuredAt, configuredAtCommit } = versionData;
|
|
42
|
+
|
|
43
|
+
// No configure data yet - skip (user hasn't run /5:configure)
|
|
44
|
+
if (!configuredAt) {
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Calculate days elapsed
|
|
49
|
+
let daysElapsed = 0;
|
|
50
|
+
try {
|
|
51
|
+
daysElapsed = Math.floor((Date.now() - new Date(configuredAt).getTime()) / (1000 * 60 * 60 * 24));
|
|
52
|
+
} catch (e) {
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Count commits since configured
|
|
57
|
+
let commitCount = 0;
|
|
58
|
+
if (configuredAtCommit) {
|
|
59
|
+
try {
|
|
60
|
+
const result = execSync(`git rev-list --count ${configuredAtCommit}..HEAD`, {
|
|
61
|
+
cwd: workspaceDir,
|
|
62
|
+
timeout: 3000,
|
|
63
|
+
encoding: 'utf8',
|
|
64
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
65
|
+
});
|
|
66
|
+
commitCount = parseInt(result.trim(), 10) || 0;
|
|
67
|
+
} catch (e) {
|
|
68
|
+
// Git command failed (commit not found, not a repo, etc.) - skip
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Write or remove temp flag file (never touches version.json)
|
|
73
|
+
const COMMIT_THRESHOLD = 50;
|
|
74
|
+
const DAYS_THRESHOLD = 30;
|
|
75
|
+
const shouldRemind = daysElapsed >= DAYS_THRESHOLD || commitCount >= COMMIT_THRESHOLD;
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
if (shouldRemind) {
|
|
79
|
+
fs.writeFileSync(flagFile, '1');
|
|
80
|
+
} else if (fs.existsSync(flagFile)) {
|
|
81
|
+
fs.unlinkSync(flagFile);
|
|
82
|
+
}
|
|
83
|
+
} catch (e) {
|
|
84
|
+
// Can't write/delete temp file - skip
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
process.exit(0);
|
|
88
|
+
}
|
package/src/hooks/statusline.js
CHANGED
|
@@ -43,22 +43,31 @@ process.stdin.on('end', () => {
|
|
|
43
43
|
// Shorten directory path for display
|
|
44
44
|
const shortDir = dir.replace(os.homedir(), '~');
|
|
45
45
|
|
|
46
|
-
// Check for available update
|
|
46
|
+
// Check for available update and reconfigure reminder
|
|
47
47
|
let updateIndicator = '';
|
|
48
|
+
let reconfigIndicator = '';
|
|
48
49
|
try {
|
|
49
50
|
const versionFile = path.join(dir, '.5', 'version.json');
|
|
50
51
|
const versionData = JSON.parse(fs.readFileSync(versionFile, 'utf8'));
|
|
52
|
+
|
|
53
|
+
// Update check
|
|
51
54
|
const latest = versionData.latestAvailableVersion;
|
|
52
55
|
const installed = versionData.installedVersion;
|
|
53
56
|
if (latest && installed && compareVersions(installed, latest) < 0) {
|
|
54
57
|
updateIndicator = ` | \x1b[33m↑${latest} → /5:update\x1b[0m`;
|
|
55
58
|
}
|
|
59
|
+
|
|
60
|
+
// Reconfigure check (reads flag file in .5/, gitignored)
|
|
61
|
+
const flagFile = path.join(dir, '.5', '.reconfig-reminder');
|
|
62
|
+
if (fs.existsSync(flagFile)) {
|
|
63
|
+
reconfigIndicator = ` | \x1b[35m↻ /5:reconfigure\x1b[0m`;
|
|
64
|
+
}
|
|
56
65
|
} catch (e) {
|
|
57
66
|
// No version file or parse error — no indicator
|
|
58
67
|
}
|
|
59
68
|
|
|
60
|
-
// Build and output statusline: model | directory | context | update
|
|
61
|
-
const statusline = `\x1b[36m${model}\x1b[0m | \x1b[90m${shortDir}\x1b[0m${ctx}${updateIndicator}`;
|
|
69
|
+
// Build and output statusline: model | directory | context | update | reconfig
|
|
70
|
+
const statusline = `\x1b[36m${model}\x1b[0m | \x1b[90m${shortDir}\x1b[0m${ctx}${updateIndicator}${reconfigIndicator}`;
|
|
62
71
|
process.stdout.write(statusline);
|
|
63
72
|
|
|
64
73
|
} catch (e) {
|
package/src/settings.json
CHANGED
|
@@ -22,6 +22,29 @@ Note: config.json is written directly by `/5:configure` during the Q&A phase.
|
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
+
## Modes
|
|
26
|
+
|
|
27
|
+
This skill supports two modes. The analysis (A1), template filling (A2-A3), CLAUDE.md update (A4-A5), and skill generation (B) logic is the same in both modes — only the **input source** changes.
|
|
28
|
+
|
|
29
|
+
### Full Mode (default)
|
|
30
|
+
|
|
31
|
+
Used by `/5:configure` → `/5:implement-feature CONFIGURE` flow.
|
|
32
|
+
|
|
33
|
+
- **Input:** Pattern/command selections from feature spec (`.5/features/CONFIGURE/feature.md`)
|
|
34
|
+
- **Behavior:** Creates everything from scratch based on feature spec requirements
|
|
35
|
+
|
|
36
|
+
### Refresh Mode
|
|
37
|
+
|
|
38
|
+
Used by `/5:reconfigure` for lightweight refresh.
|
|
39
|
+
|
|
40
|
+
- **Input:** The Task prompt lists which skills to refresh, create, and remove (determined by `/5:reconfigure` after scanning `.claude/skills/` and comparing with detected codebase patterns)
|
|
41
|
+
- **Behavior:** Re-analyzes codebase, overwrites docs and refreshes/creates/removes skills as specified
|
|
42
|
+
- **Trigger:** Task prompt includes "REFRESH MODE"
|
|
43
|
+
|
|
44
|
+
In both modes, the analysis and generation logic is identical — only where the skill list comes from differs.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
25
48
|
## A. Analyze Codebase and Create/Update CLAUDE.md
|
|
26
49
|
|
|
27
50
|
**Process:**
|
|
@@ -9,6 +9,8 @@ created: {ISO-timestamp}
|
|
|
9
9
|
- Description column: one action-oriented sentence per component
|
|
10
10
|
- Implementation Notes: reference existing files as patterns, no code snippets
|
|
11
11
|
- Components table must cover all functional requirements from feature.md
|
|
12
|
+
- Every "create" component with logic (services, controllers, repositories, utilities) must have a corresponding test component
|
|
13
|
+
- Declarative-only components (types, interfaces, route wiring) are exempt from test requirements
|
|
12
14
|
-->
|
|
13
15
|
|
|
14
16
|
# Implementation Plan: {TICKET-ID}
|
|
@@ -24,6 +26,7 @@ created: {ISO-timestamp}
|
|
|
24
26
|
| 2 | {name} | create | {path} | {what it does} | moderate |
|
|
25
27
|
| 2 | {name} | modify | {path} | {what to change} | moderate |
|
|
26
28
|
| 3 | {name} | create | {path} | {what it does} | complex |
|
|
29
|
+
| 4 | {name} tests | create | {test-path} | Test {what it tests} | moderate |
|
|
27
30
|
|
|
28
31
|
## Implementation Notes
|
|
29
32
|
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
- `[SKIP]` - Don't apply this fix (change FIX to SKIP)
|
|
15
15
|
- `[MANUAL]` - Custom instructions (change FIX to MANUAL and add instructions)
|
|
16
16
|
3. Save this file
|
|
17
|
-
4. Run: `/review-
|
|
17
|
+
4. Run: `/5:address-review-findings`
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The command will read your annotations and apply marked fixes.
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -55,4 +55,4 @@ The apply command will read your annotations and apply marked fixes.
|
|
|
55
55
|
|
|
56
56
|
**Next Steps:**
|
|
57
57
|
1. Edit this file to mark which findings to fix
|
|
58
|
-
2. Run: `/review-
|
|
58
|
+
2. Run: `/5:address-review-findings`
|
|
@@ -73,14 +73,22 @@
|
|
|
73
73
|
|
|
74
74
|
### Test Coverage for New Files
|
|
75
75
|
|
|
76
|
+
**Required Tests (logic-bearing components):**
|
|
77
|
+
|
|
78
|
+
| New File | Test File | Status |
|
|
79
|
+
|----------|-----------|--------|
|
|
80
|
+
| {src/path/Service.ts} | {src/path/Service.test.ts} | HAS TEST |
|
|
81
|
+
| {src/path/Controller.ts} | — | MISSING REQUIRED TEST |
|
|
82
|
+
|
|
83
|
+
**Optional Tests (declarative components):**
|
|
84
|
+
|
|
76
85
|
| New File | Test File | Status |
|
|
77
86
|
|----------|-----------|--------|
|
|
78
|
-
| {src/path/
|
|
79
|
-
| {src/path/Other.ts} | — | NO TEST |
|
|
87
|
+
| {src/path/types.ts} | — | NO TEST (exempt) |
|
|
80
88
|
|
|
81
|
-
**Result:** {N}/{M}
|
|
89
|
+
**Result:** {N}/{M} required test files exist
|
|
82
90
|
|
|
83
|
-
**Layer 3 Result:** PASSED | PARTIAL
|
|
91
|
+
**Layer 3 Result:** PASSED | FAILED | PARTIAL
|
|
84
92
|
|
|
85
93
|
---
|
|
86
94
|
|