@drafthq/draft 3.5.3 → 3.7.1
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/README.md +28 -49
- package/bin/README.md +47 -1
- package/cli/src/hosts/cursor.js +3 -0
- package/cli/src/installer.js +8 -4
- package/cli/src/lib/cursor-registry.js +10 -0
- package/cli/src/lib/fsx.js +3 -0
- package/cli/src/lib/marker.js +8 -3
- package/core/agents/architect.md +21 -9
- package/core/agents/debugger.md +5 -0
- package/core/agents/ops.md +7 -2
- package/core/agents/planner.md +7 -0
- package/core/agents/rca.md +14 -3
- package/core/agents/reviewer.md +1 -0
- package/core/agents/writer.md +6 -0
- package/core/knowledge-base.md +22 -3
- package/core/methodology.md +30 -5
- package/core/shared/condensation.md +28 -18
- package/core/shared/context-verify.md +3 -1
- package/core/shared/cross-skill-dispatch.md +7 -3
- package/core/shared/draft-context-loading.md +3 -0
- package/core/shared/git-report-metadata.md +2 -1
- package/core/shared/graph-query.md +24 -26
- package/core/shared/graph-usage-report.md +1 -1
- package/core/shared/jira-sync.md +10 -6
- package/core/shared/okf-retrieval.md +1 -1
- package/core/shared/parallel-analysis.md +14 -7
- package/core/shared/pattern-learning.md +2 -0
- package/core/shared/template-contract.md +1 -1
- package/core/shared/tool-resolver.md +20 -15
- package/core/shared/vcs-commands.md +5 -2
- package/core/templates/ai-context.md +3 -2
- package/core/templates/ai-profile.md +7 -0
- package/core/templates/architecture.md +6 -2
- package/core/templates/discovery.md +1 -1
- package/core/templates/guardrails.md +9 -0
- package/core/templates/hld.md +5 -4
- package/core/templates/intake-questions.md +45 -0
- package/core/templates/jira.md +11 -2
- package/core/templates/lld.md +8 -5
- package/core/templates/okf/concept.md +0 -1
- package/core/templates/plan.md +1 -1
- package/core/templates/product.md +11 -2
- package/core/templates/rca.md +6 -0
- package/core/templates/service-index.md +1 -0
- package/core/templates/spec.md +15 -0
- package/core/templates/tech-stack.md +12 -0
- package/core/templates/workflow.md +20 -0
- package/integrations/agents/AGENTS.md +1449 -817
- package/integrations/copilot/.github/copilot-instructions.md +1449 -817
- package/package.json +1 -1
- package/scripts/fetch-memory-engine.sh +25 -7
- package/scripts/lib.sh +90 -6
- package/scripts/tools/_graph_queries.sh +22 -8
- package/scripts/tools/_lib.sh +81 -11
- package/scripts/tools/adr-index.sh +1 -1
- package/scripts/tools/check-repo-size.sh +125 -0
- package/scripts/tools/check-skill-line-caps.sh +3 -4
- package/scripts/tools/check-template-noop.sh +0 -1
- package/scripts/tools/check-track-hygiene.sh +41 -21
- package/scripts/tools/classify-files.sh +3 -3
- package/scripts/tools/cycle-detect.sh +18 -17
- package/scripts/tools/detect-test-framework.sh +1 -1
- package/scripts/tools/emit-skill-metrics.sh +7 -2
- package/scripts/tools/fix-whitespace.sh +3 -0
- package/scripts/tools/freshness-check.sh +2 -2
- package/scripts/tools/git-metadata.sh +12 -6
- package/scripts/tools/graph-arch.sh +5 -11
- package/scripts/tools/graph-callers.sh +10 -15
- package/scripts/tools/graph-deps.sh +3 -10
- package/scripts/tools/graph-errors.sh +4 -11
- package/scripts/tools/graph-hierarchy.sh +4 -11
- package/scripts/tools/graph-impact.sh +21 -19
- package/scripts/tools/graph-init.sh +13 -9
- package/scripts/tools/graph-preflight.sh +4 -1
- package/scripts/tools/graph-query.sh +74 -18
- package/scripts/tools/graph-risk.sh +3 -10
- package/scripts/tools/graph-search.sh +4 -11
- package/scripts/tools/graph-snapshot.sh +38 -9
- package/scripts/tools/graph-snippet.sh +3 -10
- package/scripts/tools/graph-tests.sh +3 -10
- package/scripts/tools/graph-traces.sh +3 -10
- package/scripts/tools/hotspot-rank.sh +6 -12
- package/scripts/tools/install-smoke-test.sh +223 -0
- package/scripts/tools/mermaid-from-graph.sh +5 -11
- package/scripts/tools/migrate-track-frontmatter.sh +11 -10
- package/scripts/tools/okf-coverage-check.sh +8 -7
- package/scripts/tools/okf-emit-catalog.sh +256 -0
- package/scripts/tools/okf-fix-links.sh +251 -0
- package/scripts/tools/okf-plan-concepts.sh +242 -14
- package/scripts/tools/okf-render-views.sh +63 -21
- package/scripts/tools/okf-validate-all.sh +20 -9
- package/scripts/tools/okf-validate-quality.sh +15 -10
- package/scripts/tools/okf-validate.sh +20 -6
- package/scripts/tools/parse-git-log.sh +23 -5
- package/scripts/tools/parse-reports.sh +1 -1
- package/scripts/tools/render-track.sh +1 -1
- package/scripts/tools/resolve-tools.sh +24 -8
- package/scripts/tools/run-coverage.sh +1 -1
- package/scripts/tools/scan-markers.sh +4 -4
- package/scripts/tools/validate-frontmatter.sh +2 -2
- package/scripts/tools/verify-citations.sh +3 -4
- package/scripts/tools/verify-doc-anchors.sh +14 -34
- package/scripts/tools/verify-graph-binary.sh +15 -5
- package/skills/GRAPH.md +21 -10
- package/skills/adr/SKILL.md +25 -7
- package/skills/assist-review/SKILL.md +2 -1
- package/skills/bughunt/SKILL.md +55 -12
- package/skills/bughunt/references/regression-tests.md +14 -4
- package/skills/change/SKILL.md +19 -9
- package/skills/coverage/SKILL.md +28 -12
- package/skills/debug/SKILL.md +13 -3
- package/skills/decompose/SKILL.md +42 -12
- package/skills/deep-review/SKILL.md +19 -6
- package/skills/deploy-checklist/SKILL.md +10 -3
- package/skills/documentation/SKILL.md +12 -1
- package/skills/draft/SKILL.md +40 -29
- package/skills/draft/context-files.md +8 -1
- package/skills/draft/quality-guide.md +10 -2
- package/skills/graph/SKILL.md +2 -2
- package/skills/impact/SKILL.md +4 -2
- package/skills/implement/SKILL.md +62 -20
- package/skills/incident-response/SKILL.md +5 -2
- package/skills/init/SKILL.md +112 -30
- package/skills/init/references/architecture-spec.md +32 -8
- package/skills/init/references/okf-emitter.md +42 -78
- package/skills/jira/SKILL.md +33 -13
- package/skills/jira/references/review.md +61 -19
- package/skills/learn/SKILL.md +30 -7
- package/skills/new-track/SKILL.md +73 -18
- package/skills/quick-review/SKILL.md +8 -3
- package/skills/revert/SKILL.md +11 -5
- package/skills/review/SKILL.md +126 -27
- package/skills/review/references/zero-setup-mode.md +117 -0
- package/skills/standup/SKILL.md +10 -2
- package/skills/status/SKILL.md +7 -7
- package/skills/tech-debt/SKILL.md +9 -3
- package/skills/testing-strategy/SKILL.md +10 -2
- package/skills/tour/SKILL.md +2 -1
- package/skills/upload/SKILL.md +4 -3
- package/core/templates/track-architecture.md +0 -311
package/skills/change/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Handle mid-track requirement changes. Analyzes impact on completed
|
|
|
7
7
|
|
|
8
8
|
You are handling a mid-track requirement change using Draft's Context-Driven Development methodology.
|
|
9
9
|
|
|
10
|
-
## Red Flags - STOP if you're
|
|
10
|
+
## Red Flags - STOP if you're
|
|
11
11
|
|
|
12
12
|
- Applying changes to spec.md or plan.md without showing the user what will change first
|
|
13
13
|
- Invalidating `[x]` completed tasks without flagging them explicitly
|
|
@@ -38,11 +38,13 @@ Extract from `$ARGUMENTS`:
|
|
|
38
38
|
### Default Behavior
|
|
39
39
|
|
|
40
40
|
If no `track <id>` specified:
|
|
41
|
+
|
|
41
42
|
- Auto-detect the active `[~]` In Progress track from `draft/tracks.md`
|
|
42
43
|
- If no `[~]` track, find the first `[ ]` Pending track
|
|
43
44
|
- Display: `Auto-detected track: <id> - <name>` before proceeding
|
|
44
45
|
|
|
45
46
|
If no change description provided:
|
|
47
|
+
|
|
46
48
|
- Error: "Usage: `/draft:change <description>` or `/draft:change track <id> <description>`"
|
|
47
49
|
|
|
48
50
|
---
|
|
@@ -73,7 +75,8 @@ For each requirement and acceptance criterion, classify the effect:
|
|
|
73
75
|
| **Unaffected** | No change needed |
|
|
74
76
|
|
|
75
77
|
Produce a concise impact list. Example:
|
|
76
|
-
|
|
78
|
+
|
|
79
|
+
```text
|
|
77
80
|
Spec impact:
|
|
78
81
|
- AC #2 "User can export to CSV" → Modified (now also requires JSON format)
|
|
79
82
|
- AC #5 "Export limited to 1000 rows" → Removed (no row limit)
|
|
@@ -81,6 +84,7 @@ Spec impact:
|
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
**HLD impact** (only when `hld.md` exists):
|
|
87
|
+
|
|
84
88
|
- §Architecture / Component Diagram — does the change introduce new modules or alter integration edges?
|
|
85
89
|
- §Detailed Design — does any per-component subsection need updating, or are new components introduced?
|
|
86
90
|
- §Dependencies — new/removed dependent components?
|
|
@@ -89,6 +93,7 @@ Spec impact:
|
|
|
89
93
|
- §Deployment — does the deployment surface change?
|
|
90
94
|
|
|
91
95
|
**LLD impact** (only when `lld.md` exists):
|
|
96
|
+
|
|
92
97
|
- §Classes and Interfaces — signatures added/modified/removed?
|
|
93
98
|
- §Data Model — schema changes? New fields? Migration required?
|
|
94
99
|
- §Key Algorithms and Workflows — algorithm changes? New sequence diagrams needed?
|
|
@@ -97,7 +102,7 @@ Spec impact:
|
|
|
97
102
|
|
|
98
103
|
**Re-approval flag:** If the HLD Approvals table has any signed rows (Date column populated) AND the change touches HLD structural sections (Architecture, Detailed Design, Dependencies, Checklist, IP, Deployment), surface this warning prominently:
|
|
99
104
|
|
|
100
|
-
```
|
|
105
|
+
```text
|
|
101
106
|
⚠️ HLD modified after sign-off — Approvals table requires re-circulation.
|
|
102
107
|
Signed rows: [list which roles signed and when]
|
|
103
108
|
Changed sections: [list of HLD sections impacted]
|
|
@@ -130,7 +135,7 @@ For each task in `plan.md`, determine if the spec change affects it:
|
|
|
130
135
|
|
|
131
136
|
Display a clear summary before proposing any file changes:
|
|
132
137
|
|
|
133
|
-
```
|
|
138
|
+
```yaml
|
|
134
139
|
Change: [change description]
|
|
135
140
|
Track: <track_id> — <track_name>
|
|
136
141
|
|
|
@@ -178,7 +183,7 @@ Show before/after for each impacted LLD section. Preserve §Approvals verbatim.
|
|
|
178
183
|
|
|
179
184
|
## Step 7: CHECKPOINT
|
|
180
185
|
|
|
181
|
-
```
|
|
186
|
+
```text
|
|
182
187
|
Apply these changes to spec.md and plan.md? [yes / no / edit]
|
|
183
188
|
```
|
|
184
189
|
|
|
@@ -208,7 +213,7 @@ Apply these changes to spec.md and plan.md? [yes / no / edit]
|
|
|
208
213
|
|
|
209
214
|
4. Announce:
|
|
210
215
|
|
|
211
|
-
```
|
|
216
|
+
```text
|
|
212
217
|
Changes applied: <track_id>
|
|
213
218
|
|
|
214
219
|
Updated:
|
|
@@ -235,19 +240,22 @@ Next: /draft:implement to continue, or /draft:review to assess current state.
|
|
|
235
240
|
## Error Handling
|
|
236
241
|
|
|
237
242
|
### Track Not Found
|
|
238
|
-
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
239
245
|
Error: Track '<id>' not found.
|
|
240
246
|
Run /draft:status to see available tracks.
|
|
241
247
|
```
|
|
242
248
|
|
|
243
249
|
### No Active Track
|
|
244
|
-
|
|
250
|
+
|
|
251
|
+
```yaml
|
|
245
252
|
Error: No active track found.
|
|
246
253
|
Use: /draft:change track <id> <description>
|
|
247
254
|
```
|
|
248
255
|
|
|
249
256
|
### No Spec or Plan
|
|
250
|
-
|
|
257
|
+
|
|
258
|
+
```yaml
|
|
251
259
|
Error: Missing spec.md or plan.md for track <id>.
|
|
252
260
|
Cannot perform change analysis without both files.
|
|
253
261
|
```
|
|
@@ -257,11 +265,13 @@ Cannot perform change analysis without both files.
|
|
|
257
265
|
## Examples
|
|
258
266
|
|
|
259
267
|
### Change description for active track
|
|
268
|
+
|
|
260
269
|
```bash
|
|
261
270
|
/draft:change the export format should support JSON in addition to CSV
|
|
262
271
|
```
|
|
263
272
|
|
|
264
273
|
### Targeting a specific track
|
|
274
|
+
|
|
265
275
|
```bash
|
|
266
276
|
/draft:change track add-export-feature also require a progress indicator for exports over 500 rows
|
|
267
277
|
```
|
package/skills/coverage/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Compute code coverage for active track or module. Targets 95%+ cove
|
|
|
7
7
|
|
|
8
8
|
You are computing and reporting code coverage for the active track or a specific module. This complements the TDD workflow — TDD is the process (write test, implement, refactor), coverage is the measurement (how much code do those tests exercise).
|
|
9
9
|
|
|
10
|
-
## Red Flags - STOP if you're
|
|
10
|
+
## Red Flags - STOP if you're
|
|
11
11
|
|
|
12
12
|
- Reporting coverage without actually running the coverage tool
|
|
13
13
|
- Making up coverage percentages
|
|
@@ -26,6 +26,7 @@ You are computing and reporting code coverage for the active track or a specific
|
|
|
26
26
|
5. Check if `draft/tracks/<id>/bughunt-report-latest.md` (track scope) or `draft/bughunt-report-latest.md` (project scope) exists for cross-referencing (see Coverage-Bughunt Cross-Reference below)
|
|
27
27
|
|
|
28
28
|
If no active track and no argument provided:
|
|
29
|
+
|
|
29
30
|
- Tell user: "No active track. Provide a path or track ID, or run `/draft:new-track` first."
|
|
30
31
|
|
|
31
32
|
## Step 2: Detect Coverage Tool
|
|
@@ -33,7 +34,7 @@ If no active track and no argument provided:
|
|
|
33
34
|
**Preferred:** use the deterministic `detect-test-framework.sh` wrapper — it emits JSON `{languages:[{language,framework,runner_command,test_globs,config_file}]}`. Resolve via the canonical tool resolver (see [core/shared/tool-resolver.md](../../core/shared/tool-resolver.md)):
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
37
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
37
38
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
38
39
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
39
40
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -54,6 +55,7 @@ If the script is unavailable or returns `framework: unknown`, fall back to the h
|
|
|
54
55
|
| Ruby | `simplecov` |
|
|
55
56
|
|
|
56
57
|
**Detection order (fallback path):**
|
|
58
|
+
|
|
57
59
|
1. Check `tech-stack.md` for explicit testing section
|
|
58
60
|
2. Check config files (`jest.config.*`, `vitest.config.*`, `pytest.ini`, `setup.cfg`, `pyproject.toml`, `.nycrc`)
|
|
59
61
|
3. Check `package.json` scripts for coverage commands
|
|
@@ -62,6 +64,7 @@ If the script is unavailable or returns `framework: unknown`, fall back to the h
|
|
|
62
64
|
## Step 3: Determine Scope
|
|
63
65
|
|
|
64
66
|
**Priority order:**
|
|
67
|
+
|
|
65
68
|
1. If argument provided (path or module name): use as scope filter
|
|
66
69
|
2. If track has `architecture.md` (or project has `.ai-context.md`) with an in-progress module: scope to that module's files
|
|
67
70
|
3. If active track exists: scope to files changed in the track (use `git diff` against base branch)
|
|
@@ -75,7 +78,7 @@ Build the coverage command with the appropriate scope/filter flags.
|
|
|
75
78
|
|
|
76
79
|
```bash
|
|
77
80
|
# Re-resolve helpers (this is a separate Bash session from Step 2).
|
|
78
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
81
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
79
82
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
80
83
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
81
84
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -84,6 +87,7 @@ DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
|
84
87
|
```
|
|
85
88
|
|
|
86
89
|
If the script is unavailable or returns `tool: unsupported`:
|
|
90
|
+
|
|
87
91
|
1. Execute the coverage command. Request machine-readable output when possible: `--json` for Jest, `--cov-report=json` for pytest, `-coverprofile` for Go, `--coverage-output-format json` for dotnet.
|
|
88
92
|
2. Capture full output
|
|
89
93
|
3. If command fails:
|
|
@@ -95,7 +99,7 @@ If the script is unavailable or returns `tool: unsupported`:
|
|
|
95
99
|
|
|
96
100
|
Parse coverage output and present in a standardized format:
|
|
97
101
|
|
|
98
|
-
```
|
|
102
|
+
```yaml
|
|
99
103
|
---
|
|
100
104
|
COVERAGE REPORT
|
|
101
105
|
---
|
|
@@ -151,7 +155,8 @@ For files below target (using per-module targets when configured — see Per-Mod
|
|
|
151
155
|
- **Infrastructure** - Framework boilerplate, main entry points. Usually acceptable.
|
|
152
156
|
- **Legacy/Brownfield** - Modules with 0% or very low coverage that need refactoring. Apply Characterization Testing (see below).
|
|
153
157
|
3. **Suggest tests** for testable gaps:
|
|
154
|
-
|
|
158
|
+
|
|
159
|
+
```text
|
|
155
160
|
SUGGESTED TESTS
|
|
156
161
|
─────────────────────────────────────────────────────────
|
|
157
162
|
1. Test malformed JWT token handling (jwt.ts:45-52)
|
|
@@ -174,7 +179,8 @@ When encountering modules with 0% or very low coverage that need refactoring, do
|
|
|
174
179
|
5. **Remove approval tests** — Once proper unit test coverage meets the target, retire the Golden Master tests.
|
|
175
180
|
|
|
176
181
|
**Tool references:**
|
|
177
|
-
|
|
182
|
+
|
|
183
|
+
- ApprovalTests (<https://approvaltests.com/>) — available for Java, C#, Python, JS, and more
|
|
178
184
|
- Verify (.NET) — snapshot testing library
|
|
179
185
|
|
|
180
186
|
Present characterization testing recommendations in the gap analysis when applicable.
|
|
@@ -191,11 +197,11 @@ After measuring line coverage (and branch coverage if applicable), prompt the en
|
|
|
191
197
|
|
|
192
198
|
| Language | Tool | Reference |
|
|
193
199
|
|----------|------|-----------|
|
|
194
|
-
| Java | PIT | https://pitest.org
|
|
195
|
-
| JavaScript/TypeScript | Stryker | https://stryker-mutator.io
|
|
200
|
+
| Java | PIT | <https://pitest.org/> |
|
|
201
|
+
| JavaScript/TypeScript | Stryker | <https://stryker-mutator.io/> |
|
|
196
202
|
| Python | mutmut | (Mutation testing tool) |
|
|
197
203
|
| Rust | cargo-mutants | (Mutation testing tool) |
|
|
198
|
-
| C# | Stryker.NET | https://stryker-mutator.io
|
|
204
|
+
| C# | Stryker.NET | <https://stryker-mutator.io/> |
|
|
199
205
|
| Go | go-mutesting | (Mutation testing tool) |
|
|
200
206
|
|
|
201
207
|
**Reference:** Google's mutation testing program is used by 6,000+ engineers and processes approximately 30% of all code diffs, validating that mutation testing scales to large codebases.
|
|
@@ -209,7 +215,8 @@ If a bughunt report exists (`draft/tracks/<id>/bughunt-report-latest.md` or `dra
|
|
|
209
215
|
1. **Parse bughunt findings** — Extract file paths and line ranges of confirmed or suspected bugs.
|
|
210
216
|
2. **Cross-reference with uncovered code paths** — Identify bughunt findings that fall in uncovered lines.
|
|
211
217
|
3. **Flag as highest-priority test gaps** — Confirmed bugs in uncovered code are the most dangerous gaps. Present them prominently:
|
|
212
|
-
|
|
218
|
+
|
|
219
|
+
```text
|
|
213
220
|
BUGHUNT CROSS-REFERENCE
|
|
214
221
|
─────────────────────────────────────────────────────────
|
|
215
222
|
⚠ CRITICAL: Bug "Race condition in session refresh" (bughunt #3)
|
|
@@ -220,6 +227,7 @@ If a bughunt report exists (`draft/tracks/<id>/bughunt-report-latest.md` or `dra
|
|
|
220
227
|
at src/users/repository.ts:45 — IN UNCOVERED CODE
|
|
221
228
|
→ Write a regression test targeting this path
|
|
222
229
|
```
|
|
230
|
+
|
|
223
231
|
4. **Prioritize suggested tests** — Tests that cover bughunt-flagged code should appear first in the SUGGESTED TESTS section.
|
|
224
232
|
|
|
225
233
|
## Per-Module Coverage Enforcement
|
|
@@ -255,7 +263,8 @@ coverage_targets:
|
|
|
255
263
|
**Classification heuristic:** Infer module risk from directory names and file content when explicit configuration is absent. Flag the inferred classification in the report so the developer can correct it.
|
|
256
264
|
|
|
257
265
|
In the coverage report, show per-module targets alongside actual coverage:
|
|
258
|
-
|
|
266
|
+
|
|
267
|
+
```text
|
|
259
268
|
PER-FILE BREAKDOWN (module-level targets)
|
|
260
269
|
---
|
|
261
270
|
src/auth/middleware.ts 96.2% [high_risk: 95%] PASS
|
|
@@ -271,6 +280,7 @@ src/generated/api.ts — [generated: excluded]
|
|
|
271
280
|
**STOP.** Present the full coverage report and gap analysis.
|
|
272
281
|
|
|
273
282
|
Ask developer:
|
|
283
|
+
|
|
274
284
|
- Accept current coverage? (if at or above target)
|
|
275
285
|
- Write additional tests for testable gaps?
|
|
276
286
|
- Justify and document acceptable uncovered lines?
|
|
@@ -283,17 +293,20 @@ Ask developer:
|
|
|
283
293
|
After developer approves:
|
|
284
294
|
|
|
285
295
|
1. **Update plan.md** - Add coverage note to the relevant phase:
|
|
296
|
+
|
|
286
297
|
```markdown
|
|
287
298
|
**Coverage:** 96.2% (target: 95%) - PASS
|
|
288
299
|
- Uncovered: defensive null checks in jwt.ts (justified)
|
|
289
300
|
```
|
|
290
301
|
|
|
291
302
|
2. **Update architecture context** — update the project-level `draft/architecture.md` with coverage data (not a track-level architecture file), then run the Condensation Subroutine (defined in `core/shared/condensation.md`) to regenerate `draft/.ai-context.md`. The Condensation Subroutine only applies to the project-level `draft/architecture.md` → `draft/.ai-context.md` pipeline:
|
|
303
|
+
|
|
292
304
|
```markdown
|
|
293
305
|
- **Status:** [x] Complete (Coverage: 96.2%)
|
|
294
306
|
```
|
|
295
307
|
|
|
296
308
|
3. **Update metadata.json** - Add coverage field if not present:
|
|
309
|
+
|
|
297
310
|
```json
|
|
298
311
|
{
|
|
299
312
|
"coverage": {
|
|
@@ -307,6 +320,7 @@ After developer approves:
|
|
|
307
320
|
4. **Write detailed coverage report** to `draft/tracks/<id>/coverage-report-<timestamp>.md` (where `<timestamp>` is generated via `date +%Y-%m-%dT%H%M`, e.g., `2026-03-15T1430`) with YAML frontmatter (include `project`, `track_id`, `generated_by: "draft:coverage"`, `generated_at`, `git` metadata matching other skills) and timestamped entries for historical tracking.
|
|
308
321
|
|
|
309
322
|
After writing the timestamped report, create a symlink pointing to it:
|
|
323
|
+
|
|
310
324
|
```bash
|
|
311
325
|
ln -sf coverage-report-<timestamp>.md draft/tracks/<id>/coverage-report-latest.md
|
|
312
326
|
```
|
|
@@ -316,7 +330,8 @@ After developer approves:
|
|
|
316
330
|
## Completion
|
|
317
331
|
|
|
318
332
|
Announce:
|
|
319
|
-
|
|
333
|
+
|
|
334
|
+
```text
|
|
320
335
|
Coverage report complete.
|
|
321
336
|
|
|
322
337
|
Overall: [percentage]% (target: [target]%)
|
|
@@ -335,6 +350,7 @@ Results recorded in:
|
|
|
335
350
|
## Re-running Coverage
|
|
336
351
|
|
|
337
352
|
When coverage is run again on the same track/module:
|
|
353
|
+
|
|
338
354
|
1. Compare with previous results from metadata.json. If no previous coverage data found in metadata.json, skip delta comparison and report current values only.
|
|
339
355
|
2. Show delta: "Coverage improved from 87.3% to 96.2% (+8.9%)"
|
|
340
356
|
3. Highlight newly covered lines
|
package/skills/debug/SKILL.md
CHANGED
|
@@ -14,7 +14,7 @@ First resolve the bundled helpers:
|
|
|
14
14
|
```bash
|
|
15
15
|
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
16
16
|
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
17
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
17
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
18
18
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
19
19
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
20
20
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -29,11 +29,12 @@ When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-firs
|
|
|
29
29
|
|
|
30
30
|
Filesystem `grep` is reserved for source-text scans (literal error strings, stack-trace symbols when the graph misses). Use the fallback sentence on graph miss.
|
|
31
31
|
|
|
32
|
-
## Red Flags — STOP if you're
|
|
32
|
+
## Red Flags — STOP if you're
|
|
33
33
|
|
|
34
34
|
See [shared red flags](../../core/shared/red-flags.md) — applies to all code-touching skills.
|
|
35
35
|
|
|
36
36
|
Skill-specific:
|
|
37
|
+
|
|
37
38
|
- Making code changes before reproducing the bug
|
|
38
39
|
- Guessing at the cause instead of tracing data/control flow
|
|
39
40
|
- Trying multiple fixes simultaneously ("shotgun debugging")
|
|
@@ -70,6 +71,7 @@ Debug can run standalone (without draft context) or within a draft track. If `dr
|
|
|
70
71
|
Read and follow the base procedure in `core/shared/draft-context-loading.md`.
|
|
71
72
|
|
|
72
73
|
Key context for debugging:
|
|
74
|
+
|
|
73
75
|
- `.ai-context.md` — Module boundaries, data flows, invariants (crucial for tracing)
|
|
74
76
|
- `tech-stack.md` — Language-specific debugging tools and techniques
|
|
75
77
|
- `guardrails.md` — Known anti-patterns that may be causing the issue
|
|
@@ -78,12 +80,14 @@ Key context for debugging:
|
|
|
78
80
|
## Step 1: Parse Arguments
|
|
79
81
|
|
|
80
82
|
Check for arguments:
|
|
83
|
+
|
|
81
84
|
- `/draft:debug` — Interactive: ask what's broken
|
|
82
85
|
- `/draft:debug <description>` — Start with the described problem
|
|
83
86
|
- `/draft:debug track <id>` — Debug within a specific track context (load spec.md, plan.md)
|
|
84
87
|
- `/draft:debug <JIRA-KEY>` — Pull context from Jira ticket via MCP
|
|
85
88
|
|
|
86
89
|
If a Jira ticket is provided:
|
|
90
|
+
|
|
87
91
|
1. Pull ticket via Jira MCP: `get_issue()`, `get_issue_description()`, `get_issue_comments()`
|
|
88
92
|
2. Extract: URLs, log paths, stack traces, reproduction steps, affected services
|
|
89
93
|
3. Use `curl`/`wget` to fetch any URLs mentioned (dashboards, error pages, API responses)
|
|
@@ -111,8 +115,10 @@ Reference `core/agents/debugger.md` Phase 1 for detailed investigation technique
|
|
|
111
115
|
1. **Trace data flow** — Follow data from input to failure point, documenting each hop with `file:line` references
|
|
112
116
|
2. **Trace control flow** — Map the execution path, identify where it diverges from expected behavior
|
|
113
117
|
3. **Differential analysis** — Compare working vs failing cases:
|
|
118
|
+
|
|
114
119
|
| Aspect | Working Case | Failing Case | Difference |
|
|
115
120
|
|--------|-------------|-------------|------------|
|
|
121
|
+
|
|
116
122
|
4. **Check boundaries** — Reference `.ai-context.md` module boundaries to scope the investigation
|
|
117
123
|
|
|
118
124
|
Reference `core/agents/debugger.md` Phase 2 for language-specific debugging techniques.
|
|
@@ -143,9 +149,11 @@ Reference `core/agents/debugger.md` Phase 3 and `core/agents/rca.md` for 5 Whys
|
|
|
143
149
|
### Test Writing Guardrail
|
|
144
150
|
|
|
145
151
|
**STOP.** Before writing any test:
|
|
146
|
-
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
147
154
|
ASK: "Root cause confirmed: [summary]. Want me to write a regression test for this fix? [Y/n]"
|
|
148
155
|
```
|
|
156
|
+
|
|
149
157
|
- If accepted: write regression test first (fails before fix, passes after)
|
|
150
158
|
- If declined: note "Tests: developer-handled" and proceed to fix
|
|
151
159
|
|
|
@@ -172,6 +180,7 @@ Include the report header table immediately after frontmatter:
|
|
|
172
180
|
```
|
|
173
181
|
|
|
174
182
|
Save to:
|
|
183
|
+
|
|
175
184
|
- Track-scoped: `draft/tracks/<id>/debug-report.md`
|
|
176
185
|
- Standalone: `draft/debug-report-<timestamp>.md` with symlink `debug-report-latest.md`
|
|
177
186
|
|
|
@@ -194,6 +203,7 @@ If `draft/graph/schema.yaml` does not exist, set `Graph files queried: NONE` and
|
|
|
194
203
|
## Graph Usage Report (append to debug report)
|
|
195
204
|
|
|
196
205
|
Emit the canonical footer from [core/shared/graph-usage-report.md](../../core/shared/graph-usage-report.md) §Canonical footer. The lint hook `scripts/tools/check-graph-usage-report.sh` validates the section on save.
|
|
206
|
+
|
|
197
207
|
## Cross-Skill Dispatch
|
|
198
208
|
|
|
199
209
|
- **Auto-invoked by:** `/draft:new-track` (bug tracks — Offer tier), `/draft:implement` (blocked tasks — Offer tier)
|