claude-devkit-cli 1.4.2 → 1.4.3
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/package.json
CHANGED
|
@@ -15,6 +15,9 @@ TDD delivery loop — write failing tests from spec AS, implement story by story
|
|
|
15
15
|
If no changes → "No source changes found. Specify a file or feature."
|
|
16
16
|
|
|
17
17
|
2. **Read the spec** at `docs/specs/<feature>/<feature>.md` — the `## Stories` section with acceptance scenarios is your roadmap. The `## Overview` and `## Constraints` sections tell you the INTENT behind the code.
|
|
18
|
+
|
|
19
|
+
3. **Locate related code:** If `codebase-memory-mcp` is available, use `search_code` to find all files touching this feature, and `trace_call_path` to understand dependency chain before writing tests — faster and more accurate than manual grep. Fallback: Grep for the main function/type names in the changed files.
|
|
20
|
+
|
|
18
21
|
4. **Read existing tests** for the changed files — find patterns, fixtures, naming conventions. Don't duplicate.
|
|
19
22
|
|
|
20
23
|
---
|
|
@@ -111,19 +114,32 @@ Files: [test files touched]
|
|
|
111
114
|
Stories: [AS-001 ✓, AS-002 ✓, AS-005 new]
|
|
112
115
|
```
|
|
113
116
|
|
|
114
|
-
|
|
117
|
+
### Spec Update Signal
|
|
118
|
+
|
|
119
|
+
After every build, check against these conditions. If ANY is true → **must** signal.
|
|
115
120
|
|
|
116
|
-
|
|
121
|
+
**Signal when (MUST):**
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
| # | Condition |
|
|
124
|
+
|---|-----------|
|
|
125
|
+
| S1 | A new test covers behavior, edge case, or error path with no corresponding AS in the spec |
|
|
126
|
+
| S2 | Code behavior no longer matches the Given/When/Then of an existing AS (spec is stale) |
|
|
127
|
+
| S3 | Implementation adds a new constraint or guard not documented in any AS or Constraints section |
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
**Do not signal when:**
|
|
130
|
+
- Pure refactor — behavior unchanged, all existing AS still map correctly
|
|
131
|
+
- Performance fix — same output, just faster
|
|
132
|
+
- Fix to match spec — code was wrong, spec was right, no new behavior added
|
|
133
|
+
|
|
134
|
+
**Signal format:**
|
|
135
|
+
```
|
|
136
|
+
⚠️ Spec Update Needed — run `/mf-plan docs/specs/<feature>/<feature>.md '<describe change>'`
|
|
137
|
+
Reason: [S1 | S2 | S3] — <one line: what is missing or mismatched>
|
|
138
|
+
```
|
|
123
139
|
|
|
124
|
-
|
|
140
|
+
If S1 applies to a failing test: state **"This failure suggests a missing acceptance scenario."** Describe the gap and prompt to run `/mf-plan` before re-running `/mf-build`. Do not silently add the test without the AS.
|
|
125
141
|
|
|
126
142
|
## Rules
|
|
127
143
|
1. **Behavior over implementation.** Test what code DOES, not how.
|
|
128
144
|
2. **Independent tests.** Each test sets up its own state, cleans up after.
|
|
129
|
-
3. **Spec stays upstream.** If a test reveals a spec gap, update the spec before adding the test.
|
|
145
|
+
3. **Spec stays upstream.** If a test reveals a spec gap (S1), signal and update the spec before adding the test. If code drifts from spec (S2), signal. If new constraint added (S3), signal.
|
|
@@ -13,7 +13,7 @@ Bug: $ARGUMENTS
|
|
|
13
13
|
Don't jump to code. Understand the bug first:
|
|
14
14
|
|
|
15
15
|
1. **Parse the report.** Symptom? Expected vs actual? Repro steps?
|
|
16
|
-
2. **Locate the code.** Grep for keywords from the bug (error messages, function names).
|
|
16
|
+
2. **Locate the code.** If `codebase-memory-mcp` is available, use `search_code("<error message or function name>")` to find related files faster, and `trace_call_path` to map callers and impact radius. Fallback: Grep for keywords from the bug (error messages, function names).
|
|
17
17
|
3. **Check history.** `git log --oneline -5 -- <file>` and `git blame -L <range> <file>` — who changed this last and why?
|
|
18
18
|
4. **Form a hypothesis:** "I believe the bug is caused by [X] in [file:function] because [evidence]."
|
|
19
19
|
|
|
@@ -102,7 +102,27 @@ Prevention: <suggestion>
|
|
|
102
102
|
Full suite: All passing ✓
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
### Spec Update Signal
|
|
106
|
+
|
|
107
|
+
After fixing, check these conditions. If ANY is true → **must** signal.
|
|
108
|
+
|
|
109
|
+
**Signal when (MUST):**
|
|
110
|
+
|
|
111
|
+
| # | Condition |
|
|
112
|
+
|---|-----------|
|
|
113
|
+
| S1 | Fix covers an edge case or error path with no corresponding AS in the spec |
|
|
114
|
+
| S2 | Bug existed because an AS described wrong behavior — After fix, code and AS now conflict |
|
|
115
|
+
| S3 | Fix adds a new constraint or guard (null check, balance guard, validation) not in spec |
|
|
116
|
+
|
|
117
|
+
**Do not signal when:**
|
|
118
|
+
- Fix is a clear typo/off-by-one — code was always wrong relative to spec, no new behavior
|
|
119
|
+
- Performance-only fix — output unchanged
|
|
120
|
+
|
|
121
|
+
**Signal format:**
|
|
122
|
+
```
|
|
123
|
+
⚠️ Spec Update Needed — run `/mf-plan docs/specs/<feature>/<feature>.md '<describe change>'`
|
|
124
|
+
Reason: [S1 | S2 | S3] — <one line: what is missing or mismatched>
|
|
125
|
+
```
|
|
106
126
|
|
|
107
127
|
## Multiple Bugs
|
|
108
128
|
|
|
@@ -13,6 +13,7 @@ Pre-merge code review — security, correctness, spec alignment.
|
|
|
13
13
|
```
|
|
14
14
|
2. Check for spec in `docs/specs/<feature>/<feature>.md` — review against INTENT.
|
|
15
15
|
3. Read the diff: `git diff "$BASE"...HEAD`
|
|
16
|
+
4. **Expand blast radius:** If `codebase-memory-mcp` is available, use `search_code("<changed function or type>")` to find files not in the diff that may be affected, and `get_architecture()` to check if changed files belong to a sensitive layer (auth, payment, core). Fallback: skip, review diff only.
|
|
16
17
|
|
|
17
18
|
If `$ARGUMENTS` provided → scope to those files only.
|
|
18
19
|
If diff > 500 lines → review file-by-file, prioritize by smart focus below.
|