@drafthq/draft 3.2.0 → 3.2.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/cli/src/installer.js +8 -0
- package/cli/src/lib/marker.js +93 -0
- package/core/shared/condensation.md +3 -2
- package/core/shared/git-report-metadata.md +3 -2
- package/core/shared/graph-query.md +4 -3
- package/core/shared/tool-resolver.md +71 -4
- package/core/templates/plan.md +3 -2
- package/integrations/agents/AGENTS.md +345 -101
- package/integrations/copilot/.github/copilot-instructions.md +345 -101
- package/package.json +1 -1
- package/scripts/lib.sh +1 -0
- package/scripts/tools/resolve-tools.sh +78 -0
- package/skills/adr/SKILL.md +3 -2
- package/skills/bughunt/SKILL.md +10 -1
- package/skills/coverage/SKILL.md +8 -3
- package/skills/debug/SKILL.md +16 -5
- package/skills/decompose/SKILL.md +29 -12
- package/skills/deep-review/SKILL.md +19 -6
- package/skills/deploy-checklist/SKILL.md +6 -5
- package/skills/graph/SKILL.md +15 -6
- package/skills/impact/SKILL.md +12 -1
- package/skills/implement/SKILL.md +20 -4
- package/skills/init/SKILL.md +17 -10
- package/skills/init/references/architecture-spec.md +17 -6
- package/skills/learn/SKILL.md +15 -4
- package/skills/quick-review/SKILL.md +13 -3
- package/skills/review/SKILL.md +32 -8
- package/skills/standup/SKILL.md +3 -2
- package/skills/status/SKILL.md +3 -2
- package/skills/tech-debt/SKILL.md +20 -6
- package/skills/upload/SKILL.md +3 -2
|
@@ -275,7 +275,18 @@ Only when material: authentication/authorization checkpoints, distributed transa
|
|
|
275
275
|
|
|
276
276
|
**Core rule:** The graph is the source of truth for structure. LLM synthesis exists only to interpret the graph into actionable design understanding — primarily via one accurate workflow or state diagram per module — plus tiny supporting notes. The previous volume-oriented deep-dive expectations are superseded.
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
First resolve the bundled helpers:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
282
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
283
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
284
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
285
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
286
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
For each module returned by `"$DRAFT_TOOLS/graph-arch.sh" --repo . | jq '.packages[]'`, produce a subsection whose **primary content** is the deterministic graph block followed by one synthesized behavioral diagram. Every module gets a slot; do not sample. The block's fan-in/out and node counts come from `.packages[]`; public API and key call edges come from live per-package queries (`"$DRAFT_TOOLS/graph-callers.sh"`, `"$DRAFT_TOOLS/graph-impact.sh"`) and `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .`.
|
|
279
290
|
|
|
280
291
|
#### 7.{N} {module-name}
|
|
281
292
|
|
|
@@ -362,7 +373,7 @@ Regardless of tier, any directory whose name contains `ops`, `handlers`, `execut
|
|
|
362
373
|
| ... | (enumerate ALL — no sampling, no "and others") | | | |
|
|
363
374
|
```
|
|
364
375
|
|
|
365
|
-
Use `
|
|
376
|
+
Use `"$DRAFT_TOOLS/graph-callers.sh" --symbol <module>` or `"$DRAFT_TOOLS/graph-arch.sh" --repo .` to get the complete file list. Use `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` to flag high-complexity operations.
|
|
366
377
|
|
|
367
378
|
#### Example: Full Sub-Module Treatment for `icebox/` (917 files)
|
|
368
379
|
|
|
@@ -516,10 +527,10 @@ Include architecturally significant implementations (high fan-in, core extension
|
|
|
516
527
|
| (enumerate ALL — use hotspot-rank.sh and graph-callers.sh / get_architecture for file list and line counts) |
|
|
517
528
|
```
|
|
518
529
|
|
|
519
|
-
> **MANDATORY (graph data)**: Query `
|
|
520
|
-
> `
|
|
530
|
+
> **MANDATORY (graph data)**: Query `"$DRAFT_TOOLS/graph-arch.sh" --repo .` or
|
|
531
|
+
> `"$DRAFT_TOOLS/graph-callers.sh" --symbol <module>` to get the complete file list with line counts.
|
|
521
532
|
> Filter for files in operation sub-directories (paths containing `/ops/`,
|
|
522
|
-
> `/handlers/`, `/executors/`, `/workers/`). Use `
|
|
533
|
+
> `/handlers/`, `/executors/`, `/workers/`). Use `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` to flag
|
|
523
534
|
> high-complexity operations (high line count or fanIn). Do NOT skip this step — incomplete
|
|
524
535
|
> catalogs cause AI agents to reinvent existing functionality.
|
|
525
536
|
|
|
@@ -1214,7 +1225,7 @@ Fix: Cross-reference ALL data sources (Appendix B), ALL implementation outputs (
|
|
|
1214
1225
|
|
|
1215
1226
|
**FAILURE 4 — Missing Sub-Modules:**
|
|
1216
1227
|
Detection: A module with 100+ source files (check graph data) has no Sub-Module Structure table.
|
|
1217
|
-
Fix: Query `
|
|
1228
|
+
Fix: Query `"$DRAFT_TOOLS/graph-arch.sh" --repo .` or `"$DRAFT_TOOLS/graph-callers.sh" --symbol <name>`, group results by immediate sub-directory, and generate the table with file counts and one-line role descriptions per sub-directory.
|
|
1218
1229
|
|
|
1219
1230
|
**FAILURE 4b — Shallow Sub-Module Treatment:**
|
|
1220
1231
|
Detection: Large sub-modules (50+ files) listed only as table rows with no dedicated deep-dive subsection. Or ops/handler directories have no operation catalog.
|
package/skills/learn/SKILL.md
CHANGED
|
@@ -9,10 +9,21 @@ Scan the codebase to discover recurring coding patterns and update `draft/guardr
|
|
|
9
9
|
|
|
10
10
|
## MANDATORY GRAPH LOOKUP (read before pattern scanning)
|
|
11
11
|
|
|
12
|
+
First resolve the bundled helpers:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
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"
|
|
18
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
19
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
20
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
21
|
+
```
|
|
22
|
+
|
|
12
23
|
When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-first lookup contract in [core/shared/graph-query.md](../../core/shared/graph-query.md) §Mandatory Lookup Contract. Use the graph to:
|
|
13
24
|
|
|
14
|
-
1. Enumerate a module's symbols/files via `
|
|
15
|
-
2. Prioritize hotspots via `
|
|
25
|
+
1. Enumerate a module's symbols/files via `"$DRAFT_TOOLS/graph-callers.sh"`/`"$DRAFT_TOOLS/graph-impact.sh"` and `"$DRAFT_TOOLS/graph-arch.sh" --repo .` (preferred over `find`).
|
|
26
|
+
2. Prioritize hotspots via `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` — patterns in high-fanIn files are more impactful when learned.
|
|
16
27
|
3. For TS/Python/Go/C/C++, use `*-index.jsonl` to identify class/function definitions rather than re-discovering them via regex.
|
|
17
28
|
|
|
18
29
|
Filesystem `find` for source discovery (Step 2.1) is permitted **as a complement** to the graph for languages not covered by indexes (e.g. Ruby, Java without ctags). Record the rationale in the Graph Usage Report.
|
|
@@ -246,10 +257,10 @@ git log --follow --oneline -1 -- {file_containing_pattern}
|
|
|
246
257
|
|
|
247
258
|
### 2.7: Graph-Aware Severity Enrichment
|
|
248
259
|
|
|
249
|
-
If `draft/graph/schema.yaml` exists (engine live), derive objective severity for all anti-pattern candidates based on the fanIn of files where the pattern was found via `
|
|
260
|
+
If `draft/graph/schema.yaml` exists (engine live), derive objective severity for all anti-pattern candidates based on the fanIn of files where the pattern was found via `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .`.
|
|
250
261
|
|
|
251
262
|
For each anti-pattern candidate from Step 2.2:
|
|
252
|
-
1. Check if any evidence files appear in the hotspot output from `
|
|
263
|
+
1. Check if any evidence files appear in the hotspot output from `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .`
|
|
253
264
|
2. Take the highest fanIn value across all evidence files:
|
|
254
265
|
- fanIn ≥ 10 → `graph_severity: critical` (breakage propagates to many callers)
|
|
255
266
|
- fanIn 5–9 → `graph_severity: high`
|
|
@@ -11,8 +11,18 @@ You are performing a lightweight, ad-hoc code review. This is the fast alternati
|
|
|
11
11
|
|
|
12
12
|
When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-first lookup contract in [core/shared/graph-query.md](../../core/shared/graph-query.md) §Mandatory Lookup Contract. Quick-review keeps the graph load light:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
First resolve the bundled helpers:
|
|
15
|
+
```bash
|
|
16
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
17
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
18
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
19
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
20
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
21
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
1. Always run `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` for every changed file (Step 2 blast-radius pre-check below).
|
|
25
|
+
2. If a finding spans more than one file, run `"$DRAFT_TOOLS/graph-callers.sh" --repo . --symbol <name>` to enumerate the call sites before claiming "no other usages".
|
|
16
26
|
|
|
17
27
|
Filesystem `grep` is reserved for source-text scans (literal strings, regex patterns). Symbol and caller discovery go through the graph.
|
|
18
28
|
|
|
@@ -70,7 +80,7 @@ Determine the diff to review:
|
|
|
70
80
|
|
|
71
81
|
## Step 2: Blast Radius Pre-check (if `draft/graph/schema.yaml` exists)
|
|
72
82
|
|
|
73
|
-
Before the four-dimension review, run `
|
|
83
|
+
Before the four-dimension review, run `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` and check if any files in scope appear in the output. If any file has a `fanIn` in the top 20% of the list, add this warning at the top of the review report:
|
|
74
84
|
|
|
75
85
|
```
|
|
76
86
|
⚠ HIGH IMPACT: {file} is a high-fanIn hotspot (fanIn={N}). Changes here propagate to many callers — review with extra care.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -11,9 +11,19 @@ You are conducting a code review using Draft's Context-Driven Development method
|
|
|
11
11
|
|
|
12
12
|
When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-first lookup contract in [core/shared/graph-query.md](../../core/shared/graph-query.md) §Mandatory Lookup Contract. Stage 1 (Automated Validation) **starts from the graph**:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
First resolve the bundled helpers:
|
|
15
|
+
```bash
|
|
16
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
17
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
18
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
19
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
20
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
21
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
1. Run blast-radius assessment via `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` and `"$DRAFT_TOOLS/graph-impact.sh"` (see Stage 1).
|
|
25
|
+
2. For each changed file with non-trivial diff size, run `"$DRAFT_TOOLS/graph-impact.sh" --repo . --file <path>` to obtain the affected module set deterministically.
|
|
26
|
+
3. For each public symbol modified, run `"$DRAFT_TOOLS/graph-callers.sh" --repo . --symbol <name>` to enumerate downstream callers before judging breaking-change severity.
|
|
17
27
|
|
|
18
28
|
Filesystem `grep` is reserved for source-text scans (string literals, log messages, regex matches in code) — not for discovering modules, files, or callers when the graph can answer.
|
|
19
29
|
|
|
@@ -369,10 +379,21 @@ Load plugin guardrails before scanning: `core/guardrails/review-checks.md` (RC-#
|
|
|
369
379
|
For the files changed in the diff, perform static checks using `grep` or similar tools:
|
|
370
380
|
|
|
371
381
|
- **Blast Radius Assessment** (if the `draft/graph/` snapshot exists):
|
|
382
|
+
|
|
383
|
+
First resolve the bundled helpers:
|
|
384
|
+
```bash
|
|
385
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
386
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
387
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
388
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
389
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
390
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
391
|
+
```
|
|
392
|
+
|
|
372
393
|
- List all changed files from the diff
|
|
373
|
-
- For each changed file, check if it appears in `
|
|
394
|
+
- For each changed file, check if it appears in `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` output — if yes, record its `fanIn` value
|
|
374
395
|
- Classify: files with fanIn in the top 20% of the hotspot output = **HIGH IMPACT**; top 21–50% = **MEDIUM**; below 50% or not in output = **STANDARD**
|
|
375
|
-
- For any file in a HIGH or MEDIUM module, query `
|
|
396
|
+
- For any file in a HIGH or MEDIUM module, query `"$DRAFT_TOOLS/graph-arch.sh" --repo . | jq '.packages[].fan_in'` (how many modules depend on this module)
|
|
376
397
|
- Include a `Blast Radius` line in the Stage 1 report summary: `Blast Radius: HIGH | MEDIUM | STANDARD — <N> changed files affect high-fanIn modules: [file list]`
|
|
377
398
|
- If any changed file is HIGH IMPACT: escalate Stage 3 thoroughness (check all callers of changed functions) and note this in the report header
|
|
378
399
|
- **Architecture Conformance:** Search for pattern violations documented in `draft/.ai-context.md`. (e.g. `import * from 'database'` in a React component).
|
|
@@ -381,7 +402,7 @@ For the files changed in the diff, perform static checks using `grep` or similar
|
|
|
381
402
|
- **Graph Boundary Check** (if `draft/graph/schema.yaml` exists) `[RC-013]`:
|
|
382
403
|
- For each changed file, identify its module from the graph
|
|
383
404
|
- Check if any new cross-module includes were added in the diff
|
|
384
|
-
- Verify they follow the established dependency direction from `
|
|
405
|
+
- Verify they follow the established dependency direction from `"$DRAFT_TOOLS/graph-arch.sh" --repo .` package fan-in/out
|
|
385
406
|
- Flag reverse-direction dependencies (module A now depends on module B, but only B→A existed before) as "Potential architecture violation — new dependency direction"
|
|
386
407
|
- Check if changes introduce files in modules listed in graph cycles — flag as higher risk
|
|
387
408
|
- **Security Scan** `[RC-001, RC-002, RC-003, RC-011]`:
|
|
@@ -1106,8 +1127,11 @@ As the last step after saving the review report, emit a metrics record. Best-eff
|
|
|
1106
1127
|
|
|
1107
1128
|
**Emit call:**
|
|
1108
1129
|
```bash
|
|
1109
|
-
|
|
1110
|
-
|
|
1130
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
1131
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
1132
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
1133
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
1134
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
1111
1135
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
1112
1136
|
[ -x "$DRAFT_TOOLS/emit-skill-metrics.sh" ] && bash "$DRAFT_TOOLS/emit-skill-metrics.sh" \
|
|
1113
1137
|
'{"skill":"review","track_id":"<id_or_null>","stage_reached":"<stage>","verdict":"<v>","critical_count":<N>,"important_count":<N>,"blast_radius":"<br>","graph_queries":<N>,"fallback_grep_count":<N>}'
|
package/skills/standup/SKILL.md
CHANGED
|
@@ -54,8 +54,9 @@ Check for arguments:
|
|
|
54
54
|
**Preferred:** invoke `parse-git-log.sh` — it parses conventional commits into structured JSONL `{sha,type,scope,track_id,subject,author,timestamp,files_changed}`, eliminating ambiguity in `type(track-id): subject` parsing. Resolve via the canonical tool resolver (see [core/shared/tool-resolver.md](../../core/shared/tool-resolver.md)):
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
DRAFT_TOOLS="$
|
|
58
|
-
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$
|
|
57
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
58
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
59
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
59
60
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
60
61
|
if [ -x "$DRAFT_TOOLS/parse-git-log.sh" ]; then
|
|
61
62
|
bash "$DRAFT_TOOLS/parse-git-log.sh" --since "24 hours ago" --author "$(git config user.name)"
|
package/skills/status/SKILL.md
CHANGED
|
@@ -44,8 +44,9 @@ Display a comprehensive overview of project progress.
|
|
|
44
44
|
If `parse-reports.sh` and `freshness-check.sh` are available, gather structured signals to enrich the status output (severity counts per track, stale `draft/` docs). Resolve via the canonical tool resolver (see [core/shared/tool-resolver.md](../../core/shared/tool-resolver.md)):
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
DRAFT_TOOLS="$
|
|
48
|
-
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$
|
|
47
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
48
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
49
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
49
50
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
50
51
|
|
|
51
52
|
# Per-track report severity rollup (bughunt, review, tech-debt, etc.):
|
|
@@ -9,12 +9,23 @@ You are conducting a technical debt analysis to catalog, prioritize, and plan re
|
|
|
9
9
|
|
|
10
10
|
## MANDATORY GRAPH LOOKUP (read before debt scan)
|
|
11
11
|
|
|
12
|
+
First resolve the bundled helpers:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
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"
|
|
18
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
19
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
20
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
21
|
+
```
|
|
22
|
+
|
|
12
23
|
When `draft/graph/schema.yaml` exists, this skill **must** follow the graph-first lookup contract in [core/shared/graph-query.md](../../core/shared/graph-query.md) §Mandatory Lookup Contract. Tech-debt prioritization is fundamentally driven by graph data:
|
|
13
24
|
|
|
14
|
-
1. Run `
|
|
15
|
-
2. Query `
|
|
16
|
-
3. Run `
|
|
17
|
-
4. For each catalogued finding, run `
|
|
25
|
+
1. Run `"$DRAFT_TOOLS/hotspot-rank.sh" --repo .` — **rank candidates by `fanIn × complexity`** to surface high-leverage debt first.
|
|
26
|
+
2. Query `"$DRAFT_TOOLS/graph-arch.sh" --repo .` and run `"$DRAFT_TOOLS/cycle-detect.sh" --repo .` — flag debt in modules involved in cycles as higher priority.
|
|
27
|
+
3. Run `"$DRAFT_TOOLS/cycle-detect.sh" --repo .` to enumerate dependency cycles — every cycle is a candidate architecture-debt entry.
|
|
28
|
+
4. For each catalogued finding, run `"$DRAFT_TOOLS/graph-impact.sh" --repo . --file <path>` so the remediation plan includes blast-radius.
|
|
18
29
|
|
|
19
30
|
Filesystem `grep` (e.g. `scan-markers.sh`) is still primary for TODO/FIXME marker discovery — markers are source-text, not graph-derived. The graph governs **prioritization**, the marker scan governs **discovery**.
|
|
20
31
|
|
|
@@ -82,8 +93,11 @@ Scan the codebase systematically across all seven categories. For each finding,
|
|
|
82
93
|
For TODO/FIXME/HACK/XXX/DEPRECATED markers, prefer the deterministic `scan-markers.sh` wrapper — it emits JSON `[{path,line,marker,text,sha,author,introduced,age_days}]` with blame ages already computed. Resolve via the canonical tool resolver (see [core/shared/tool-resolver.md](../../core/shared/tool-resolver.md)):
|
|
83
94
|
|
|
84
95
|
```bash
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
97
|
+
# is not exported into skill Bash). See core/shared/tool-resolver.md.
|
|
98
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
99
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
100
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
87
101
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
88
102
|
[ -x "$DRAFT_TOOLS/scan-markers.sh" ] && bash "$DRAFT_TOOLS/scan-markers.sh" --root .
|
|
89
103
|
# Fallback when script unavailable: grep -rn 'TODO\|FIXME\|HACK\|XXX\|DEPRECATED' .
|
package/skills/upload/SKILL.md
CHANGED
|
@@ -52,8 +52,9 @@ Run the WS-9 chain from [verification-gates.md](../../core/shared/verification-g
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
TRACK_DIR="draft/tracks/<id>"
|
|
55
|
-
DRAFT_TOOLS="$
|
|
56
|
-
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$
|
|
55
|
+
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
56
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
57
|
+
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
57
58
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
58
59
|
|
|
59
60
|
"$DRAFT_TOOLS/check-track-hygiene.sh" "$TRACK_DIR"
|