claude-devkit-cli 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -31
- package/package.json +1 -1
- package/src/cli.js +6 -3
- package/src/commands/init.js +160 -5
- package/src/commands/remove.js +53 -2
- package/src/commands/upgrade.js +84 -4
- package/src/lib/installer.js +182 -8
- package/src/lib/manifest.js +1 -1
- package/templates/.claude/CLAUDE.md +2 -2
- package/templates/.claude/hooks/comment-guard.js +1 -1
- package/templates/.claude/hooks/glob-guard.js +8 -0
- package/templates/.claude/hooks/path-guard.sh +32 -26
- package/templates/.claude/hooks/self-review.sh +1 -0
- package/templates/.claude/hooks/sensitive-guard.sh +9 -9
- package/templates/.claude/{commands/mf-test.md → skills/mf-build/SKILL.md} +23 -3
- package/templates/.claude/{commands/mf-challenge.md → skills/mf-challenge/SKILL.md} +42 -27
- package/templates/.claude/{commands/mf-commit.md → skills/mf-commit/SKILL.md} +39 -8
- package/templates/.claude/{commands/mf-fix.md → skills/mf-fix/SKILL.md} +22 -1
- package/templates/.claude/{commands/mf-plan.md → skills/mf-plan/SKILL.md} +59 -48
- package/templates/.claude/{commands/mf-review.md → skills/mf-review/SKILL.md} +4 -0
- package/templates/docs/WORKFLOW.md +5 -5
|
@@ -1,22 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate spec with acceptance scenarios from description or existing spec
|
|
3
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
|
|
4
|
+
---
|
|
1
5
|
Generate spec with acceptance scenarios from description or existing spec.
|
|
2
6
|
|
|
3
7
|
## Question Format
|
|
4
8
|
|
|
5
|
-
When presenting
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
When presenting questions to the user with multiple options, use the `AskUserQuestion` tool.
|
|
10
|
+
|
|
11
|
+
**Schema:**
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"questions": [
|
|
15
|
+
{
|
|
16
|
+
"question": "<plain-language problem statement — what needs deciding and why. Include RECOMMENDATION: Choose [X] because [one-line reason]>",
|
|
17
|
+
"header": "<short label>",
|
|
18
|
+
"multiSelect": false,
|
|
19
|
+
"options": [
|
|
20
|
+
{"label": "A) <option> — <1-line rationale> | Fit: X/10 | Trade-off: <gain vs. lose>"},
|
|
21
|
+
{"label": "B) <option> — <1-line rationale> | Fit: X/10 | Trade-off: <gain vs. lose>"},
|
|
22
|
+
{"label": "C) <option> — <1-line rationale> | Fit: X/10 | Trade-off: <gain vs. lose>"}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
20
27
|
```
|
|
21
28
|
|
|
22
29
|
**Fit scoring calibration:**
|
|
@@ -29,9 +36,9 @@ Q<N>: <Plain-language problem statement — what needs deciding and why>
|
|
|
29
36
|
Rules:
|
|
30
37
|
- 2-4 options per question. Never more than 4.
|
|
31
38
|
- Every option must have a Fit score AND a Trade-off. No score without rationale.
|
|
32
|
-
- RECOMMENDATION is mandatory. Pick one. State why.
|
|
39
|
+
- RECOMMENDATION is mandatory in the question text. Pick one. State why.
|
|
33
40
|
- If two options score within 1 point, flag it: "Close call — A and B are both strong. Leaning A because [reason]."
|
|
34
|
-
-
|
|
41
|
+
- Pass all questions in a single `AskUserQuestion` call (not one-by-one) unless the answer to Q1 changes what Q2 should be.
|
|
35
42
|
|
|
36
43
|
---
|
|
37
44
|
|
|
@@ -275,21 +282,23 @@ Before finalizing, scan the spec for gaps. Check BOTH the spec content AND the a
|
|
|
275
282
|
| Priority consistency | P0 story with only 1 happy path AS? |
|
|
276
283
|
| Constraint coverage | Which constraint has no AS verifying it? |
|
|
277
284
|
|
|
278
|
-
Identify the top 3-5 ambiguities (most impactful first). Present
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
285
|
+
Identify the top 3-5 ambiguities (most impactful first). Present all at once using the `AskUserQuestion` tool (see Question Format at top). Example call:
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"questions": [
|
|
290
|
+
{
|
|
291
|
+
"question": "Auth strategy not specified — spec mentions 'logged-in users' but no auth mechanism. RECOMMENDATION: Choose A — single-service app, session auth is simplest path.",
|
|
292
|
+
"header": "Auth Strategy",
|
|
293
|
+
"multiSelect": false,
|
|
294
|
+
"options": [
|
|
295
|
+
{"label": "A) Session-based auth (cookie) — traditional, simple server-side | Fit: 8/10 | Trade-off: simple setup vs. harder to scale across services"},
|
|
296
|
+
{"label": "B) JWT (stateless tokens) — API-friendly, no server session | Fit: 7/10 | Trade-off: scalable vs. token revocation complexity"},
|
|
297
|
+
{"label": "C) Defer — add auth story later when auth requirements are clearer | Fit: 5/10 | Trade-off: unblocks now vs. may require spec rewrite later"}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
}
|
|
293
302
|
```
|
|
294
303
|
|
|
295
304
|
If 0 questions remain, you MUST state why — not just "spec is clear." Cite at minimum:
|
|
@@ -317,7 +326,7 @@ Show:
|
|
|
317
326
|
- AS count
|
|
318
327
|
- Directory structure created
|
|
319
328
|
- Implementation order: which stories to implement first (by priority + dependency)
|
|
320
|
-
- Next steps: "Implement stories in order. Use `/mf-
|
|
329
|
+
- Next steps: "Implement stories in order. Use `/mf-build` to verify each story. For complex specs, run `/mf-challenge` first."
|
|
321
330
|
|
|
322
331
|
---
|
|
323
332
|
|
|
@@ -425,21 +434,23 @@ Display to the user:
|
|
|
425
434
|
S-001, S-003
|
|
426
435
|
```
|
|
427
436
|
|
|
428
|
-
Present the decision using
|
|
429
|
-
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
437
|
+
Present the decision using the `AskUserQuestion` tool:
|
|
438
|
+
|
|
439
|
+
```json
|
|
440
|
+
{
|
|
441
|
+
"questions": [
|
|
442
|
+
{
|
|
443
|
+
"question": "Apply these changes to <feature> spec? RECOMMENDATION: Choose A — <reason based on change count and complexity>.",
|
|
444
|
+
"header": "Apply Changes",
|
|
445
|
+
"multiSelect": false,
|
|
446
|
+
"options": [
|
|
447
|
+
{"label": "A) Apply all — accept the full change report as shown | Fit: N/10 | Trade-off: fast vs. no per-item control"},
|
|
448
|
+
{"label": "B) Review each — walk through changes one by one, accept/reject/modify | Fit: N/10 | Trade-off: precise control vs. slower"},
|
|
449
|
+
{"label": "C) Reject all — discard and start over | Fit: N/10 | Trade-off: clean slate vs. loses work"}
|
|
450
|
+
]
|
|
451
|
+
}
|
|
452
|
+
]
|
|
453
|
+
}
|
|
443
454
|
```
|
|
444
455
|
|
|
445
456
|
> **⛔ MUST wait for user confirmation before applying.**
|
|
@@ -22,7 +22,7 @@ Step 2 → (Optional) /mf-challenge docs/specs/<feature>/<feature>.md
|
|
|
22
22
|
Skip for simple CRUD or small features.
|
|
23
23
|
|
|
24
24
|
Step 3 → Implement in chunks. After each chunk:
|
|
25
|
-
/mf-
|
|
25
|
+
/mf-build
|
|
26
26
|
Repeat until chunk is green.
|
|
27
27
|
|
|
28
28
|
Step 4 → /mf-review (before merge)
|
|
@@ -41,7 +41,7 @@ Step 1 → /mf-plan docs/specs/<feature>/<feature>.md "description of changes"
|
|
|
41
41
|
snapshot first, then applies changes. Manual edits bypass snapshot protection.
|
|
42
42
|
|
|
43
43
|
Step 2 → Implement code changes.
|
|
44
|
-
/mf-
|
|
44
|
+
/mf-build
|
|
45
45
|
Fix until green.
|
|
46
46
|
|
|
47
47
|
Step 4 → /mf-review → /mf-commit
|
|
@@ -99,7 +99,7 @@ Is this a brand new feature (no existing spec or code)?
|
|
|
99
99
|
│ │ └─ No → Update Feature workflow. Start with /mf-plan.
|
|
100
100
|
│ │
|
|
101
101
|
│ └─ Is the change very small (< 5 lines, behavior unchanged)?
|
|
102
|
-
│ └─ Yes → Skip spec update. Just /mf-
|
|
102
|
+
│ └─ Yes → Skip spec update. Just /mf-build and /mf-commit.
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
---
|
|
@@ -170,7 +170,7 @@ Files to delete: [list]
|
|
|
170
170
|
|
|
171
171
|
| Workflow | Estimated Tokens | When |
|
|
172
172
|
|----------|-----------------|------|
|
|
173
|
-
| `/mf-
|
|
173
|
+
| `/mf-build` (incremental) | 5–10k | Daily, after each code chunk |
|
|
174
174
|
| `/mf-fix` (single bug) | 3–5k | As bugs arise |
|
|
175
175
|
| `/mf-commit` | 2–4k | Each commit |
|
|
176
176
|
| `/mf-review` (diff-based) | 10–20k | Before merge |
|
|
@@ -178,7 +178,7 @@ Files to delete: [list]
|
|
|
178
178
|
| `/mf-challenge` (adversarial) | 15–30k | After /mf-plan, for complex features |
|
|
179
179
|
| Full audit (manual) | 100k+ | Before release, quarterly |
|
|
180
180
|
|
|
181
|
-
**Rule of thumb:** Daily work uses templates + `/mf-
|
|
181
|
+
**Rule of thumb:** Daily work uses templates + `/mf-build` → low token cost.
|
|
182
182
|
Save `/mf-plan` and full audits for significant milestones.
|
|
183
183
|
|
|
184
184
|
---
|