@hegemonart/get-design-done 1.28.0 → 1.28.6

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.
Files changed (98) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +134 -0
  4. package/SKILL.md +1 -1
  5. package/hooks/gdd-decision-injector.js +149 -3
  6. package/package.json +1 -1
  7. package/reference/adr-format.md +96 -0
  8. package/reference/architecture-vocabulary.md +102 -0
  9. package/reference/context-md-format.md +106 -0
  10. package/reference/heuristics.md +84 -0
  11. package/reference/registry.json +29 -1
  12. package/reference/registry.schema.json +1 -1
  13. package/reference/shared-preamble.md +78 -6
  14. package/reference/skill-authoring-contract.md +159 -0
  15. package/scripts/validate-skill-length.cjs +283 -0
  16. package/skills/add-backlog/SKILL.md +1 -0
  17. package/skills/analyze-dependencies/SKILL.md +33 -122
  18. package/skills/apply-reflections/SKILL.md +1 -40
  19. package/skills/apply-reflections/apply-reflections-procedure.md +68 -0
  20. package/skills/audit/SKILL.md +3 -1
  21. package/skills/bandit-status/SKILL.md +31 -66
  22. package/skills/benchmark/SKILL.md +15 -55
  23. package/skills/brief/SKILL.md +12 -1
  24. package/skills/cache-manager/SKILL.md +3 -57
  25. package/skills/cache-manager/cache-policy.md +126 -0
  26. package/skills/check-update/SKILL.md +38 -75
  27. package/skills/compare/SKILL.md +29 -269
  28. package/skills/compare/compare-rubric.md +171 -0
  29. package/skills/complete-cycle/SKILL.md +1 -1
  30. package/skills/connections/SKILL.md +21 -427
  31. package/skills/connections/connections-onboarding.md +417 -0
  32. package/skills/continue/SKILL.md +1 -0
  33. package/skills/darkmode/SKILL.md +32 -287
  34. package/skills/darkmode/darkmode-audit-procedure.md +258 -0
  35. package/skills/debug/SKILL.md +11 -8
  36. package/skills/debug/debug-feedback-loops.md +119 -0
  37. package/skills/design/SKILL.md +27 -245
  38. package/skills/design/design-procedure.md +304 -0
  39. package/skills/discover/SKILL.md +26 -133
  40. package/skills/discover/discover-procedure.md +204 -0
  41. package/skills/discuss/SKILL.md +18 -2
  42. package/skills/explore/SKILL.md +40 -205
  43. package/skills/explore/explore-procedure.md +267 -0
  44. package/skills/fast/SKILL.md +1 -0
  45. package/skills/figma-write/SKILL.md +2 -2
  46. package/skills/health/SKILL.md +11 -33
  47. package/skills/health/health-mcp-detection.md +44 -0
  48. package/skills/health/health-skill-length-report.md +69 -0
  49. package/skills/help/SKILL.md +1 -0
  50. package/skills/list-assumptions/SKILL.md +1 -0
  51. package/skills/map/SKILL.md +8 -31
  52. package/skills/new-cycle/SKILL.md +3 -1
  53. package/skills/new-cycle/milestone-completeness-rubric.md +87 -0
  54. package/skills/next/SKILL.md +1 -0
  55. package/skills/note/SKILL.md +1 -0
  56. package/skills/optimize/SKILL.md +21 -44
  57. package/skills/pause/SKILL.md +1 -0
  58. package/skills/peer-cli-add/SKILL.md +26 -108
  59. package/skills/peer-cli-add/peer-cli-protocol.md +161 -0
  60. package/skills/peer-cli-customize/SKILL.md +22 -42
  61. package/skills/peers/SKILL.md +33 -57
  62. package/skills/plan/SKILL.md +33 -220
  63. package/skills/plan/plan-procedure.md +278 -0
  64. package/skills/plant-seed/SKILL.md +1 -0
  65. package/skills/pr-branch/SKILL.md +1 -0
  66. package/skills/progress/SKILL.md +1 -7
  67. package/skills/quality-gate/SKILL.md +34 -166
  68. package/skills/quality-gate/threat-modeling.md +101 -0
  69. package/skills/quick/SKILL.md +1 -0
  70. package/skills/reapply-patches/SKILL.md +1 -0
  71. package/skills/recall/SKILL.md +1 -0
  72. package/skills/resume/SKILL.md +1 -0
  73. package/skills/review-backlog/SKILL.md +1 -0
  74. package/skills/router/SKILL.md +3 -59
  75. package/skills/router/router-rules.md +84 -0
  76. package/skills/scan/SKILL.md +36 -675
  77. package/skills/scan/scan-procedure.md +731 -0
  78. package/skills/settings/SKILL.md +1 -0
  79. package/skills/ship/SKILL.md +1 -0
  80. package/skills/sketch/SKILL.md +1 -1
  81. package/skills/sketch-wrap-up/SKILL.md +13 -54
  82. package/skills/spike/SKILL.md +1 -1
  83. package/skills/spike-wrap-up/SKILL.md +12 -46
  84. package/skills/start/SKILL.md +13 -112
  85. package/skills/start/start-procedure.md +115 -0
  86. package/skills/stats/SKILL.md +1 -0
  87. package/skills/style/SKILL.md +18 -140
  88. package/skills/style/style-doc-procedure.md +150 -0
  89. package/skills/synthesize/SKILL.md +1 -0
  90. package/skills/timeline/SKILL.md +1 -0
  91. package/skills/todo/SKILL.md +1 -0
  92. package/skills/turn-closeout/SKILL.md +36 -56
  93. package/skills/undo/SKILL.md +1 -0
  94. package/skills/update/SKILL.md +1 -0
  95. package/skills/verify/SKILL.md +42 -457
  96. package/skills/verify/verify-procedure.md +512 -0
  97. package/skills/warm-cache/SKILL.md +3 -35
  98. package/skills/zoom-out/SKILL.md +26 -0
@@ -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.
@@ -2,6 +2,7 @@
2
2
  name: gdd-next
3
3
  description: "Routes to the next pipeline stage based on current STATE.md position"
4
4
  tools: Read, Write, mcp__gdd_status, mcp__gdd_phase_current, mcp__gdd_plans_list
5
+ disable-model-invocation: true
5
6
  ---
6
7
 
7
8
  # Get Design Done — Next
@@ -3,6 +3,7 @@ name: gdd-note
3
3
  description: "Zero-friction idea capture during any stage. Appends to .design/NOTES.md. Subcommands: add, list, promote."
4
4
  argument-hint: "<add|list|promote> [text|line-number]"
5
5
  tools: Read, Write
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  # /gdd:note
@@ -10,61 +10,42 @@ tools: Read, Bash, Grep, Write
10
10
 
11
11
  ## Role
12
12
 
13
- You are the optimization advisor. You read the telemetry ledger (`.design/telemetry/costs.jsonl`) and the per-agent metrics aggregate (`.design/agent-metrics.json`), apply a fixed set of rule-based heuristics, and emit recommendations to `.design/OPTIMIZE-RECOMMENDATIONS.md`. You never modify agent files, budget config, or cache state. Your output is a markdown table of proposals the user reviews manually, mirroring the Phase 11 `/gdd:apply-reflections` discipline.
14
-
15
- This skill is **advisory only**. It never edits `agents/*.md`, `.design/budget.json`, `.design/cache-manifest.json`, or any other configuration. The skill never makes model calls — every rule is deterministic.
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.
16
14
 
17
15
  ## Refresh Step
18
16
 
19
- Before analysis, invoke the aggregator to ensure metrics are current:
17
+ Before analysis, invoke the aggregator:
20
18
 
21
19
  ```bash
22
20
  node --experimental-strip-types scripts/aggregate-agent-metrics.ts
23
21
  ```
24
22
 
25
- This is idempotent. If `--refresh` flag is absent and `.design/agent-metrics.json` was generated within the last 60 seconds, the skill may skip this step.
23
+ Idempotent. If `--refresh` absent and `.design/agent-metrics.json` generated within 60s, skip.
26
24
 
27
25
  ## Inputs
28
26
 
29
- - `.design/telemetry/costs.jsonl` — append-only; skill reads tail. Tolerant of malformed lines.
30
- - `.design/agent-metrics.json` — per-agent aggregate produced by `scripts/aggregate-agent-metrics.ts`. Source of truth for `cache_hit_rate`, `lazy_skip_rate`, `total_cost_usd`, `total_spawns`.
31
- - `agents/*.md` — frontmatter cross-reference when checking tier override churn + typical-duration drift.
32
- - `.design/budget.json` — `tier_overrides` table for cross-check (optional; proceed if missing).
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).
33
31
 
34
32
  ## Optional Arguments
35
33
 
36
34
  - `--refresh` — force aggregator refresh even if metrics file is fresh.
37
- - `--min-spawns=N` — only emit recommendations for agents with ≥ N spawns (default: 5; raise for high-traffic projects to suppress noise).
35
+ - `--min-spawns=N` — only emit recommendations for agents with ≥ N spawns (default 5).
38
36
 
39
37
  ## Rules
40
38
 
41
- Rule-based analysis, applied in this order. Each rule inspects per-agent aggregates and emits zero or more rows to the recommendations table.
42
-
43
- **Rule R1 — Low cache hit rate.**
44
- > IF an agent has `total_spawns >= --min-spawns` AND `cache_hit_rate < 0.20`
45
- > THEN emit: `"Consider batching tasks for agent {agent} — cache hit rate is {rate*100}%. Investigate cache-aligned ordering (see reference/shared-preamble.md) and whether input paths can be normalized."`
46
- > PROPOSED: Batch similar tasks; confirm shared-preamble import ordering.
47
-
48
- **Rule R2 — Expensive and rarely lazy-skipped.**
49
- > IF an agent has `total_cost_usd > 0.50` AND `lazy_skip_rate < 0.10`
50
- > THEN emit: `"Agent {agent} is expensive (${cost}) and rarely skipped ({rate*100}% lazy-skip). Consider adding a lazy gate heuristic at agents/{agent}-gate.md (see plan 10.1-04 pattern)."`
51
- > PROPOSED: Add lazy-gate agent.
39
+ Rule-based analysis. Full thresholds + emission templates in `./reference/heuristics.md` §"Optimization rules"; here, the short rule catalog:
52
40
 
53
- **Rule R3 Tier override churn.**
54
- > IF for multiple telemetry rows an agent's recorded `tier` differs from its frontmatter `default-tier` (e.g., frontmatter says `opus` but measured rows consistently show `haiku` from budget.json override or soft-threshold downgrade)
55
- > THEN emit: `"Tier override churn detected for {agent}: frontmatter says {frontmatter-tier} but measured tier is {measured-tier} in {N} of last {M} rows. Consider updating frontmatter default-tier or removing the budget.json override."`
56
- > PROPOSED: Update frontmatter default-tier OR prune budget.json tier_overrides entry.
57
-
58
- **Rule R4 — Typical duration drift.**
59
- > IF measured `typical_duration_seconds` (computed as average wall-clock duration from telemetry `ts` deltas when paired spawn/complete rows exist; fall back to frontmatter value if pairing unavailable in v1) differs from frontmatter `typical-duration-seconds` by more than 50%
60
- > THEN emit: `"Typical duration for {agent} has drifted: frontmatter {old}s vs measured {new}s ({delta_pct}% drift). Update frontmatter typical-duration-seconds: {new}."`
61
- > PROPOSED: Edit agents/{agent}.md frontmatter.
62
-
63
- (Note: v1 only computes wall-clock duration if the telemetry ledger carries both spawn and complete rows with matching correlation IDs. If it doesn't — 10.1's PreToolUse-only writer doesn't — Rule R4 flags "insufficient data" for affected agents rather than emitting a false proposal. Phase 11 reflector can add a PostToolUse writer to close this gap; out of 10.1 scope.)
41
+ - **R1Low 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".)
64
45
 
65
46
  ## Output Format
66
47
 
67
- Write `.design/OPTIMIZE-RECOMMENDATIONS.md` with this exact structure:
48
+ Write `.design/OPTIMIZE-RECOMMENDATIONS.md`:
68
49
 
69
50
  ```markdown
70
51
  # Optimization Recommendations
@@ -80,9 +61,7 @@ Write `.design/OPTIMIZE-RECOMMENDATIONS.md` with this exact structure:
80
61
 
81
62
  | Rule | Agent | Current | Proposed | Rationale |
82
63
  |------|-------|---------|----------|-----------|
83
- | R1 | design-verifier | cache_hit_rate: 8% | Batch tasks; audit shared-preamble ordering | Low cache reuse; likely causing 3× cost on repeated calls |
84
- | R2 | design-planner | $1.23 cost, 2% lazy-skip | Add agents/design-planner-gate.md | High spend with minimal gating |
85
- | R3 | design-verifier | frontmatter opus / measured haiku (9/12 rows) | Update frontmatter default-tier: haiku | budget.json overrides are effectively permanent |
64
+ | R1 | ... | ... | ... | ... |
86
65
 
87
66
  ## Summary
88
67
 
@@ -94,17 +73,15 @@ Write `.design/OPTIMIZE-RECOMMENDATIONS.md` with this exact structure:
94
73
  ## OPTIMIZE COMPLETE
95
74
  ```
96
75
 
97
- The `## OPTIMIZE COMPLETE` marker is the completion sentinel — automated graders and downstream tools detect completion by grepping for this exact line.
76
+ The `## OPTIMIZE COMPLETE` marker is the completion sentinel.
98
77
 
99
78
  ## No Auto-Apply
100
79
 
101
- This skill **never modifies** `agents/*.md`, `.design/budget.json`, `.design/cache-manifest.json`, or any other configuration. It **never auto-applies** proposals. It only writes `.design/OPTIMIZE-RECOMMENDATIONS.md`. If the user wants to act on a proposal, they do so manually (or via a future Phase 12 command that cross-references these proposals).
102
-
103
- The discipline mirrors `/gdd:apply-reflections` from Phase 11: advisory output, user review, manual application.
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.
104
81
 
105
82
  ## Integration with Phase 11 Reflector
106
83
 
107
- The Phase 11 reflector (`agents/design-reflector.md`) reads both `costs.jsonl` and `agent-metrics.json` on its own cadence. `/gdd:optimize` is the user-facing advisor; the reflector is the automation-facing one. Both output to different files (`.design/OPTIMIZE-RECOMMENDATIONS.md` vs `.design/reflections/*.md`) and never collide.
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.
108
85
 
109
86
  ## Non-Goals
110
87
 
@@ -115,6 +92,6 @@ The Phase 11 reflector (`agents/design-reflector.md`) reads both `costs.jsonl` a
115
92
 
116
93
  ## Failure Modes
117
94
 
118
- - Missing `.design/telemetry/costs.jsonl` → emit a single line `"No telemetry data yet — run one or more /gdd:* commands to accumulate data, then retry."` and still write the `## OPTIMIZE COMPLETE` marker.
119
- - Missing `.design/agent-metrics.json` after refresh → emit `"Aggregator failed — check \`node --experimental-strip-types scripts/aggregate-agent-metrics.ts\` output manually."`.
120
- - Zero rules matched → still write the recommendations file with `"No recommendations — all agents within healthy thresholds."` and the `## OPTIMIZE COMPLETE` marker.
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`.
@@ -3,6 +3,7 @@ name: gdd-pause
3
3
  description: "Write a numbered checkpoint so work can resume in a new session without re-running completed stages."
4
4
  argument-hint: "[context note]"
5
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
6
7
  ---
7
8
 
8
9
  @reference/retrieval-contract.md
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: peer-cli-add
3
- description: "Guided ladder for adding a brand-new peer (a peer not in the v1.27 capability matrix) to the gdd peer-CLI delegation layer. Verification ladder + adapter scaffolding + capability-matrix update + Windows quirks documented. Run when you discover a new peer CLI you want gdd to delegate to."
3
+ description: "Guided ladder for adding a brand-new peer (not in the v1.27 capability matrix) to gdd's peer-CLI delegation layer. Walks the verification ladder, scaffolds an adapter, updates the capability matrix, and handles Windows quirks. Run when you discover a new peer CLI you want gdd to delegate to."
4
4
  argument-hint: "<new-peer-id> <peer-binary> <protocol: acp|asp>"
5
5
  tools: Read, Edit, Write, Bash, Grep
6
6
  ---
@@ -11,118 +11,49 @@ tools: Read, Edit, Write, Bash, Grep
11
11
 
12
12
  ## Role
13
13
 
14
- You add a brand-new peer-CLI to gdd's delegation layer. v1.27.0 ships 5 peers (codex, gemini, cursor, copilot, qwen). When the user wants a 6th — a peer that exists in the wild but isn't in our capability matrix yet they run this skill. It walks them through a verification ladder (does the peer actually speak ACP or ASP?) and produces the 3-file footprint that integrates the peer cleanly.
14
+ You add a brand-new peer-CLI to gdd's delegation layer. v1.27.0 ships 5 peers (codex, gemini, cursor, copilot, qwen). When the user wants a 6th — a peer that exists in the wild but isn't in our capability matrix — you walk them through the verification ladder and produce the 3-file footprint that integrates the peer cleanly. The procedural ladder, adapter scaffold shape, and verification gate live in `./peer-cli-protocol.md`.
15
15
 
16
16
  ## Invocation Contract
17
17
 
18
- - **Required input**: `<new-peer-id>` (lowercase identifier, e.g., `aider`), `<peer-binary>` (the executable name, e.g., `aider` or `aider.cmd`), `<protocol>` (`acp` or `asp`).
19
- - **Output**: a 3-file diff + a verification report.
18
+ - **Required input:** `<new-peer-id>` (lowercase, e.g. `aider`), `<peer-binary>` (executable, e.g. `aider` or `aider.cmd`), `<protocol>` (`acp` or `asp`).
19
+ - **Output:** a 3-file diff + a verification report.
20
20
 
21
21
  ## Procedure
22
22
 
23
23
  ### Step 1 — Verification ladder (no edits yet)
24
24
 
25
- Before touching any code, confirm the peer actually speaks the protocol it claims.
25
+ Walk the four-rung ladder in `./peer-cli-protocol.md` §"Verification ladder":
26
26
 
27
- #### 1a. Binary on PATH
27
+ 1. Binary on PATH (`which` / `where`).
28
+ 2. Handshake test (`initialize` JSON-RPC over stdin; capture reply).
29
+ 3. Model-ID `-preview`-suffix trap (capture model list).
30
+ 4. Windows quirks (confirm `spawn-cmd.cjs` picks up `.cmd`).
28
31
 
29
- `which <peer-binary>` (POSIX) or `where <peer-binary>` (Windows). If exit non-zero, stop and ask user to install the peer first.
30
-
31
- #### 1b. Handshake test
32
-
33
- Spawn the peer with the appropriate protocol entry point:
34
- - ACP peers: `<peer-binary> acp` (or whatever the peer documents as its ACP entry — Gemini uses `gemini acp`; some peers use a flag).
35
- - ASP peers: `<peer-binary> app-server` (Codex's convention; other ASP peers may differ).
36
-
37
- Send an `initialize` JSON-RPC message over stdin with `protocolVersion: '2025-06-18'` (ACP) or `service_name: 'gdd_peer_delegation'` (ASP).
38
-
39
- Capture the reply on stdout. If the reply is a valid JSON-RPC response with `result.protocolVersion` (ACP) or `result.threadId` (ASP), the peer speaks the protocol.
40
-
41
- If no valid reply within 5 seconds, the peer either doesn't speak this protocol or uses a non-standard entry point. Stop and ask the user for the correct invocation.
42
-
43
- #### 1c. Model-ID `-preview`-suffix trap
44
-
45
- Many peers expose preview models with a `-preview` suffix (e.g., `gpt-5-preview` vs `gpt-5`). The suffix drifts: today's preview is tomorrow's GA. Capture the peer's current model list (most peers expose `<peer-binary> models` or similar). Note any model that has `-preview` in its name and document the parent name in the new entry's `provider_model_id` field — so the runtime-models.md entry can survive the suffix flipping.
46
-
47
- #### 1d. Windows quirks
48
-
49
- If the peer-binary ends in `.cmd` and the user is on Windows, confirm the spawn-cmd shell-escape logic from `scripts/lib/peer-cli/spawn-cmd.cjs` will pick it up (it should — that module already handles `.cmd` detection per Plan 27-03 / D-04). Document any other Windows-specific quirks in the new adapter's leading comment.
32
+ Stop at the first failing rung. Do not proceed to scaffold a broken adapter.
50
33
 
51
34
  ### Step 2 — Generate the adapter scaffold
52
35
 
53
- Use the existing 5 adapters at `scripts/lib/peer-cli/adapters/{codex,gemini,cursor,copilot,qwen}.cjs` as templates. Pick the closest match to your new peer's protocol (ASP if `<protocol> = asp`, otherwise ACP).
36
+ Copy one of `scripts/lib/peer-cli/adapters/{codex,gemini,cursor,copilot,qwen}.cjs` as the template (pick by protocol — ASP for `<protocol>=asp`, else ACP). Replace `ROLES_CLAIMED`, `ROLE_PREFIX`, `name`, `protocol` with the user's values from Step 1. The full adapter scaffold shape — `claims`, `dispatch`, exports — lives in `./peer-cli-protocol.md` §"Adapter scaffold shape" so consumers (codex/gemini/cursor/copilot/qwen) stay byte-similar.
54
37
 
55
- Use the `Write` tool to create `scripts/lib/peer-cli/adapters/<new-peer-id>.cjs`:
38
+ Write the result to `scripts/lib/peer-cli/adapters/<new-peer-id>.cjs`.
56
39
 
57
- ```js
58
- 'use strict';
40
+ ### Step 3 — Three-file footprint
59
41
 
60
- const { createAcpClient } = require('../acp-client.cjs');
61
- // OR for ASP peers: const { createAspClient } = require('../asp-client.cjs');
42
+ Per `./peer-cli-protocol.md` §"Three-file footprint":
62
43
 
63
- const ROLES_CLAIMED = ['<role-1>', '<role-2>']; // ASK USER which roles this peer claims
64
- const ROLE_PREFIX = {
65
- '<role-1>': '<prompt prefix or empty string>',
66
- '<role-2>': '<prompt prefix or empty string>',
67
- };
44
+ 1. New adapter at `scripts/lib/peer-cli/adapters/<new-peer-id>.cjs` (Step 2).
45
+ 2. Edit `scripts/lib/install/runtimes.cjs` — add `peerBinary` field (platform-aware: `<peer-binary>.cmd` on Windows, plain on POSIX).
46
+ 3. Edit `reference/peer-cli-capabilities.md` add matrix row + per-peer section citing the Step 1 verification evidence.
47
+ 4. Edit `scripts/lib/peer-cli/registry.cjs` append to `CAPABILITY_MATRIX` (and `KNOWN_PEERS` if separate).
68
48
 
69
- function claims(role) { return ROLES_CLAIMED.includes(role); }
49
+ ### Step 4 Verification gate
70
50
 
71
- async function dispatch({ command, args, cwd, env }, role, text, opts) {
72
- if (!claims(role)) {
73
- throw new Error(`<new-peer-id> does not claim role: ${role}`);
74
- }
75
- const client = createAcpClient({ command, args, cwd, env });
76
- try {
77
- await client.initialize({ protocolVersion: '2025-06-18' });
78
- const prompt = (ROLE_PREFIX[role] || '') + text;
79
- return await client.prompt(prompt, { onNotification: opts?.onNotification });
80
- } finally {
81
- await client.close();
82
- }
83
- }
84
-
85
- module.exports = { claims, dispatch, ROLES_CLAIMED, ROLE_PREFIX, name: '<new-peer-id>', protocol: '<protocol>' };
86
- ```
51
+ Run the four-check gate in `./peer-cli-protocol.md` §"Verification gate": `tsc --noEmit`, peer-cli tests, reference-registry round-trip, frontmatter validator. Any failure — surface error + offer revert.
87
52
 
88
- Replace placeholders with the user's input from Step 1's verification.
89
-
90
- ### Step 3 — Add `peerBinary` to runtimes.cjs
91
-
92
- Edit `scripts/lib/install/runtimes.cjs` to add an entry for the new peer. Mirror the shape of the 5 existing peer entries. Add the `peerBinary` field with platform-aware resolution:
93
-
94
- ```js
95
- {
96
- id: '<new-peer-id>',
97
- // ... existing fields per Phase 24 runtime matrix shape ...
98
- peerBinary: process.platform === 'win32' ? '<peer-binary>.cmd' : '<peer-binary>',
99
- }
100
- ```
101
-
102
- ### Step 4 — Add the capability-matrix entry
103
-
104
- Edit `reference/peer-cli-capabilities.md`. Add a new row to the top capability matrix table AND a new per-peer section. Follow the existing format. Cite the verification evidence from Step 1.
105
-
106
- ### Step 5 — Update the registry capability matrix
107
-
108
- Edit `scripts/lib/peer-cli/registry.cjs`. Add the new peer to the `CAPABILITY_MATRIX` constant (and `KNOWN_PEERS` if that's a separate list). Mirror the shape of the 5 existing entries.
109
-
110
- ### Step 6 — Verify the integration
111
-
112
- Run, in this order, until each passes:
113
-
114
- 1. `npx tsc --noEmit` — clean.
115
- 2. `node --test tests/peer-cli-registry.test.cjs tests/peer-cli-adapters.test.cjs` — no regression on existing tests.
116
- 3. `node --test tests/reference-registry.test.cjs` — capability-matrix doc is in registry.json (if you added it).
117
- 4. `npm run validate:frontmatter` — no agent's `delegate_to:` field is broken by the new entry.
118
-
119
- If any step fails, surface the error and offer to revert the changes.
120
-
121
- ### Step 7 — Surface a 3-file footprint summary
53
+ ### Step 5 Surface the summary
122
54
 
123
55
  ```
124
56
  ## peer-cli-add summary
125
-
126
57
  Added peer: <new-peer-id> (protocol: <protocol>)
127
58
  Roles claimed: <role-1>, <role-2>
128
59
 
@@ -139,31 +70,18 @@ Verification:
139
70
  ✓ frontmatter validator: 0 violations
140
71
 
141
72
  Next steps:
142
- - Run /gdd:peers to confirm the new peer shows up in the capability matrix.
143
- - Run skills/peer-cli-customize/SKILL.md to wire delegate_to: <new-peer-id>-<role> on specific agents.
144
- - Phase 23.5 bandit will need ~5 cycles of data before the posterior surfaces a recommendation for this peer.
73
+ - /gdd:peers to confirm the new peer appears in the matrix.
74
+ - skills/peer-cli-customize/SKILL.md to wire delegate_to: <new-peer-id>-<role> on agents.
75
+ - Phase 23.5 bandit needs ~5 cycles of data before a posterior recommendation surfaces.
145
76
  ```
146
77
 
147
78
  ## Edge cases
148
79
 
149
- - **Peer speaks neither ACP nor ASP** — gdd v1.27 ships only those two protocols. Stop and document the gap in `.design/RESEARCH.md` for a future phase to consider adding a new protocol layer.
150
- - **Peer claims a role no existing peer claims** (e.g., `translate`) — fine, capability matrix is open. But document the role in `reference/peer-cli-capabilities.md` so future peers can compete on it.
151
- - **Peer claims ALL roles** (e.g., a generalist peer) — accept, but flag in the per-peer section. Generalist peers are usually weaker than specialist peers; the bandit will sort it out via measurement.
152
- - **Peer name conflicts with an existing peer-id** — fail. Peer-IDs must be globally unique. Suggest a disambiguating suffix.
153
- - **User wants to add a peer for testing only** — same flow, but suggest committing under a separate branch and not adding to the install-time detection nudge until the peer is production-ready.
154
-
155
- ## Cross-references
156
-
157
- - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05) — capability matrix data.
158
- - `scripts/lib/peer-cli/adapters/*.cjs` (Plan 27-04) — adapter template.
159
- - `scripts/lib/peer-cli/spawn-cmd.cjs` (Plan 27-03) — Windows .cmd handling.
160
- - `reference/peer-cli-capabilities.md` (Plan 27-05) — capability-matrix doc.
161
- - `skills/peer-cli-customize/SKILL.md` — once new peer is added, use customize to wire it on specific agents.
162
- - `.planning/phases/27-peer-cli-delegation/CONTEXT.md` D-02, D-05 — decision lineage.
80
+ See `./peer-cli-protocol.md` §"Edge cases" for: peer speaks neither protocol, claims unknown role, claims all roles (generalist), peer-ID conflicts, and testing-only peers.
163
81
 
164
82
  ## Record
165
83
 
166
- After execution, append one JSONL line to `.design/skill-records.jsonl`:
84
+ Append one JSONL line to `.design/skill-records.jsonl`:
167
85
 
168
86
  ```json
169
87
  {"skill": "peer-cli-add", "ts": "<ISO timestamp>", "new_peer": "<new-peer-id>", "protocol": "<protocol>", "roles_claimed": ["<role-1>"], "verification_passed": true}
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: peer-cli-protocol
3
+ type: heuristic
4
+ version: 1.0.0
5
+ phase: 28.5
6
+ tags: [peer-cli, acp, asp, protocol, verification-ladder, add-peer, customize, cc-multi-cli]
7
+ last_updated: 2026-05-18
8
+ ---
9
+
10
+ <!-- Procedural patterns adapted from greenpolo/cc-multi-cli (Apache 2.0). See ../NOTICE for full attribution. -->
11
+
12
+ # Peer-CLI Protocol — Add + Customize Procedures
13
+
14
+ Procedural reference for the peer-CLI delegation layer. Centralizes the verification
15
+ ladder, adapter scaffolding shape, rewire-discipline, and Windows quirks so the three
16
+ peer-CLI skills (`peers`, `peer-cli-add`, `peer-cli-customize`) can cross-link rather
17
+ than each carry the full procedure inline. See `./peer-protocols.md` for the protocol
18
+ shape (JSON-RPC framing, initialize handshake, error envelope); this file is the
19
+ procedure layer that sits above it.
20
+
21
+ ## Verification ladder (run before any code edit when adding a peer)
22
+
23
+ When a user wants to add a brand-new peer to the capability matrix, walk these four
24
+ rungs in order. Stop at the first rung that fails — do not proceed to scaffold a broken
25
+ adapter.
26
+
27
+ ### Rung 1 — Binary on PATH
28
+
29
+ `which <peer-binary>` (POSIX) or `where <peer-binary>` (Windows). If exit non-zero, stop
30
+ and ask the user to install the peer first. Adapters cannot be tested without the binary.
31
+
32
+ ### Rung 2 — Handshake test
33
+
34
+ Spawn the peer with the protocol entry point:
35
+
36
+ - **ACP peers** — `<peer-binary> acp` (or whatever the peer documents — Gemini uses
37
+ `gemini acp`; some peers use a flag).
38
+ - **ASP peers** — `<peer-binary> app-server` (Codex convention; other ASP peers may
39
+ differ).
40
+
41
+ Send an `initialize` JSON-RPC message over stdin with `protocolVersion: '2025-06-18'`
42
+ (ACP) or `service_name: 'gdd_peer_delegation'` (ASP). Capture the reply on stdout. A
43
+ valid JSON-RPC response with `result.protocolVersion` (ACP) or `result.threadId` (ASP)
44
+ means the peer speaks the protocol. No valid reply within 5 seconds means either
45
+ wrong-protocol or non-standard entry point — stop and ask the user for the correct
46
+ invocation.
47
+
48
+ ### Rung 3 — Model-ID `-preview`-suffix trap
49
+
50
+ Many peers expose preview models with a `-preview` suffix (e.g., `gpt-5-preview` vs
51
+ `gpt-5`). The suffix drifts: today's preview is tomorrow's GA. Capture the peer's model
52
+ list (most peers expose `<peer-binary> models` or similar) and document parent names in
53
+ the new entry's `provider_model_id` field so the runtime-models entry survives the
54
+ suffix flipping.
55
+
56
+ ### Rung 4 — Windows quirks
57
+
58
+ If the peer-binary ends in `.cmd` and the user is on Windows, confirm
59
+ `scripts/lib/peer-cli/spawn-cmd.cjs` will pick it up. That module handles `.cmd`
60
+ detection per Plan 27-03 / D-04. Document any other Windows-specific quirks in the new
61
+ adapter's leading comment.
62
+
63
+ ## Adapter scaffold shape
64
+
65
+ Use the existing five adapters at `../scripts/lib/peer-cli/adapters/{codex,gemini,cursor,copilot,qwen}.cjs`
66
+ as templates. Pick the closest match by protocol (ASP if `<protocol> = asp`, otherwise
67
+ ACP). Each adapter exports:
68
+
69
+ - `claims(role)` — boolean predicate against `ROLES_CLAIMED`.
70
+ - `dispatch({command, args, cwd, env}, role, text, opts)` — async dispatch with optional
71
+ `opts.onNotification` callback.
72
+ - `ROLES_CLAIMED` — array of role identifiers the peer claims.
73
+ - `ROLE_PREFIX` — per-role prompt prefix object (empty string when no prefix needed).
74
+ - `name`, `protocol` — string identifiers.
75
+
76
+ Canonical skeleton (ACP variant; for ASP swap to `createAspClient` from `asp-client.cjs`):
77
+
78
+ ```js
79
+ 'use strict';
80
+ const { createAcpClient } = require('../acp-client.cjs');
81
+
82
+ const ROLES_CLAIMED = ['<role-1>', '<role-2>'];
83
+ const ROLE_PREFIX = { '<role-1>': '', '<role-2>': '' };
84
+
85
+ function claims(role) { return ROLES_CLAIMED.includes(role); }
86
+ async function dispatch({ command, args, cwd, env }, role, text, opts) {
87
+ if (!claims(role)) throw new Error(`<peer-id> does not claim role: ${role}`);
88
+ const client = createAcpClient({ command, args, cwd, env });
89
+ try {
90
+ await client.initialize({ protocolVersion: '2025-06-18' });
91
+ return await client.prompt((ROLE_PREFIX[role] || '') + text, { onNotification: opts?.onNotification });
92
+ } finally { await client.close(); }
93
+ }
94
+ module.exports = { claims, dispatch, ROLES_CLAIMED, ROLE_PREFIX, name: '<peer-id>', protocol: '<protocol>' };
95
+ ```
96
+
97
+ ## Three-file footprint (peer add)
98
+
99
+ A new peer integrates cleanly with a 3-file diff plus the capability-matrix doc:
100
+
101
+ 1. **`scripts/lib/peer-cli/adapters/<new-peer-id>.cjs`** — new adapter.
102
+ 2. **`scripts/lib/install/runtimes.cjs`** — add a `peerBinary` field (platform-aware:
103
+ `<binary>.cmd` on Windows, plain `<binary>` elsewhere).
104
+ 3. **`reference/peer-cli-capabilities.md`** — add a row to the capability matrix and a
105
+ per-peer section with the verification evidence from Rung 1–4 above.
106
+ 4. **`scripts/lib/peer-cli/registry.cjs`** — append to `CAPABILITY_MATRIX` (and
107
+ `KNOWN_PEERS` if separate).
108
+
109
+ ## Rewire discipline (customize)
110
+
111
+ When rewiring `delegate_to:` on a specific agent's frontmatter:
112
+
113
+ - Validate the new value against the capability matrix BEFORE editing the file. The
114
+ peer must exist; the role must be in the peer's `claims` list.
115
+ - Three frontmatter cases: field absent + add it, field present + change it, field
116
+ present + remove it (revert to default).
117
+ - Re-run `npm run validate:frontmatter` after every edit; offer to revert if it fails.
118
+ - The peer must also be in `.design/config.json#peer_cli.enabled_peers` for dispatch
119
+ to fire at runtime — but that's a runtime concern, not a frontmatter validation
120
+ concern.
121
+
122
+ ## Verification gate (after any peer-CLI change)
123
+
124
+ Run, in order, until each passes:
125
+
126
+ 1. `npx tsc --noEmit` — clean.
127
+ 2. `node --test tests/peer-cli-registry.test.cjs tests/peer-cli-adapters.test.cjs` —
128
+ no regression on existing tests.
129
+ 3. `node --test tests/reference-registry.test.cjs` — capability-matrix doc is in
130
+ `reference/registry.json`.
131
+ 4. `npm run validate:frontmatter` — no agent's `delegate_to:` field is broken.
132
+
133
+ Any failure: surface the error and offer to revert.
134
+
135
+ ## Edge cases
136
+
137
+ - **Peer speaks neither ACP nor ASP** — gdd v1.27 ships only those two protocols. Stop
138
+ and document the gap in `.design/RESEARCH.md` for a future phase.
139
+ - **Peer claims a role no existing peer claims** — fine, capability matrix is open. But
140
+ document the role in `peer-cli-capabilities.md` so future peers can compete on it.
141
+ - **Peer claims ALL roles** (generalist) — accept, but flag in the per-peer section.
142
+ Generalist peers are usually weaker than specialist peers; the bandit will sort it
143
+ out via measurement.
144
+ - **Peer-ID collides with an existing peer** — fail. Peer-IDs must be globally unique.
145
+ - **Rewire target peer not in capability matrix** — direct user to `peer-cli-add` first;
146
+ do not allow the frontmatter edit until the peer exists in the matrix.
147
+ - **Rewire target role peer does not claim** — refuse with a list of what the peer DOES
148
+ claim. Suggest a closer match when obvious.
149
+
150
+ ## Cross-references
151
+
152
+ - `./peer-protocols.md` — protocol-level reference (JSON-RPC framing, handshake shape).
153
+ - `./peer-cli-capabilities.md` — capability matrix doc (per-peer claimed roles).
154
+ - `../scripts/lib/peer-cli/registry.cjs` (Plan 27-05) — capability-matrix data source.
155
+ - `../scripts/lib/peer-cli/adapters/*.cjs` (Plan 27-04) — adapter template.
156
+ - `../scripts/lib/peer-cli/spawn-cmd.cjs` (Plan 27-03) — Windows `.cmd` handling.
157
+ - `../scripts/lib/install/runtimes.cjs` (Plan 27-11) — `peerBinary` field per runtime.
158
+ - `../skills/peers/SKILL.md` — discovery surface.
159
+ - `../skills/peer-cli-add/SKILL.md` — add-peer flow.
160
+ - `../skills/peer-cli-customize/SKILL.md` — rewire flow.
161
+ - `../NOTICE` — Apache 2.0 attribution to greenpolo/cc-multi-cli.