@hegemonart/get-design-done 1.59.3 → 1.59.4
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +31 -0
- package/SKILL.md +2 -0
- package/figma-plugin/README.md +61 -0
- package/figma-plugin/code.ts +36 -0
- package/figma-plugin/manifest.json +12 -0
- package/figma-plugin/package-lock.json +35 -0
- package/figma-plugin/package.json +12 -0
- package/figma-plugin/src/export-variables.ts +144 -0
- package/figma-plugin/src/payload-schema.ts +250 -0
- package/figma-plugin/tsconfig.json +16 -0
- package/figma-plugin/ui.html +44 -0
- package/hooks/gdd-intel-trigger.js +3 -3
- package/package.json +6 -1
- package/reference/DEPRECATIONS.md +3 -3
- package/reference/live-mode-integration.md +1 -1
- package/reference/registry.json +1 -1
- package/reference/skill-metadata.md +4 -4
- package/reference/skill-placeholders.md +2 -2
- package/scripts/build-skills.cjs +146 -0
- package/scripts/generate-skill-frontmatter.cjs +243 -0
- package/scripts/lib/manifest/scaffolder.cjs +1 -1
- package/scripts/lib/manifest/schemas/skills.schema.json +1 -1
- package/scripts/lib/manifest/skills.json +1 -1
- package/scripts/lib/new-addendum.cjs +1 -1
- package/scripts/skill-templates/README.md +90 -0
- package/scripts/skill-templates/add-backlog/SKILL.md +48 -0
- package/scripts/skill-templates/analyze-dependencies/SKILL.md +95 -0
- package/scripts/skill-templates/apply-reflections/SKILL.md +109 -0
- package/scripts/skill-templates/apply-reflections/apply-reflections-procedure.md +170 -0
- package/scripts/skill-templates/audit/SKILL.md +79 -0
- package/scripts/skill-templates/bandit-reset/SKILL.md +91 -0
- package/scripts/skill-templates/bandit-status/SKILL.md +94 -0
- package/scripts/skill-templates/benchmark/SKILL.md +65 -0
- package/scripts/skill-templates/bootstrap-ds/SKILL.md +43 -0
- package/scripts/skill-templates/brief/SKILL.md +145 -0
- package/scripts/skill-templates/budget/SKILL.md +45 -0
- package/scripts/skill-templates/cache-manager/SKILL.md +66 -0
- package/scripts/skill-templates/cache-manager/cache-policy.md +126 -0
- package/scripts/skill-templates/check-update/SKILL.md +98 -0
- package/scripts/skill-templates/compare/SKILL.md +82 -0
- package/scripts/skill-templates/compare/compare-rubric.md +171 -0
- package/scripts/skill-templates/complete-cycle/SKILL.md +81 -0
- package/scripts/skill-templates/connections/SKILL.md +71 -0
- package/scripts/skill-templates/connections/connections-onboarding.md +608 -0
- package/scripts/skill-templates/context/SKILL.md +137 -0
- package/scripts/skill-templates/continue/SKILL.md +24 -0
- package/scripts/skill-templates/darkmode/SKILL.md +76 -0
- package/scripts/skill-templates/darkmode/darkmode-audit-procedure.md +258 -0
- package/scripts/skill-templates/debug/SKILL.md +41 -0
- package/scripts/skill-templates/debug/debug-feedback-loops.md +119 -0
- package/scripts/skill-templates/design/SKILL.md +118 -0
- package/scripts/skill-templates/design/design-procedure.md +304 -0
- package/scripts/skill-templates/discuss/SKILL.md +96 -0
- package/scripts/skill-templates/do/SKILL.md +45 -0
- package/scripts/skill-templates/explore/SKILL.md +118 -0
- package/scripts/skill-templates/explore/explore-procedure.md +267 -0
- package/scripts/skill-templates/export/SKILL.md +30 -0
- package/scripts/skill-templates/extract-learnings/SKILL.md +114 -0
- package/scripts/skill-templates/fast/SKILL.md +91 -0
- package/scripts/skill-templates/figma-extract/SKILL.md +64 -0
- package/scripts/skill-templates/figma-write/SKILL.md +50 -0
- package/scripts/skill-templates/graphify/SKILL.md +49 -0
- package/scripts/skill-templates/health/SKILL.md +99 -0
- package/scripts/skill-templates/health/health-mcp-detection.md +44 -0
- package/scripts/skill-templates/health/health-skill-length-report.md +69 -0
- package/scripts/skill-templates/help/SKILL.md +60 -0
- package/scripts/skill-templates/instinct/SKILL.md +111 -0
- package/scripts/skill-templates/list-assumptions/SKILL.md +61 -0
- package/scripts/skill-templates/list-pins/SKILL.md +27 -0
- package/scripts/skill-templates/live/SKILL.md +98 -0
- package/scripts/skill-templates/locale/SKILL.md +51 -0
- package/scripts/skill-templates/map/SKILL.md +89 -0
- package/scripts/skill-templates/migrate/SKILL.md +70 -0
- package/scripts/skill-templates/migrate-context/SKILL.md +123 -0
- package/scripts/skill-templates/new-addendum/SKILL.md +81 -0
- package/scripts/skill-templates/new-cycle/SKILL.md +37 -0
- package/scripts/skill-templates/new-project/SKILL.md +53 -0
- package/scripts/skill-templates/new-skill/SKILL.md +90 -0
- package/scripts/skill-templates/next/SKILL.md +68 -0
- package/scripts/skill-templates/note/SKILL.md +48 -0
- package/scripts/skill-templates/openrouter-status/SKILL.md +86 -0
- package/scripts/skill-templates/optimize/SKILL.md +97 -0
- package/scripts/skill-templates/override/SKILL.md +86 -0
- package/scripts/skill-templates/paper-write/SKILL.md +54 -0
- package/scripts/skill-templates/pause/SKILL.md +77 -0
- package/scripts/skill-templates/peer-cli-add/SKILL.md +88 -0
- package/scripts/skill-templates/peer-cli-add/peer-cli-protocol.md +161 -0
- package/scripts/skill-templates/peer-cli-customize/SKILL.md +89 -0
- package/scripts/skill-templates/peers/SKILL.md +96 -0
- package/scripts/skill-templates/pencil-write/SKILL.md +54 -0
- package/scripts/skill-templates/pin/SKILL.md +37 -0
- package/scripts/skill-templates/plan/SKILL.md +105 -0
- package/scripts/skill-templates/plan/plan-procedure.md +278 -0
- package/scripts/skill-templates/plant-seed/SKILL.md +48 -0
- package/scripts/skill-templates/pr-branch/SKILL.md +32 -0
- package/scripts/skill-templates/progress/SKILL.md +107 -0
- package/scripts/skill-templates/quality-gate/SKILL.md +90 -0
- package/scripts/skill-templates/quality-gate/threat-modeling.md +101 -0
- package/scripts/skill-templates/quick/SKILL.md +44 -0
- package/scripts/skill-templates/reapply-patches/SKILL.md +32 -0
- package/scripts/skill-templates/recall/SKILL.md +75 -0
- package/scripts/skill-templates/reflect/SKILL.md +85 -0
- package/scripts/skill-templates/reflect/procedures/capability-gap-scan.md +119 -0
- package/scripts/skill-templates/report-issue/SKILL.md +53 -0
- package/scripts/skill-templates/report-issue/report-issue-procedure.md +119 -0
- package/scripts/skill-templates/resume/SKILL.md +93 -0
- package/scripts/skill-templates/review-backlog/SKILL.md +46 -0
- package/scripts/skill-templates/review-decisions/SKILL.md +42 -0
- package/scripts/skill-templates/roi/SKILL.md +54 -0
- package/scripts/skill-templates/rollout-status/SKILL.md +35 -0
- package/scripts/skill-templates/router/SKILL.md +89 -0
- package/scripts/skill-templates/router/capability-gap-emitter.md +65 -0
- package/scripts/skill-templates/router/router-pick-emitter.md +78 -0
- package/scripts/skill-templates/router/router-rules.md +84 -0
- package/scripts/skill-templates/settings/SKILL.md +87 -0
- package/scripts/skill-templates/ship/SKILL.md +48 -0
- package/scripts/skill-templates/sketch/SKILL.md +78 -0
- package/scripts/skill-templates/sketch-wrap-up/SKILL.md +92 -0
- package/scripts/skill-templates/skill-manifest/SKILL.md +79 -0
- package/scripts/skill-templates/spike/SKILL.md +67 -0
- package/scripts/skill-templates/spike-wrap-up/SKILL.md +86 -0
- package/scripts/skill-templates/start/SKILL.md +67 -0
- package/scripts/skill-templates/start/start-procedure.md +115 -0
- package/scripts/skill-templates/state/SKILL.md +106 -0
- package/scripts/skill-templates/stats/SKILL.md +51 -0
- package/scripts/skill-templates/style/SKILL.md +71 -0
- package/scripts/skill-templates/style/style-doc-procedure.md +150 -0
- package/scripts/skill-templates/synthesize/SKILL.md +94 -0
- package/scripts/skill-templates/timeline/SKILL.md +66 -0
- package/scripts/skill-templates/todo/SKILL.md +64 -0
- package/scripts/skill-templates/turn-closeout/SKILL.md +95 -0
- package/scripts/skill-templates/undo/SKILL.md +31 -0
- package/scripts/skill-templates/unlock-decision/SKILL.md +54 -0
- package/scripts/skill-templates/unpin/SKILL.md +31 -0
- package/scripts/skill-templates/update/SKILL.md +56 -0
- package/scripts/skill-templates/using-gdd/SKILL.md +78 -0
- package/scripts/skill-templates/verify/SKILL.md +113 -0
- package/scripts/skill-templates/verify/verify-procedure.md +511 -0
- package/scripts/skill-templates/warm-cache/SKILL.md +81 -0
- package/scripts/skill-templates/watch-authorities/SKILL.md +82 -0
- package/scripts/skill-templates/zoom-out/SKILL.md +26 -0
- package/sdk/cli/commands/build.ts +2 -2
- package/sdk/cli/index.js +2 -2
- package/sdk/cli/index.ts +1 -1
- package/skills/README.md +22 -14
- package/skills/help/SKILL.md +28 -55
- package/skills/new-skill/SKILL.md +5 -5
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-review-backlog
|
|
3
|
+
description: "Review parked backlog items and promote any to active cycle todo."
|
|
4
|
+
tools: Read, Write, AskUserQuestion
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# {{command_prefix}}review-backlog
|
|
9
|
+
|
|
10
|
+
**Role:** Walk through parked backlog items and for each ask: promote to this cycle, keep parked, or archive.
|
|
11
|
+
|
|
12
|
+
## Step 1 - Read backlog
|
|
13
|
+
|
|
14
|
+
Read `.design/backlog/BACKLOG.md`. Parse each `## <title>` block with its metadata and body. If no parked items, print "No parked backlog items." and stop.
|
|
15
|
+
|
|
16
|
+
## Step 2 - Loop
|
|
17
|
+
|
|
18
|
+
For each item with `**Status**: parked`:
|
|
19
|
+
|
|
20
|
+
Use `AskUserQuestion`:
|
|
21
|
+
```
|
|
22
|
+
Title: <title>
|
|
23
|
+
Added: <date>
|
|
24
|
+
<truncated body>
|
|
25
|
+
|
|
26
|
+
Promote to this cycle | Keep parked | Archive
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Step 3 - Apply decision
|
|
30
|
+
|
|
31
|
+
- **Promote**: append `- [ ] [YYYY-MM-DD] <title>` under `## P1 — High` in `.design/TODO.md` (create file from the TODO.md skeleton if missing). Update backlog item status to `**Status**: promoted` + `**Promoted**: YYYY-MM-DD`.
|
|
32
|
+
- **Keep parked**: leave unchanged.
|
|
33
|
+
- **Archive**: update status to `**Status**: archived` + `**Archived**: YYYY-MM-DD`.
|
|
34
|
+
|
|
35
|
+
Rewrite `.design/backlog/BACKLOG.md` after each decision so crashes preserve progress.
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
━━━ Backlog review ━━━
|
|
41
|
+
Reviewed: 5
|
|
42
|
+
Promoted: 2 Kept parked: 2 Archived: 1
|
|
43
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## REVIEW-BACKLOG COMPLETE
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-review-decisions
|
|
3
|
+
description: "Surfaces the async decision-review queue for team mode. Reads .design/reviews/<decision-id>/ entries and reports each decision's state in the proposed → reviewing → approved → locked machine (via scripts/lib/collab/review-queue.cjs), so a team can see what's awaiting review, what's approved, and what's locked. --pending shows only decisions still needing action. Read-only - it reports the queue; it never advances a decision (that's a reviewer's explicit call). Use to run an async design-decision review without a meeting."
|
|
4
|
+
argument-hint: "[<decision-id>] [--pending]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}review-decisions
|
|
10
|
+
|
|
11
|
+
Closes the async-review gap for team mode: design decisions move through an explicit review queue
|
|
12
|
+
instead of being decided in a single operator's head. This skill reports where each decision is.
|
|
13
|
+
**Read-only** - it surfaces state; advancing a decision is a reviewer's explicit action. Contract:
|
|
14
|
+
`../../reference/multi-author-model.md`.
|
|
15
|
+
|
|
16
|
+
## Invocation
|
|
17
|
+
|
|
18
|
+
| Command | Behavior |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `{{command_prefix}}review-decisions` | Every decision in the queue, grouped by state. |
|
|
21
|
+
| `{{command_prefix}}review-decisions <decision-id>` | One decision's state + audit trail. |
|
|
22
|
+
| `{{command_prefix}}review-decisions --pending` | Only decisions not yet `locked` (awaiting action). |
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Find the queue.** List `.design/reviews/*/` (each dir is a `<decision-id>`). No reviews dir →
|
|
27
|
+
print `review-decisions: no review queue yet (team mode not in use).` and exit.
|
|
28
|
+
2. **Read each entry** (`.design/reviews/<id>/state.json` → `{ id, state, audit }`). Validate the
|
|
29
|
+
state against `scripts/lib/collab/review-queue.cjs` `STATES`.
|
|
30
|
+
3. **Render** grouped by state: `proposed` / `reviewing` / `approved` / `locked`, each listing the
|
|
31
|
+
decision id + a one-line summary. For `--pending`, use `review-queue.pending(entries)` to show only
|
|
32
|
+
non-locked ones. For a single `<decision-id>`, also print its audit trail (transitions + approvers).
|
|
33
|
+
4. **Do not advance.** Reporting only - moving a decision forward (or `{{command_prefix}}unlock-decision`) is the
|
|
34
|
+
reviewer's explicit call.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
End with:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
## REVIEW-DECISIONS COMPLETE
|
|
42
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-roi
|
|
3
|
+
description: "Shows whether GDD spend actually shipped anything. Joins per-cycle cost (.design/telemetry/costs.jsonl) with what each cycle shipped - commits that SURVIVED in main vs commits that were reverted - and reports cost-per-shipped-commit + a stick rate per cycle. 'Shipped' = a commit surviving >= the window (default 14 days), which catches revert-after-bug-discovery. Markdown table, not a GUI. Read-only - it reads git log + cost telemetry and reports. Use to see which cycles were worth their spend."
|
|
4
|
+
argument-hint: "[--since <date>] [--window-days 14]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}roi
|
|
10
|
+
|
|
11
|
+
Closes the loop on cost: `{{command_prefix}}budget` forecasts *spend*, this shows the *return*. It joins per-cycle
|
|
12
|
+
cost with the commits that actually stuck, so you can see cost-per-shipped-commit and which cycles
|
|
13
|
+
were worth it. **Read-only** - it reads `git log` + cost telemetry and prints a table. Contract +
|
|
14
|
+
the "shipped" definition: `../../reference/cost-governance.md`.
|
|
15
|
+
|
|
16
|
+
## Invocation
|
|
17
|
+
|
|
18
|
+
| Command | Behavior |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `{{command_prefix}}roi` | ROI table across all cycles with cost telemetry (14-day stick window). |
|
|
21
|
+
| `{{command_prefix}}roi --since <date>` | Only cycles since `<date>`. |
|
|
22
|
+
| `{{command_prefix}}roi --window-days N` | "Shipped" = a commit surviving ≥ N days (default 14). |
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Check telemetry exists.** No `.design/telemetry/costs.jsonl` (or zero rows) → print
|
|
27
|
+
`roi: no cost telemetry yet — run a cycle first.` and exit.
|
|
28
|
+
2. **Per-cycle cost.** Group `est_cost_usd` in `costs.jsonl` by `cycle`.
|
|
29
|
+
3. **Per-cycle shipped / reverted.** For each cycle, use `git log` to count, in that cycle's date
|
|
30
|
+
range: commits still present in `main` and older than the window = **shipped**; commits that a
|
|
31
|
+
later `revert` removed (or that were reverted within the window) = **reverted**. (A commit younger
|
|
32
|
+
than the window is "too new to score" - exclude it, don't count it as shipped.)
|
|
33
|
+
4. **Join + compute** via the pure helper - never hand-compute:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
node -e '
|
|
37
|
+
const { computeRoi, roiTableMarkdown } = require("./scripts/lib/budget/roi.cjs");
|
|
38
|
+
const cycles = JSON.parse(process.argv[1]); // [{cycle,costUsd,commitsShipped,commitsReverted},...]
|
|
39
|
+
console.log(roiTableMarkdown(computeRoi(cycles)));
|
|
40
|
+
' "$CYCLES_JSON"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5. **Render** the markdown table (cycle · cost · shipped · reverted · $/shipped · stick rate) plus the
|
|
44
|
+
TOTAL row. A high `$/shipped` with a low stick rate is the signal that a cycle burned budget
|
|
45
|
+
without lasting output.
|
|
46
|
+
6. **Do not act.** Reporting only - never revert, re-run, or change budget.
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
|
|
50
|
+
End with:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
## ROI COMPLETE
|
|
54
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-rollout-status
|
|
3
|
+
description: "Shows where a finished design cycle actually is in production rollout - unrolled / staging-only / canary-N% / prod-100% - by reading the feature-flag service (LaunchDarkly/Statsig/GrowthBook) via the rollout-coordinator. Surfaces STUCK rollouts (a canary that hasn't advanced for N days) and the design_arms outcome weighting. Read-only - GDD never advances or rolls back; it reports and notifies. Use after {{command_prefix}}ship to track the post-merge journey."
|
|
4
|
+
argument-hint: "[<cycle>] [--all] [--stuck]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Bash, Grep, Glob, ToolSearch, Task
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}rollout-status
|
|
10
|
+
|
|
11
|
+
Closes the visibility gap after `{{command_prefix}}ship`: a PR merges, but staging → canary → 100% rollout happens outside GDD. This skill reports where each cycle's design actually is in production, by delegating to `agents/rollout-coordinator.md` (which reads the feature-flag service via the Phase 38 connections). **Read-only** - it reports + notifies; it never advances or rolls back a rollout. Contract + the `<rollout_status>` schema: `../../reference/rollout-coordination.md`.
|
|
12
|
+
|
|
13
|
+
## Invocation
|
|
14
|
+
|
|
15
|
+
| Command | Behavior |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `{{command_prefix}}rollout-status` | The current cycle's rollout state (from `.design/STATE.md <rollout_status>`, refreshed via the coordinator). |
|
|
18
|
+
| `{{command_prefix}}rollout-status <cycle>` | A specific cycle's rollout state. |
|
|
19
|
+
| `{{command_prefix}}rollout-status --all` | Every cycle with a `<rollout_status>` block - a rollout dashboard. |
|
|
20
|
+
| `{{command_prefix}}rollout-status --stuck` | Only the **stuck** rollouts (partial rollouts that haven't advanced for ≥ the threshold). |
|
|
21
|
+
|
|
22
|
+
## Steps
|
|
23
|
+
|
|
24
|
+
1. **Probe the flag service.** Check a flag connection is `available` (`connections/launchdarkly.md` / `statsig.md` / `growthbook.md`). None → print `rollout-status: no flag service configured — connect one via {{command_prefix}}connections.` and exit.
|
|
25
|
+
2. **Delegate to `rollout-coordinator`** (via `Task`): it reads the service, classifies via `scripts/lib/rollout/rollout-status.cjs`, refreshes the `<rollout_status>` block, and reports state + deployed % + stuck.
|
|
26
|
+
3. **Render.** Show each cycle: `state` · `deployed_pct` · `last_changed` · `stuck?`. For `--stuck`, list only stuck cycles with the days-since-change and an advance-or-rollback suggestion.
|
|
27
|
+
4. **Do not act.** Never run a flag-service mutation, advance a canary, or roll back - GDD reports; the human + the flag service decide.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
|
|
31
|
+
End with:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
## ROLLOUT-STATUS COMPLETE
|
|
35
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-router
|
|
3
|
+
description: "Routes a /gdd command to fast|quick|full path + S|M|L|XL complexity_class and returns {path, complexity_class, model_tier_overrides, resolved_models, estimated_cost_usd, cache_hits}. Deterministic - no model call. Invoked once at command entry before any Agent spawn. Read by hooks/budget-enforcer.ts."
|
|
4
|
+
argument-hint: "<intent-string> [<target-artifacts-csv>]"
|
|
5
|
+
tools: Read, Bash, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# gdd-router
|
|
9
|
+
|
|
10
|
+
## Role
|
|
11
|
+
|
|
12
|
+
You are a deterministic routing skill. You do not spawn agents. You read `.design/budget.json`, `reference/model-prices.md`, `.design/cache-manifest.json` (if present), and the agent frontmatter list, then emit a single JSON object describing the planned spawn graph. The budget-enforcer hook (`hooks/budget-enforcer.ts`) consumes your output on every `Agent` tool call.
|
|
13
|
+
|
|
14
|
+
## Invocation Contract
|
|
15
|
+
|
|
16
|
+
- **Input**: `intent-string` (e.g., `"run discover stage on greenfield project"`) + optional comma-separated list of target artifacts (files this command will touch).
|
|
17
|
+
- **Output**: a single JSON object to stdout - nothing else on the line, no prose wrapper:
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"path": "fast",
|
|
21
|
+
"complexity_class": "M",
|
|
22
|
+
"model_tier_overrides": {"design-verifier": "haiku"},
|
|
23
|
+
"resolved_models": {
|
|
24
|
+
"design-reflector": "gpt-5",
|
|
25
|
+
"design-context-checker": "gpt-5-nano",
|
|
26
|
+
"design-verifier": "gpt-5-nano"
|
|
27
|
+
},
|
|
28
|
+
"estimated_cost_usd": 0.034,
|
|
29
|
+
"cache_hits": ["design-context-builder:abc123"]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
- `path` enum: `fast` (single Haiku + no checkers), `quick` (Sonnet mappers + Haiku verify), `full` (Opus planners + full quality gates). Stays unchanged for back-compat per D-05.
|
|
33
|
+
- `complexity_class` enum: `S | M | L | XL` (Phase 25 / D-04, D-05). Additive to `path` - existing consumers reading only `path` keep working. Mapping is documented in the Path Selection Heuristic table below.
|
|
34
|
+
- `model_tier_overrides` merges agent frontmatter `default-tier` with `.design/budget.json.tier_overrides` - budget.json wins per D-04. Enum stays `opus|sonnet|haiku` for back-compat across all 14 runtimes; consumers that need the **concrete** model name for the active runtime read `resolved_models` instead.
|
|
35
|
+
- `resolved_models` is a per-agent map of concrete model IDs for the runtime in use (Phase 26 / D-07). Keys are agent names; values are runtime-specific model strings (e.g. `"gpt-5"` under codex, `"gemini-2.5-pro"` under gemini, `"claude-opus-4-7"` under claude) or `null` when the resolver can supply no model (missing tier-map row, missing tier on the row). Additive to `model_tier_overrides` - existing consumers reading the tier-name map keep working unchanged; new consumers (budget-enforcer cost computation, cost telemetry, bandit posterior store) read `resolved_models` for runtime-correct cost. See **Runtime-aware model resolution** below for the computation contract.
|
|
36
|
+
- `estimated_cost_usd` is the sum of per-spawn estimates using the D-06 formula and `reference/model-prices.md`.
|
|
37
|
+
- `cache_hits` is a list of `{agent}:{input-hash}` strings that exist in `.design/cache-manifest.json` and are within TTL; emitting a hit lets the hook short-circuit that spawn per D-05.
|
|
38
|
+
|
|
39
|
+
### Output schema versioning
|
|
40
|
+
|
|
41
|
+
The router output contract is additive across phases. The current shape (Phase 26, v1.26.0) carries:
|
|
42
|
+
|
|
43
|
+
| Field | Added in | Status |
|
|
44
|
+
|-------|----------|--------|
|
|
45
|
+
| `path` | v1.10.1 (10.1-01) | stable |
|
|
46
|
+
| `model_tier_overrides` | v1.10.1 (10.1-01) | stable, enum unchanged |
|
|
47
|
+
| `estimated_cost_usd` | v1.10.1 (10.1-01) | stable |
|
|
48
|
+
| `cache_hits` | v1.10.1 (10.1-01) | stable |
|
|
49
|
+
| `complexity_class` | v1.25.0 (25-02) | stable, additive |
|
|
50
|
+
| `resolved_models` | v1.26.0 (26-04) | stable, additive |
|
|
51
|
+
|
|
52
|
+
Existing consumers reading any subset of the older fields keep working unchanged across these bumps - the schema is a strict superset at every phase boundary. New fields are documented inline in this skill rather than in a separate JSON-schema file (the SKILL is the contract - same convention Phase 25 followed for `complexity_class`).
|
|
53
|
+
|
|
54
|
+
## Path Selection Heuristic
|
|
55
|
+
|
|
56
|
+
The router emits `path` (3-tier: `fast|quick|full`, legacy enum, stable for back-compat) AND `complexity_class` (4-tier: `S|M|L|XL`, Phase 25 / D-04 additive). Full mapping table, bucket-assignment signal list, `--dry-run` downgrade rule, and the S-class short-circuit semantics live in `./router-rules.md#path-selection-heuristic`. The S-class short-circuit is essential: when `complexity_class` would be `S`, the router does not run; the deterministic skip list lives in the `{{command_prefix}}*` SKILL.md entry, and the budget-enforcer hook treats "no payload + matching command name" as the S signal.
|
|
57
|
+
|
|
58
|
+
## Cost Estimation Algorithm
|
|
59
|
+
|
|
60
|
+
Standard cost-estimation pseudocode (sum over planned spawn graph; per-agent `(in_tok / 1e6) * in_rate + (out_tok / 1e6) * out_rate` using `./reference/model-prices.md`) lives in `./router-rules.md#cost-estimation-algorithm`.
|
|
61
|
+
|
|
62
|
+
## Runtime-aware model resolution
|
|
63
|
+
|
|
64
|
+
Computation contract for `resolved_models`, implementation surfaces (`scripts/lib/runtime-detect.cjs` + `scripts/lib/tier-resolver.cjs`), per-agent emission rules (including the JSON-`null` contract), and the Claude-runtime back-compat assertion live in `./router-rules.md#runtime-aware-model-resolution`. Top-line: `model_tier_overrides` keeps its `opus|sonnet|haiku` enum for back-compat; `resolved_models` runs the per-runtime translation additively on top.
|
|
65
|
+
|
|
66
|
+
## Cache-Hit Detection
|
|
67
|
+
|
|
68
|
+
Delegate to `skills/cache-manager/SKILL.md` (Plan 10.1-02). The router lists candidate `{agent}:{input-hash}` tuples; the cache-manager confirms freshness against TTL from `budget.json.cache_ttl_seconds`.
|
|
69
|
+
|
|
70
|
+
## Integration Point
|
|
71
|
+
|
|
72
|
+
Every `{{command_prefix}}*` SKILL.md's first substantive step is: spawn the router via `Task` or inline invocation; receive the JSON blob; pass it to downstream agents as context so the budget-enforcer hook has the router decision available in tool_input metadata when the first Agent spawn fires.
|
|
73
|
+
|
|
74
|
+
## Failure Modes
|
|
75
|
+
|
|
76
|
+
If `.design/budget.json` is missing, assume defaults from `reference/config-schema.md` per D-12. If `reference/model-prices.md` is missing, emit `estimated_cost_usd: null` and log a warning - do not block.
|
|
77
|
+
|
|
78
|
+
## Emitting capability_gap on unmatched intent
|
|
79
|
+
|
|
80
|
+
When the router cannot resolve `intent-string` to a known agent (no `description` match, no `default-tier` rule, no path-selection fallback), emit ONE `capability_gap` event with `source: "router"` before returning the conservative-fallback JSON. Feeds Phase 29 Stage-0 telemetry - see `./capability-gap-emitter.md` for the synchronous Node snippet, semantic notes (suggested_kind = `"agent"`, MCP-probe exclusion per D-08, back-compat invariant on router output), and the opaque-extras payload routing through `appendChainEvent`.
|
|
81
|
+
|
|
82
|
+
## Emitting router_pick on a resolved pick
|
|
83
|
+
|
|
84
|
+
When the router DID resolve a pick - it has the `path`/`complexity_class`/`resolved_models` decision and is about to return the decision JSON - emit ONE `router_pick` event (`source: "router"`) recording which skill/agent was auto-picked, as the last step before returning. Side-effect only; the output JSON contract is UNCHANGED. Feeds the D-02 under-reached-skill instrument (Phase 33 baselines per-skill pick rates) - see `./router-pick-emitter.md` for the synchronous Node snippet, the 7-field no-PII payload (context_hash only - never the raw prompt), and the opaque-extras routing through `appendChainEvent`.
|
|
85
|
+
|
|
86
|
+
## Non-Goals
|
|
87
|
+
|
|
88
|
+
The router does not: (a) make a model call, (b) write files, (c) enforce budget caps (that's the hook's job), (d) learn from history (Phase 11 reflector territory per D-07).
|
|
89
|
+
The router does not author capability-gap CLUSTERS - Stage-0 emit is single-event-per-failure. Aggregation across events is Plan 29-03's reflector pass.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# gdd-router - capability_gap emitter (Phase 29 / D-02 / D-08)
|
|
2
|
+
|
|
3
|
+
Co-located reference for `skills/router/SKILL.md` - split out per Phase 28.5
|
|
4
|
+
contract (router SKILL ≤100 lines) and the Phase 28.6 co-location pattern.
|
|
5
|
+
|
|
6
|
+
## When to emit
|
|
7
|
+
|
|
8
|
+
If the router cannot resolve `intent-string` to a known agent (no agent's
|
|
9
|
+
`description` field matches, no `default-tier` rule applies, and the fallback
|
|
10
|
+
path-selection table returns nothing meaningful), emit ONE `capability_gap`
|
|
11
|
+
event before returning the conservative-fallback JSON output to the caller.
|
|
12
|
+
|
|
13
|
+
This feeds Phase 29 Stage-0 telemetry - the reflector pattern-detection pass
|
|
14
|
+
(Plan 29-02) and aggregation (Plan 29-03) read these events from the chain
|
|
15
|
+
file (`.design/gep/events.jsonl`) to surface recurring router-unmatched
|
|
16
|
+
intents as candidate agents in `{{command_prefix}}apply-reflections`.
|
|
17
|
+
|
|
18
|
+
## Synchronous emitter snippet
|
|
19
|
+
|
|
20
|
+
Same shape as fast, with `source: "router"`:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
node -e '
|
|
24
|
+
const { appendChainEvent } = require("./scripts/lib/event-chain.cjs");
|
|
25
|
+
const { createHash, randomUUID } = require("node:crypto");
|
|
26
|
+
const intent = process.env.GDD_INTENT || "";
|
|
27
|
+
const payload = {
|
|
28
|
+
event_id: randomUUID(),
|
|
29
|
+
parent_event_id: null,
|
|
30
|
+
source: "router",
|
|
31
|
+
context_hash: createHash("sha256").update(intent).digest("hex"),
|
|
32
|
+
intent_summary: intent.slice(0, 256),
|
|
33
|
+
suggested_kind: "agent",
|
|
34
|
+
evidence_refs: [],
|
|
35
|
+
};
|
|
36
|
+
appendChainEvent({
|
|
37
|
+
agent: "router",
|
|
38
|
+
outcome: "capability_gap",
|
|
39
|
+
payload,
|
|
40
|
+
type: "capability_gap",
|
|
41
|
+
timestamp: new Date().toISOString(),
|
|
42
|
+
sessionId: process.env.GDD_SESSION_ID || "router-cli",
|
|
43
|
+
});
|
|
44
|
+
'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
|
|
49
|
+
- `suggested_kind` is `"agent"` because router unmatched intents typically
|
|
50
|
+
describe multi-step workflows (the unit the router resolves).
|
|
51
|
+
- Router-unmatched is NOT the same as MCP-probe failure (per D-08). If
|
|
52
|
+
gdd-router returns a fallback because a peer-CLI connection is down, do
|
|
53
|
+
NOT emit capability_gap - that's a Phase 22 connection-status concern.
|
|
54
|
+
- The emitter is the LAST step before returning the fallback JSON. Router
|
|
55
|
+
output is unchanged (back-compat per the existing `## Output schema
|
|
56
|
+
versioning` table in `SKILL.md`); the event is a SIDE EFFECT, not a
|
|
57
|
+
payload addition.
|
|
58
|
+
- Router output JSON contract is UNCHANGED - back-compat preserved.
|
|
59
|
+
- The 7-field payload flows through `appendChainEvent`'s opaque-extras
|
|
60
|
+
pattern verbatim; the chain row carries `type`, `timestamp`, `sessionId`,
|
|
61
|
+
`payload` as opaque extras and is projected back to the events-schema
|
|
62
|
+
envelope by Plan 29-03 aggregation.
|
|
63
|
+
|
|
64
|
+
MCP-probe failures (connection down, transport-layer errors) do NOT emit
|
|
65
|
+
`capability_gap` - those are Phase 22 connection-status concerns (D-08).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# gdd-router - router_pick emitter (Phase 32-08 / D-02)
|
|
2
|
+
|
|
3
|
+
Co-located reference for `skills/router/SKILL.md` - split out per the Phase 28.5
|
|
4
|
+
contract (router SKILL ≤100 lines) and the Phase 28.6 co-location pattern (same
|
|
5
|
+
convention as the sibling `./capability-gap-emitter.md`).
|
|
6
|
+
|
|
7
|
+
## When to emit
|
|
8
|
+
|
|
9
|
+
When the router resolves an intent to a concrete pick - i.e. it has selected the
|
|
10
|
+
`path` / `complexity_class` / `resolved_models` decision and is about to return
|
|
11
|
+
its decision JSON - emit ONE `router_pick` event recording WHICH skill/agent it
|
|
12
|
+
auto-picked. Emit exactly once per resolved pick, as the LAST step before
|
|
13
|
+
returning the decision JSON to the caller.
|
|
14
|
+
|
|
15
|
+
This is the D-02 router_pick instrument: GDD routes by description-match but has
|
|
16
|
+
no record of what the router actually reaches for, so there is no data on
|
|
17
|
+
under-reached skills. Phase 33 reads these events from the chain file
|
|
18
|
+
(`.design/gep/events.jsonl`) to baseline per-skill auto-pick rates (the
|
|
19
|
+
"pick-rate regression" expansion in the ROADMAP).
|
|
20
|
+
|
|
21
|
+
`router_pick` is NOT `capability_gap`: emit `router_pick` when the router DID
|
|
22
|
+
resolve a pick; emit `capability_gap` (see `./capability-gap-emitter.md`) only
|
|
23
|
+
when it could not resolve the intent at all. They are disjoint surfaces.
|
|
24
|
+
|
|
25
|
+
## Synchronous emitter snippet
|
|
26
|
+
|
|
27
|
+
Builds the 7-field `RouterPickPayload` and writes it via `appendChainEvent`.
|
|
28
|
+
The intent is hashed - the raw prompt is NEVER stored (no PII). `picked_skill`,
|
|
29
|
+
`rank`, and `alternatives` come from the router's resolved decision:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
node -e '
|
|
33
|
+
const { appendChainEvent } = require("./scripts/lib/event-chain.cjs");
|
|
34
|
+
const { createHash, randomUUID } = require("node:crypto");
|
|
35
|
+
const intent = process.env.GDD_INTENT || "";
|
|
36
|
+
const payload = {
|
|
37
|
+
event_id: randomUUID(),
|
|
38
|
+
source: "router",
|
|
39
|
+
picked_skill: process.env.GDD_PICKED_SKILL || "",
|
|
40
|
+
context_hash: createHash("sha256").update(intent).digest("hex"),
|
|
41
|
+
rank: Number(process.env.GDD_PICK_RANK || 0),
|
|
42
|
+
alternatives: (process.env.GDD_ALTERNATIVES || "").split(",").filter(Boolean),
|
|
43
|
+
ts: new Date().toISOString(),
|
|
44
|
+
};
|
|
45
|
+
appendChainEvent({
|
|
46
|
+
agent: "router",
|
|
47
|
+
outcome: "router_pick",
|
|
48
|
+
payload,
|
|
49
|
+
type: "router_pick",
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
sessionId: process.env.GDD_SESSION_ID || "router-cli",
|
|
52
|
+
});
|
|
53
|
+
'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`GDD_PICKED_SKILL` is the resolved pick; `GDD_PICK_RANK` is its rank among
|
|
57
|
+
candidates (0 = top pick); `GDD_ALTERNATIVES` is a comma-separated list of the
|
|
58
|
+
OTHER candidate skill/agent names the router considered (names only - no scores,
|
|
59
|
+
no prompt text). `GDD_INTENT` is hashed in-process and is never written to disk.
|
|
60
|
+
|
|
61
|
+
## Notes
|
|
62
|
+
|
|
63
|
+
- **No PII**: only `context_hash` (sha256 of the intent) is stored - never the
|
|
64
|
+
raw prompt or intent string. The `RouterPickPayload` is
|
|
65
|
+
`additionalProperties: false`, so a stray `raw_prompt` field would be rejected
|
|
66
|
+
by `events.schema.json` validation. This mirrors `capability_gap`'s hash
|
|
67
|
+
discipline.
|
|
68
|
+
- **Router output JSON contract is UNCHANGED** - `router_pick` is a SIDE EFFECT,
|
|
69
|
+
not a new output field. Back-compat is preserved exactly as the existing
|
|
70
|
+
`## Output schema versioning` table in `SKILL.md` guarantees; the emitter runs
|
|
71
|
+
AFTER the decision is computed and does not alter the returned blob.
|
|
72
|
+
- The 7-field payload flows through `appendChainEvent`'s opaque-extras pattern
|
|
73
|
+
verbatim; the chain row carries `type`, `timestamp`, `sessionId`, `payload` as
|
|
74
|
+
opaque extras and is projected back to the events-schema envelope by Phase 33
|
|
75
|
+
aggregation (same projection the capability_gap aggregation uses).
|
|
76
|
+
- Validated against the additive `RouterPickPayload` branch (allOf[2]) in
|
|
77
|
+
`reference/schemas/events.schema.json` - see
|
|
78
|
+
`test/suite/router-pick-event.test.cjs`.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: router-rules
|
|
3
|
+
type: heuristic
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
phase: 28.5
|
|
6
|
+
tags: [router, path-selection, complexity-class, model-tier, runtime-resolution, cost-estimation]
|
|
7
|
+
last_updated: 2026-05-18
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Router Path-Selection + Runtime Resolution Rules
|
|
11
|
+
|
|
12
|
+
Extracted from `skills/router/SKILL.md` per Phase 28.5 D-10 (extract-then-link, never delete
|
|
13
|
+
content). The router SKILL keeps its invocation contract, output schema versioning table,
|
|
14
|
+
integration point, and failure modes. The path-selection heuristic tables, the cost
|
|
15
|
+
estimation algorithm, and the runtime-aware model resolution computation contract live
|
|
16
|
+
here so the SKILL stays under the 100-line cap.
|
|
17
|
+
|
|
18
|
+
## Path Selection Heuristic
|
|
19
|
+
|
|
20
|
+
The router emits both `path` (legacy 3-tier enum) and `complexity_class` (Phase 25 4-tier enum). The canonical mapping is:
|
|
21
|
+
|
|
22
|
+
| complexity_class | path | Behavior |
|
|
23
|
+
|------------------|------|----------|
|
|
24
|
+
| `S` | `fast` (short-circuited) | Skip router itself, skip cache-manager, skip telemetry write. Deterministic no-op decision. |
|
|
25
|
+
| `M` | `fast` | Single Haiku + no checkers. |
|
|
26
|
+
| `L` | `quick` | Sonnet mappers + Haiku verify. |
|
|
27
|
+
| `XL` | `full` | Opus planners + full quality gates. Recommends worktree-isolation default + mandatory inter-stage checkpoint + reflector auto-spawn. |
|
|
28
|
+
|
|
29
|
+
Bucket assignment:
|
|
30
|
+
|
|
31
|
+
| Signal | complexity_class | path |
|
|
32
|
+
|--------|------------------|------|
|
|
33
|
+
| Command is `{{command_prefix}}help`, `{{command_prefix}}stats`, `{{command_prefix}}note`, `{{command_prefix}}health`, single-Haiku skill | `S` | `fast` (short-circuited - see below) |
|
|
34
|
+
| Command is `{{command_prefix}}scan`, `{{command_prefix}}brief`, `{{command_prefix}}sketch`, `{{command_prefix}}spike`, `{{command_prefix}}fast` | `M` | `fast` |
|
|
35
|
+
| Command spawns exactly one agent (no orchestration), not in S list | `M` | `fast` |
|
|
36
|
+
| Command is `{{command_prefix}}explore`, `{{command_prefix}}discover`, standalone `{{command_prefix}}verify`, standalone `{{command_prefix}}plan` | `L` | `quick` |
|
|
37
|
+
| Command spawns parallel mappers but no planners/auditors (`{{command_prefix}}discover` in `--auto` mode) | `L` | `quick` |
|
|
38
|
+
| Command is `{{command_prefix}}next`, `{{command_prefix}}do`, `{{command_prefix}}autonomous`, end-to-end Brief→Verify, anything spawning planners + auditors + verifiers in series | `XL` | `full` |
|
|
39
|
+
| Command spawns planners, auditors, verifiers, or integration-checkers (`{{command_prefix}}plan`, `{{command_prefix}}verify`, `{{command_prefix}}audit`) and is not standalone | `XL` | `full` |
|
|
40
|
+
| `--dry-run` flag present on any command | downgrade one tier (XL→L→M→S; `path` follows the mapping table) |
|
|
41
|
+
|
|
42
|
+
### S-class short-circuit
|
|
43
|
+
|
|
44
|
+
When `complexity_class` would be `S`, the router itself **does not run** for that invocation - the deterministic skip list is encoded in the `{{command_prefix}}*` SKILL.md entry of the matching command. The budget-enforcer hook treats "no router decision payload + matching command name" as the S-class signal and skips enforcement entirely (no telemetry row, no cache lookup, no event emission). When the router *is* invoked explicitly (e.g., debugging) it still emits `complexity_class: "S"` in the JSON for observability, but the runtime path is the no-op.
|
|
45
|
+
|
|
46
|
+
## Cost Estimation Algorithm
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
total = 0
|
|
50
|
+
for each agent in planned spawn graph:
|
|
51
|
+
tier = resolve_tier(agent) # budget.json tier_overrides > agent frontmatter default-tier
|
|
52
|
+
(in_tok, out_tok) = token_range_from_size_budget(agent.size_budget) # from reference/model-prices.md
|
|
53
|
+
(in_rate, out_rate) = price_from_tier(tier)
|
|
54
|
+
total += (in_tok / 1e6) * in_rate + (out_tok / 1e6) * out_rate
|
|
55
|
+
return total
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Runtime-aware model resolution
|
|
59
|
+
|
|
60
|
+
The router emits `resolved_models` alongside `model_tier_overrides` so downstream consumers (budget-enforcer cost computation, Phase 22 cost telemetry, Phase 23.5 bandit posterior store) can read the **concrete model ID** for the active runtime without re-deriving it from the tier name. The resolution is per-agent and additive - `model_tier_overrides` keeps its `opus|sonnet|haiku` enum for back-compat across all 14 runtimes, and `resolved_models` runs the runtime-specific translation on top of it.
|
|
61
|
+
|
|
62
|
+
Computation contract (per D-07):
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
runtime = runtimeDetect.detect() ?? 'claude'
|
|
66
|
+
for each agent in planned spawn graph:
|
|
67
|
+
tier = resolve_tier(agent) # same merge as model_tier_overrides
|
|
68
|
+
resolved_models[agent] = tierResolver.resolve(runtime, tier)
|
|
69
|
+
# → concrete model string OR null
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Implementation surfaces (Phase 26 / Wave A):
|
|
73
|
+
|
|
74
|
+
- `scripts/lib/runtime-detect.cjs` - `detect() → runtime-id | null`. Reads the same `*_CONFIG_DIR` / `*_HOME` env-vars Phase 24's installer uses (single source of truth in `scripts/lib/install/runtimes.cjs`). Returns `null` when no recognized runtime env-var is set; the router falls back to `'claude'` so the resolver always has a runtime ID to work with.
|
|
75
|
+
- `scripts/lib/tier-resolver.cjs` - `resolve(runtime, tier, opts?) → model | null`. Translates `opus|sonnet|haiku` to the concrete model the runtime understands using the `./runtime-models.md` mapping (Phase 26 / Wave A). Fallback chain (D-04): runtime-specific entry → `claude` row default with `tier_resolution_fallback` event → `null` with `tier_resolution_failed` event. Never throws; `null` is a valid output the consumer must handle.
|
|
76
|
+
|
|
77
|
+
Per-agent emission rules:
|
|
78
|
+
|
|
79
|
+
- One key per agent in the planned spawn graph (same key set the cost-estimation loop iterates over). Keys MUST match agent names exactly so consumers can join `resolved_models` against `model_tier_overrides` and the spawn graph by name.
|
|
80
|
+
- Value is the concrete model string returned by `tier-resolver.resolve(runtime, tier)`.
|
|
81
|
+
- When the resolver returns `null` (missing tier-map row, missing tier, garbage input), the value is JSON `null` - NOT omitted, NOT the empty string. Consumers (budget-enforcer, telemetry) MUST handle `null`: typically by skipping the cost row for that spawn and emitting their own diagnostic event, never by crashing.
|
|
82
|
+
- When `complexity_class` is `S` and the router itself short-circuits (see **S-class short-circuit** above), no payload is emitted at all and `resolved_models` does not exist for that invocation - the budget-enforcer's "no router decision payload" branch already handles this case.
|
|
83
|
+
|
|
84
|
+
Back-compat assertion: a router invocation in a Claude runtime (or any environment where `runtime-detect.detect()` returns `null` and the router falls back to `'claude'`) produces `resolved_models` values that are the canonical Anthropic model IDs (`claude-opus-4-7`, `claude-sonnet-4-6`, `claude-haiku-4-5`) for the corresponding tiers. Pre-Phase-26 consumers that ignore `resolved_models` see the same `model_tier_overrides` they always saw (Plan 26-09 owns the runtime fixture diff that asserts this).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-settings
|
|
3
|
+
description: "Manage .design/config.json settings. Subcommands: profile, parallelism, cleanup, show."
|
|
4
|
+
argument-hint: "<profile <name>|parallelism <key> <value>|cleanup|show>"
|
|
5
|
+
tools: Read, Write, AskUserQuestion, Bash, mcp__gdd_state__get, mcp__gdd_state__frontmatter_update
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# gdd-settings
|
|
10
|
+
|
|
11
|
+
Manages `.design/config.json` - the per-project config for model profile and parallelism. See `reference/config-schema.md` for the full schema. This skill also supports patching non-stage STATE.md frontmatter keys (`cycle`, `wave`, custom keys) via `mcp__gdd_state__frontmatter_update`. See **STATE.md frontmatter** below.
|
|
12
|
+
|
|
13
|
+
## Subcommands
|
|
14
|
+
|
|
15
|
+
### `show`
|
|
16
|
+
|
|
17
|
+
Print the current `.design/config.json` contents, nicely formatted. If the file is missing, print the defaults with a note that no config exists yet. Also call `mcp__gdd_state__get` to print the current STATE.md frontmatter keys (cycle, wave, model_profile) alongside config.json for a unified view.
|
|
18
|
+
|
|
19
|
+
### `profile <name>`
|
|
20
|
+
|
|
21
|
+
Set `model_profile` to one of `quality`, `balanced`, `budget`. Validate the value; reject anything else with the list of allowed values. Read current config, merge the change, write back. Confirm with the new value.
|
|
22
|
+
|
|
23
|
+
### `parallelism <key> <value>`
|
|
24
|
+
|
|
25
|
+
Set one field under `parallelism`. Supported keys and value types:
|
|
26
|
+
|
|
27
|
+
| Key | Type |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `enabled` | bool (`true`/`false`) |
|
|
30
|
+
| `max_parallel_agents` | int |
|
|
31
|
+
| `min_tasks_to_parallelize` | int |
|
|
32
|
+
| `min_estimated_savings_seconds` | int |
|
|
33
|
+
| `require_disjoint_touches` | bool |
|
|
34
|
+
| `worktree_isolation` | bool |
|
|
35
|
+
|
|
36
|
+
Validate type; reject otherwise. Read current config, merge, write back. Confirm.
|
|
37
|
+
|
|
38
|
+
### `cleanup`
|
|
39
|
+
|
|
40
|
+
Use `AskUserQuestion` to pick one or more cleanup actions, then confirm each before executing:
|
|
41
|
+
|
|
42
|
+
1. Delete `.design/*.md` artifacts (excludes `config.json`, `STATE.md`, `backlog/`).
|
|
43
|
+
2. Reset `.design/STATE.md` to the template at `reference/STATE-TEMPLATE.md`.
|
|
44
|
+
3. Clear `.design/backlog/` directory contents.
|
|
45
|
+
|
|
46
|
+
## Config Read/Write Pattern
|
|
47
|
+
|
|
48
|
+
Always:
|
|
49
|
+
|
|
50
|
+
1. Read current `.design/config.json` (use defaults below if missing).
|
|
51
|
+
2. Merge the single field being changed - never overwrite unrelated fields.
|
|
52
|
+
3. Write back as pretty JSON (2-space indent, trailing newline).
|
|
53
|
+
|
|
54
|
+
## STATE.md frontmatter
|
|
55
|
+
|
|
56
|
+
For any STATE.md frontmatter patch (cycle, wave, or project-custom keys), call `mcp__gdd_state__frontmatter_update({ patch: { <key>: <value> } })`. Do not `Edit` or `Write` STATE.md directly.
|
|
57
|
+
|
|
58
|
+
**Stage-patch guard:** this skill cannot patch `stage`. If the user attempts to set `stage` here, reject with: "Use {{command_prefix}}brief, {{command_prefix}}explore, etc. for stage transitions. The settings skill is for non-stage frontmatter only." The MCP tool itself rejects `stage` patches with a VALIDATION error (surfaced by `mcp__gdd_state__frontmatter_update`), which this prose surfaces up-front so the user gets a clear message before the tool round-trip.
|
|
59
|
+
|
|
60
|
+
This surface is STATE.md-only. `.design/config.json` mutations continue to use `Read` + `Write` directly (out of scope for the 11-tool MCP catalog).
|
|
61
|
+
|
|
62
|
+
## Default Config
|
|
63
|
+
|
|
64
|
+
If `.design/config.json` does not exist, create it with:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"model_profile": "balanced",
|
|
69
|
+
"parallelism": {
|
|
70
|
+
"enabled": true,
|
|
71
|
+
"max_parallel_agents": 5,
|
|
72
|
+
"min_tasks_to_parallelize": 2,
|
|
73
|
+
"min_estimated_savings_seconds": 30,
|
|
74
|
+
"require_disjoint_touches": true,
|
|
75
|
+
"worktree_isolation": false,
|
|
76
|
+
"per_stage_override": {}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Output
|
|
82
|
+
|
|
83
|
+
End every invocation with:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
## SETTINGS COMPLETE
|
|
87
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-ship
|
|
3
|
+
description: "Post-verify PR flow - creates a clean PR branch, invokes code review check, and prepares the PR for merge. Activates for requests involving finishing a cycle, packaging design output, or moving work to a pull request."
|
|
4
|
+
argument-hint: "[--title <PR title>] [--draft]"
|
|
5
|
+
tools: Read, Write, Bash, AskUserQuestion, Task
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}ship
|
|
10
|
+
|
|
11
|
+
Closes the verify → merge gap: runs `{{command_prefix}}pr-branch` for a clean branch, assembles a PR body from design artifacts, and creates the PR via `gh`.
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. **Pre-flight verify check**: Check that `.design/DESIGN-VERIFICATION.md` exists and shows a pass. If missing or failing, ask: "Verify has not completed / failed. Ship anyway? (yes/no)"
|
|
16
|
+
2. **Clean branch**: Invoke `{{command_prefix}}pr-branch` to produce a branch with only `src/` commits (no `.design/` or `.planning/` noise). Use the resulting branch for the PR.
|
|
17
|
+
3. **PR title**: Use `--title` argument if given, otherwise ask (AskUserQuestion): "PR title?"
|
|
18
|
+
4. **PR body**: Auto-generate from:
|
|
19
|
+
- Goals section of `.design/DESIGN-PLAN.md`
|
|
20
|
+
- Summary of `.design/DESIGN-VERIFICATION.md` (per-task pass/fail)
|
|
21
|
+
- Top-line audit score from `.design/DESIGN-AUDIT.md` if present
|
|
22
|
+
Format as Markdown with `## Goals`, `## Verification`, `## Audit` sections.
|
|
23
|
+
5. **Create PR**: Run `gh pr create --title "<title>" --body "<body>" [--draft]` via Bash. If `gh` is not installed, print the full body and instruct the user to create the PR manually.
|
|
24
|
+
6. **Print PR URL** on success.
|
|
25
|
+
|
|
26
|
+
## Do Not
|
|
27
|
+
|
|
28
|
+
- Do not push to `main`/`master` directly.
|
|
29
|
+
- Do not include `.design/` or `.planning/` files in the PR branch - that is `{{command_prefix}}pr-branch`'s job.
|
|
30
|
+
- Do not skip the verify pre-flight silently - always surface a failure and ask.
|
|
31
|
+
|
|
32
|
+
## Step 6.5 - PR inline review surface (pr-commenter)
|
|
33
|
+
|
|
34
|
+
ONLY on the success path - after the PR has been created (Step 5) and its URL printed (Step 6) - spawn `agents/pr-commenter.md` via the `Task` tool to post GDD's verify/audit output **inline** on the new PR: inline review comments on changed lines, Preview/Chromatic before-after screenshot pairs, and the `gdd/design-review` check-run (audit pillar scores + verify pass/fail + a11y). Pass the PR number + `owner/repo` in the Task context.
|
|
35
|
+
|
|
36
|
+
This is a **degrade-to-noop** surface and MUST NOT fail the ship: if `gh` is unavailable, the `GDD_DISABLE_PR_COMMENTER` kill-switch (env or `.design/config.json`) is set, or the agent errors, the ship still succeeds (pr-commenter prints the bodies for manual paste). Skip this step entirely if PR creation failed in Step 5. The posting contract (gh-api shapes, check-run payload, redaction, branch-protection setup) lives in `reference/pr-review-integration.md`.
|
|
37
|
+
|
|
38
|
+
## Step 7 - Update notice (post-closeout surface)
|
|
39
|
+
|
|
40
|
+
ONLY on the success path - after the PR has been created and the URL has been printed - emit the plugin-update banner. If PR creation failed earlier, skip this step (do not suggest upgrades in the middle of a PR-creation failure).
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
[ -f .design/update-available.md ] && cat .design/update-available.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Written by `hooks/update-check.sh`; suppressed mid-pipeline and when the latest release is dismissed.
|
|
47
|
+
|
|
48
|
+
## SHIP COMPLETE
|