@hegemonart/get-design-done 1.41.0 → 1.42.0
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 +81 -0
- package/README.md +2 -0
- package/dist/claude-code/.claude/skills/add-backlog/SKILL.md +48 -0
- package/dist/claude-code/.claude/skills/analyze-dependencies/SKILL.md +95 -0
- package/dist/claude-code/.claude/skills/apply-reflections/SKILL.md +92 -0
- package/dist/claude-code/.claude/skills/apply-reflections/apply-reflections-procedure.md +170 -0
- package/dist/claude-code/.claude/skills/audit/SKILL.md +79 -0
- package/dist/claude-code/.claude/skills/bandit-status/SKILL.md +94 -0
- package/dist/claude-code/.claude/skills/benchmark/SKILL.md +65 -0
- package/dist/claude-code/.claude/skills/bootstrap-ds/SKILL.md +43 -0
- package/dist/claude-code/.claude/skills/brief/SKILL.md +128 -0
- package/dist/claude-code/.claude/skills/budget/SKILL.md +45 -0
- package/dist/claude-code/.claude/skills/cache-manager/SKILL.md +66 -0
- package/dist/claude-code/.claude/skills/cache-manager/cache-policy.md +126 -0
- package/dist/claude-code/.claude/skills/check-update/SKILL.md +98 -0
- package/dist/claude-code/.claude/skills/compare/SKILL.md +82 -0
- package/dist/claude-code/.claude/skills/compare/compare-rubric.md +171 -0
- package/dist/claude-code/.claude/skills/complete-cycle/SKILL.md +81 -0
- package/dist/claude-code/.claude/skills/connections/SKILL.md +71 -0
- package/dist/claude-code/.claude/skills/connections/connections-onboarding.md +608 -0
- package/dist/claude-code/.claude/skills/continue/SKILL.md +24 -0
- package/dist/claude-code/.claude/skills/darkmode/SKILL.md +76 -0
- package/dist/claude-code/.claude/skills/darkmode/darkmode-audit-procedure.md +258 -0
- package/dist/claude-code/.claude/skills/debug/SKILL.md +41 -0
- package/dist/claude-code/.claude/skills/debug/debug-feedback-loops.md +119 -0
- package/dist/claude-code/.claude/skills/design/SKILL.md +99 -0
- package/dist/claude-code/.claude/skills/design/design-procedure.md +304 -0
- package/dist/claude-code/.claude/skills/discover/SKILL.md +72 -0
- package/dist/claude-code/.claude/skills/discover/discover-procedure.md +222 -0
- package/dist/claude-code/.claude/skills/discuss/SKILL.md +96 -0
- package/dist/claude-code/.claude/skills/do/SKILL.md +45 -0
- package/dist/claude-code/.claude/skills/explore/SKILL.md +105 -0
- package/dist/claude-code/.claude/skills/explore/explore-procedure.md +267 -0
- package/dist/claude-code/.claude/skills/export/SKILL.md +30 -0
- package/dist/claude-code/.claude/skills/extract-learnings/SKILL.md +98 -0
- package/dist/claude-code/.claude/skills/fast/SKILL.md +91 -0
- package/dist/claude-code/.claude/skills/figma-extract/SKILL.md +64 -0
- package/dist/claude-code/.claude/skills/figma-write/SKILL.md +39 -0
- package/dist/claude-code/.claude/skills/graphify/SKILL.md +49 -0
- package/dist/claude-code/.claude/skills/health/SKILL.md +99 -0
- package/dist/claude-code/.claude/skills/health/health-mcp-detection.md +44 -0
- package/dist/claude-code/.claude/skills/health/health-skill-length-report.md +69 -0
- package/dist/claude-code/.claude/skills/help/SKILL.md +87 -0
- package/dist/claude-code/.claude/skills/list-assumptions/SKILL.md +61 -0
- package/dist/claude-code/.claude/skills/locale/SKILL.md +51 -0
- package/dist/claude-code/.claude/skills/map/SKILL.md +89 -0
- package/dist/claude-code/.claude/skills/migrate/SKILL.md +70 -0
- package/dist/claude-code/.claude/skills/new-cycle/SKILL.md +37 -0
- package/dist/claude-code/.claude/skills/new-cycle/milestone-completeness-rubric.md +87 -0
- package/dist/claude-code/.claude/skills/new-project/SKILL.md +53 -0
- package/dist/claude-code/.claude/skills/next/SKILL.md +68 -0
- package/dist/claude-code/.claude/skills/note/SKILL.md +48 -0
- package/dist/claude-code/.claude/skills/openrouter-status/SKILL.md +86 -0
- package/dist/claude-code/.claude/skills/optimize/SKILL.md +97 -0
- package/dist/claude-code/.claude/skills/pause/SKILL.md +77 -0
- package/dist/claude-code/.claude/skills/peer-cli-add/SKILL.md +88 -0
- package/dist/claude-code/.claude/skills/peer-cli-add/peer-cli-protocol.md +161 -0
- package/dist/claude-code/.claude/skills/peer-cli-customize/SKILL.md +90 -0
- package/dist/claude-code/.claude/skills/peers/SKILL.md +96 -0
- package/dist/claude-code/.claude/skills/plan/SKILL.md +105 -0
- package/dist/claude-code/.claude/skills/plan/plan-procedure.md +278 -0
- package/dist/claude-code/.claude/skills/plant-seed/SKILL.md +48 -0
- package/dist/claude-code/.claude/skills/pr-branch/SKILL.md +32 -0
- package/dist/claude-code/.claude/skills/progress/SKILL.md +95 -0
- package/dist/claude-code/.claude/skills/quality-gate/SKILL.md +90 -0
- package/dist/claude-code/.claude/skills/quality-gate/threat-modeling.md +101 -0
- package/dist/claude-code/.claude/skills/quick/SKILL.md +44 -0
- package/dist/claude-code/.claude/skills/reapply-patches/SKILL.md +32 -0
- package/dist/claude-code/.claude/skills/recall/SKILL.md +75 -0
- package/dist/claude-code/.claude/skills/reflect/SKILL.md +85 -0
- package/dist/claude-code/.claude/skills/reflect/procedures/capability-gap-scan.md +120 -0
- package/dist/claude-code/.claude/skills/report-issue/SKILL.md +53 -0
- package/dist/claude-code/.claude/skills/report-issue/report-issue-procedure.md +120 -0
- package/dist/claude-code/.claude/skills/resume/SKILL.md +93 -0
- package/dist/claude-code/.claude/skills/review-backlog/SKILL.md +46 -0
- package/dist/claude-code/.claude/skills/review-decisions/SKILL.md +42 -0
- package/dist/claude-code/.claude/skills/roi/SKILL.md +54 -0
- package/dist/claude-code/.claude/skills/rollout-status/SKILL.md +35 -0
- package/dist/claude-code/.claude/skills/router/SKILL.md +89 -0
- package/dist/claude-code/.claude/skills/router/capability-gap-emitter.md +65 -0
- package/dist/claude-code/.claude/skills/router/router-pick-emitter.md +78 -0
- package/dist/claude-code/.claude/skills/router/router-rules.md +84 -0
- package/dist/claude-code/.claude/skills/scan/SKILL.md +92 -0
- package/dist/claude-code/.claude/skills/scan/scan-procedure.md +732 -0
- package/dist/claude-code/.claude/skills/settings/SKILL.md +87 -0
- package/dist/claude-code/.claude/skills/ship/SKILL.md +48 -0
- package/dist/claude-code/.claude/skills/sketch/SKILL.md +78 -0
- package/dist/claude-code/.claude/skills/sketch-wrap-up/SKILL.md +92 -0
- package/dist/claude-code/.claude/skills/skill-manifest/SKILL.md +79 -0
- package/dist/claude-code/.claude/skills/spike/SKILL.md +67 -0
- package/dist/claude-code/.claude/skills/spike-wrap-up/SKILL.md +86 -0
- package/dist/claude-code/.claude/skills/start/SKILL.md +67 -0
- package/dist/claude-code/.claude/skills/start/start-procedure.md +115 -0
- package/dist/claude-code/.claude/skills/stats/SKILL.md +51 -0
- package/dist/claude-code/.claude/skills/style/SKILL.md +71 -0
- package/dist/claude-code/.claude/skills/style/style-doc-procedure.md +150 -0
- package/dist/claude-code/.claude/skills/synthesize/SKILL.md +94 -0
- package/dist/claude-code/.claude/skills/timeline/SKILL.md +66 -0
- package/dist/claude-code/.claude/skills/todo/SKILL.md +64 -0
- package/dist/claude-code/.claude/skills/turn-closeout/SKILL.md +95 -0
- package/dist/claude-code/.claude/skills/undo/SKILL.md +31 -0
- package/dist/claude-code/.claude/skills/unlock-decision/SKILL.md +54 -0
- package/dist/claude-code/.claude/skills/update/SKILL.md +56 -0
- package/dist/claude-code/.claude/skills/using-gdd/SKILL.md +78 -0
- package/dist/claude-code/.claude/skills/verify/SKILL.md +113 -0
- package/dist/claude-code/.claude/skills/verify/verify-procedure.md +512 -0
- package/dist/claude-code/.claude/skills/warm-cache/SKILL.md +81 -0
- package/dist/claude-code/.claude/skills/watch-authorities/SKILL.md +82 -0
- package/dist/claude-code/.claude/skills/zoom-out/SKILL.md +26 -0
- package/package.json +5 -1
- package/reference/DEPRECATIONS.md +14 -0
- package/reference/registry.json +7 -0
- package/reference/skill-placeholders.md +71 -0
- package/scripts/lib/build/factory.cjs +62 -0
- package/scripts/lib/build/harness-configs.cjs +64 -0
- package/scripts/lib/manifest/README.md +46 -0
- package/scripts/lib/manifest/harnesses.cjs +3 -0
- package/scripts/lib/manifest/harnesses.json +91 -0
- package/scripts/lib/manifest/index.cjs +26 -0
- package/scripts/lib/manifest/loader.cjs +51 -0
- package/scripts/lib/manifest/prose-denylist.json +126 -0
- package/scripts/lib/manifest/schemas/harnesses.schema.json +38 -0
- package/scripts/lib/manifest/schemas/prose-denylist.schema.json +41 -0
- package/scripts/lib/manifest/schemas/skills.schema.json +33 -0
- package/scripts/lib/manifest/skills.json +255 -0
- package/sdk/cli/commands/build.ts +106 -0
- package/sdk/cli/index.js +84 -2
- package/sdk/cli/index.ts +7 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-map
|
|
3
|
+
description: "Dispatches 5 specialist codebase mappers in parallel. Produces .design/map/*.md files consumed by the explore stage."
|
|
4
|
+
argument-hint: "[--only tokens|components|visual-hierarchy|a11y|motion]"
|
|
5
|
+
tools: Read, Write, Bash, Task
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Get Design Done — Map
|
|
10
|
+
|
|
11
|
+
Parallel orchestrator. Spawns 5 specialist mappers, each writing one file under `.design/map/`. The explore stage consumes these when present. See `./reference/heuristics.md` §"Optimization rules" for parallel-spawn cost considerations.
|
|
12
|
+
|
|
13
|
+
## Mapper → Output
|
|
14
|
+
|
|
15
|
+
| Mapper | Output |
|
|
16
|
+
|--------|--------|
|
|
17
|
+
| `token-mapper` | `.design/map/tokens.md` |
|
|
18
|
+
| `component-taxonomy-mapper` | `.design/map/components.md` |
|
|
19
|
+
| `visual-hierarchy-mapper` | `.design/map/visual-hierarchy.md` |
|
|
20
|
+
| `a11y-mapper` | `.design/map/a11y.md` |
|
|
21
|
+
| `motion-mapper` | `.design/map/motion.md` |
|
|
22
|
+
|
|
23
|
+
## Step 1 — Setup
|
|
24
|
+
|
|
25
|
+
- Ensure `.design/map/` exists (create if missing).
|
|
26
|
+
- Read `.design/config.json` → `parallelism` object. Use `reference/config-schema.md` defaults if absent.
|
|
27
|
+
- Read `.design/STATE.md` — note `<connections>` (Figma availability for token-mapper).
|
|
28
|
+
- Parse `$ARGUMENTS`. If `--only <name>`, restrict the dispatch set to one mapper.
|
|
29
|
+
|
|
30
|
+
## Step 2 — Parallelism Decision
|
|
31
|
+
|
|
32
|
+
Per `reference/parallelism-rules.md`: all 5 mappers have `parallel-safe: auto` with disjoint `writes:` (each writes a different `.design/map/*.md` file) — no hard-rule conflict. `typical-duration-seconds` sum (~210s) minus slowest (~45s) ≈ 165s savings → clears `min_estimated_savings_seconds`. Verdict: **parallel**.
|
|
33
|
+
|
|
34
|
+
Write the verdict to STATE.md:
|
|
35
|
+
|
|
36
|
+
```xml
|
|
37
|
+
<parallelism_decision>
|
|
38
|
+
stage: map
|
|
39
|
+
verdict: parallel
|
|
40
|
+
reason: "5 mappers, parallel-safe: auto, writes disjoint, est savings ~165s"
|
|
41
|
+
agents: ["token-mapper", "component-taxonomy-mapper", "visual-hierarchy-mapper", "a11y-mapper", "motion-mapper"]
|
|
42
|
+
ruled_out: []
|
|
43
|
+
timestamp: [ISO 8601 now]
|
|
44
|
+
</parallelism_decision>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`--only` → adjust `agents` and set `verdict: serial` with `reason: "single mapper requested"`.
|
|
48
|
+
|
|
49
|
+
## Step 3 — Dispatch (concurrent)
|
|
50
|
+
|
|
51
|
+
Spawn all selected mappers in a single response with multiple `Task()` calls:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Task("<mapper-name>", """
|
|
55
|
+
<required_reading>
|
|
56
|
+
@.design/STATE.md
|
|
57
|
+
@reference/audit-scoring.md
|
|
58
|
+
[@reference/accessibility.md — a11y-mapper only]
|
|
59
|
+
[@reference/motion.md — motion-mapper only]
|
|
60
|
+
</required_reading>
|
|
61
|
+
|
|
62
|
+
You are <mapper-name>. Scan the codebase per your agent spec and write your
|
|
63
|
+
output file under .design/map/. Emit your completion marker when done.
|
|
64
|
+
""")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Wait for each completion marker: `## TOKEN MAP COMPLETE`, `## COMPONENT MAP COMPLETE`, `## VISUAL HIERARCHY MAP COMPLETE`, `## A11Y MAP COMPLETE`, `## MOTION MAP COMPLETE`.
|
|
68
|
+
|
|
69
|
+
## Step 3.5 — Synthesize parallel mapper outputs (Plan 10.1-04, D-13/D-14/D-15)
|
|
70
|
+
|
|
71
|
+
Each mapper has written its own `.design/map/*.md` (disjoint writes). Main-context doesn't need all 5 verbatim — invoke `synthesize` inline with `outputs:[<each file's text labelled "=== from <mapper> ==="]`, `directive: "Merge into cross-cutting DESIGN-PATTERNS.md preserving section headers; consolidate cross-mapper duplicates with source-agent names; target ~120 lines."`, `output_shape:"markdown"`.
|
|
72
|
+
|
|
73
|
+
Wait for `## SYNTHESIS COMPLETE`. Write merged markdown to `.design/DESIGN-PATTERNS.md` (overwrite if present) — the primary explore-stage input; per-mapper files remain as drill-down evidence. `--only` (single mapper) → skip this step.
|
|
74
|
+
|
|
75
|
+
## Step 4 — Collate
|
|
76
|
+
|
|
77
|
+
Write `.design/DESIGN-MAP.md` — thin index linking to each `.design/map/*.md` with a one-paragraph summary from each file's header. If Step 3.5 ran, also cross-link to `.design/DESIGN-PATTERNS.md` and note at the top: "See DESIGN-PATTERNS.md for the merged cross-cutting summary — this index preserves per-mapper drill-down."
|
|
78
|
+
|
|
79
|
+
## Step 5 — Report
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
━━━ Map complete ━━━
|
|
83
|
+
Files: .design/map/tokens.md, components.md, visual-hierarchy.md, a11y.md, motion.md
|
|
84
|
+
Index: .design/DESIGN-MAP.md
|
|
85
|
+
Next: /gdd:explore (consumes .design/DESIGN-PATTERNS.md on happy path; .design/map/*.md available for drill-down)
|
|
86
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## MAP COMPLETE
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-migrate
|
|
3
|
+
description: "Migrates a project off GDD's own deprecated paths after an upgrade. Reads the machine-readable registry in reference/DEPRECATIONS.md (via scripts/lib/deprecation-registry.cjs), scans the project's .design/config.json + any local skill/agent references for paths that are now deprecated or removed at the installed version, and PREVIEWS a diff before changing anything. Interactive by default (confirm per change); --yes auto-applies; --dry-run previews only. Read-first, never silent. Use after /gdd:update flags a breaking change."
|
|
4
|
+
argument-hint: "[--yes] [--dry-run]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Write, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /gdd:migrate
|
|
10
|
+
|
|
11
|
+
Closes the GDD-on-GDD gap: when GDD moves or removes its own paths (e.g. the Phase 31.5
|
|
12
|
+
`scripts/lib/**` → `sdk/**` reorg), a project that referenced the old paths needs updating. This skill
|
|
13
|
+
consults the deprecation registry, finds the stale references **in this project**, and rewrites them —
|
|
14
|
+
**after showing you the diff**. It never edits silently. Contract: `../../reference/DEPRECATIONS.md`.
|
|
15
|
+
|
|
16
|
+
## Invocation
|
|
17
|
+
|
|
18
|
+
| Command | Behavior |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `/gdd:migrate` | Scan + preview every applicable migration, then confirm each before applying. |
|
|
21
|
+
| `/gdd:migrate --dry-run` | Preview only — print the diff, change nothing. |
|
|
22
|
+
| `/gdd:migrate --yes` | Apply every applicable migration without the per-change prompt (still prints what changed). |
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Resolve the installed version** from `.claude-plugin/plugin.json` (`version`).
|
|
27
|
+
2. **Load the registry.** Parse `reference/DEPRECATIONS.md` with the pure helper:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
node -e '
|
|
31
|
+
const fs = require("fs");
|
|
32
|
+
const dr = require("./scripts/lib/deprecation-registry.cjs");
|
|
33
|
+
const entries = dr.parseDeprecations(fs.readFileSync("reference/DEPRECATIONS.md","utf8"));
|
|
34
|
+
const version = require("./.claude-plugin/plugin.json").version;
|
|
35
|
+
// Only entries that are deprecated/removed at the installed version are actionable.
|
|
36
|
+
const actionable = entries.filter(e => dr.classify(e, version) !== "pending");
|
|
37
|
+
console.log(JSON.stringify({ version, actionable }));
|
|
38
|
+
'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
3. **Scan the project** for each actionable entry's `Old` path:
|
|
42
|
+
- `.design/config.json` (string values referencing an old path),
|
|
43
|
+
- project-local skill/agent references (`grep` the repo, excluding `.git/`, `node_modules/`, and
|
|
44
|
+
GDD's own `reference/DEPRECATIONS.md`),
|
|
45
|
+
- any `require(...)`/import of a removed SDK path.
|
|
46
|
+
For a code rewrite, scaffold the edit with `scripts/lib/migration/codemod-gen.cjs` (Phase 39.1) —
|
|
47
|
+
you emit the change as a reviewable patch, you do not run a codemod engine.
|
|
48
|
+
4. **Preview.** Print a unified-diff-style preview per file: `Old → New`, the registry status
|
|
49
|
+
(`deprecated` vs `removed`), and the migration hint. If `--dry-run`, stop here.
|
|
50
|
+
5. **Confirm + apply.** Without `--yes`, ask per change. With `--yes`, apply all. Use `Write` to make
|
|
51
|
+
the edits; never touch a file the user didn't consent to.
|
|
52
|
+
6. **Report.** Summarize: files changed, references rewritten, and any `removed`-status reference that
|
|
53
|
+
still has no replacement wired (flag it loudly — that one breaks at the installed version).
|
|
54
|
+
|
|
55
|
+
## Boundaries
|
|
56
|
+
|
|
57
|
+
- **Preview-first.** Nothing changes before you've shown the diff (or `--yes` was passed).
|
|
58
|
+
- Migrates **this project's references** to GDD paths — it does not rewrite GDD's own source, and it
|
|
59
|
+
never performs a downgrade (reverse migrations are out of scope).
|
|
60
|
+
- Read the registry; never invent a migration that isn't in `reference/DEPRECATIONS.md`.
|
|
61
|
+
|
|
62
|
+
## Record
|
|
63
|
+
|
|
64
|
+
Print a `## Migration summary` (version, actionable entries, files changed, unresolved `removed`
|
|
65
|
+
references) and append one JSONL line to `.design/intel/insights.jsonl` recording the migration run.
|
|
66
|
+
Close with:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
## MIGRATE COMPLETE
|
|
70
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-new-cycle
|
|
3
|
+
description: "Start a new design cycle. Creates cycle scope in STATE.md, initializes .design/CYCLES.md entry. Each cycle has its own goal and tracks its own decisions/tasks/pipeline runs."
|
|
4
|
+
argument-hint: "[<goal>]"
|
|
5
|
+
tools: Read, Write, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /gdd:new-cycle
|
|
9
|
+
|
|
10
|
+
The cycle is the hierarchical unit above individual pipeline runs: **Cycle > Pipeline run > Wave > Task**. Each cycle has a goal, tracks its own decisions, and can span many pipeline runs. See `./milestone-completeness-rubric.md` §"Cycle level" for what counts as cycle completion (used by `/gdd:complete-cycle` to close the cycle).
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. Read `.design/STATE.md`. If `cycle:` field is populated and no `complete` flag, ask: "Cycle <N> is active. End it first with `/gdd:complete-cycle`?" Abort if user declines.
|
|
15
|
+
2. If no goal was passed as an argument, ask (AskUserQuestion): "What is the goal for this design cycle? (e.g., 'Redesign the checkout flow', 'Improve dashboard accessibility')"
|
|
16
|
+
3. Generate cycle ID: read `.design/CYCLES.md` if present, find the max `cycle-N`, increment. If CYCLES.md is missing, start at `cycle-1`.
|
|
17
|
+
4. Update `.design/STATE.md` frontmatter: set `cycle: cycle-N`.
|
|
18
|
+
5. Create or append to `.design/CYCLES.md`:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
## cycle-N: <goal>
|
|
22
|
+
**Started**: <date>
|
|
23
|
+
**Status**: active
|
|
24
|
+
**Goal**: <goal>
|
|
25
|
+
**Pipeline runs**: 0
|
|
26
|
+
**Decisions made**: 0
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
6. Reset the `<decisions>` section in STATE.md for the new cycle. Preserve prior decisions by prepending a comment marker `<!-- prior cycle decisions archived in CYCLES.md -->`.
|
|
30
|
+
7. Print: "Cycle cycle-N started. Run `@get-design-done brief` or `@get-design-done explore` to begin."
|
|
31
|
+
|
|
32
|
+
## Do Not
|
|
33
|
+
|
|
34
|
+
- Do not archive prior artifacts here — that's `/gdd:complete-cycle`.
|
|
35
|
+
- Do not overwrite the existing CYCLES.md — append only.
|
|
36
|
+
|
|
37
|
+
## NEW-CYCLE COMPLETE
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: milestone-completeness-rubric
|
|
3
|
+
type: heuristic
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
phase: 28.5
|
|
6
|
+
tags: [milestone, closeout, rubric, completion, turn-closeout, new-cycle, complete-cycle]
|
|
7
|
+
last_updated: 2026-05-18
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Milestone Completeness Rubric
|
|
11
|
+
|
|
12
|
+
What "complete" means at each layer of the gdd lifecycle. Used by `skills/turn-closeout/`,
|
|
13
|
+
`skills/new-cycle/`, `skills/complete-cycle/`, the phase closeout discipline (Plan -12 of
|
|
14
|
+
every phase), and the cycle wrap-up flow. Centralized here so the rubric stays consistent
|
|
15
|
+
across consumers and updates land in one place rather than fanning out across N skills.
|
|
16
|
+
|
|
17
|
+
## Layers
|
|
18
|
+
|
|
19
|
+
The lifecycle has four nested layers. A layer is complete only when EVERY criterion at
|
|
20
|
+
that layer is satisfied. Layers above can only flip complete when every layer below has
|
|
21
|
+
flipped complete first — closeout walks bottom-up.
|
|
22
|
+
|
|
23
|
+
### Task level
|
|
24
|
+
|
|
25
|
+
The smallest unit of work — one row in a PLAN.md `<tasks>` list.
|
|
26
|
+
|
|
27
|
+
- Verify command runs with exit 0 (the `<verify>` block's command).
|
|
28
|
+
- The `<done>` criterion is observable (the file exists, the test passes, the output
|
|
29
|
+
matches the contract).
|
|
30
|
+
- If the task is `tdd="true"`: tests pass after the GREEN step; tests fail before it.
|
|
31
|
+
- File diff is scoped to the declared `files_modified` only — no collateral damage.
|
|
32
|
+
- A single commit per task in conventional form `{type}({phase}-{plan}): {description}`.
|
|
33
|
+
- Deviations (Rules 1, 2, 3) tracked for the SUMMARY.md "Deviations" section.
|
|
34
|
+
|
|
35
|
+
### Plan level
|
|
36
|
+
|
|
37
|
+
A self-contained chunk of work — one `XX-YY-PLAN.md`.
|
|
38
|
+
|
|
39
|
+
- All tasks complete (per task level above).
|
|
40
|
+
- Plan-level validator passes (e.g. `validate-skill-length.cjs` for Phase 28.5 buckets;
|
|
41
|
+
`validate-frontmatter.ts` for agent-frontmatter plans).
|
|
42
|
+
- SUMMARY.md written at `.planning/phases/XX-name/XX-YY-SUMMARY.md` with the canonical
|
|
43
|
+
shape: deviations, files-modified table, commits, verification result, decisions.
|
|
44
|
+
- No collateral damage outside the plan's declared `files_modified` list — out-of-scope
|
|
45
|
+
edits are forbidden (executor Rule 5 boundary).
|
|
46
|
+
- A final docs commit aggregates `SUMMARY.md`, `STATE.md`, `ROADMAP.md`, and
|
|
47
|
+
`REQUIREMENTS.md` updates.
|
|
48
|
+
|
|
49
|
+
### Phase level
|
|
50
|
+
|
|
51
|
+
A coherent batch of plans — one `XX-name/` directory under `.planning/phases/`.
|
|
52
|
+
|
|
53
|
+
- All plans complete (per plan level above).
|
|
54
|
+
- Phase-level verification ALL pass (`<verification>` block in each PLAN.md).
|
|
55
|
+
- ROADMAP.md flipped `[ ]` → `[x]` for all plans in this phase (rule #14: scoped flip
|
|
56
|
+
only — never flip plans outside this phase).
|
|
57
|
+
- Phase SUMMARY ladder coherent — each `XX-YY-SUMMARY.md` exists and reads top-to-bottom
|
|
58
|
+
as a single story.
|
|
59
|
+
- All decisions surfaced through the SUMMARY frontmatter and rolled up into STATE.md's
|
|
60
|
+
`<decisions>` block.
|
|
61
|
+
|
|
62
|
+
### Cycle level
|
|
63
|
+
|
|
64
|
+
A shipping milestone — typically one minor version bump in the gdd project.
|
|
65
|
+
|
|
66
|
+
- All phases for the cycle's target version complete (per phase level above).
|
|
67
|
+
- 4 manifests version-aligned: `plugin.json`, `marketplace.json`, `package.json`, and
|
|
68
|
+
the phase-20 manifests-version baseline (`test-fixture/baselines/phase-XX/manifests-version.txt`).
|
|
69
|
+
- CHANGELOG.md entry written for the new version with one block per phase.
|
|
70
|
+
- Off-cadence registration if applicable — `tests/semver-compare.test.cjs` adds
|
|
71
|
+
`OFF_CADENCE_VERSIONS.add('<version>')` for `.5`/`.6`/`.7` insertion-style versions.
|
|
72
|
+
- Regression baseline at `test-fixture/baselines/phase-XX/` exists and the
|
|
73
|
+
`tests/phase-XX-baseline.test.cjs` suite passes (version-agnostic — reads
|
|
74
|
+
`package.json#version`).
|
|
75
|
+
- NOTICE attribution updated if any third-party content was adopted in this cycle.
|
|
76
|
+
- Closeout plan's scoped ROADMAP flip touches only this cycle's checkboxes (precedent:
|
|
77
|
+
Phase 28 closeout flipped exactly 7 inline + 1 overview entry).
|
|
78
|
+
|
|
79
|
+
## Cross-references
|
|
80
|
+
|
|
81
|
+
- `./STATE-TEMPLATE.md` — STATE.md schema; closeout updates the `<position>` block's
|
|
82
|
+
`last_checkpoint` field.
|
|
83
|
+
- `../skills/turn-closeout/SKILL.md` — consumer at the turn boundary (within a stage).
|
|
84
|
+
- `../skills/new-cycle/SKILL.md` — consumer at cycle ingress.
|
|
85
|
+
- `../skills/complete-cycle/SKILL.md` — consumer at cycle egress.
|
|
86
|
+
- `../skills/quality-gate/SKILL.md` — Stage 4.5 gate that gates the plan-level "verify
|
|
87
|
+
command runs with exit 0" criterion when project tooling exists.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-new-project
|
|
3
|
+
description: "Initialize a new get-design-done project. Gathers project context, creates PROJECT.md and STATE.md, initializes first cycle. Run once per project before any pipeline stage."
|
|
4
|
+
argument-hint: "[--name <project-name>]"
|
|
5
|
+
tools: Read, Write, AskUserQuestion, Bash, Glob
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /gdd:new-project
|
|
9
|
+
|
|
10
|
+
One-time project initialization. Replaces "run scan cold" by gathering context up front and producing PROJECT.md + STATE.md + cycle-1.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. **Existing check**: If `.design/STATE.md` exists, ask (AskUserQuestion): "Project already initialized. Re-initialize? (This does not delete existing work.)" Abort if declined.
|
|
15
|
+
2. **Create directory**: `mkdir -p .design` via Bash.
|
|
16
|
+
3. **Auto-detect from codebase** (do this before asking):
|
|
17
|
+
- Read `package.json` for framework (React/Next.js/Vue/SvelteKit/etc.).
|
|
18
|
+
- Glob for `tailwind.config.*`, `components/`, `src/`, `shadcn.json` to guess the design system.
|
|
19
|
+
- Use directory name as default project name.
|
|
20
|
+
4. **Gather context** (AskUserQuestion, one at a time, pre-filled with detected values):
|
|
21
|
+
- Project name
|
|
22
|
+
- Project type (framework)
|
|
23
|
+
- Main design goal
|
|
24
|
+
- Primary user
|
|
25
|
+
- Design system / component library
|
|
26
|
+
5. **Write `.design/PROJECT.md`**:
|
|
27
|
+
```markdown
|
|
28
|
+
# Project: <name>
|
|
29
|
+
**Type**: <framework>
|
|
30
|
+
**Design system**: <system>
|
|
31
|
+
**Main goal**: <goal>
|
|
32
|
+
**Primary user**: <user>
|
|
33
|
+
**Initialized**: <date>
|
|
34
|
+
```
|
|
35
|
+
6. **Initialize STATE.md**: Copy from `reference/STATE-TEMPLATE.md`, fill in project name, set stage to `brief`, cycle to `cycle-1`.
|
|
36
|
+
7. **Create `.design/config.json`** with defaults from `reference/config-schema.md`.
|
|
37
|
+
8. **Initialize first cycle**: Write `.design/CYCLES.md` with a `cycle-1` entry (goal copied from PROJECT.md main goal, status `active`).
|
|
38
|
+
9. **Seed project-local skills directory**: Create `./.claude/skills/` and write `./.claude/skills/README.md`:
|
|
39
|
+
```markdown
|
|
40
|
+
# Project-Local Skills
|
|
41
|
+
|
|
42
|
+
Auto-loaded by gdd pipeline stages. See `reference/project-skills-guide.md` in the plugin.
|
|
43
|
+
Files named `design-*-conventions.md` are read by explore/plan/design.
|
|
44
|
+
Populated by `/gdd:sketch-wrap-up` and manual edits.
|
|
45
|
+
```
|
|
46
|
+
10. Print: "Project initialized. Run `/gdd:brief` to capture your design problem, or `/gdd:explore` to scan directly. Run `/gdd:connections` to wire up optional integrations (Figma, Storybook, Chromatic, etc.)."
|
|
47
|
+
|
|
48
|
+
## Do Not
|
|
49
|
+
|
|
50
|
+
- Do not delete or overwrite existing `.design/` artifacts if re-initializing.
|
|
51
|
+
- Do not run any pipeline stage automatically — this is init only.
|
|
52
|
+
|
|
53
|
+
## NEW-PROJECT 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 `/gdd: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 `/gdd: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 `/gdd:new-cycle` for next cycle or `/gdd: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
|
+
# /gdd: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 `/gdd: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 — /gdd: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 `/gdd: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
|
+
# /gdd: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 `/gdd: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 `/gdd: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. `/gdd: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 /gdd:* 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`.
|