@hegemonart/get-design-done 1.26.0 → 1.27.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.
Files changed (33) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +50 -0
  4. package/README.md +10 -8
  5. package/SKILL.md +3 -0
  6. package/agents/README.md +29 -0
  7. package/package.json +1 -1
  8. package/reference/peer-cli-capabilities.md +151 -0
  9. package/reference/peer-protocols.md +266 -0
  10. package/reference/registry.json +14 -0
  11. package/reference/runtime-models.md +3 -3
  12. package/scripts/lib/bandit-router.cjs +214 -7
  13. package/scripts/lib/budget-enforcer.cjs +69 -1
  14. package/scripts/lib/event-stream/index.ts +14 -1
  15. package/scripts/lib/event-stream/types.ts +125 -1
  16. package/scripts/lib/install/runtimes.cjs +58 -0
  17. package/scripts/lib/peer-cli/acp-client.cjs +375 -0
  18. package/scripts/lib/peer-cli/adapters/codex.cjs +101 -0
  19. package/scripts/lib/peer-cli/adapters/copilot.cjs +79 -0
  20. package/scripts/lib/peer-cli/adapters/cursor.cjs +78 -0
  21. package/scripts/lib/peer-cli/adapters/gemini.cjs +81 -0
  22. package/scripts/lib/peer-cli/adapters/qwen.cjs +72 -0
  23. package/scripts/lib/peer-cli/asp-client.cjs +587 -0
  24. package/scripts/lib/peer-cli/broker-lifecycle.cjs +406 -0
  25. package/scripts/lib/peer-cli/registry.cjs +434 -0
  26. package/scripts/lib/peer-cli/spawn-cmd.cjs +149 -0
  27. package/scripts/lib/runtime-detect.cjs +1 -1
  28. package/scripts/lib/session-runner/index.ts +215 -0
  29. package/scripts/lib/session-runner/types.ts +60 -0
  30. package/scripts/validate-frontmatter.ts +159 -1
  31. package/skills/peer-cli-add/SKILL.md +170 -0
  32. package/skills/peer-cli-customize/SKILL.md +110 -0
  33. package/skills/peers/SKILL.md +101 -0
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: peer-cli-customize
3
+ description: "Rewire role→peer mappings on a per-agent basis. File-edit-driven (touches frontmatter delegate_to: per agent), no runtime config layer. Run when you want a specific agent to delegate to a different peer than the default capability-matrix mapping suggests."
4
+ argument-hint: "[<agent-name>] [<new-delegate-target>]"
5
+ tools: Read, Edit, Bash, Grep
6
+ ---
7
+
8
+ <!-- Procedural pattern adapted from greenpolo/cc-multi-cli's `customize` skill (Apache 2.0). See NOTICE for full attribution. -->
9
+
10
+ # peer-cli-customize
11
+
12
+ ## Role
13
+
14
+ You help the user rewire which peer-CLI delegate handles which agent's calls. The mechanism is direct file-edits to agent frontmatter (`delegate_to:` field added in Plan 27-06) — there is no runtime config layer. Your job is to make this safe and validatable.
15
+
16
+ ## Invocation Contract
17
+
18
+ - **Optional input**: agent-name + new delegate target. If absent, the skill runs in interactive discovery mode.
19
+ - **Output**: a diff summary listing each `agents/*.md` file modified, the old vs new `delegate_to:` value, and the validation result.
20
+
21
+ ## Procedure
22
+
23
+ ### Step 1 — Show current state
24
+
25
+ Read the capability matrix from `scripts/lib/peer-cli/registry.cjs#describeCapabilities()`. Surface the 5 peers and their claimed roles to the user.
26
+
27
+ Then scan `agents/*.md` and grep for `delegate_to:` frontmatter values. Render a table:
28
+
29
+ ```
30
+ | Agent | delegate_to (current) |
31
+ |----------------------------|------------------------|
32
+ | design-reflector | none |
33
+ | design-context-checker | (unset) |
34
+ | design-verifier | gemini-research |
35
+ | ... | ... |
36
+ ```
37
+
38
+ ### Step 2 — Confirm rewire intent
39
+
40
+ Either accept the user's explicit `<agent-name> <new-delegate-target>` arguments OR ask: "Which agent do you want to rewire? What should `delegate_to:` become?"
41
+
42
+ Valid `<new-delegate-target>` values:
43
+ - `<peer>-<role>` from the capability matrix (e.g., `gemini-research`, `codex-execute`, `cursor-debug`, `cursor-plan`, `copilot-review`, `copilot-research`, `qwen-write`).
44
+ - `none` (explicit opt-out).
45
+ - Empty / `(unset)` to remove the field entirely (revert to default behavior).
46
+
47
+ ### Step 3 — Validate the proposed rewire
48
+
49
+ Cross-check the new value against the capability matrix:
50
+ 1. The peer must exist in the matrix.
51
+ 2. The role must be in the peer's `claims` list.
52
+ 3. The peer must (eventually, at runtime) be in `.design/config.json#peer_cli.enabled_peers` for dispatch to fire — but that's a runtime concern, not a frontmatter validation concern.
53
+
54
+ If validation fails, surface the error and stop. Do not edit the file.
55
+
56
+ ### Step 4 — Apply the edit
57
+
58
+ Use the `Edit` tool to modify the agent's frontmatter. Three cases:
59
+
60
+ **Case A: Field is absent, user wants to add it.**
61
+ Insert `delegate_to: <new-target>` into the frontmatter block (between the existing `default-tier:` and the next field, or at the end of frontmatter). Preserve YAML formatting.
62
+
63
+ **Case B: Field is present, user wants to change the value.**
64
+ Replace the existing value. If the existing value is `none` and the new value is `<peer>-<role>`, just swap. Mirror the existing indentation.
65
+
66
+ **Case C: Field is present, user wants to remove it.**
67
+ Delete the entire `delegate_to:` line. The field is optional — absence === default behavior.
68
+
69
+ ### Step 5 — Re-validate via the frontmatter validator
70
+
71
+ Run `npm run validate:frontmatter` (or whatever the project's frontmatter check is). Confirm the modified agent passes. If validation fails, surface the error and offer to revert.
72
+
73
+ ### Step 6 — Surface a diff summary
74
+
75
+ Report back:
76
+
77
+ ```
78
+ ## Rewire summary
79
+
80
+ ✓ design-verifier: delegate_to: gemini-research → cursor-debug
81
+ ✓ design-reflector: delegate_to (unset) → codex-execute
82
+
83
+ frontmatter validator: 0 violations (40 files checked)
84
+ next time these agents are spawned, session-runner will dispatch through the new peer.
85
+
86
+ To verify: /gdd:peers (shows updated allowlist + capability matrix).
87
+ ```
88
+
89
+ ## Edge cases
90
+
91
+ - **User asks to rewire to a peer not in the capability matrix** (e.g., a peer they want to add later): direct them to `skills/peer-cli-add/SKILL.md` first; do not allow the frontmatter edit until the peer exists in the matrix.
92
+ - **User asks to rewire to a role the peer doesn't claim** (e.g., `codex-debug` — codex only claims `execute`): refuse with a helpful message listing what the peer DOES claim. Suggest a closer match if obvious.
93
+ - **User asks to rewire ALL agents to a peer at once** (bulk operation): support but require explicit confirmation. Show the diff of all proposed edits before applying.
94
+ - **Validator fails after edit**: revert the edit (re-run `Edit` with the inverse old/new strings). Surface the original error.
95
+
96
+ ## Cross-references
97
+
98
+ - `scripts/validate-frontmatter.ts` (Plan 27-06) — `delegate_to` field validation.
99
+ - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05) — capability matrix.
100
+ - `agents/README.md#peer-cli-delegation-delegate_to` — field documentation.
101
+ - `skills/peer-cli-add/SKILL.md` — for adding a NEW peer (this skill is for rewiring among existing peers).
102
+ - `.planning/phases/27-peer-cli-delegation/CONTEXT.md` D-06 — decision lineage.
103
+
104
+ ## Record
105
+
106
+ After execution, append one JSONL line to `.design/skill-records.jsonl`:
107
+
108
+ ```json
109
+ {"skill": "peer-cli-customize", "ts": "<ISO timestamp>", "agents_rewired": ["design-verifier", "design-reflector"], "validator_passed": true}
110
+ ```
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: gdd-peers
3
+ description: "Discover peer-CLI capability matrix — which of {codex, gemini, cursor, copilot, qwen} are installed, allowlisted in .design/config.json, and (if Phase 23.5 has data) their cost/quality delta vs local. Single command, no flags. Read by users investigating delegation setup."
4
+ argument-hint: ""
5
+ tools: Read, Bash
6
+ ---
7
+
8
+ # gdd-peers
9
+
10
+ ## Role
11
+
12
+ You are a deterministic discovery skill. You do not spawn agents and do not delegate to peers. You read `scripts/lib/install/runtimes.cjs`, `scripts/lib/peer-cli/registry.cjs`, `.design/config.json`, and (optionally) `.design/intel/bandit-posterior.json`, then emit a single Markdown table summarizing peer-CLI status.
13
+
14
+ ## Invocation Contract
15
+
16
+ - **Input**: none. The skill takes no arguments.
17
+ - **Output**: a Markdown capability-matrix table to stdout. No JSON wrapper. The table is the entire output.
18
+
19
+ ## Procedure
20
+
21
+ ### 1. Load runtime matrix
22
+
23
+ Read `scripts/lib/install/runtimes.cjs` and extract the 14 runtime entries. The 5 peer-capable entries (`codex`, `gemini`, `cursor`, `copilot`, `qwen`) carry a `peerBinary?` field (added in Plan 27-11). Collect their IDs and binary paths.
24
+
25
+ ### 2. Load capability matrix
26
+
27
+ Read `scripts/lib/peer-cli/registry.cjs`. The exported `describeCapabilities()` returns the per-peer claimed-roles map. The capability matrix is the source of truth for which roles each peer can take.
28
+
29
+ Use the canonical declared matrix:
30
+
31
+ | Peer | Roles claimed | Protocol |
32
+ |---------|--------------------------|----------|
33
+ | codex | execute | ASP |
34
+ | gemini | research, exploration | ACP |
35
+ | cursor | debug, plan | ACP |
36
+ | copilot | review, research | ACP |
37
+ | qwen | write | ACP |
38
+
39
+ ### 3. Detect installation
40
+
41
+ For each peer, run `which <peerBinary>` (POSIX) or `where <peerBinary>` (Windows). If exit 0 → installed. If exit non-zero → not installed.
42
+
43
+ ### 4. Read allowlist
44
+
45
+ Read `.design/config.json`. The path is `peer_cli.enabled_peers` — an array of peer-IDs. Default: `[]` (empty, opt-in required). If the file or path is missing, treat as empty.
46
+
47
+ ### 5. (Optional) Read posterior win-rate
48
+
49
+ If `.design/intel/bandit-posterior.json` exists, look up the per-peer last-N-cycle delta (cost or correctness, whichever is the bandit's primary signal). For each peer, compute the average reward delta vs the `delegate=none` arm. Render as `-12% cost (last 5 cycles)` or `(no data yet)` when fewer than 3 cycles of evidence exist.
50
+
51
+ If the posterior file does not exist, surface "(no data yet)" for every peer.
52
+
53
+ ### 6. Render the table
54
+
55
+ Emit the table in this exact shape:
56
+
57
+ ```
58
+ ## Peer-CLI Capability Matrix
59
+
60
+ | Peer | Installed | Allowlisted | Claimed roles | Posterior delta vs local |
61
+ |---------|-----------|-------------|--------------------------|--------------------------|
62
+ | codex | ✓ | ✓ | execute | -12% cost (last 5 cycles)|
63
+ | gemini | ✓ | ✓ | research, exploration | -8% |
64
+ | cursor | ✗ | ✗ | debug, plan | (not installed) |
65
+ | copilot | ✓ | ✗ | review, research | (opt-in disabled) |
66
+ | qwen | ✓ | ✓ | write | (no data yet) |
67
+
68
+ > Tip: Enable peers via `.design/config.json#peer_cli.enabled_peers`.
69
+ > See `reference/peer-cli-capabilities.md` for the full capability matrix.
70
+ > See `skills/peer-cli-customize/SKILL.md` to rewire role→peer mappings per agent.
71
+ ```
72
+
73
+ Rules for the third column ("Posterior delta vs local"):
74
+ - If `Installed = ✗` → `(not installed)`.
75
+ - Else if `Allowlisted = ✗` → `(opt-in disabled)`.
76
+ - Else if posterior data has fewer than 3 cycles → `(no data yet)`.
77
+ - Else compute and render the delta.
78
+
79
+ ### 7. Done
80
+
81
+ The table IS the output. No follow-up prose. Users can act on the data:
82
+ - See "(opt-in disabled)" → enable in `.design/config.json`.
83
+ - See "(not installed)" → install the peer CLI.
84
+ - See concrete deltas → trust the bandit's recommendation, or override per-agent via `skills/peer-cli-customize`.
85
+
86
+ ## Cross-references
87
+
88
+ - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05) — capability matrix data source.
89
+ - `scripts/lib/install/runtimes.cjs` (Plan 27-11) — `peerBinary` field per runtime.
90
+ - `reference/peer-cli-capabilities.md` (Plan 27-05) — full capability matrix doc.
91
+ - `skills/peer-cli-customize/SKILL.md` (Plan 27-10) — rewire role→peer mappings.
92
+ - `skills/peer-cli-add/SKILL.md` (Plan 27-10) — add a brand-new peer.
93
+ - `.planning/phases/27-peer-cli-delegation/CONTEXT.md` D-10 — decision lineage.
94
+
95
+ ## Record
96
+
97
+ After execution, append one JSONL line to `.design/skill-records.jsonl`:
98
+
99
+ ```json
100
+ {"skill": "gdd-peers", "ts": "<ISO timestamp>", "peers_detected": ["codex", "gemini"], "peers_allowlisted": ["codex"], "had_posterior": false}
101
+ ```