@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
|
@@ -23,7 +23,9 @@ Referenced by: every skill that starts with a `Verify Draft Context` step.
|
|
|
23
23
|
|---|---|
|
|
24
24
|
| Directory exists | Proceed to step 3. |
|
|
25
25
|
| Directory missing AND skill requires context (`/draft:learn`, `/draft:deep-review`, `/draft:tech-debt`, `/draft:implement`) | **STOP** — print `No Draft context found. Run /draft:init first.` and exit. |
|
|
26
|
-
| Directory missing AND skill is context-optional (`/draft:debug`, `/draft:quick-review`, `/draft:bughunt`, `/draft:deploy-checklist`, `/draft:documentation`, `/draft:testing-strategy`) | Proceed with reduced-context mode; record `draft_context: absent` in the report header. |
|
|
26
|
+
| Directory missing AND skill is context-optional (`/draft:review`, `/draft:debug`, `/draft:quick-review`, `/draft:bughunt`, `/draft:deploy-checklist`, `/draft:documentation`, `/draft:testing-strategy`) | Proceed with reduced-context mode; record `draft_context: absent` in the report header. |
|
|
27
|
+
|
|
28
|
+
`/draft:review` is deliberately in the context-optional row: it is the command a new user runs first, so requiring `/draft:init` would put the expensive step ahead of the demonstration. Its degraded contract is `skills/review/references/zero-setup-mode.md`.
|
|
27
29
|
|
|
28
30
|
3. **Load context** by following [draft-context-loading.md](draft-context-loading.md). Honor the **selective guardrail matrix** in that file's Layer 0.5 — do not load all guardrails just because they are available.
|
|
29
31
|
|
|
@@ -22,11 +22,13 @@ Execute without user confirmation. Used for passive context enrichment and estab
|
|
|
22
22
|
Present a choice with a recommended default. Used when the skill adds significant value but the user may want to skip.
|
|
23
23
|
|
|
24
24
|
Format:
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
```text
|
|
26
27
|
"Run /draft:<skill> to <benefit>? [Y/n]"
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
Examples:
|
|
31
|
+
|
|
30
32
|
- "Run `/draft:debug` to investigate before writing the spec? [Y/n]" — bug tracks in new-track
|
|
31
33
|
- "Run full three-stage review or `/draft:quick-review` for lightweight check? [full]" — phase boundaries in implement
|
|
32
34
|
- "Run `/draft:tech-debt` to scope this refactor? [Y/n]" — refactor tracks in new-track
|
|
@@ -38,11 +40,13 @@ Examples:
|
|
|
38
40
|
Announce availability at completion without blocking. Used for optional follow-up actions.
|
|
39
41
|
|
|
40
42
|
Format:
|
|
41
|
-
|
|
43
|
+
|
|
44
|
+
```text
|
|
42
45
|
"Consider running `/draft:<skill>` to <benefit>."
|
|
43
46
|
```
|
|
44
47
|
|
|
45
48
|
Examples:
|
|
49
|
+
|
|
46
50
|
- "Consider running `/draft:tech-debt` to catalog debt found during review."
|
|
47
51
|
- "Consider running `/draft:documentation api` to document new endpoints."
|
|
48
52
|
- "Consider running `/draft:adr` to record this design decision."
|
|
@@ -119,7 +123,7 @@ At this point, check for dispatch opportunities:
|
|
|
119
123
|
Applies to: `/draft:debug`, `/draft:implement` (bug tracks), auto-triage pipeline, `/draft:bughunt`
|
|
120
124
|
Does NOT apply to: Feature tracks with TDD enabled, `/draft:coverage`
|
|
121
125
|
|
|
122
|
-
```
|
|
126
|
+
```text
|
|
123
127
|
If track type is "bugfix" OR current context is debug/RCA:
|
|
124
128
|
BEFORE writing any test file:
|
|
125
129
|
ASK: "Want me to write [regression/unit] tests for [description]? [Y/n]"
|
|
@@ -101,6 +101,7 @@ If `draft/.state/facts.json` exists, it provides granular fact-level context:
|
|
|
101
101
|
Facts are NOT loaded in full for every command — use relevance filtering (see below).
|
|
102
102
|
|
|
103
103
|
Additional state files used by refresh operations (not loaded during normal context loading):
|
|
104
|
+
|
|
104
105
|
- `draft/.state/freshness.json` — SHA-256 hashes for file-level staleness detection
|
|
105
106
|
- `draft/.state/signals.json` — signal classification for structural drift detection
|
|
106
107
|
|
|
@@ -111,6 +112,7 @@ Not all context is equally relevant to every task. When a specific track or task
|
|
|
111
112
|
### When to Apply
|
|
112
113
|
|
|
113
114
|
Apply relevance scoring when ALL of these conditions are true:
|
|
115
|
+
|
|
114
116
|
1. A specific track or task is active (has `spec.md` and/or `plan.md`)
|
|
115
117
|
2. `draft/.ai-context.md` exists and is above tier-1 minimum (100 lines)
|
|
116
118
|
3. The command benefits from focused context (`/draft:implement`, `/draft:bughunt`, `/draft:review`)
|
|
@@ -212,6 +214,7 @@ If analyzing a specific track, also load:
|
|
|
212
214
|
| `draft/tracks/<id>/plan.md` | Implementation tasks, phases, dependencies |
|
|
213
215
|
|
|
214
216
|
Use track context to:
|
|
217
|
+
|
|
215
218
|
- Verify implemented features match spec requirements
|
|
216
219
|
- Check edge cases listed in spec are handled
|
|
217
220
|
- Focus analysis on files modified/created by the track
|
|
@@ -5,6 +5,7 @@ Shared procedure for gathering git metadata and generating YAML frontmatter in D
|
|
|
5
5
|
Referenced by: All skills that generate Draft reports — including `/draft:bughunt`, `/draft:deep-review`, `/draft:review`, `/draft:quick-review`, `/draft:tech-debt`, `/draft:deploy-checklist`, `/draft:incident-response`, `/draft:debug`, `/draft:standup`, `/draft:testing-strategy`
|
|
6
6
|
|
|
7
7
|
> **Two-tier metadata pattern:**
|
|
8
|
+
>
|
|
8
9
|
> - **Project-level artifacts** (`draft/architecture.md`, `.ai-context.md`, `.ai-profile.md`, `product.md`, `workflow.md`, etc.): git state lives in `draft/metadata.json` only. Per-file frontmatter carries only `project`, `module`, `generated_by`, `generated_at`. Skills read `synced_to_commit` from `draft/metadata.json`.
|
|
9
10
|
> - **Session/report artifacts** (`draft/bughunt-report-*.md`, `draft/review-*.md`, etc.): embed full git frontmatter using the template below — these are point-in-time snapshots, not refreshable docs.
|
|
10
11
|
> - **Track artifacts** (`tracks/<id>/spec.md`, `hld.md`, etc.): git state lives in `tracks/<id>/metadata.json`. Per-file frontmatter carries only stable fields.
|
|
@@ -16,7 +17,7 @@ Referenced by: All skills that generate Draft reports — including `/draft:bugh
|
|
|
16
17
|
Use `git-metadata.sh` from the plugin install, resolved via the canonical tool resolver (see [tool-resolver.md](tool-resolver.md)):
|
|
17
18
|
|
|
18
19
|
```bash
|
|
19
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
20
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
20
21
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
21
22
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
22
23
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -88,14 +88,12 @@ Skills that emit telemetry via [emit-skill-metrics.sh](../../scripts/tools/emit-
|
|
|
88
88
|
|
|
89
89
|
These fields are appended to `~/.draft/metrics.jsonl` along with the existing skill fields (`skill`, `track_id`, etc.) — no new state file is needed. Run `tail -100 ~/.draft/metrics.jsonl | jq -s 'group_by(.skill) | map({skill: .[0].skill, runs: length, avg_graph_queries: ([.[].graph_queries] | add / length), avg_grep_fallbacks: ([.[].fallback_grep_count] | add / length)})'` to monitor adherence per skill.
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
91
|
## Tooling Wrappers
|
|
94
92
|
|
|
95
|
-
For common query modes, prefer the deterministic wrappers that ship with the plugin. Resolve their location via the canonical tool resolver (see [tool-resolver.md](tool-resolver.md)) before invoking. Skills run with cwd = the user's project and `${CLAUDE_PLUGIN_ROOT}` is **not** exported into skill Bash, so a bare `scripts/tools/
|
|
93
|
+
For common query modes, prefer the deterministic wrappers that ship with the plugin. Resolve their location via the canonical tool resolver (see [tool-resolver.md](tool-resolver.md)) before invoking. Skills run with cwd = the user's project and `${CLAUDE_PLUGIN_ROOT}` is **not** exported into skill Bash, so a bare `scripts/tools/git-metadata.sh` fails — establish `DRAFT_TOOLS` once before the first helper call, in the same Bash session as your tool calls (re-establish it if you split helper calls into a separate, later Bash block):
|
|
96
94
|
|
|
97
95
|
```bash
|
|
98
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
96
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
99
97
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
100
98
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
101
99
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -211,7 +209,7 @@ Live queries go through the shell tools under `scripts/tools/`, which drive the
|
|
|
211
209
|
### Callers — who calls this function?
|
|
212
210
|
|
|
213
211
|
```bash
|
|
214
|
-
|
|
212
|
+
"$DRAFT_TOOLS/graph-callers.sh" --repo . --symbol <name>
|
|
215
213
|
```
|
|
216
214
|
|
|
217
215
|
Output: `{symbol, callers[{name, file}], source}`. Use when enumerating call sites before claiming "no other usages" or judging breaking-change severity.
|
|
@@ -219,8 +217,8 @@ Output: `{symbol, callers[{name, file}], source}`. Use when enumerating call sit
|
|
|
219
217
|
### Impact — blast radius of a file or symbol
|
|
220
218
|
|
|
221
219
|
```bash
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
"$DRAFT_TOOLS/graph-impact.sh" --repo . --file <path> # changed-file impact (working-tree diff)
|
|
221
|
+
"$DRAFT_TOOLS/graph-impact.sh" --repo . --symbol <name> # transitive callers of a function
|
|
224
222
|
```
|
|
225
223
|
|
|
226
224
|
Output: `{target, kind, impacted[{name, file, hop}], source}`. Use when sizing risk before modifying a file or symbol, especially high-fan-in hotspots.
|
|
@@ -228,7 +226,7 @@ Output: `{target, kind, impacted[{name, file, hop}], source}`. Use when sizing r
|
|
|
228
226
|
### Hotspots — fan-in ranking
|
|
229
227
|
|
|
230
228
|
```bash
|
|
231
|
-
|
|
229
|
+
"$DRAFT_TOOLS/hotspot-rank.sh" --repo . [--top N]
|
|
232
230
|
```
|
|
233
231
|
|
|
234
232
|
Output: `{hotspots[{id, name, fanIn}], source}` (server-computed by the engine).
|
|
@@ -236,7 +234,7 @@ Output: `{hotspots[{id, name, fanIn}], source}` (server-computed by the engine).
|
|
|
236
234
|
### Cycles — call-cycle detection
|
|
237
235
|
|
|
238
236
|
```bash
|
|
239
|
-
|
|
237
|
+
"$DRAFT_TOOLS/cycle-detect.sh" --repo .
|
|
240
238
|
```
|
|
241
239
|
|
|
242
240
|
Output: `{cycles[[a,b],[a,b,c]], source}` — fixed-length 2- and 3-node `CALLS` cycles (mutual recursion / tight coupling).
|
|
@@ -246,7 +244,7 @@ Output: `{cycles[[a,b],[a,b,c]], source}` — fixed-length 2- and 3-node `CALLS`
|
|
|
246
244
|
Query the engine's architecture view live with the `graph-arch.sh` wrapper (it resolves the engine, indexes on demand, and auto-resolves the project):
|
|
247
245
|
|
|
248
246
|
```bash
|
|
249
|
-
|
|
247
|
+
"$DRAFT_TOOLS/graph-arch.sh" --repo . \
|
|
250
248
|
| jq '{packages, node_labels, edge_types, routes, layers, boundaries}'
|
|
251
249
|
```
|
|
252
250
|
|
|
@@ -255,8 +253,8 @@ scripts/tools/graph-arch.sh --repo . \
|
|
|
255
253
|
### Mermaid — diagram text
|
|
256
254
|
|
|
257
255
|
```bash
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
"$DRAFT_TOOLS/mermaid-from-graph.sh" --repo . --diagram module-deps # co-change coupling
|
|
257
|
+
"$DRAFT_TOOLS/mermaid-from-graph.sh" --repo . --diagram proto-map # detected routes
|
|
260
258
|
```
|
|
261
259
|
|
|
262
260
|
Emits a ready-to-inject ` ```mermaid ``` ` block on the fly (computed live by the engine), or an empty stub (exit 2) when the engine is unavailable. Diagrams are generated at the moment of use — they are never committed.
|
|
@@ -264,7 +262,7 @@ Emits a ready-to-inject ` ```mermaid ``` ` block on the fly (computed live by th
|
|
|
264
262
|
### Snippet — verified source + caller/callee counts
|
|
265
263
|
|
|
266
264
|
```bash
|
|
267
|
-
|
|
265
|
+
"$DRAFT_TOOLS/graph-snippet.sh" --repo . --qualified <pkg.Mod.Class.method>
|
|
268
266
|
```
|
|
269
267
|
|
|
270
268
|
Output: `{qualified_name, file, start_line, end_line, callers, callees, transitive_loop_depth, complexity, code, status, source}`. Prefer this over grep+Read when you have a qualified name — it returns the engine's attributed source plus pre-computed counts.
|
|
@@ -272,7 +270,7 @@ Output: `{qualified_name, file, start_line, end_line, callers, callees, transiti
|
|
|
272
270
|
### Search — semantic / ranked symbol lookup
|
|
273
271
|
|
|
274
272
|
```bash
|
|
275
|
-
|
|
273
|
+
"$DRAFT_TOOLS/graph-search.sh" --repo . --query "auth token refresh" [--limit N]
|
|
276
274
|
```
|
|
277
275
|
|
|
278
276
|
Output: `{query, results[{name, qualified_name, label, file, rank}], total, source}`. Use when the user names an **intent/concept** rather than an exact symbol — this is the first move in the Concept-to-Files recipe.
|
|
@@ -280,8 +278,8 @@ Output: `{query, results[{name, qualified_name, label, file, rank}], total, sour
|
|
|
280
278
|
### Tests — coverage edges and untested surface
|
|
281
279
|
|
|
282
280
|
```bash
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
"$DRAFT_TOOLS/graph-tests.sh" --repo . --symbol <name> # tests covering a symbol
|
|
282
|
+
"$DRAFT_TOOLS/graph-tests.sh" --repo . --untested # exported symbols with no TESTS edge
|
|
285
283
|
```
|
|
286
284
|
|
|
287
285
|
Output: `{symbol, tests[{test,file}], status, source}` or `{untested[{symbol,file}], total, truncated, source}`. Feeds coverage gaps for `init`/`testing-strategy`/`coverage`.
|
|
@@ -289,7 +287,7 @@ Output: `{symbol, tests[{test,file}], status, source}` or `{untested[{symbol,fil
|
|
|
289
287
|
### Deps — real module/file import graph
|
|
290
288
|
|
|
291
289
|
```bash
|
|
292
|
-
|
|
290
|
+
"$DRAFT_TOOLS/graph-deps.sh" --repo . [--file PATH]
|
|
293
291
|
```
|
|
294
292
|
|
|
295
293
|
Output: `{imports[{src,dst}], total, truncated, source}` from actual `IMPORTS` edges (self-imports filtered). This is the auto-derived dependency graph behind `mermaid-from-graph.sh --diagram module-deps` and `architecture.md §9`.
|
|
@@ -297,7 +295,7 @@ Output: `{imports[{src,dst}], total, truncated, source}` from actual `IMPORTS` e
|
|
|
297
295
|
### Hierarchy — class inheritance
|
|
298
296
|
|
|
299
297
|
```bash
|
|
300
|
-
|
|
298
|
+
"$DRAFT_TOOLS/graph-hierarchy.sh" --repo . [--symbol <Class> | --derived <Base>]
|
|
301
299
|
```
|
|
302
300
|
|
|
303
301
|
Output: `{edges[{child,parent}], status, source}`. `--derived` gives the blast radius of changing a base class.
|
|
@@ -305,8 +303,8 @@ Output: `{edges[{child,parent}], status, source}`. `--derived` gives the blast r
|
|
|
305
303
|
### Errors — error-propagation paths
|
|
306
304
|
|
|
307
305
|
```bash
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
"$DRAFT_TOOLS/graph-errors.sh" --repo . --symbol <name> # what it raises/throws
|
|
307
|
+
"$DRAFT_TOOLS/graph-errors.sh" --repo . --type <ErrType> # who raises/throws that type
|
|
310
308
|
```
|
|
311
309
|
|
|
312
310
|
Output: `{symbol, raises[...], status, source}` or `{type, raisers[...], status, source}`. `--type` drives fail-closed audits.
|
|
@@ -314,7 +312,7 @@ Output: `{symbol, raises[...], status, source}` or `{type, raisers[...], status,
|
|
|
314
312
|
### Risk — pre-computed risk hotspots
|
|
315
313
|
|
|
316
314
|
```bash
|
|
317
|
-
|
|
315
|
+
"$DRAFT_TOOLS/graph-risk.sh" --repo . [--min-complexity N]
|
|
318
316
|
```
|
|
319
317
|
|
|
320
318
|
Output: `{risky[{symbol, file, complexity, flags}], total, truncated, source}` from the engine's pre-computed flags (`unguarded_recursion`, `recursion_in_loop`, `alloc_in_loop`, `linear_scan_in_loop`). High-signal input for `bughunt`/`deep-review` — the engine already found these.
|
|
@@ -322,8 +320,8 @@ Output: `{risky[{symbol, file, complexity, flags}], total, truncated, source}` f
|
|
|
322
320
|
### Generic — read-only escape hatch (all 20 edges / ~30 properties)
|
|
323
321
|
|
|
324
322
|
```bash
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
"$DRAFT_TOOLS/graph-query.sh" --repo . --cypher 'MATCH (f)-[:WRITES]->(v) RETURN f.name, v.name LIMIT 50'
|
|
324
|
+
"$DRAFT_TOOLS/graph-query.sh" --repo . --tool get_graph_schema --json '{}'
|
|
327
325
|
```
|
|
328
326
|
|
|
329
327
|
Unlocks any edge type or node property without a purpose-built wrapper. Write verbs are rejected; stay inside the SAFE dialect set (above). Emits raw engine JSON.
|
|
@@ -331,7 +329,7 @@ Unlocks any edge type or node property without a purpose-built wrapper. Write ve
|
|
|
331
329
|
### Indexing / refreshing the gate marker
|
|
332
330
|
|
|
333
331
|
```bash
|
|
334
|
-
|
|
332
|
+
"$DRAFT_TOOLS/graph-snapshot.sh" --repo .
|
|
335
333
|
```
|
|
336
334
|
|
|
337
335
|
Indexes the repo into the engine and writes the `draft/graph/schema.yaml` gate marker (now including the `detect_changes` delta: `changed_files`/`impacted_symbols`). It writes **no** graph data. Run during `/draft:init` and `/draft:graph`, or whenever the index should be refreshed.
|
|
@@ -350,7 +348,7 @@ The engine is the `codebase-memory-mcp` binary. Resolution order (implemented by
|
|
|
350
348
|
The canonical verifier is `scripts/tools/verify-graph-binary.sh` (`--json --verbose --strict`). It resolves and liveness-checks the engine and, in a `draft/` context, writes the usage-report side-effect:
|
|
351
349
|
|
|
352
350
|
```bash
|
|
353
|
-
ENGINE_INFO="$(
|
|
351
|
+
ENGINE_INFO="$("$DRAFT_TOOLS/verify-graph-binary.sh" --repo . --json 2>/dev/null || true)"
|
|
354
352
|
# {"status":"ok","engine_bin":"...","source":"managed|path|bundled:<arch>|override","arch":"..."}
|
|
355
353
|
```
|
|
356
354
|
|
|
@@ -363,7 +361,7 @@ After successful detection, `draft/.graph-binary-report.json` contains: `detecte
|
|
|
363
361
|
Run during `draft:init` / `draft:graph`, or manually:
|
|
364
362
|
|
|
365
363
|
```bash
|
|
366
|
-
|
|
364
|
+
"$DRAFT_TOOLS/graph-snapshot.sh" --repo .
|
|
367
365
|
```
|
|
368
366
|
|
|
369
367
|
The engine indexes C/C++, Go, Python, TypeScript/JS, and more (tree-sitter, 159 languages) plus LSP-assisted resolution for the major ones, and detects HTTP/gRPC/GraphQL routes. Indexing is incremental in the engine (content-based, git-aware). This refreshes the engine index and rewrites the `schema.yaml` gate marker; it produces no committed graph data.
|
|
@@ -19,4 +19,4 @@ See [graph-query.md](graph-query.md) §Graph Usage Report (Mandatory Footer) for
|
|
|
19
19
|
- Justification (only when `Graph files queried: NONE`): <required — `graph data unavailable` | `non-code task` | `<explicit reason>`>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
**Gate:** `Graph files queried: NONE` without a populated justification line is a hard failure.
|
|
22
|
+
**Gate:** `Graph files queried: NONE` without a populated justification line is a hard failure.
|
package/core/shared/jira-sync.md
CHANGED
|
@@ -28,7 +28,7 @@ All Jira content written by Draft (comments and descriptions) MUST include a sig
|
|
|
28
28
|
|
|
29
29
|
Append this signature block at the end of every Jira comment:
|
|
30
30
|
|
|
31
|
-
```
|
|
31
|
+
```text
|
|
32
32
|
─────────────────────────────
|
|
33
33
|
🤖 Generated by Draft
|
|
34
34
|
```
|
|
@@ -37,7 +37,7 @@ Append this signature block at the end of every Jira comment:
|
|
|
37
37
|
|
|
38
38
|
Append this signature line inside `{noformat}` blocks at the end of every Jira description:
|
|
39
39
|
|
|
40
|
-
```
|
|
40
|
+
```yaml
|
|
41
41
|
---
|
|
42
42
|
🤖 Generated by Draft
|
|
43
43
|
Branch: [branch-name] | Commit: [short-hash]
|
|
@@ -63,7 +63,7 @@ On every sync operation, after posting the comment or attachment:
|
|
|
63
63
|
|
|
64
64
|
All Jira comments from Draft follow this format for consistency and scannability:
|
|
65
65
|
|
|
66
|
-
```
|
|
66
|
+
```json
|
|
67
67
|
[draft] {action}: {1-line summary}
|
|
68
68
|
─────────────────────────────
|
|
69
69
|
• {key detail 1}
|
|
@@ -77,7 +77,8 @@ Attachment: {filename} (if applicable)
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Examples:
|
|
80
|
-
|
|
80
|
+
|
|
81
|
+
```json
|
|
81
82
|
[draft] spec-complete: Specification and plan generated for track add-user-auth
|
|
82
83
|
─────────────────────────────
|
|
83
84
|
• 3 phases, 12 tasks planned
|
|
@@ -90,7 +91,7 @@ Attachments: spec.md, plan.md
|
|
|
90
91
|
🤖 Generated by Draft
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
```
|
|
94
|
+
```json
|
|
94
95
|
[draft] rca-complete: Root cause identified for login timeout
|
|
95
96
|
─────────────────────────────
|
|
96
97
|
• Root cause: connection pool exhaustion under concurrent load
|
|
@@ -118,7 +119,7 @@ Attachment: rca.md
|
|
|
118
119
|
|
|
119
120
|
## Sync Procedure
|
|
120
121
|
|
|
121
|
-
```
|
|
122
|
+
```text
|
|
122
123
|
1. Verify Jira MCP is available (from context loading state)
|
|
123
124
|
- If unavailable: queue to .jira-sync-queue.json, return
|
|
124
125
|
|
|
@@ -152,8 +153,10 @@ Attachment: rca.md
|
|
|
152
153
|
## Failure Handling
|
|
153
154
|
|
|
154
155
|
If MCP operation fails:
|
|
156
|
+
|
|
155
157
|
1. Do NOT fail the parent skill
|
|
156
158
|
2. Save pending sync to `draft/tracks/<id>/.jira-sync-queue.json`:
|
|
159
|
+
|
|
157
160
|
```json
|
|
158
161
|
{
|
|
159
162
|
"pending": [
|
|
@@ -166,5 +169,6 @@ If MCP operation fails:
|
|
|
166
169
|
]
|
|
167
170
|
}
|
|
168
171
|
```
|
|
172
|
+
|
|
169
173
|
3. On next successful MCP connection, retry queued items
|
|
170
174
|
4. Warn user: "Jira sync queued (MCP unavailable). Will retry on next connection."
|
|
@@ -20,7 +20,7 @@ If `draft/wiki/` does **not** exist (monolith mode), skip this procedure entirel
|
|
|
20
20
|
|
|
21
21
|
The bundle is a tree: `.ai-context.md` (index root: Synopsis + Concept Map) → section indexes (`systems/`, `features/`, `reference/`, `entrypoints/`, `overview/`) → concept pages. Each node advertises a `description` routing key. Navigate it, do not flatten it.
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```text
|
|
24
24
|
1. Frame the query
|
|
25
25
|
Extract routing terms from the active task: domain nouns from spec.md
|
|
26
26
|
acceptance criteria, file paths / module names / tech terms from plan.md,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## Architecture
|
|
10
10
|
|
|
11
|
-
```
|
|
11
|
+
```text
|
|
12
12
|
Phase 1 (Map) N parallel reader agents bounded scope per agent (4 modules each)
|
|
13
13
|
each agent reads source files in its assigned modules
|
|
14
14
|
each agent outputs (A) IR JSON array — structured metadata for tables/diagrams
|
|
@@ -97,7 +97,7 @@ Large modules with deep sub-module hierarchies (e.g., 500+ files with 5+ sub-mod
|
|
|
97
97
|
Use this verbatim as the `prompt` field when spawning each reader agent via the `Agent` tool.
|
|
98
98
|
Replace `{MODULE_LIST}`, `{REPO_ROOT}`, and `{GRAPH_DATA_SUMMARY}` before sending.
|
|
99
99
|
|
|
100
|
-
```
|
|
100
|
+
```text
|
|
101
101
|
You are a module reader agent. You have two jobs for each assigned module:
|
|
102
102
|
(A) Extract structured IR JSON — metadata for tables and diagrams
|
|
103
103
|
(B) Write a full §7 deep-dive section in Markdown — prose the synthesis agent will paste verbatim into architecture.md
|
|
@@ -206,7 +206,7 @@ Only when the graph shows clear internal structure with its own public surface o
|
|
|
206
206
|
Use this as the prompt for the single synthesis agent in Phase 2.
|
|
207
207
|
Replace `{CONCATENATED_IRS}`, `{GRAPH_DEPENDENCY_DIAGRAM}`, and `{ARCHITECTURE_TEMPLATE_STRUCTURE}`.
|
|
208
208
|
|
|
209
|
-
```
|
|
209
|
+
```text
|
|
210
210
|
You are the synthesis agent. Your job is to assemble draft/architecture.md from reader outputs.
|
|
211
211
|
|
|
212
212
|
## Inputs
|
|
@@ -305,7 +305,7 @@ For tier 1–2, skip parallelism — one reader agent handles all modules sequen
|
|
|
305
305
|
|
|
306
306
|
When assigning modules to reader agents (tier 3+), apply this priority ordering:
|
|
307
307
|
|
|
308
|
-
```
|
|
308
|
+
```text
|
|
309
309
|
Rule 1: Assign high fan-in modules to separate readers
|
|
310
310
|
(modules with many callers produce IRs that many other IRs reference)
|
|
311
311
|
|
|
@@ -319,7 +319,8 @@ Rule 4: Use tier table above for modules-per-agent target
|
|
|
319
319
|
```
|
|
320
320
|
|
|
321
321
|
Example grouping heuristic (adapt to actual fan-in data from graph):
|
|
322
|
-
|
|
322
|
+
|
|
323
|
+
```yaml
|
|
323
324
|
reader_A: [highest fan-in module alone] — never share high-fan-in with others
|
|
324
325
|
reader_B: [coupled pair: module_X + module_Y] — modules that call each other
|
|
325
326
|
reader_C: [data layer modules] — shared persistence/cache modules together
|
|
@@ -332,24 +333,30 @@ reader_E: [infra/bootstrap modules] — low fan-in, foundational
|
|
|
332
333
|
## Failure Modes and Recovery
|
|
333
334
|
|
|
334
335
|
### Reader produces prose instead of IR
|
|
336
|
+
|
|
335
337
|
**Detection:** Output doesn't start with `[` or fails JSON.parse.
|
|
336
338
|
**Recovery:** Retry that reader with stricter constraint:
|
|
337
|
-
|
|
339
|
+
|
|
340
|
+
```text
|
|
338
341
|
RETRY INSTRUCTION: Your previous output was not valid JSON. Output ONLY the JSON array.
|
|
339
342
|
The first character of your response MUST be `[`. No preamble. No explanation.
|
|
340
343
|
```
|
|
344
|
+
|
|
341
345
|
**Fallback:** If retry fails, run those modules through the standard sequential analysis.
|
|
342
346
|
|
|
343
347
|
### IR is too sparse AND deep-dive is too short
|
|
348
|
+
|
|
344
349
|
**Detection:** IR `token_budget_used < 150` for a module with >20 files AND deep-dive < 100 lines.
|
|
345
350
|
**Recovery:** Re-run that reader with explicit instruction to read more source files and expand the deep-dive.
|
|
346
351
|
If only the IR is sparse but the deep-dive is substantive, no action needed — prose is the primary output.
|
|
347
352
|
|
|
348
353
|
### Synthesis agent re-reads source outside policy
|
|
354
|
+
|
|
349
355
|
**Detection:** Tool calls to Read for files not in the permitted-sections list during synthesis.
|
|
350
356
|
**Prevention:** The synthesis prompt lists exactly which sections permit source reads. Outside those, synthesis derives from reader prose and IR.
|
|
351
357
|
|
|
352
358
|
### One reader agent fails entirely
|
|
359
|
+
|
|
353
360
|
**Detection:** Agent returns error or times out.
|
|
354
361
|
**Recovery:** Run the failed module group through standard sequential analysis.
|
|
355
362
|
The other readers' IRs are still valid — only the failed group needs re-work.
|
|
@@ -359,7 +366,7 @@ This is the blast-radius advantage over single-agent: a reader failure is a part
|
|
|
359
366
|
|
|
360
367
|
## Token Budget Model
|
|
361
368
|
|
|
362
|
-
```
|
|
369
|
+
```text
|
|
363
370
|
Phase 1 readers (parallel, ceil(M/4) agents):
|
|
364
371
|
Per agent: 4 modules × ~4K source tokens = ~16K input
|
|
365
372
|
IR output: ~2K tokens/agent
|
|
@@ -11,6 +11,7 @@ Referenced by: `/draft:bughunt`, `/draft:deep-review`, `/draft:review`, `/draft:
|
|
|
11
11
|
Execute this phase **after** the main analysis and report generation are complete. This phase updates `draft/guardrails.md` with newly discovered patterns.
|
|
12
12
|
|
|
13
13
|
**Skip this phase if:**
|
|
14
|
+
|
|
14
15
|
- `draft/` directory does not exist (no Draft context)
|
|
15
16
|
- Analysis found zero findings to learn from
|
|
16
17
|
- Running in a read-only or preview mode
|
|
@@ -110,6 +111,7 @@ Append under `## Learned Anti-Patterns`:
|
|
|
110
111
|
```
|
|
111
112
|
|
|
112
113
|
`graph_severity` derivation rules (from live hotspot query `scripts/tools/hotspot-rank.sh --repo .` fanIn values):
|
|
114
|
+
|
|
113
115
|
- fanIn ≥ 10 in any evidence file → `critical`
|
|
114
116
|
- fanIn 5–9 → `high`
|
|
115
117
|
- fanIn 1–4 → `medium`
|
|
@@ -19,4 +19,4 @@ See [verification-gates.md](verification-gates.md) for the canonical WS-9 gate c
|
|
|
19
19
|
|
|
20
20
|
**Required track artifacts (2.0):** `spec.md`, `plan.md`, `hld.md`, `lld.md`, `metadata.json`, `discovery.md`.
|
|
21
21
|
|
|
22
|
-
**Scope fields:** `metadata.json:scope_includes` / `scope_excludes` (or spec frontmatter fallback) define track footprint; conflicts block parallel work without explicit exclusion.
|
|
22
|
+
**Scope fields:** `metadata.json:scope_includes` / `scope_excludes` (or spec frontmatter fallback) define track footprint; conflicts block parallel work without explicit exclusion.
|
|
@@ -15,7 +15,7 @@ project**, not the plugin. The helpers live inside the plugin install directory,
|
|
|
15
15
|
which on a marketplace/npm install is `~/.claude/plugins/cache/<marketplace>/draft/<version>/`
|
|
16
16
|
— never the cwd. `${CLAUDE_PLUGIN_ROOT}` is **not** exported into skill-driven Bash
|
|
17
17
|
(it is only set for hooks, MCP/LSP servers, and monitor commands), so a bare
|
|
18
|
-
`scripts/tools/
|
|
18
|
+
`scripts/tools/git-metadata.sh` or `${CLAUDE_PLUGIN_ROOT}/...` invocation silently fails.
|
|
19
19
|
|
|
20
20
|
Every skill MUST resolve `DRAFT_TOOLS` and invoke helpers as `"$DRAFT_TOOLS/<tool>.sh"`.
|
|
21
21
|
|
|
@@ -24,16 +24,20 @@ Every skill MUST resolve `DRAFT_TOOLS` and invoke helpers as `"$DRAFT_TOOLS/<too
|
|
|
24
24
|
`DRAFT_TOOLS` resolves to the first directory that exists, in this order:
|
|
25
25
|
|
|
26
26
|
1. `${DRAFT_PLUGIN_ROOT}/scripts/tools` — explicit override (testing / pinned installs)
|
|
27
|
-
2. `$
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
2. `$PWD/scripts/tools` — dev / dogfooding when cwd IS the draft repo (guarded by
|
|
28
|
+
`resolve-tools.sh`'s own presence, so it can never misfire in a user project;
|
|
29
|
+
deliberately beats the install marker so a repo checkout always wins)
|
|
30
|
+
3. `$(cat ~/.cache/draft/plugin-root)/scripts/tools` — install marker written by `draft install` (authoritative for installs)
|
|
31
|
+
4. `${CLAUDE_PLUGIN_ROOT}/scripts/tools` — set in hook/MCP contexts; harmless to probe
|
|
32
|
+
5. `installed_plugins.json → installPath` for `draft@*` — Claude Code's own registry (needs `jq`)
|
|
33
|
+
6. `~/.claude/plugins/cache/*/draft/*/scripts/tools` — newest cache install (glob, `sort -V`)
|
|
34
|
+
7. `~/.claude/plugins/marketplaces/*draft*/scripts/tools` — marketplace clone
|
|
35
|
+
8. `~/.cursor/plugins/local/draft/scripts/tools` — Cursor local install
|
|
36
|
+
9. `$PWD/scripts/tools` — last-resort cwd fallback (unguarded)
|
|
37
|
+
|
|
38
|
+
The marker (step 3) is the fast, authoritative path for installs; steps 6–7 are the
|
|
39
|
+
glob fallback that keeps resolution working on installs predating the marker (no
|
|
40
|
+
reinstall required).
|
|
37
41
|
|
|
38
42
|
## Skill preamble (copy verbatim)
|
|
39
43
|
|
|
@@ -44,7 +48,7 @@ invocations (only the cwd does), so if you split helper calls into a later, sepa
|
|
|
44
48
|
Bash block, re-establish `DRAFT_TOOLS` there too:
|
|
45
49
|
|
|
46
50
|
```bash
|
|
47
|
-
DRAFT_TOOLS="$(cat ~/.cache/draft/plugin-root 2>/dev/null)/scripts/tools"
|
|
51
|
+
DRAFT_TOOLS="${DRAFT_PLUGIN_ROOT:-$(cat ~/.cache/draft/plugin-root 2>/dev/null)}/scripts/tools"
|
|
48
52
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/cache/*/draft/*/scripts/tools 2>/dev/null | sort -V | tail -1)"
|
|
49
53
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$(ls -d ~/.claude/plugins/marketplaces/*draft*/scripts/tools 2>/dev/null | tail -1)"
|
|
50
54
|
[ -d "$DRAFT_TOOLS" ] || DRAFT_TOOLS="$PWD/scripts/tools"
|
|
@@ -58,9 +62,10 @@ Then invoke helpers through the variable:
|
|
|
58
62
|
```
|
|
59
63
|
|
|
60
64
|
The four-line inline preamble is self-contained and is the recommended form for
|
|
61
|
-
skills — it needs no marker file and no prior `source`. The full
|
|
62
|
-
(adding the `${DRAFT_PLUGIN_ROOT}` override,
|
|
63
|
-
lookup, and the Cursor path) is shipped
|
|
65
|
+
skills — it needs no marker file and no prior `source`. The full resolver
|
|
66
|
+
(adding the `${DRAFT_PLUGIN_ROOT}` override, the guarded dogfood short-circuit,
|
|
67
|
+
`${CLAUDE_PLUGIN_ROOT}`, the jq-registry lookup, and the Cursor path) is shipped
|
|
68
|
+
as `scripts/tools/resolve-tools.sh` for tests
|
|
64
69
|
and for callers that prefer a single source of truth:
|
|
65
70
|
|
|
66
71
|
```bash
|
|
@@ -38,7 +38,7 @@ git rev-list [range] # Commit listing
|
|
|
38
38
|
|
|
39
39
|
Draft uses [Conventional Commits](https://www.conventionalcommits.org/) for traceability:
|
|
40
40
|
|
|
41
|
-
```
|
|
41
|
+
```text
|
|
42
42
|
<type>(<track_id>): <description>
|
|
43
43
|
|
|
44
44
|
[optional body]
|
|
@@ -49,11 +49,13 @@ Draft uses [Conventional Commits](https://www.conventionalcommits.org/) for trac
|
|
|
49
49
|
Common `<type>` values: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`, `perf`.
|
|
50
50
|
|
|
51
51
|
Footer fields (when applicable):
|
|
52
|
+
|
|
52
53
|
- `Refs: <issue or PR number>` — link to issue tracker
|
|
53
54
|
- `Co-Authored-By: <name> <email>` — for AI-assisted commits
|
|
54
55
|
|
|
55
56
|
If a Jira ticket is linked in `spec.md`, include it in the body or footer:
|
|
56
|
-
|
|
57
|
+
|
|
58
|
+
```text
|
|
57
59
|
feat(add-auth): implement OAuth2 callback
|
|
58
60
|
|
|
59
61
|
Refs: ENG-1234
|
|
@@ -78,6 +80,7 @@ git push -u origin <branch>
|
|
|
78
80
|
```
|
|
79
81
|
|
|
80
82
|
Then open a PR via the `gh` CLI or the GitHub web UI:
|
|
83
|
+
|
|
81
84
|
```bash
|
|
82
85
|
gh pr create --title "<title>" --body "<description>"
|
|
83
86
|
```
|
|
@@ -35,7 +35,7 @@ generated_at: "{ISO_TIMESTAMP}"
|
|
|
35
35
|
|
|
36
36
|
## Component Graph
|
|
37
37
|
|
|
38
|
-
```
|
|
38
|
+
```json
|
|
39
39
|
{project_root}/
|
|
40
40
|
├── {module1}/ ← {5-10 word description}
|
|
41
41
|
│ ├── {submod1}/ ← {description} ({Ncc} cc, {Nh} h)
|
|
@@ -114,6 +114,7 @@ None ✓
|
|
|
114
114
|
{One paragraph or bullets explaining how components find each other.}
|
|
115
115
|
|
|
116
116
|
Key injection points:
|
|
117
|
+
|
|
117
118
|
- `{token1}`: {what it provides}
|
|
118
119
|
- `{token2}`: {what it provides}
|
|
119
120
|
- `{token3}`: {what it provides}
|
|
@@ -144,7 +145,7 @@ interface {ServiceName} {
|
|
|
144
145
|
|
|
145
146
|
## Dependency Graph
|
|
146
147
|
|
|
147
|
-
```
|
|
148
|
+
```json
|
|
148
149
|
[{Component}] -> (HTTP) -> [{ExternalService}]
|
|
149
150
|
[{Component}] -> (SQL) -> [{Database}]
|
|
150
151
|
[{Component}] -> (gRPC) -> [{PeerService}]
|
|
@@ -9,12 +9,14 @@ generated_at: "{ISO_TIMESTAMP}"
|
|
|
9
9
|
# {PROJECT_NAME} Profile
|
|
10
10
|
|
|
11
11
|
## Project
|
|
12
|
+
|
|
12
13
|
- Name: {PROJECT_NAME}
|
|
13
14
|
- One-liner: {ONE_LINE_PRODUCT_DESCRIPTION}
|
|
14
15
|
- Primary users: {USER_TYPES}
|
|
15
16
|
- Repository layout: {monorepo|polyrepo|single-service}
|
|
16
17
|
|
|
17
18
|
## Stack
|
|
19
|
+
|
|
18
20
|
- Language: {LANGUAGE}
|
|
19
21
|
- Framework: {FRAMEWORK}
|
|
20
22
|
- Database: {DATABASE}
|
|
@@ -26,17 +28,22 @@ generated_at: "{ISO_TIMESTAMP}"
|
|
|
26
28
|
- Entry: {ENTRY_POINT}
|
|
27
29
|
|
|
28
30
|
## INVARIANTS
|
|
31
|
+
|
|
29
32
|
{Top 3-5 critical invariants from .ai-context.md, one per line, with file:line refs}
|
|
30
33
|
|
|
31
34
|
## NEVER
|
|
35
|
+
|
|
32
36
|
{2-3 safety rules — things that must never happen}
|
|
33
37
|
|
|
34
38
|
## Key Operational Models (from §6 / GRAPH:OPERATIONAL)
|
|
39
|
+
|
|
35
40
|
- {Most critical flow 1 — one line}
|
|
36
41
|
- {Most critical flow 2 (if space allows)}
|
|
37
42
|
|
|
38
43
|
## Active Tracks
|
|
44
|
+
|
|
39
45
|
{List of active track IDs and one-line descriptions, or "none"}
|
|
40
46
|
|
|
41
47
|
## Recent Changes
|
|
48
|
+
|
|
42
49
|
{Last 3-5 significant commits or changes, one per line}
|