@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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Zero-Setup Review Mode
|
|
2
|
+
|
|
3
|
+
Full contract for running `/draft:review` on a repo that has never been indexed. Loaded when Step 0 detects no `draft/` directory.
|
|
4
|
+
|
|
5
|
+
## Why this mode exists
|
|
6
|
+
|
|
7
|
+
`/draft:init` is a multi-phase, token-heavy analysis. Requiring it before the first review puts the expensive step in front of the cheap one, so a new user pays before seeing anything. Zero-setup mode inverts that: review the diff now with whatever can be established from the code itself, then name precisely what indexing would have added.
|
|
8
|
+
|
|
9
|
+
The mode is a **reduction in evidence, never a reduction in rigor**. Every finding still requires a file, a line, and a reason. A finding you cannot ground in the diff is not reported — degraded mode is not license to guess at structure the graph would have told you.
|
|
10
|
+
|
|
11
|
+
## Detection
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ls draft/ 2>/dev/null # absent -> zero-setup mode
|
|
15
|
+
ls draft/graph/schema.yaml # absent -> graph-less (may still have prose context)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Three states, and they are independent:
|
|
19
|
+
|
|
20
|
+
| `draft/` | `draft/graph/schema.yaml` | Mode |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| absent | absent | **zero-setup** — this document |
|
|
23
|
+
| present | absent | **graph-less** — prose context, no structural queries |
|
|
24
|
+
| present | present | full three-stage review |
|
|
25
|
+
|
|
26
|
+
Never print "Draft not initialized" and stop. That error is reserved for skills that genuinely cannot function without context (`/draft:learn`, `/draft:deep-review`, `/draft:tech-debt`, `/draft:implement`).
|
|
27
|
+
|
|
28
|
+
## Scope resolution without tracks
|
|
29
|
+
|
|
30
|
+
Track auto-detection needs `draft/tracks.md`, which does not exist. Resolve scope from git alone, first match wins:
|
|
31
|
+
|
|
32
|
+
1. Explicit `files <pattern>` or `commits <range>` argument → use it.
|
|
33
|
+
2. Uncommitted changes present (`git diff HEAD --shortstat` non-empty) → review those.
|
|
34
|
+
3. Current branch diverges from the default branch → review `<default>...HEAD`.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
default="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
|
|
38
|
+
default="${default:-$(git config --get init.defaultBranch || echo main)}"
|
|
39
|
+
git diff --shortstat "$default...HEAD"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
4. Neither → review the last commit (`git show --stat HEAD`), and say that is what you did.
|
|
43
|
+
5. Empty repository → the one legitimate stop. Print: `No changes to review. Make a change, or run /draft:review commits <range>.`
|
|
44
|
+
|
|
45
|
+
## Stage behavior
|
|
46
|
+
|
|
47
|
+
| Stage | Zero-setup behavior |
|
|
48
|
+
|---|---|
|
|
49
|
+
| **1. Automated Validation** | Runs. Detect the test/lint/type-check commands from the manifest present in the repo (`package.json` scripts, `Makefile` targets, `pyproject.toml`, `Cargo.toml`, `go.mod`). Run what is discoverable; report each as run/failed/not-found. Never invent a command. |
|
|
50
|
+
| **1.5. HLD/LLD conformance** | Skipped — no design docs exist. |
|
|
51
|
+
| **2. Spec Compliance** | Skipped — no spec exists. Do not substitute the commit message for a spec; say the stage was skipped and why. |
|
|
52
|
+
| **3. Code Quality** | Runs, all four dimensions (security, correctness, performance, maintainability), against plugin guardrails only (`core/guardrails/review-checks.md`, `security.md`, `language-standards.md` for the detected stack). |
|
|
53
|
+
| **Adversarial pass** | Runs, and is still mandatory on zero findings. Fewer inputs make a false "clean" more likely, not less. |
|
|
54
|
+
|
|
55
|
+
Guardrail citations still apply — `[SEC-03]`, `[RC-012]`. They come from the plugin, not the project, so they are available with no setup.
|
|
56
|
+
|
|
57
|
+
## What degrades, precisely
|
|
58
|
+
|
|
59
|
+
State these as limitations in the report rather than silently omitting them:
|
|
60
|
+
|
|
61
|
+
| Unavailable | Consequence for this review |
|
|
62
|
+
|---|---|
|
|
63
|
+
| Blast radius (`graph-impact.sh`) | Cannot say what else breaks. Severity of a signature change is judged from the diff only, so a breaking change with distant callers may read as Minor. |
|
|
64
|
+
| Caller enumeration (`graph-callers.sh`) | Cannot enumerate downstream callers of a modified public symbol. |
|
|
65
|
+
| Fan-in hotspot ranking (`hotspot-rank.sh`) | Cannot flag "you just edited the most-depended-on file in the repo." |
|
|
66
|
+
| Cycle detection | Cannot detect a newly introduced dependency cycle. |
|
|
67
|
+
| Module boundary check `[RC-013]` | Cannot verify the change respects intended module boundaries. |
|
|
68
|
+
| `draft/guardrails.md` | Project-specific learned conventions and anti-patterns are unknown, so findings that a team has already accepted as intentional may appear as issues. |
|
|
69
|
+
| `tech-stack.md` Accepted Patterns | Deliberate trade-offs are not suppressed — expect a higher false-positive rate. |
|
|
70
|
+
| Spec / acceptance criteria | No verdict on whether the change does what was asked. |
|
|
71
|
+
|
|
72
|
+
The false-positive caveat is the honest one to surface: without Accepted Patterns and learned conventions, some findings will be things the team decided on purpose.
|
|
73
|
+
|
|
74
|
+
## Output
|
|
75
|
+
|
|
76
|
+
**Render the report in the conversation. Write no files.** A user evaluating the tool has not asked for artifacts in their repo, and an unrequested `draft/` write is exactly the friction this mode removes.
|
|
77
|
+
|
|
78
|
+
Header (replaces the standard git-metadata frontmatter, which assumes a report file):
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Review — zero-setup mode
|
|
82
|
+
Scope: <what was reviewed, and how it was chosen>
|
|
83
|
+
Context: none (draft/ not present)
|
|
84
|
+
Graph: unavailable
|
|
85
|
+
Checks: <test/lint commands run, or "none discoverable">
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Then Stage 1 results, Stage 3 findings grouped by severity, and the limitations table above trimmed to what actually mattered for this diff.
|
|
89
|
+
|
|
90
|
+
If the user asks to save it, write `.draft-review/review-report-<timestamp>.md` (`date +%Y-%m-%dT%H%M`) and tell them the path. Do not create `draft/` — that directory is `/draft:init`'s to own.
|
|
91
|
+
|
|
92
|
+
## Closing call to action
|
|
93
|
+
|
|
94
|
+
End every zero-setup review with a concrete, quantified upgrade line. Name real numbers from this run, not a generic pitch:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
Found <N> issues in <M> files (<C> Critical, <I> Important, <m> Minor).
|
|
98
|
+
|
|
99
|
+
Not checked: blast radius, downstream callers, dependency cycles, module
|
|
100
|
+
boundaries, and your project's own accepted patterns.
|
|
101
|
+
|
|
102
|
+
/draft:init index this repo (one time) — adds the structural checks above
|
|
103
|
+
/draft:review re-run with them enabled
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If the review found nothing, the CTA is the same but framed on coverage rather than count: say which structural checks never ran, so "clean" is not overclaimed.
|
|
107
|
+
|
|
108
|
+
## Anti-patterns specific to this mode
|
|
109
|
+
|
|
110
|
+
| Don't | Instead |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Stop with "Draft not initialized" | Review the diff, then invite indexing |
|
|
113
|
+
| Claim blast radius or hotspot findings without the graph | Say the check did not run |
|
|
114
|
+
| Report "no issues found" without the adversarial pass | Run it — thin input raises the bar, not lowers it |
|
|
115
|
+
| Write into `draft/` to store the report | Render inline; `.draft-review/` only on request |
|
|
116
|
+
| Pitch `/draft:init` generically | Name the specific checks this diff missed |
|
|
117
|
+
| Treat the commit message as a spec | Mark Stage 2 skipped |
|
package/skills/standup/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Generate standup summary from git history, track progress, and Jira
|
|
|
7
7
|
|
|
8
8
|
You are generating a standup summary from recent development activity. This is a **read-only** skill — it makes no changes to the codebase or track files.
|
|
9
9
|
|
|
10
|
-
## Red Flags — STOP if you're
|
|
10
|
+
## Red Flags — STOP if you're
|
|
11
11
|
|
|
12
12
|
- Modifying any files (this is read-only)
|
|
13
13
|
- Fabricating activity that didn't happen
|
|
@@ -42,6 +42,7 @@ If `draft/` exists, read and follow `core/shared/draft-context-loading.md`.
|
|
|
42
42
|
## Step 1: Parse Arguments
|
|
43
43
|
|
|
44
44
|
Check for arguments:
|
|
45
|
+
|
|
45
46
|
- `/draft:standup` — Default: last 24 hours of activity
|
|
46
47
|
- `/draft:standup <days>` — Activity from last N days
|
|
47
48
|
- `/draft:standup weekly` — Full week summary (Monday-Friday)
|
|
@@ -54,7 +55,7 @@ Check for arguments:
|
|
|
54
55
|
**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
56
|
|
|
56
57
|
```bash
|
|
57
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
58
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
58
59
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
59
60
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
60
61
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -68,6 +69,7 @@ fi
|
|
|
68
69
|
```
|
|
69
70
|
|
|
70
71
|
Parse commit messages for:
|
|
72
|
+
|
|
71
73
|
- Track IDs (from `type(track-id): description` convention — already extracted as `track_id` in JSONL)
|
|
72
74
|
- Task completions
|
|
73
75
|
- Bug fixes
|
|
@@ -76,6 +78,7 @@ Parse commit messages for:
|
|
|
76
78
|
### Source 2: Track Progress (if draft context exists)
|
|
77
79
|
|
|
78
80
|
Read `draft/tracks.md` for active tracks:
|
|
81
|
+
|
|
79
82
|
- Current status and phase
|
|
80
83
|
- Tasks completed since last standup
|
|
81
84
|
- Blockers (tasks marked `[!]`)
|
|
@@ -85,6 +88,7 @@ Read `draft/tracks.md` for active tracks:
|
|
|
85
88
|
[core/shared/template-contract.md](../../core/shared/template-contract.md).
|
|
86
89
|
|
|
87
90
|
For each active track, read `plan.md` to determine:
|
|
91
|
+
|
|
88
92
|
- Tasks completed (count `[x]` with recent commit SHAs)
|
|
89
93
|
- Current task (first `[ ]` or `[~]`)
|
|
90
94
|
- Phase progress
|
|
@@ -92,6 +96,7 @@ For each active track, read `plan.md` to determine:
|
|
|
92
96
|
### Source 3: Jira Activity (if MCP available)
|
|
93
97
|
|
|
94
98
|
If Jira MCP is available:
|
|
99
|
+
|
|
95
100
|
- Query recent ticket transitions (status changes)
|
|
96
101
|
- Check for new comments or assignments
|
|
97
102
|
- Pull sprint board status
|
|
@@ -99,6 +104,7 @@ If Jira MCP is available:
|
|
|
99
104
|
### Source 4: GitHub Activity (if MCP available)
|
|
100
105
|
|
|
101
106
|
If GitHub MCP is available:
|
|
107
|
+
|
|
102
108
|
- Query open reviews authored by user
|
|
103
109
|
- Check for new review comments received
|
|
104
110
|
- Query recently merged changes
|
|
@@ -110,6 +116,7 @@ tail -50 ~/.draft/metrics.jsonl 2>/dev/null
|
|
|
110
116
|
```
|
|
111
117
|
|
|
112
118
|
If the file exists and has records in the standup period, enrich the standup with skill activity:
|
|
119
|
+
|
|
113
120
|
- **implement** records: count tasks completed, note TDD pass/fail rate
|
|
114
121
|
- **review** records: note reviews run and their verdicts
|
|
115
122
|
- **bughunt** records: note bug hunts run and critical counts
|
|
@@ -154,6 +161,7 @@ Format using the standard Yesterday/Today/Blockers structure:
|
|
|
154
161
|
Present the standup summary directly in the conversation. Do not write to any file unless explicitly requested.
|
|
155
162
|
|
|
156
163
|
If the user asks to save:
|
|
164
|
+
|
|
157
165
|
- Save to `draft/standup-<date>.md`
|
|
158
166
|
- Symlink: `draft/standup-latest.md`
|
|
159
167
|
|
package/skills/status/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Display current progress of Draft tracks and active tasks. Shows ph
|
|
|
7
7
|
|
|
8
8
|
Display a comprehensive overview of project progress.
|
|
9
9
|
|
|
10
|
-
## Red Flags - STOP if you're
|
|
10
|
+
## Red Flags - STOP if you're
|
|
11
11
|
|
|
12
12
|
- Reporting status without actually reading the files
|
|
13
13
|
- Making up progress percentages
|
|
@@ -44,7 +44,7 @@ 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="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
47
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
48
48
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
49
49
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
50
50
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -66,7 +66,7 @@ Check each track's `metadata.json` `type` field to determine display format.
|
|
|
66
66
|
|
|
67
67
|
### Standard (multi-phase) tracks
|
|
68
68
|
|
|
69
|
-
```
|
|
69
|
+
```yaml
|
|
70
70
|
---
|
|
71
71
|
DRAFT STATUS
|
|
72
72
|
---
|
|
@@ -95,7 +95,7 @@ ACTIVE TRACKS
|
|
|
95
95
|
|
|
96
96
|
Quick-mode tracks use flat task numbering (`Task 1:`, `Task 2:`) without phases. Display them with a flat task list instead of the phase-grouped tree:
|
|
97
97
|
|
|
98
|
-
```
|
|
98
|
+
```json
|
|
99
99
|
[track-id-3] Quick Feature
|
|
100
100
|
Status: [~] In Progress
|
|
101
101
|
Type: quick
|
|
@@ -111,7 +111,7 @@ Do **not** show `Phase: X/Y` for quick-mode tracks — they have no phases.
|
|
|
111
111
|
|
|
112
112
|
### Remaining sections (shared by both formats)
|
|
113
113
|
|
|
114
|
-
```
|
|
114
|
+
```text
|
|
115
115
|
MODULES (if architecture.md exists)
|
|
116
116
|
---
|
|
117
117
|
Module A [x] Complete (Coverage: 96.2%)
|
|
@@ -161,7 +161,7 @@ When `.ai-context.md` or `architecture.md` exists for a track (track-level or pr
|
|
|
161
161
|
|
|
162
162
|
## If No Tracks
|
|
163
163
|
|
|
164
|
-
```
|
|
164
|
+
```yaml
|
|
165
165
|
---
|
|
166
166
|
DRAFT STATUS
|
|
167
167
|
---
|
|
@@ -177,7 +177,7 @@ Get started:
|
|
|
177
177
|
|
|
178
178
|
## If Not Initialized
|
|
179
179
|
|
|
180
|
-
```
|
|
180
|
+
```text
|
|
181
181
|
Draft not initialized in this project.
|
|
182
182
|
|
|
183
183
|
Run /draft:init to initialize.
|
|
@@ -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` (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**.
|
|
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
|
- Flagging intentional design choices as debt (check tech-stack.md accepted patterns first)
|
|
38
39
|
- Cataloging debt without understanding the business context
|
|
39
40
|
- Setting priorities without considering team capacity
|
|
@@ -95,7 +96,7 @@ For TODO/FIXME/HACK/XXX/DEPRECATED markers, prefer the deterministic `scan-marke
|
|
|
95
96
|
```bash
|
|
96
97
|
# Locate Draft's bundled helpers (cwd is the user's project; ${CLAUDE_PLUGIN_ROOT}
|
|
97
98
|
# 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
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
99
100
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
100
101
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
101
102
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -236,6 +237,7 @@ Organize findings into three actionable tiers:
|
|
|
236
237
|
Items that can be fixed in a single sprint or less. Do these first — they deliver the best return on investment.
|
|
237
238
|
|
|
238
239
|
For each item:
|
|
240
|
+
|
|
239
241
|
- Specific fix description
|
|
240
242
|
- Estimated time (hours)
|
|
241
243
|
- Suggested assignee pattern (e.g., "whoever touches this module next")
|
|
@@ -245,6 +247,7 @@ For each item:
|
|
|
245
247
|
Items requiring dedicated effort. Create via `/draft:new-track` or route via `/draft:jira` (or `/draft:plan "tech debt remediation"`).
|
|
246
248
|
|
|
247
249
|
For each item:
|
|
250
|
+
|
|
248
251
|
- Scope and approach
|
|
249
252
|
- Estimated effort (sprints)
|
|
250
253
|
- Dependencies and sequencing
|
|
@@ -279,6 +282,7 @@ ln -sf tech-debt-report-${TIMESTAMP}.md draft/tech-debt-report-latest.md
|
|
|
279
282
|
```
|
|
280
283
|
|
|
281
284
|
Report structure:
|
|
285
|
+
|
|
282
286
|
1. **Executive Summary** — Total findings by category and priority tier, headline stats
|
|
283
287
|
2. **Priority Matrix** — Table of all findings sorted by priority score
|
|
284
288
|
3. **Category Details** — Per-category findings with file locations and evidence
|
|
@@ -298,6 +302,7 @@ Every tech-debt report must end with a `## Next Actions` section listing the sma
|
|
|
298
302
|
```
|
|
299
303
|
|
|
300
304
|
Rules:
|
|
305
|
+
|
|
301
306
|
- Tech-debt rarely "blocks" merge; mark `Blocker? = yes` only for items that will cause an outage on next deploy.
|
|
302
307
|
- Suggest `/draft:new-track` for items >1 day of work, `/draft:adr` for design re-decisions, `/draft:implement` for surgical cleanups.
|
|
303
308
|
- Cap at 10 actions; full backlog stays in the report body.
|
|
@@ -315,6 +320,7 @@ If `draft/graph/schema.yaml` does not exist, set `Graph files queried: NONE` and
|
|
|
315
320
|
## Graph Usage Report (append to debt report)
|
|
316
321
|
|
|
317
322
|
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.
|
|
323
|
+
|
|
318
324
|
## Cross-Skill Dispatch
|
|
319
325
|
|
|
320
326
|
- **Offered by:** `/draft:new-track` (refactor tracks — scope the debt before planning)
|
|
@@ -7,7 +7,7 @@ description: Design test strategies and test plans with coverage targets. Comple
|
|
|
7
7
|
|
|
8
8
|
You are designing a testing strategy and test plan for this project or track.
|
|
9
9
|
|
|
10
|
-
## Red Flags — STOP if you're
|
|
10
|
+
## Red Flags — STOP if you're
|
|
11
11
|
|
|
12
12
|
- Writing a strategy without understanding the codebase
|
|
13
13
|
- Setting unrealistic coverage targets (100% is rarely appropriate)
|
|
@@ -61,13 +61,16 @@ Read and follow the base procedure in `core/shared/draft-context-loading.md`.
|
|
|
61
61
|
- CLI tools
|
|
62
62
|
|
|
63
63
|
2. **Discover existing tests:**
|
|
64
|
+
|
|
64
65
|
```bash
|
|
65
66
|
find . -name "*test*" -o -name "*spec*" | head -50
|
|
66
67
|
```
|
|
68
|
+
|
|
67
69
|
Identify: test frameworks, test directories, existing coverage config, test runners.
|
|
68
70
|
|
|
69
71
|
3. **Assess current coverage:**
|
|
70
72
|
Check for existing coverage reports or configuration:
|
|
73
|
+
|
|
71
74
|
```bash
|
|
72
75
|
ls coverage/ .nyc_output/ htmlcov/ .coverage 2>/dev/null
|
|
73
76
|
```
|
|
@@ -85,7 +88,7 @@ Read and follow the base procedure in `core/shared/draft-context-loading.md`.
|
|
|
85
88
|
|
|
86
89
|
Tailor to the project architecture:
|
|
87
90
|
|
|
88
|
-
```
|
|
91
|
+
```text
|
|
89
92
|
┌─────────┐
|
|
90
93
|
│ E2E │ Few, critical paths only
|
|
91
94
|
├─────────┤
|
|
@@ -111,6 +114,7 @@ Adjust the pyramid shape per architecture. A microservices backend may need a wi
|
|
|
111
114
|
### Coverage Targets
|
|
112
115
|
|
|
113
116
|
Set realistic targets based on component criticality:
|
|
117
|
+
|
|
114
118
|
- **Critical paths** (from .ai-context.md INVARIANTS): 95%+
|
|
115
119
|
- **Business logic**: 85-90%
|
|
116
120
|
- **Utilities/helpers**: 80%
|
|
@@ -121,6 +125,7 @@ Set realistic targets based on component criticality:
|
|
|
121
125
|
### Test Quality Guidelines
|
|
122
126
|
|
|
123
127
|
Coverage alone is insufficient. Include guidance on:
|
|
128
|
+
|
|
124
129
|
- **Assertion density:** At least one meaningful assertion per test (not just "doesn't throw")
|
|
125
130
|
- **Boundary testing:** Edge cases, empty inputs, max values, off-by-one
|
|
126
131
|
- **Error paths:** Test failure modes, not just happy paths
|
|
@@ -131,6 +136,7 @@ Coverage alone is insufficient. Include guidance on:
|
|
|
131
136
|
## Step 4: Gap Analysis
|
|
132
137
|
|
|
133
138
|
Compare current state to targets:
|
|
139
|
+
|
|
134
140
|
1. Run test discovery to count existing tests per module
|
|
135
141
|
2. Identify modules with zero test coverage
|
|
136
142
|
3. Identify critical paths (from INVARIANTS) without integration tests
|
|
@@ -157,6 +163,7 @@ Priority test cases to write, ordered by impact:
|
|
|
157
163
|
7. Performance tests for latency-sensitive paths
|
|
158
164
|
|
|
159
165
|
For each priority test, specify:
|
|
166
|
+
|
|
160
167
|
- **What:** Description of the test scenario
|
|
161
168
|
- **Why:** Which invariant, anti-pattern, or flow it protects
|
|
162
169
|
- **How:** Test type (unit/integration/E2E), framework, key assertions
|
|
@@ -178,6 +185,7 @@ Include the report header table immediately after frontmatter:
|
|
|
178
185
|
```
|
|
179
186
|
|
|
180
187
|
Save to:
|
|
188
|
+
|
|
181
189
|
- Project-wide: `draft/testing-strategy.md`
|
|
182
190
|
- Track-scoped: `draft/tracks/<id>/testing-strategy.md`
|
|
183
191
|
|
package/skills/tour/SKILL.md
CHANGED
|
@@ -7,7 +7,8 @@ description: Interactive onboarding walkthrough for a new engineer. Use for "giv
|
|
|
7
7
|
|
|
8
8
|
Provide an interactive codebase walk-through based on existing architecture and guardrail constraints.
|
|
9
9
|
|
|
10
|
-
## Red Flags - STOP if you're
|
|
10
|
+
## Red Flags - STOP if you're
|
|
11
|
+
|
|
11
12
|
- Dumping the entire `architecture.md` into the chat window.
|
|
12
13
|
- Giving answers to foundational pattern questions before prompting the developer to guess.
|
|
13
14
|
- Explaining code the developer hasn't explicitly asked to view yet.
|
package/skills/upload/SKILL.md
CHANGED
|
@@ -7,11 +7,12 @@ description: Pre-upload gate for track handoff. Verifies review status, HLD appr
|
|
|
7
7
|
|
|
8
8
|
Gate track completion before `git upload`, `git push`, or opening a PR for human review.
|
|
9
9
|
|
|
10
|
-
## Red Flags — STOP if you're
|
|
10
|
+
## Red Flags — STOP if you're
|
|
11
11
|
|
|
12
12
|
See [shared red flags](../../core/shared/red-flags.md).
|
|
13
13
|
|
|
14
14
|
Skill-specific:
|
|
15
|
+
|
|
15
16
|
- Uploading without a passing `/draft:review` on the track
|
|
16
17
|
- Skipping HLD §Approvals for `criticality ∈ {high, mission-critical}` tracks
|
|
17
18
|
- Treating a deploy checklist with `status: BLOCKED` as passing
|
|
@@ -52,7 +53,7 @@ Run the WS-9 chain from [verification-gates.md](../../core/shared/verification-g
|
|
|
52
53
|
|
|
53
54
|
```bash
|
|
54
55
|
TRACK_DIR="draft/tracks/<id>"
|
|
55
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
56
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
56
57
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
57
58
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
58
59
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -115,4 +116,4 @@ Update `draft/tracks/<id>/metadata.json`:
|
|
|
115
116
|
|
|
116
117
|
## Graph Usage Report
|
|
117
118
|
|
|
118
|
-
Emit the canonical footer from [graph-usage-report.md](../../core/shared/graph-usage-report.md) when graph queries were used during validation.
|
|
119
|
+
Emit the canonical footer from [graph-usage-report.md](../../core/shared/graph-usage-report.md) when graph queries were used during validation.
|