@hegemonart/get-design-done 1.59.3 → 1.59.5
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 +61 -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/budget-enforcer.ts +134 -7
- 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/runtime-models.md +15 -15
- package/reference/schemas/generated.d.ts +4 -0
- package/reference/schemas/runtime-models.schema.json +5 -0
- 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/bandit-router/integration.cjs +38 -0
- package/scripts/lib/install/installer.cjs +133 -1
- 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,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-new-skill
|
|
3
|
+
description: "Scaffolds a new Phase-28.5 + Phase-50-compliant skill: gathers a name, a multi-paragraph v3 description, a lifecycle stage, an allowed-tools list, and optional composes_with neighbours, then writes scripts/skill-templates/<name>/SKILL.md from the pure generator. Use when adding a brand-new gdd skill and you want the frontmatter, length cap, and v3 description form correct from the first commit. Activates for requests involving authoring a skill, scaffolding a command, creating a new SKILL.md, or adding a slash command."
|
|
4
|
+
argument-hint: "<skill-name>"
|
|
5
|
+
tools: Read, Write, Bash, AskUserQuestion
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}new-skill
|
|
10
|
+
|
|
11
|
+
**Role:** Interactively scaffold a contract-compliant skill. Gather the fields, then write `scripts/skill-templates/<name>/SKILL.md` from the pure generator at `scripts/lib/manifest/scaffolder.cjs`. This skill writes ONE source file. It does NOT touch `scripts/lib/manifest/skills.json` and does NOT run the build; it prints the exact follow-up commands instead.
|
|
12
|
+
|
|
13
|
+
Read `reference/skill-authoring-contract.md` first for the length cap, the frontmatter required fields, and the v3 description form.
|
|
14
|
+
|
|
15
|
+
## Prompt strategy (clack with a fallback)
|
|
16
|
+
|
|
17
|
+
Mirror the installer pattern in `scripts/install.cjs`: try `@clack/prompts` lazily, and degrade to `AskUserQuestion` (or plain text) when it is absent. Use this probe at the start:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
node -e "try { require.resolve('@clack/prompts'); console.log('clack'); } catch { console.log('fallback'); }"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- `clack`: drive `clack.text`, `clack.select`, and `clack.confirm` from a short Node script.
|
|
24
|
+
- `fallback`: ask the same questions with `AskUserQuestion` (one prompt per field), or read plain answers.
|
|
25
|
+
|
|
26
|
+
Either way the answers feed the same record builder. Never block waiting on a TTY in a non-interactive run; fall back to `AskUserQuestion`.
|
|
27
|
+
|
|
28
|
+
## Step 1 - Gather the fields
|
|
29
|
+
|
|
30
|
+
1. **name**: the slug from `$ARGUMENTS` if present, else ask. Must match `^[a-z0-9][a-z0-9-._]*$`. Reject `scripts/skill-templates/<name>/` collisions.
|
|
31
|
+
2. **description**: a multi-paragraph v3 form. Sentence one is what the skill does. Sentence two is `Use when <triggers>`. Sentence three is `Activates for requests involving <kw1>, <kw2>, <kw3>.` Keep it 20 to 1024 chars.
|
|
32
|
+
3. **lifecycle stage**: pick one of brief / explore / plan / verify / ship / figma / token / report (free text allowed). This seeds the composition suggestions.
|
|
33
|
+
4. **tools**: a comma list (for example `Read, Write, Bash`). Empty means inherit-all.
|
|
34
|
+
5. **composes_with**: auto-suggest neighbours, then confirm. Compute the suggestion list:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
node -e "
|
|
38
|
+
const s = require('./scripts/lib/manifest/scaffolder.cjs');
|
|
39
|
+
const m = require('./scripts/lib/manifest/skills.json');
|
|
40
|
+
console.log(JSON.stringify(s.suggestComposesWith(process.argv[1], m.skills)));
|
|
41
|
+
" "<name>"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Present the suggestions; let the user accept, edit, or clear them.
|
|
45
|
+
|
|
46
|
+
## Step 2 - Length pre-check
|
|
47
|
+
|
|
48
|
+
Before writing, estimate the body length. If the planned body would exceed about 100 lines, warn the user (the authoring contract warns at 100 and blocks at 250) and suggest extracting domain content into a co-located `scripts/skill-templates/<name>/<topic>.md` reference. The generated skeleton is small; the warning is for the prose the user will add next.
|
|
49
|
+
|
|
50
|
+
## Step 3 - Write the file
|
|
51
|
+
|
|
52
|
+
Build the record and render the file with the pure generator, then write it with the Write tool (not shell redirection):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node -e "
|
|
56
|
+
const s = require('./scripts/lib/manifest/scaffolder.cjs');
|
|
57
|
+
const rec = s.buildSkillRecord({
|
|
58
|
+
name: process.env.SK_NAME,
|
|
59
|
+
description: process.env.SK_DESC,
|
|
60
|
+
argumentHint: process.env.SK_HINT || undefined,
|
|
61
|
+
tools: process.env.SK_TOOLS || undefined,
|
|
62
|
+
userInvocable: process.env.SK_UI === 'true',
|
|
63
|
+
composesWith: (process.env.SK_COMPOSES || '').split(',').map(x => x.trim()).filter(Boolean),
|
|
64
|
+
});
|
|
65
|
+
process.stdout.write(s.renderSkillMd(rec));
|
|
66
|
+
"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`buildSkillRecord` throws on an invalid name, an out-of-budget description, or a malformed tools list. Surface the thrown message to the user and re-prompt the offending field. Capture stdout and write it verbatim to `scripts/skill-templates/<name>/SKILL.md` via the Write tool.
|
|
70
|
+
|
|
71
|
+
## Step 4 - Tell the user the follow-up
|
|
72
|
+
|
|
73
|
+
The skill stops here by contract. Print the next two commands for the user to run after they add the manifest record:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
1. Add a record for "<name>" to scripts/lib/manifest/skills.json
|
|
77
|
+
(description, argument_hint, tools, user_invocable; put composes_with in extra_frontmatter).
|
|
78
|
+
2. npm run generate:skill-frontmatter && npm run build:skills
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Note that `npm run generate:skill-frontmatter:check` and the skills-coverage test stay red until the manifest record exists; that is expected and is the maintainer's step.
|
|
82
|
+
|
|
83
|
+
## Do Not
|
|
84
|
+
|
|
85
|
+
- Do not edit `scripts/lib/manifest/skills.json`, `package.json`, or any reference doc.
|
|
86
|
+
- Do not run `build:skills` or `generate:skill-frontmatter` for the user; print the commands.
|
|
87
|
+
- Do not write the SKILL.md with shell redirection; use the Write tool so the content is exact.
|
|
88
|
+
- Do not invent a description; require the v3 three-sentence form from the user.
|
|
89
|
+
|
|
90
|
+
## NEW-SKILL COMPLETE
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-next
|
|
3
|
+
description: "Routes to the next pipeline stage based on current STATE.md position"
|
|
4
|
+
tools: Read, Write, mcp__gdd_status, mcp__gdd_phase_current, mcp__gdd_plans_list
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Get Design Done - Next
|
|
9
|
+
|
|
10
|
+
**Role:** Lightweight router. Read `.design/STATE.md` and recommend the next command.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Logic
|
|
15
|
+
|
|
16
|
+
Two paths - MCP preferred when available, file-read fallback otherwise.
|
|
17
|
+
|
|
18
|
+
### MCP path (preferred)
|
|
19
|
+
|
|
20
|
+
When `mcp__gdd_phase_current` is exposed (Phase 27.7+, registered via `npx @hegemonart/get-design-done --register-mcp`):
|
|
21
|
+
|
|
22
|
+
1. Call `mcp__gdd_status` (no args) → `{phase, branch, last_decisions, last_completed_plans, blocker_count}`. Gives cycle + branch context for the output block in one call.
|
|
23
|
+
2. Call `mcp__gdd_phase_current` (no args) → `{phase, stage, task_progress, status}`. Use `stage` to drive the routing table below.
|
|
24
|
+
3. (Optional) Call `mcp__gdd_plans_list` (no args) → current phase plans + status, to identify the next incomplete plan and refine the recommendation.
|
|
25
|
+
4. If `mcp__gdd_status` returns a "STATE.md missing" error, print: "No STATE.md found. Run `{{command_prefix}}new-project` to initialize, or `@get-design-done brief` to start the pipeline." and stop. Otherwise, skip to the routing table.
|
|
26
|
+
|
|
27
|
+
Two to three MCP calls = full routing decision (~3s, ~32k tokens - Storybloq benchmark).
|
|
28
|
+
|
|
29
|
+
### File-read path (fallback)
|
|
30
|
+
|
|
31
|
+
When MCP tools are not available, fall back to the legacy flow:
|
|
32
|
+
|
|
33
|
+
1. Check if `.design/STATE.md` exists.
|
|
34
|
+
- **No STATE.md** → Print: "No STATE.md found. Run `{{command_prefix}}new-project` to initialize, or `@get-design-done brief` to start the pipeline."
|
|
35
|
+
2. If STATE.md exists, parse frontmatter `stage:` field. Proceed to the routing table.
|
|
36
|
+
|
|
37
|
+
This path loads the same context in 1–2 file reads (~20s, ~46.5k tokens - file-reading baseline).
|
|
38
|
+
|
|
39
|
+
## Routing table
|
|
40
|
+
|
|
41
|
+
Map the `stage` (from either path above) to the next recommended command:
|
|
42
|
+
|
|
43
|
+
| Current `stage:` | Recommendation |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `brief` | Run `@get-design-done explore` to scan and interview |
|
|
46
|
+
| `explore` | Run `@get-design-done plan` to create design plan |
|
|
47
|
+
| `plan` | Run `@get-design-done design` to execute design tasks |
|
|
48
|
+
| `design` | Run `@get-design-done verify` to audit and verify |
|
|
49
|
+
| `verify` | Pipeline complete. Run `{{command_prefix}}new-cycle` for next cycle or `{{command_prefix}}ship` to create PR |
|
|
50
|
+
|
|
51
|
+
## Output
|
|
52
|
+
|
|
53
|
+
Print the recommendation as a single formatted block:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
━━━ Next step ━━━
|
|
57
|
+
Current stage: <stage>
|
|
58
|
+
Status: <status>
|
|
59
|
+
→ <recommendation>
|
|
60
|
+
━━━━━━━━━━━━━━━━━━
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Do Not
|
|
64
|
+
|
|
65
|
+
- Do not modify STATE.md.
|
|
66
|
+
- Do not invoke the next stage automatically - only recommend.
|
|
67
|
+
|
|
68
|
+
## NEXT COMPLETE
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-note
|
|
3
|
+
description: "Zero-friction idea capture during any stage. Appends to .design/NOTES.md. Subcommands: add, list, promote."
|
|
4
|
+
argument-hint: "<add|list|promote> [text|line-number]"
|
|
5
|
+
tools: Read, Write
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}note
|
|
10
|
+
|
|
11
|
+
**Role:** Ephemeral design notes. Zero ceremony - no priority, no due date. Backing store: `.design/NOTES.md`.
|
|
12
|
+
|
|
13
|
+
## File format
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
# Design Notes
|
|
17
|
+
|
|
18
|
+
- [2026-04-18 04:55] Consider revisiting the card border-radius after Phase 7 ships
|
|
19
|
+
- [2026-04-18 05:10] [promoted → todo] Try a glassmorphism treatment for the sidebar
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Subcommands
|
|
23
|
+
|
|
24
|
+
### add [text]
|
|
25
|
+
Create `.design/NOTES.md` with header if missing. Append one line:
|
|
26
|
+
```
|
|
27
|
+
- [YYYY-MM-DD HH:MM] <text>
|
|
28
|
+
```
|
|
29
|
+
If text omitted, append a blank timestamped entry for the user to fill later:
|
|
30
|
+
```
|
|
31
|
+
- [YYYY-MM-DD HH:MM]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### list
|
|
35
|
+
Read `.design/NOTES.md`. Print each note line with its line number for use with `promote`.
|
|
36
|
+
|
|
37
|
+
### promote [line-number]
|
|
38
|
+
Read the note at that line. Delegate to `{{command_prefix}}todo add` by writing a new P2 entry into `.design/TODO.md` directly (format: `- [ ] [YYYY-MM-DD] <text>` under `## P2 — Normal`). Rewrite the original note line in NOTES.md with `[promoted → todo]` prefix before the text:
|
|
39
|
+
```
|
|
40
|
+
- [2026-04-18 05:10] [promoted → todo] <original text>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Constraints
|
|
44
|
+
|
|
45
|
+
- Never overwrite prior notes on `add`.
|
|
46
|
+
- Preserve exact line order on `promote`.
|
|
47
|
+
|
|
48
|
+
## NOTE COMPLETE
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-openrouter-status
|
|
3
|
+
description: "Read-only OpenRouter catalog + tier-mapping diagnostic - surfaces catalog freshness (fetched_at vs the 24h TTL), the last-fetch timestamp, the resolved opus/sonnet/haiku → model mappings (via the Phase-33.6 adapter), and a per-tier preview. Use when investigating which OpenRouter model a tier resolves to, or whether the catalog cache is fresh/stale. Phase 33.6 (v1.33.6) diagnostic - {{command_prefix}}openrouter-status."
|
|
4
|
+
argument-hint: "[--refresh]"
|
|
5
|
+
tools: Read, Bash
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# gdd-openrouter-status
|
|
10
|
+
|
|
11
|
+
## Role
|
|
12
|
+
|
|
13
|
+
You are a deterministic, read-only diagnostic skill. You do **not** spawn agents and you do **not** modify the catalog cache. You read `.design/cache/openrouter-models.json` (the Phase-33.6-01 catalog cache) via `scripts/lib/openrouter/catalog-fetcher.cjs#readCatalog`, resolve the `opus`/`sonnet`/`haiku` tiers via `scripts/lib/tier-resolver-openrouter.cjs#resolve`, and emit a single Markdown status block. Read-only - to refresh the catalog you pass `--refresh` (a single opt-in fetch gated on `OPENROUTER_API_KEY`); there is no other mutation. See `connections/openrouter.md` for setup and `reference/openrouter-tier-mapping.md` for the resolution heuristic.
|
|
14
|
+
|
|
15
|
+
This is `disable-model-invocation: true` (mirroring `skills/cache-manager/SKILL.md`): the skill is user-invoked only - the model must not auto-spawn it. It never makes a model call.
|
|
16
|
+
|
|
17
|
+
## Invocation Contract
|
|
18
|
+
|
|
19
|
+
- **Input**: optional `--refresh`. When absent, the skill is purely read-only (cache + resolve). When `--refresh` is set AND `OPENROUTER_API_KEY` is present, it calls the Phase-33.6-01 fetcher once to refresh the cache before reading; when `--refresh` is set but no key is present, it prints the empty-state/no-key message and does NOT fetch.
|
|
20
|
+
- **Output**: a Markdown OpenRouter-status block to stdout. The block is the entire output.
|
|
21
|
+
|
|
22
|
+
## Procedure
|
|
23
|
+
|
|
24
|
+
### 1. (Optional) refresh
|
|
25
|
+
|
|
26
|
+
If `--refresh` is set and `OPENROUTER_API_KEY` is present, run a single fetch to refresh the cache:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
node -e "require('./scripts/lib/openrouter/catalog-fetcher.cjs').fetchCatalog().then(()=>{}).catch(()=>{})"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This is the ONLY mutation the skill performs, and only on explicit `--refresh`. The fetch never throws (D-08); a failure degrades to the existing cache.
|
|
33
|
+
|
|
34
|
+
### 2. Read the catalog cache
|
|
35
|
+
|
|
36
|
+
Read `.design/cache/openrouter-models.json` via `readCatalog`. Missing or empty → emit the empty-state message and stop:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
## OpenRouter Status
|
|
40
|
+
|
|
41
|
+
No OpenRouter catalog yet — set OPENROUTER_API_KEY and run a cycle, or `{{command_prefix}}openrouter-status --refresh`.
|
|
42
|
+
|
|
43
|
+
Tier resolution is currently falling back to the native provider (graceful degrade — D-08).
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Compute freshness
|
|
47
|
+
|
|
48
|
+
Read `fetched_at` from the cache object and compare against the 24h TTL (D-02): `age = now - fetched_at`. `age < 24h` → **fresh**; otherwise → **stale** (a stale catalog still resolves - the adapter uses the last good cache).
|
|
49
|
+
|
|
50
|
+
### 4. Resolve the tiers
|
|
51
|
+
|
|
52
|
+
For each of `opus`, `sonnet`, `haiku`, resolve via the adapter (it reads `.design/config.json#openrouter_tier_overrides` and applies the heuristic over the cached catalog):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node -e "const r=require('./scripts/lib/tier-resolver-openrouter.cjs');for(const t of ['opus','sonnet','haiku'])console.log(t, '->', r.resolve(t) || '(null → native fallback)')"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
A `null` for a tier means OpenRouter has no pick → the native provider resolves that tier (D-08). Note any tier that resolved from an explicit `openrouter_tier_overrides` pin vs the heuristic.
|
|
59
|
+
|
|
60
|
+
### 5. Print the status block
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
## OpenRouter Status
|
|
64
|
+
|
|
65
|
+
Catalog source: <source URL from cache>
|
|
66
|
+
Last fetched: <fetched_at> (<fresh | stale> — TTL 24h)
|
|
67
|
+
Models in catalog: <count>
|
|
68
|
+
|
|
69
|
+
| Tier | Resolved model id | Source |
|
|
70
|
+
|--------|----------------------------------|--------------------|
|
|
71
|
+
| opus | <id or (null → native fallback)> | <override | heuristic> |
|
|
72
|
+
| sonnet | <id or (null → native fallback)> | <override | heuristic> |
|
|
73
|
+
| haiku | <id or (null → native fallback)> | <override | heuristic> |
|
|
74
|
+
|
|
75
|
+
> Resolution: override (`.design/config.json#openrouter_tier_overrides`) wins, else the closed-vs-open + pricing heuristic over the catalog.
|
|
76
|
+
> A null resolution means tier resolution falls back to the native provider (D-08).
|
|
77
|
+
> Read-only — this skill never modifies the cache; use `--refresh` to re-fetch (needs OPENROUTER_API_KEY).
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Completion marker
|
|
81
|
+
|
|
82
|
+
End the output with:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
## OPENROUTER-STATUS COMPLETE
|
|
86
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: optimize
|
|
3
|
+
description: "Reads .design/telemetry/costs.jsonl + .design/agent-metrics.json, runs rule-based analysis, writes .design/OPTIMIZE-RECOMMENDATIONS.md. Pure advisory - no auto-apply. User reviews + decides."
|
|
4
|
+
argument-hint: "[--refresh] [--min-spawns=N]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Bash, Grep, Write
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}optimize - Optimization Advisor
|
|
10
|
+
|
|
11
|
+
## Role
|
|
12
|
+
|
|
13
|
+
Read the telemetry ledger (`.design/telemetry/costs.jsonl`) and per-agent aggregate (`.design/agent-metrics.json`), apply a fixed set of rule-based heuristics, and emit recommendations to `.design/OPTIMIZE-RECOMMENDATIONS.md`. Never modify agent files, budget config, or cache state. Output is a markdown table of proposals the user reviews manually, mirroring Phase 11 `{{command_prefix}}apply-reflections`. **Advisory only**: never edits `agents/*.md`, `.design/budget.json`, `.design/cache-manifest.json`. Never makes model calls - every rule is deterministic. See `./reference/heuristics.md` §"Optimization rules" for the full rule catalog.
|
|
14
|
+
|
|
15
|
+
## Refresh Step
|
|
16
|
+
|
|
17
|
+
Before analysis, invoke the aggregator:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
node --experimental-strip-types scripts/aggregate-agent-metrics.ts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Idempotent. If `--refresh` absent and `.design/agent-metrics.json` generated within 60s, skip.
|
|
24
|
+
|
|
25
|
+
## Inputs
|
|
26
|
+
|
|
27
|
+
- `.design/telemetry/costs.jsonl` - append-only; tolerant of malformed lines.
|
|
28
|
+
- `.design/agent-metrics.json` - per-agent aggregate; source of truth for `cache_hit_rate`, `lazy_skip_rate`, `total_cost_usd`, `total_spawns`.
|
|
29
|
+
- `agents/*.md` - frontmatter cross-reference for tier override churn + typical-duration drift.
|
|
30
|
+
- `.design/budget.json` - `tier_overrides` table (optional).
|
|
31
|
+
|
|
32
|
+
## Optional Arguments
|
|
33
|
+
|
|
34
|
+
- `--refresh` - force aggregator refresh even if metrics file is fresh.
|
|
35
|
+
- `--min-spawns=N` - only emit recommendations for agents with ≥ N spawns (default 5).
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
Rule-based analysis. Full thresholds + emission templates in `./reference/heuristics.md` §"Optimization rules"; here, the short rule catalog:
|
|
40
|
+
|
|
41
|
+
- **R1 - Low cache hit rate.** IF `total_spawns >= --min-spawns` AND `cache_hit_rate < 0.20` → propose batching + investigate shared-preamble ordering.
|
|
42
|
+
- **R2 - Expensive + rarely lazy-skipped.** IF `total_cost_usd > 0.50` AND `lazy_skip_rate < 0.10` → propose adding a lazy gate at `agents/{agent}-gate.md` (Plan 10.1-04 pattern).
|
|
43
|
+
- **R3 - Tier override churn.** IF measured `tier` differs from frontmatter `default-tier` for multiple rows → propose updating frontmatter or removing budget.json override.
|
|
44
|
+
- **R4 - Typical duration drift.** IF measured `typical_duration_seconds` differs from frontmatter by > 50% → propose frontmatter update. (v1 only computes wall-clock duration if both spawn + complete rows have matching correlation IDs; otherwise flag "insufficient data".)
|
|
45
|
+
|
|
46
|
+
## Output Format
|
|
47
|
+
|
|
48
|
+
Write `.design/OPTIMIZE-RECOMMENDATIONS.md`:
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
# Optimization Recommendations
|
|
52
|
+
|
|
53
|
+
**Generated:** {ISO-8601 timestamp}
|
|
54
|
+
**Telemetry rows analyzed:** {N}
|
|
55
|
+
**Agents analyzed:** {M}
|
|
56
|
+
**Min spawns threshold:** {--min-spawns value}
|
|
57
|
+
|
|
58
|
+
> Advisory only. No changes have been applied. Review each proposal and apply manually via the suggested action.
|
|
59
|
+
|
|
60
|
+
## Proposals
|
|
61
|
+
|
|
62
|
+
| Rule | Agent | Current | Proposed | Rationale |
|
|
63
|
+
|------|-------|---------|----------|-----------|
|
|
64
|
+
| R1 | ... | ... | ... | ... |
|
|
65
|
+
|
|
66
|
+
## Summary
|
|
67
|
+
|
|
68
|
+
- R1 matches: {count}
|
|
69
|
+
- R2 matches: {count}
|
|
70
|
+
- R3 matches: {count}
|
|
71
|
+
- R4 matches: {count}
|
|
72
|
+
|
|
73
|
+
## OPTIMIZE COMPLETE
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The `## OPTIMIZE COMPLETE` marker is the completion sentinel.
|
|
77
|
+
|
|
78
|
+
## No Auto-Apply
|
|
79
|
+
|
|
80
|
+
This skill **never modifies** `agents/*.md`, `.design/budget.json`, `.design/cache-manifest.json`, or any other configuration. **Never auto-applies** proposals. If the user wants to act, they do so manually. Discipline mirrors `{{command_prefix}}apply-reflections` from Phase 11.
|
|
81
|
+
|
|
82
|
+
## Integration with Phase 11 Reflector
|
|
83
|
+
|
|
84
|
+
The Phase 11 reflector (`agents/design-reflector.md`) reads both `costs.jsonl` and `agent-metrics.json` on its own cadence. `{{command_prefix}}optimize` is user-facing; the reflector is automation-facing. Outputs land in different files (`.design/OPTIMIZE-RECOMMENDATIONS.md` vs `.design/reflections/*.md`) and never collide.
|
|
85
|
+
|
|
86
|
+
## Non-Goals
|
|
87
|
+
|
|
88
|
+
- Does not make model calls (rule-based, deterministic).
|
|
89
|
+
- Does not modify config.
|
|
90
|
+
- Does not propose changes outside the four rules - future rules added by future phases.
|
|
91
|
+
- Does not learn from history - Phase 11 reflector territory.
|
|
92
|
+
|
|
93
|
+
## Failure Modes
|
|
94
|
+
|
|
95
|
+
- Missing `.design/telemetry/costs.jsonl` → emit `No telemetry data yet — run {{command_prefix}}* commands to accumulate data, then retry.` + `## OPTIMIZE COMPLETE`.
|
|
96
|
+
- Missing `.design/agent-metrics.json` after refresh → emit `Aggregator failed — check node --experimental-strip-types scripts/aggregate-agent-metrics.ts output manually.`
|
|
97
|
+
- Zero rules matched → write `No recommendations — all agents within healthy thresholds.` + `## OPTIMIZE COMPLETE`.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-override
|
|
3
|
+
description: "Escalation surface for a risk-blocked action or a fact-force gate. Use when the Phase 56 risk gate blocked a writer action (suggested_action=block) and a reviewer has signed off, or when the first-write fact-force gate is holding a file you have legitimately reviewed. Activates for requests involving overriding a blocked edit, approving a high-risk change, or clearing a fact-force hold on a path."
|
|
4
|
+
argument-hint: "<finding-id | factforce <path>> [--approver <who>] [--reason <text>]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Write, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# {{command_prefix}}override
|
|
10
|
+
|
|
11
|
+
A risk-blocked action is hard: the Phase 56 risk gate routes `suggested_action=block`
|
|
12
|
+
to `override` (see `scripts/lib/risk/route.cjs`), and the fact-force gate holds the
|
|
13
|
+
first write to a file until its facts are read. This skill is the audited way past
|
|
14
|
+
either hold. It mirrors `{{command_prefix}}unlock-decision`: a named approver plus a
|
|
15
|
+
reason, recorded before anything is let through. Override is never silent.
|
|
16
|
+
|
|
17
|
+
## Invocation
|
|
18
|
+
|
|
19
|
+
| Command | Behavior |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `{{command_prefix}}override <finding-id> --approver <who> --reason <text>` | Record a `D-XX` `override`-tagged decision in STATE.md `<decisions>` and let the risk-blocked action through. |
|
|
22
|
+
| `{{command_prefix}}override factforce <path> --approver <who> --reason <text>` | Set `checked[path]` in the session fact-force state so the fact-force gate stops holding that path. |
|
|
23
|
+
|
|
24
|
+
Both modes ask for a rationale: the audit trail is the reason override exists.
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
1. **Parse args.** Mode is `factforce` when the first token is the literal `factforce`
|
|
29
|
+
(the next token is the `<path>`); otherwise the first token is a `<finding-id>`.
|
|
30
|
+
`--approver` is required (a non-empty name). Missing `--approver` prints the usage
|
|
31
|
+
and changes nothing. If `--reason` is absent, ASK for one (AskUserQuestion or a
|
|
32
|
+
prompt) before continuing: an override with no rationale is rejected.
|
|
33
|
+
|
|
34
|
+
2. **Preview.** Show what will be written and stop for confirmation:
|
|
35
|
+
- finding mode: the decision entry from `overrideDecisionEntry(<id>, {approver, reason})`
|
|
36
|
+
(its `text`, `status: locked`, and `override` tag) plus the action it unblocks.
|
|
37
|
+
- factforce mode: the `<path>` that will gain `checked[path] = true` and the
|
|
38
|
+
session-state file it lands in.
|
|
39
|
+
|
|
40
|
+
3. **Apply (finding mode).** Record the audited decision via the STATE writer
|
|
41
|
+
`mcp__gdd_state__add_decision` (it auto-assigns the next `D-N`). Pass the `text`
|
|
42
|
+
from the pure builder so the `override` tag is embedded and greppable:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
node -e '
|
|
46
|
+
const o = require("./scripts/lib/risk/override.cjs");
|
|
47
|
+
const [id, who, reason] = process.argv.slice(1);
|
|
48
|
+
const entry = o.overrideDecisionEntry(id, { approver: who, reason });
|
|
49
|
+
console.log(JSON.stringify(entry));
|
|
50
|
+
' "<finding-id>" "<who>" "<reason>"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then call `mcp__gdd_state__add_decision` with `{ text: <entry.text>, status: "locked" }`.
|
|
54
|
+
The blocked action is now approved on the audit record; proceed with it.
|
|
55
|
+
|
|
56
|
+
4. **Apply (factforce mode).** Set `checked[path]` in the session state file at
|
|
57
|
+
`<cwd>/.design/locks/factforce-<session_id>.json` (atomic tmp then rename), using
|
|
58
|
+
the pure helper so the shape matches what the fact-force gate reads:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node -e '
|
|
62
|
+
const fs = require("fs"); const path = require("path");
|
|
63
|
+
const o = require("./scripts/lib/risk/override.cjs");
|
|
64
|
+
const [file, p] = process.argv.slice(1);
|
|
65
|
+
let state = {}; try { state = JSON.parse(fs.readFileSync(file, "utf8")); } catch {}
|
|
66
|
+
const next = o.setFactForceChecked(state, p);
|
|
67
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
68
|
+
const tmp = file + ".tmp";
|
|
69
|
+
fs.writeFileSync(tmp, JSON.stringify(next, null, 2) + "\n");
|
|
70
|
+
fs.renameSync(tmp, file);
|
|
71
|
+
console.log(JSON.stringify(next.checked));
|
|
72
|
+
' "<cwd>/.design/locks/factforce-<session_id>.json" "<path>"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The fact-force gate stops holding `<path>` for the rest of the session.
|
|
76
|
+
|
|
77
|
+
5. **Report** the recorded approver, the reason, and either the new `D-XX` id (finding
|
|
78
|
+
mode) or the unblocked path (factforce mode).
|
|
79
|
+
|
|
80
|
+
## Do Not
|
|
81
|
+
|
|
82
|
+
- Do not skip the rationale: every override is audited.
|
|
83
|
+
- Do not override a finding that the risk gate did not actually block.
|
|
84
|
+
- Do not edit `scripts/lib/risk/route.cjs` or `compute-risk.cjs`: this skill consumes them.
|
|
85
|
+
|
|
86
|
+
## OVERRIDE COMPLETE
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-paper-write
|
|
3
|
+
description: "Push design decisions from `.design/DESIGN-CONTEXT.md` into the active paper.design canvas by dispatching the `design-paper-writer` agent in one of three modes (annotate / tokenize / roundtrip). Use when the user has completed a design pipeline cycle and wants the decisions reflected in their paper.design canvas. Operates proposal->confirm with `--dry-run`."
|
|
4
|
+
argument-hint: "<annotate|tokenize|roundtrip> [--dry-run]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Write, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# gdd-paper-write
|
|
10
|
+
|
|
11
|
+
Dispatches the `design-paper-writer` agent to write design decisions back to the active paper.design canvas. The shared probe pattern (ToolSearch → live call → STATE.md write) and connection handshake are documented at `../../reference/shared-preamble.md#connection-handshake-summary` and `../../connections/paper-design.md`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/get-design-done paper-write <mode> [--dry-run]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Modes:
|
|
20
|
+
- `annotate` - add design decision comments to canvas nodes
|
|
21
|
+
- `tokenize` - sync CSS token values to paper.design node styles
|
|
22
|
+
- `roundtrip` - write implementation status back as text/HTML layers
|
|
23
|
+
|
|
24
|
+
Flags:
|
|
25
|
+
- `--dry-run` - emit the proposal without executing any paper.design writes
|
|
26
|
+
|
|
27
|
+
paper.design has no team-library concept, so there is no `--confirm-shared` flag. Every write still requires an explicit `yes` confirmation (unless `--dry-run` is set).
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
1. paper.design MCP registered. Install: `claude mcp add paper-design --transport http https://mcp.paper.design/sse` then restart the session. See `../../connections/paper-design.md` for the full probe pattern and budget rules.
|
|
32
|
+
2. `.design/DESIGN-CONTEXT.md` exists (run `discover` first)
|
|
33
|
+
3. `.design/STATE.md` `<connections>` shows `paper-design: available`. If `not_configured` or `unavailable`, the agent will STOP with a diagnostic.
|
|
34
|
+
|
|
35
|
+
Budget: the agent tracks `budget_used` in STATE.md `<connections>` and warns when usage reaches 90/100 on the free tier.
|
|
36
|
+
|
|
37
|
+
## Required Reading
|
|
38
|
+
|
|
39
|
+
Read `.design/STATE.md` and `.design/DESIGN-CONTEXT.md` before dispatching the agent.
|
|
40
|
+
|
|
41
|
+
## Dispatch
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Task("design-paper-writer", """
|
|
45
|
+
mode: <annotate|tokenize|roundtrip>
|
|
46
|
+
dry_run: <true|false>
|
|
47
|
+
required_reading:
|
|
48
|
+
- .design/STATE.md
|
|
49
|
+
- .design/DESIGN-CONTEXT.md
|
|
50
|
+
""")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Pass `mode` from the first positional argument; `dry_run` from `--dry-run`.
|
|
54
|
+
Wait for the agent's completion marker before returning.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-pause
|
|
3
|
+
description: "Write a numbered checkpoint so work can resume in a new session without re-running completed stages."
|
|
4
|
+
argument-hint: "[context note]"
|
|
5
|
+
tools: Read, Write, Bash, AskUserQuestion, mcp__gdd_state__get, mcp__gdd_state__set_status, mcp__gdd_state__add_blocker, mcp__gdd_state__checkpoint
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
@reference/retrieval-contract.md
|
|
10
|
+
@reference/cycle-handoff-preamble.md
|
|
11
|
+
|
|
12
|
+
# {{command_prefix}}pause
|
|
13
|
+
|
|
14
|
+
Captures enough state that a killed or stopped session can resume cleanly via `{{command_prefix}}resume` or `{{command_prefix}}continue`.
|
|
15
|
+
|
|
16
|
+
Each invocation writes an **immutable numbered checkpoint** - it does not overwrite previous pauses. This enables branched cycles: you can pause, take a detour via `{{command_prefix}}sketch`, compare, and resume an older snapshot via `{{command_prefix}}resume N`.
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. `mcp__gdd_state__get` → snapshot current pipeline state. Extract:
|
|
21
|
+
- Current `stage` and `cycle`
|
|
22
|
+
- `last_checkpoint` timestamp
|
|
23
|
+
- `task_progress` and `status` for the current run
|
|
24
|
+
- Open todos (from `.design/TODO.md` if present - this file is outside the MCP catalog, so `Read` is still used)
|
|
25
|
+
- Active sketch/spike directories (scan `.design/sketches/` and `.design/spikes/` for in-progress markers)
|
|
26
|
+
|
|
27
|
+
2. **Determine checkpoint number**: run
|
|
28
|
+
```bash
|
|
29
|
+
ls .design/checkpoints/ 2>/dev/null | grep -E '^[0-9]+' | sort -n | tail -1
|
|
30
|
+
```
|
|
31
|
+
Next checkpoint = last number + 1 (or `01` if none exist).
|
|
32
|
+
|
|
33
|
+
3. **Collect context**: if no context argument was passed, ask (AskUserQuestion):
|
|
34
|
+
"What are you in the middle of? (optional context to capture)"
|
|
35
|
+
|
|
36
|
+
4. **Flip status via MCP** so `{{command_prefix}}resume` can detect the pause and recover the prior status:
|
|
37
|
+
1. `mcp__gdd_state__set_status` with `status: "paused:<prior-status>"` - the `paused:` prefix preserves the prior status for resume parsing.
|
|
38
|
+
2. If the user supplied a context/blocker message: `mcp__gdd_state__add_blocker` with `{ stage: <current>, date: <today>, text: <message> }`.
|
|
39
|
+
3. `mcp__gdd_state__checkpoint` to stamp `last_checkpoint` via MCP.
|
|
40
|
+
|
|
41
|
+
5. **Write numbered checkpoint**: create `.design/checkpoints/` with `mkdir -p`, then write:
|
|
42
|
+
```
|
|
43
|
+
.design/checkpoints/NN-<stage>-<ISO-date>.md
|
|
44
|
+
```
|
|
45
|
+
e.g. `01-design-2026-04-24.md`
|
|
46
|
+
|
|
47
|
+
Content:
|
|
48
|
+
```markdown
|
|
49
|
+
# Checkpoint NN
|
|
50
|
+
**Saved**: <ISO timestamp>
|
|
51
|
+
**Stage**: <stage>
|
|
52
|
+
**Cycle**: <cycle>
|
|
53
|
+
**In progress**: <task description + wave/index>
|
|
54
|
+
**Next**: <next step>
|
|
55
|
+
**Context**: <user note or "none">
|
|
56
|
+
**Active sketch**: <path or none>
|
|
57
|
+
**Open todos**: <N items (see .design/TODO.md)>
|
|
58
|
+
**Completed this session**: <list>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
6. **Update HANDOFF.md pointer**: write `.design/HANDOFF.md` with:
|
|
62
|
+
```markdown
|
|
63
|
+
# Session Handoff (pointer)
|
|
64
|
+
Latest checkpoint: `.design/checkpoints/NN-<stage>-<ISO-date>.md`
|
|
65
|
+
Run `{{command_prefix}}resume` to restore, or `{{command_prefix}}resume N` for a specific checkpoint.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
7. Print: "Checkpoint NN saved. Run `{{command_prefix}}resume` or `{{command_prefix}}continue` to pick back up."
|
|
69
|
+
|
|
70
|
+
## Do Not
|
|
71
|
+
|
|
72
|
+
- Do not mutate STATE.md directly - all STATE.md writes go through the `gdd-state` MCP tools above. Checkpoint files + HANDOFF.md are sibling artifacts, written with `Write`.
|
|
73
|
+
- Do not abort in-progress sketches; just record them.
|
|
74
|
+
- Do not delete previous checkpoint files.
|
|
75
|
+
- Do not call `mcp__gdd_state__transition_stage` - pause is status-only, never a stage transition.
|
|
76
|
+
|
|
77
|
+
## PAUSE COMPLETE
|