@event4u/agent-config 1.16.0 → 1.18.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 (224) hide show
  1. package/.agent-src/commands/{agents-audit.md → agents/audit.md} +4 -3
  2. package/.agent-src/commands/{agents-cleanup.md → agents/cleanup.md} +12 -6
  3. package/.agent-src/commands/{agents-prepare.md → agents/prepare.md} +4 -3
  4. package/.agent-src/commands/agents.md +46 -0
  5. package/.agent-src/commands/{chat-history-checkpoint.md → chat-history/checkpoint.md} +4 -4
  6. package/.agent-src/commands/{chat-history-clear.md → chat-history/clear.md} +4 -4
  7. package/.agent-src/commands/{chat-history-resume.md → chat-history/resume.md} +4 -4
  8. package/.agent-src/commands/chat-history/show.md +107 -0
  9. package/.agent-src/commands/chat-history.md +33 -89
  10. package/.agent-src/commands/{commit-in-chunks.md → commit/in-chunks.md} +15 -13
  11. package/.agent-src/commands/commit.md +22 -2
  12. package/.agent-src/commands/{context-create.md → context/create.md} +4 -3
  13. package/.agent-src/commands/{context-refactor.md → context/refactor.md} +4 -3
  14. package/.agent-src/commands/context.md +44 -0
  15. package/.agent-src/commands/{copilot-agents-init.md → copilot-agents/init.md} +4 -3
  16. package/.agent-src/commands/{copilot-agents-optimize.md → copilot-agents/optimize.md} +4 -3
  17. package/.agent-src/commands/copilot-agents.md +44 -0
  18. package/.agent-src/commands/council/default.md +221 -0
  19. package/.agent-src/commands/{council-design.md → council/design.md} +6 -5
  20. package/.agent-src/commands/{council-optimize.md → council/optimize.md} +7 -6
  21. package/.agent-src/commands/{council-pr.md → council/pr.md} +6 -5
  22. package/.agent-src/commands/council.md +47 -212
  23. package/.agent-src/commands/{create-pr-description.md → create-pr/description-only.md} +4 -2
  24. package/.agent-src/commands/create-pr.md +26 -5
  25. package/.agent-src/commands/{feature-dev.md → feature/dev.md} +5 -10
  26. package/.agent-src/commands/{feature-explore.md → feature/explore.md} +4 -8
  27. package/.agent-src/commands/{feature-plan.md → feature/plan.md} +4 -8
  28. package/.agent-src/commands/{feature-refactor.md → feature/refactor.md} +4 -8
  29. package/.agent-src/commands/{feature-roadmap.md → feature/roadmap.md} +6 -10
  30. package/.agent-src/commands/feature.md +6 -12
  31. package/.agent-src/commands/{fix-ci.md → fix/ci.md} +4 -8
  32. package/.agent-src/commands/{fix-portability.md → fix/portability.md} +4 -8
  33. package/.agent-src/commands/{fix-pr-bot-comments.md → fix/pr-bots.md} +4 -8
  34. package/.agent-src/commands/{fix-pr-developer-comments.md → fix/pr-developers.md} +4 -8
  35. package/.agent-src/commands/{fix-pr-comments.md → fix/pr.md} +7 -11
  36. package/.agent-src/commands/{fix-references.md → fix/refs.md} +4 -8
  37. package/.agent-src/commands/{fix-seeder.md → fix/seeder.md} +4 -8
  38. package/.agent-src/commands/fix.md +7 -13
  39. package/.agent-src/commands/{do-and-judge.md → judge/on-diff.md} +4 -3
  40. package/.agent-src/commands/judge/solo.md +90 -0
  41. package/.agent-src/commands/{do-in-steps.md → judge/steps.md} +4 -3
  42. package/.agent-src/commands/judge.md +35 -70
  43. package/.agent-src/commands/{memory-add.md → memory/add.md} +4 -3
  44. package/.agent-src/commands/{memory-full.md → memory/load.md} +4 -3
  45. package/.agent-src/commands/{memory-promote.md → memory/promote.md} +4 -3
  46. package/.agent-src/commands/{propose-memory.md → memory/propose.md} +4 -3
  47. package/.agent-src/commands/memory.md +48 -0
  48. package/.agent-src/commands/{module-create.md → module/create.md} +4 -3
  49. package/.agent-src/commands/{module-explore.md → module/explore.md} +4 -3
  50. package/.agent-src/commands/module.md +44 -0
  51. package/.agent-src/commands/{optimize-agents.md → optimize/agents.md} +4 -8
  52. package/.agent-src/commands/{optimize-augmentignore.md → optimize/augmentignore.md} +4 -9
  53. package/.agent-src/commands/{optimize-rtk-filters.md → optimize/rtk.md} +4 -8
  54. package/.agent-src/commands/{optimize-skills.md → optimize/skills.md} +4 -8
  55. package/.agent-src/commands/optimize.md +4 -10
  56. package/.agent-src/commands/{override-create.md → override/create.md} +4 -3
  57. package/.agent-src/commands/{override-manage.md → override/manage.md} +4 -3
  58. package/.agent-src/commands/override.md +44 -0
  59. package/.agent-src/commands/{roadmap-create.md → roadmap/create.md} +4 -3
  60. package/.agent-src/commands/{roadmap-execute.md → roadmap/execute.md} +4 -3
  61. package/.agent-src/commands/roadmap.md +44 -0
  62. package/.agent-src/commands/{tests-create.md → tests/create.md} +4 -3
  63. package/.agent-src/commands/{tests-execute.md → tests/execute.md} +4 -3
  64. package/.agent-src/commands/tests.md +44 -0
  65. package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +72 -0
  66. package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +79 -0
  67. package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +98 -0
  68. package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +87 -0
  69. package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +62 -0
  70. package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +78 -0
  71. package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +85 -0
  72. package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +65 -0
  73. package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +78 -0
  74. package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +62 -0
  75. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +55 -0
  76. package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +53 -0
  77. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +77 -0
  78. package/.agent-src/contexts/judges/no-consolidate-rationale.md +102 -0
  79. package/.agent-src/contexts/judges/persona-voice-rubric.md +140 -0
  80. package/.agent-src/rules/artifact-engagement-recording.md +13 -69
  81. package/.agent-src/rules/ask-when-uncertain.md +27 -42
  82. package/.agent-src/rules/augment-portability.md +15 -61
  83. package/.agent-src/rules/augment-source-of-truth.md +27 -93
  84. package/.agent-src/rules/cli-output-handling.md +10 -76
  85. package/.agent-src/rules/command-suggestion-policy.md +18 -59
  86. package/.agent-src/rules/commit-conventions.md +17 -14
  87. package/.agent-src/rules/context-hygiene.md +6 -0
  88. package/.agent-src/rules/direct-answers.md +35 -59
  89. package/.agent-src/rules/docker-commands.md +5 -5
  90. package/.agent-src/rules/docs-sync.md +15 -69
  91. package/.agent-src/rules/language-and-tone.md +48 -72
  92. package/.agent-src/rules/missing-tool-handling.md +28 -22
  93. package/.agent-src/rules/no-cheap-questions.md +39 -53
  94. package/.agent-src/rules/no-roadmap-references.md +73 -0
  95. package/.agent-src/rules/onboarding-gate.md +7 -0
  96. package/.agent-src/rules/package-ci-checks.md +21 -61
  97. package/.agent-src/rules/preservation-guard.md +64 -29
  98. package/.agent-src/rules/review-routing-awareness.md +24 -43
  99. package/.agent-src/rules/roadmap-progress-sync.md +31 -65
  100. package/.agent-src/rules/rule-type-governance.md +28 -0
  101. package/.agent-src/rules/security-sensitive-stop.md +8 -8
  102. package/.agent-src/rules/skill-quality.md +16 -48
  103. package/.agent-src/rules/slash-command-routing-policy.md +7 -4
  104. package/.agent-src/rules/think-before-action.md +52 -42
  105. package/.agent-src/rules/tool-safety.md +19 -16
  106. package/.agent-src/rules/ui-audit-gate.md +24 -38
  107. package/.agent-src/rules/user-interaction.md +13 -68
  108. package/.agent-src/skills/ai-council/SKILL.md +2 -0
  109. package/.agent-src/skills/api-testing/SKILL.md +1 -1
  110. package/.agent-src/skills/check-refs/SKILL.md +59 -40
  111. package/.agent-src/skills/conventional-commits-writing/SKILL.md +86 -28
  112. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +5 -5
  113. package/.agent-src/skills/developer-like-execution/SKILL.md +4 -4
  114. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +101 -65
  115. package/.agent-src/skills/flux/SKILL.md +30 -10
  116. package/.agent-src/skills/github-ci/SKILL.md +2 -2
  117. package/.agent-src/skills/judge-code-quality/SKILL.md +7 -8
  118. package/.agent-src/skills/judge-security-auditor/SKILL.md +4 -5
  119. package/.agent-src/skills/judge-test-coverage/SKILL.md +3 -4
  120. package/.agent-src/skills/lint-skills/SKILL.md +57 -39
  121. package/.agent-src/skills/md-language-check/SKILL.md +61 -39
  122. package/.agent-src/skills/override-management/SKILL.md +5 -5
  123. package/.agent-src/skills/quality-tools/SKILL.md +2 -2
  124. package/.agent-src/skills/react-shadcn-ui/SKILL.md +116 -43
  125. package/.agent-src/skills/readme-reviewer/SKILL.md +30 -29
  126. package/.agent-src/skills/readme-writing/SKILL.md +78 -53
  127. package/.agent-src/skills/readme-writing-package/SKILL.md +50 -47
  128. package/.agent-src/skills/receiving-code-review/SKILL.md +52 -47
  129. package/.agent-src/skills/refine-prompt/SKILL.md +0 -1
  130. package/.agent-src/skills/requesting-code-review/SKILL.md +35 -30
  131. package/.agent-src/skills/security/SKILL.md +7 -2
  132. package/.agent-src/skills/security-audit/SKILL.md +7 -3
  133. package/.agent-src/skills/systematic-debugging/SKILL.md +68 -60
  134. package/.agent-src/skills/test-driven-development/SKILL.md +59 -57
  135. package/.agent-src/skills/test-performance/SKILL.md +0 -1
  136. package/.agent-src/skills/traefik/SKILL.md +4 -4
  137. package/.agent-src/skills/verify-completion-evidence/SKILL.md +28 -26
  138. package/.agent-src/templates/roadmaps.md +4 -0
  139. package/.claude-plugin/marketplace.json +22 -11
  140. package/AGENTS.md +2 -2
  141. package/CHANGELOG.md +125 -1
  142. package/README.md +18 -17
  143. package/docs/architecture.md +4 -6
  144. package/docs/catalog.md +67 -39
  145. package/docs/contracts/STABILITY.md +13 -7
  146. package/docs/contracts/adr-chat-history-split.md +1 -3
  147. package/docs/contracts/adr-command-suggestion.md +0 -2
  148. package/docs/contracts/adr-implement-ticket-runtime.md +1 -2
  149. package/docs/contracts/adr-product-ui-track.md +3 -6
  150. package/docs/contracts/adr-prompt-driven-execution.md +3 -4
  151. package/docs/contracts/agent-memory-contract.md +6 -11
  152. package/docs/contracts/artifact-engagement-flow.md +6 -9
  153. package/docs/contracts/command-clusters.md +56 -46
  154. package/docs/contracts/command-suggestion-flow.md +1 -3
  155. package/docs/contracts/context-paths.md +99 -0
  156. package/docs/contracts/file-ownership-matrix.json +6722 -0
  157. package/docs/contracts/file-ownership-matrix.md +134 -0
  158. package/docs/contracts/implement-ticket-flow.md +6 -9
  159. package/docs/contracts/linear-ai-rules-inclusion.md +0 -1
  160. package/docs/contracts/linear-ai-three-layers.md +0 -2
  161. package/docs/contracts/load-context-budget-model.md +258 -0
  162. package/docs/contracts/load-context-schema.md +21 -3
  163. package/docs/contracts/roadmap-complexity-standard.md +137 -0
  164. package/docs/contracts/rule-interactions.md +0 -1
  165. package/docs/contracts/rule-priority-hierarchy.md +1 -1
  166. package/docs/contracts/ui-track-flow.md +7 -17
  167. package/docs/customization.md +2 -0
  168. package/docs/getting-started.md +5 -4
  169. package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +134 -0
  170. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +100 -0
  171. package/docs/guidelines/agent-infra/direct-answers-demos.md +145 -0
  172. package/docs/guidelines/agent-infra/verify-before-complete-demos.md +128 -0
  173. package/package.json +1 -1
  174. package/scripts/_phase2_shim_helper.py +109 -0
  175. package/scripts/agent-config +30 -0
  176. package/scripts/ai_council/one_off_archive/2026-05/README.md +45 -0
  177. package/scripts/ai_council/one_off_archive/2026-05/_one_off_2a4_acceptance.py +208 -0
  178. package/scripts/ai_council/one_off_archive/2026-05/_one_off_budget_v2_audit.py +206 -0
  179. package/scripts/ai_council/one_off_archive/2026-05/_one_off_context_layer_v1_estimate.py +67 -0
  180. package/scripts/ai_council/one_off_archive/2026-05/_one_off_context_layer_v1_review.py +292 -0
  181. package/scripts/ai_council/one_off_archive/2026-05/_one_off_followups_review.py +259 -0
  182. package/scripts/ai_council/one_off_archive/2026-05/_one_off_nondestructive_inline_audit.py +209 -0
  183. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase4_dispatch_latency.py +108 -0
  184. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase6_trigger_jaccard.py +92 -0
  185. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase_2a_budget_rebalance.py +257 -0
  186. package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase_2a_post_revert.py +197 -0
  187. package/scripts/ai_council/one_off_archive/2026-05/_one_off_rule_hardening_v1.py +251 -0
  188. package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_open_questions.py +232 -0
  189. package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_optimization.py +144 -0
  190. package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_v3_gaps.py +252 -0
  191. package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_v3_review.py +240 -0
  192. package/scripts/build_rule_trigger_matrix.py +360 -0
  193. package/scripts/check_always_budget.py +402 -45
  194. package/scripts/check_cluster_patterns.py +159 -0
  195. package/scripts/check_command_count_messaging.py +14 -7
  196. package/scripts/check_context_paths.py +201 -0
  197. package/scripts/check_no_roadmap_refs.py +155 -0
  198. package/scripts/check_one_off_location.py +81 -0
  199. package/scripts/check_phase_coupling.py +148 -0
  200. package/scripts/check_portability.py +2 -0
  201. package/scripts/check_references.py +35 -2
  202. package/scripts/check_safety_floor_untouched.py +125 -0
  203. package/scripts/command_suggester/loader.py +4 -1
  204. package/scripts/compress.py +64 -15
  205. package/scripts/context_hygiene_hook.py +173 -0
  206. package/scripts/generate_index.py +6 -2
  207. package/scripts/generate_ownership_matrix.py +323 -0
  208. package/scripts/hooks/augment-context-hygiene.sh +55 -0
  209. package/scripts/hooks/augment-onboarding-gate.sh +55 -0
  210. package/scripts/hooks/augment-roadmap-progress.sh +57 -0
  211. package/scripts/install.py +105 -45
  212. package/scripts/lint_examples.py +98 -0
  213. package/scripts/lint_no_new_atomic_commands.py +12 -11
  214. package/scripts/lint_roadmap_complexity.py +127 -0
  215. package/scripts/onboarding_gate_hook.py +137 -0
  216. package/scripts/requirements-evals.txt +1 -0
  217. package/scripts/roadmap_progress_hook.py +159 -0
  218. package/scripts/schemas/command.schema.json +4 -3
  219. package/scripts/schemas/rule.schema.json +5 -0
  220. package/scripts/skill_linter.py +1 -0
  221. package/scripts/sync_agent_settings.py +25 -2
  222. package/scripts/update_counts.py +7 -0
  223. /package/scripts/ai_council/{_one_off_rebalancing_audit.py → one_off_archive/2026-05/_one_off_rebalancing_audit.py} +0 -0
  224. /package/scripts/ai_council/{_one_off_roundtrip.py → one_off_archive/2026-05/_one_off_roundtrip.py} +0 -0
@@ -1,5 +1,7 @@
1
1
  ---
2
- name: copilot-agents-optimize
2
+ name: copilot-agents:optimize
3
+ cluster: copilot-agents
4
+ sub: optimize
3
5
  description: Analyzes and refactors AGENTS.md and copilot-instructions.md — removes duplications, enforces line budgets, and ensures both files are optimized for their audience.
4
6
  skills: [copilot-agents-optimization, copilot-config, agent-docs-writing]
5
7
  disable-model-invocation: true
@@ -8,8 +10,7 @@ suggestion:
8
10
  rationale: "Maintenance refactor; only when the maintainer chooses to run it."
9
11
  ---
10
12
 
11
- # /copilot-agents-optimize
12
-
13
+ # /copilot-agents optimize
13
14
  Analyzes and refactors `AGENTS.md` and `.github/copilot-instructions.md` against the `.augment/` ecosystem.
14
15
 
15
16
  ## Steps
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: copilot-agents
3
+ description: Copilot agents-doc orchestrator — routes to init, optimize
4
+ cluster: copilot-agents
5
+ disable-model-invocation: true
6
+ suggestion:
7
+ eligible: true
8
+ trigger_description: "create AGENTS.md, optimize copilot-instructions.md, scaffold copilot agent docs"
9
+ trigger_context: "user wants to author or tune AGENTS.md / copilot-instructions.md"
10
+ ---
11
+
12
+ # /copilot-agents
13
+
14
+ Top-level orchestrator for the `/copilot-agents` family. Replaces 2
15
+ standalone commands with a single entry point + sub-command dispatch.
16
+
17
+ ## Sub-commands
18
+
19
+ | Sub-command | Routes to | Purpose |
20
+ |---|---|---|
21
+ | `/copilot-agents init` | `commands/copilot-agents/init.md` | Create AGENTS.md and `.github/copilot-instructions.md` from scratch |
22
+ | `/copilot-agents optimize` | `commands/copilot-agents/optimize.md` | Refactor existing AGENTS.md and copilot-instructions.md for line budgets |
23
+
24
+ Sub-command names match the locked contract in
25
+ [`docs/contracts/command-clusters.md`](../../docs/contracts/command-clusters.md).
26
+
27
+ ## Dispatch
28
+
29
+ 1. Parse the user's argument: `/copilot-agents <sub-command> [args]`.
30
+ 2. Look up the sub-command in the table above.
31
+ 3. Load the body of the routed file and follow its `## Instructions` section
32
+ verbatim with the remaining args.
33
+ 4. If the sub-command is unknown or missing, print the table above and ask:
34
+
35
+ > 1. init — scaffold AGENTS.md + copilot-instructions.md from scratch
36
+ > 2. optimize — refactor existing files for budget and audience
37
+
38
+ ## Rules
39
+
40
+ - **Do NOT commit, push, or open a PR** unless the sub-command explicitly
41
+ authorizes it.
42
+ - **Do NOT chain sub-commands.** One `/copilot-agents <sub>` per turn.
43
+ - If the user invokes `/copilot-agents` with no argument, **show the
44
+ menu** — do not guess which sub-command they meant.
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: council:default
3
+ cluster: council
4
+ sub: default
5
+ skills: [ai-council]
6
+ description: Default council lens — neutral framing, redacted context, advisory output only. Run `/council default <input>` for prompt/roadmap/diff/files; the cluster shows a menu when invoked bare.
7
+ disable-model-invocation: true
8
+ suggestion:
9
+ eligible: false
10
+ rationale: "Default lens — invoked via /council dispatcher; no direct trigger."
11
+ ---
12
+
13
+ # /council default
14
+
15
+ Base orchestration entry point for the council. Specialised lenses
16
+ (`/council pr`, `/council design`, `/council optimize`) wrap this same
17
+ flow with mode-specific neutrality preambles.
18
+
19
+ ## Instructions
20
+
21
+ ### 1. Resolve the target + capture the original ask
22
+
23
+ The user invoked `/council default` on exactly one input mode:
24
+
25
+ - `prompt:"<text>"` — a free-form question or proposal
26
+ - `roadmap:<path>` — a roadmap file under `agents/roadmaps/`
27
+ - `diff:<base>..<head>` — a git diff range
28
+ - `files:<path>,<path>` — a comma-separated file list
29
+
30
+ Optional invocation flag: `mode:api|manual` overrides the per-member
31
+ and global mode for this call only (see Step 2.5). `mode:playwright`
32
+ is reserved for Phase 2c — refuse politely if invoked.
33
+
34
+ Optional **rounds**: `rounds:N` (1-3) enables multi-round debate. Round
35
+ 1 sees the artefact alone. Round 2+ sees the artefact plus anonymised
36
+ critiques from the previous round (provider/model identity stripped).
37
+ Total spend = N × single-round cost; surface this in the cost gate.
38
+ Default `rounds:1`.
39
+
40
+ Optional **mode_override**: `mode_override=pr|design|optimize` swaps
41
+ the system-prompt addendum for one of the specialised lenses
42
+ (see `prompts.py` `_MODE_TABLE`). The bundle mode is unchanged; only
43
+ the per-mode neutrality addendum is replaced. Routed by the
44
+ `/council pr`, `/council design`, `/council optimize` sub-commands —
45
+ surface to the user as "council on <target> — <lens> lens".
46
+
47
+ If no input mode was supplied, ask the user which mode + target. **One
48
+ question per turn** (per `ask-when-uncertain`). Do not assume the
49
+ working-tree diff.
50
+
51
+ Also capture the user's **original ask** verbatim — the free-form
52
+ sentence that triggered the council, distinct from the bundled
53
+ artefact. For `prompt:"…"` mode the ask and the artefact are the
54
+ same string. For `roadmap` / `diff` / `files` modes, the ask is the
55
+ user's framing sentence ("review this roadmap before I execute it",
56
+ "is this diff safe to merge?"). This string flows into
57
+ `consult(..., original_ask=…)` in Step 5 (per `ai-council` skill §
58
+ Neutrality — context-handoff).
59
+
60
+ ### 2. Check the council is configured + price table fresh
61
+
62
+ Read `.agent-settings.yml` → `ai_council`:
63
+
64
+ - If `ai_council.enabled` is false → state that and offer to flip it
65
+ on. Do not flip it autonomously.
66
+ - If no member has `enabled: true` → list the install commands
67
+ (`./agent-config keys:install-anthropic`, `./agent-config keys:install-openai`)
68
+ and stop.
69
+ - If a member is enabled but its `*.key` file is missing or has the
70
+ wrong mode → tell the user which key to install. Do not fall back
71
+ to env vars. Ever.
72
+
73
+ Load the price table via `scripts.ai_council.pricing.load_prices()`
74
+ (auto-bootstraps `.agent-prices.md` from defaults if missing). Run
75
+ `pricing.is_stale(table)` and, if stale, surface the staleness gate
76
+ from the `ai-council` skill (§ Stale price-table gate) before
77
+ continuing.
78
+
79
+ ### 2.5. Resolve per-member execution mode
80
+
81
+ For each enabled member, resolve its mode via
82
+ `scripts.ai_council.modes.resolve_mode(name, invocation_mode,
83
+ member_settings, global_mode)`. Precedence: invocation flag >
84
+ per-member setting > global setting > default (`api`).
85
+
86
+ Construct each member from the resolved mode:
87
+
88
+ - `api` → `AnthropicClient` / `OpenAIClient` (billable, cost-gated).
89
+ - `manual` → `ManualClient` from `scripts.ai_council.clients`
90
+ (`billable=False`, no API key, no SDK call).
91
+ - `playwright` → reserved for Phase 2c. If a settings/invocation
92
+ resolves to it, refuse with a one-line note.
93
+
94
+ ### 3. Cost confirmation — ALWAYS ASK for billable members
95
+
96
+ Council calls to billable members spend money. Even under
97
+ `personal.autonomy: on`, the agent **must** ask before invoking any
98
+ billable member.
99
+
100
+ Compute `orchestrator.estimate(question, members, table)` over the
101
+ **billable** subset only (`getattr(m, "billable", True)`). Manual
102
+ members contribute `$0` and skip the estimate.
103
+
104
+ Render the cost-confirmation numbered-options block per the
105
+ `ai-council` skill (§ Pre-call estimate format) — per-member tokens
106
+ + USD, projected total, budget caps, then `1. Run / 2. Cancel`. If
107
+ the resolved member set is **all-manual**, skip the gate entirely
108
+ (spend = $0) and proceed directly to Step 4.
109
+
110
+ Wait for the user's pick. `1` proceeds; anything else aborts.
111
+
112
+ ### 4. Bundle the context
113
+
114
+ Use `scripts.ai_council.bundler`:
115
+
116
+ - `prompt` mode → `bundle_prompt(text)`
117
+ - `roadmap` mode → `bundle_roadmap(path)`
118
+ - `diff` mode → `bundle_diff(base, head)`
119
+ - `files` mode → `bundle_files(paths)`
120
+
121
+ The bundler runs redaction + size guard. If `BundleTooLarge` raises,
122
+ surface the byte count and ask the user to narrow scope. Do **not**
123
+ truncate silently.
124
+
125
+ Print the manifest (what was included) and the excluded list before
126
+ sending — gives the user a chance to abort if scope is wrong.
127
+
128
+ ### 5. Run the orchestrator
129
+
130
+ Members are constructed from the settings file plus
131
+ `load_anthropic_key()` / `load_openai_key()`. Cost budget comes from
132
+ `ai_council.cost_budget`.
133
+
134
+ Detect project context once via
135
+ `scripts.ai_council.project_context.detect_project_context()` (reads
136
+ `composer.json`, `package.json`, root `README.md` — never raises;
137
+ empty-fields fall back to bare neutrality preamble).
138
+
139
+ Call:
140
+
141
+ ```python
142
+ consult(
143
+ members, question, budget,
144
+ table=table,
145
+ on_overrun=_handle_overrun,
146
+ project=project,
147
+ original_ask=original_ask,
148
+ rounds=rounds, # 1 by default; 2-3 enables multi-round debate
149
+ )
150
+ ```
151
+
152
+ `project` + `original_ask` flow into `handoff_preamble()` so each
153
+ member receives a neutral context-handoff alongside the artefact
154
+ (see `ai-council` skill § Neutrality — context-handoff). Members run
155
+ **sequentially**; per-member errors are normalised — one failure
156
+ does not abort the others. Define `_handle_overrun(event)` per the
157
+ `ai-council` skill (§ Mid-flow overrun callback) to surface the user
158
+ prompt before each breaching member.
159
+
160
+ ### 6. Render the report
161
+
162
+ Use `scripts.ai_council.orchestrator.render(responses)` for the
163
+ per-member sections (stacked, not side-by-side — narrow terminals).
164
+ Then write the **Convergence / Divergence** section yourself:
165
+
166
+ - **Agreements** — points all members made (or did not contradict).
167
+ - **Disagreements** — points where members took opposing positions.
168
+ - **Unique insights** — points raised by exactly one member.
169
+ - **Suggested next actions** — translated into concrete options for
170
+ the user.
171
+
172
+ End with a numbered-options block asking the user how to proceed
173
+ (e.g. update the roadmap, request a second round, ignore the
174
+ critique).
175
+
176
+ ### 7. Hard floor — text only
177
+
178
+ `/council` produces **text**. It does **NOT**:
179
+
180
+ - Edit any file in the project.
181
+ - Open, comment on, or merge any PR.
182
+ - Run `git` commands beyond `git diff` (read-only).
183
+ - Persist API responses outside the current chat unless the user
184
+ explicitly asks (Phase 4 — out of scope for v1).
185
+
186
+ This is restated in step 7 deliberately. The neutrality framing
187
+ loses meaning if the council can act on the project directly.
188
+
189
+ ## Failure modes
190
+
191
+ - **Member SDK not installed** → tell the user exactly which `pip
192
+ install` runs (`pip install anthropic` / `pip install openai`).
193
+ Do not fall back to mocks.
194
+ - **Key file mode drift** → refuse and point at the install script.
195
+ The 0600 contract is non-negotiable.
196
+ - **Manual mode + non-interactive stdin** → `ManualClient` reads
197
+ pasted replies from stdin terminated by a line containing only
198
+ `END`. If stdin is closed before any reply lands, the member
199
+ returns empty text with `error="manual_aborted"`; render the
200
+ partial result and ask the user.
201
+ - **Invalid mode value** → `resolve_mode()` raises
202
+ `InvalidModeError` with the exact settings path. Surface verbatim
203
+ and stop.
204
+ - **Cost budget exceeded mid-fan-out** → render the partial
205
+ responses and clearly mark the unfinished members with their
206
+ `cost_budget_exceeded` error. Do not silently retry.
207
+ - **Stale price table, refresher fails (offline)** → state the
208
+ failure, re-offer "continue with stale table / cancel", do not
209
+ proceed silently.
210
+ - **`.agent-prices.md` corrupt (missing frontmatter or columns)** →
211
+ surface the parse error, suggest deleting the file to bootstrap
212
+ fresh from defaults; never silently fall back.
213
+ - **All members error** → render the errors and ask the user
214
+ whether to fix and retry, or abort.
215
+
216
+ ## See also
217
+
218
+ - `/council` — cluster dispatcher.
219
+ - `ai-council` skill — neutrality guidelines, anti-patterns, redaction expectations.
220
+ - `subagent-orchestration` skill — internal multi-agent variant (no network calls).
221
+ - `docs/customization.md` § Available settings → `ai_council.*`.
@@ -1,6 +1,7 @@
1
1
  ---
2
- name: council-design
3
- cluster: optimize
2
+ name: council:design
3
+ cluster: council
4
+ sub: design
4
5
  skills: [ai-council]
5
6
  description: Run the council on a design document, ADR, or architecture proposal — surfaces hidden coupling, missing rollback, and sequencing risk before commitment.
6
7
  disable-model-invocation: true
@@ -10,7 +11,7 @@ suggestion:
10
11
  trigger_context: "user has a design doc / ADR / architecture proposal and wants an external review before commitment"
11
12
  ---
12
13
 
13
- # council-design
14
+ # /council design
14
15
 
15
16
  ## Instructions
16
17
 
@@ -22,7 +23,7 @@ correctness.
22
23
 
23
24
  ### 1. Resolve the artefact
24
25
 
25
- The user invoked `/council-design <path>` or `/council-design`. If no
26
+ The user invoked `/council design <path>` or `/council design`. If no
26
27
  path was supplied, ask (one question per turn):
27
28
 
28
29
  > Which design artefact should the council review?
@@ -79,7 +80,7 @@ decide which to fold in via `/feature plan` or `/feature refactor`.
79
80
 
80
81
  ### Hard floor (restated)
81
82
 
82
- `/council-design` produces **text only**. It does NOT edit the
83
+ `/council design` produces **text only**. It does NOT edit the
83
84
  design file, open ADR PRs, or modify the codebase.
84
85
 
85
86
  ## Failure modes
@@ -1,6 +1,7 @@
1
1
  ---
2
- name: council-optimize
3
- cluster: optimize
2
+ name: council:optimize
3
+ cluster: council
4
+ sub: optimize
4
5
  skills: [ai-council]
5
6
  description: Run the council on an optimization target — perf hot path, memory pattern, query, or an /optimize-* output — for ranked, evidence-based suggestions instead of generic advice.
6
7
  disable-model-invocation: true
@@ -10,7 +11,7 @@ suggestion:
10
11
  trigger_context: "user has an optimization target (code path, query, profile result, /optimize-* output) and wants a ranked external opinion"
11
12
  ---
12
13
 
13
- # council-optimize
14
+ # /council optimize
14
15
 
15
16
  ## Instructions
16
17
 
@@ -24,7 +25,7 @@ generic "you should profile" advice.
24
25
 
25
26
  ### 1. Resolve the target
26
27
 
27
- The user invoked `/council-optimize <target>` or `/council-optimize`.
28
+ The user invoked `/council optimize <target>` or `/council optimize`.
28
29
  If nothing was supplied, ask (one question per turn):
29
30
 
30
31
  > What should the council optimize?
@@ -95,7 +96,7 @@ to drive into a normal `/work` / `/implement-ticket` flow.
95
96
 
96
97
  ### Hard floor (restated)
97
98
 
98
- `/council-optimize` produces **text only**. It does NOT edit code,
99
+ `/council optimize` produces **text only**. It does NOT edit code,
99
100
  run benchmarks, or change configuration.
100
101
 
101
102
  ## Failure modes
@@ -111,5 +112,5 @@ run benchmarks, or change configuration.
111
112
  - `/council` — base orchestration entry point.
112
113
  - `/optimize-skills`, `/optimize-agents`, `/optimize-augmentignore`,
113
114
  `/optimize-rtk-filters` — internal optimization commands; their
114
- output can be fed to `/council-optimize` for an external ranking.
115
+ output can be fed to `/council optimize` for an external ranking.
115
116
  - `ai-council` skill — neutrality guidelines.
@@ -1,6 +1,7 @@
1
1
  ---
2
- name: council-pr
3
- cluster: optimize
2
+ name: council:pr
3
+ cluster: council
4
+ sub: pr
4
5
  skills: [ai-council]
5
6
  description: Pull a GitHub PR via gh CLI and run the council on the diff with a PR-specific neutrality preamble — read-only by default; comment posting is opt-in.
6
7
  disable-model-invocation: true
@@ -10,7 +11,7 @@ suggestion:
10
11
  trigger_context: "user has a PR number / URL and wants an external review before approve/merge"
11
12
  ---
12
13
 
13
- # council-pr
14
+ # /council pr
14
15
 
15
16
  ## Instructions
16
17
 
@@ -20,7 +21,7 @@ with a PR-aware neutrality preamble (the `pr` mode) and an opt-in
20
21
 
21
22
  ### 1. Resolve the PR target
22
23
 
23
- The user invoked `/council-pr <number>` or `/council-pr <url>`. If
24
+ The user invoked `/council pr <number>` or `/council pr <url>`. If
24
25
  neither was supplied, ask (one question per turn, per
25
26
  `ask-when-uncertain`):
26
27
 
@@ -99,7 +100,7 @@ public PR is a write operation that should always be explicit).
99
100
 
100
101
  ### Hard floor (restated)
101
102
 
102
- `/council-pr` produces **text** and (on user opt-in) a **single PR
103
+ `/council pr` produces **text** and (on user opt-in) a **single PR
103
104
  comment**. It does **NOT**:
104
105
 
105
106
  - Approve, request changes, or merge a PR.
@@ -1,219 +1,54 @@
1
1
  ---
2
2
  name: council
3
- cluster: optimize
4
- skills: [ai-council]
5
- description: Consult external AIs (OpenAI, Anthropic) for an independent second opinion on a prompt, roadmap, diff, or file set — neutral framing, redacted context, advisory output only.
3
+ description: Council orchestrator — routes to default, pr, design, optimize
4
+ cluster: council
6
5
  disable-model-invocation: true
7
6
  suggestion:
8
7
  eligible: true
9
- trigger_description: "external second opinion, cross-AI review, devil's advocate on a plan/roadmap/diff, polling another model"
10
- trigger_context: "user wants an outside critique on an artefact (roadmap, diff, prompt, files) without polluting the reviewer with the host agent's framing"
8
+ trigger_description: "external second opinion, cross-AI review, devil's advocate on a plan/roadmap/diff, council on PR/design/optimize, polling another model"
9
+ trigger_context: "user wants an outside critique on an artefact (roadmap, diff, prompt, files, PR, design doc, optimization target) without polluting the reviewer with the host agent's framing"
11
10
  ---
12
11
 
13
- # council
14
-
15
- ## Instructions
16
-
17
- ### 1. Resolve the target + capture the original ask
18
-
19
- The user invoked `/council` on exactly one input mode:
20
-
21
- - `prompt:"<text>"` — a free-form question or proposal
22
- - `roadmap:<path>` a roadmap file under `agents/roadmaps/`
23
- - `diff:<base>..<head>` — a git diff range
24
- - `files:<path>,<path>`a comma-separated file list
25
-
26
- Optional invocation flag: `mode:api|manual` overrides the per-member
27
- and global mode for this call only (see Step 2.5). `mode:playwright`
28
- is reserved for Phase 2c — refuse politely if invoked.
29
-
30
- Optional **rounds**: `rounds:N` (1-3) enables multi-round debate. Round
31
- 1 sees the artefact alone. Round 2+ sees the artefact plus anonymised
32
- critiques from the previous round (provider/model identity stripped).
33
- Total spend = N × single-round cost; surface this in the cost gate.
34
- Default `rounds:1` (single round, v1 behaviour).
35
-
36
- Optional **mode_override**: `mode_override=pr|design|optimize` swaps
37
- the system-prompt addendum for one of the specialised lenses
38
- (see `prompts.py` `_MODE_TABLE`). The bundle mode (`prompt:` /
39
- `roadmap:` / `diff:` / `files:`) is unchanged; only the per-mode
40
- neutrality addendum is replaced. Routed by `/council-pr`,
41
- `/council-design`, `/council-optimize`surface to the user as
42
- "council on <target><lens> lens" so the report header is
43
- unambiguous.
44
-
45
- If none was supplied, ask the user which mode + target. **One question
46
- per turn** (per `ask-when-uncertain`). Do not assume the working-tree
47
- diff.
48
-
49
- Also capture the user's **original ask** verbatim — the free-form
50
- sentence that triggered the council, distinct from the bundled
51
- artefact. For `prompt:"…"` mode the ask and the artefact are the
52
- same string. For `roadmap` / `diff` / `files` modes, the ask is the
53
- user's framing sentence ("review this roadmap before I execute it",
54
- "is this diff safe to merge?"). This string flows into
55
- `consult(..., original_ask=…)` in Step 5 so council members receive
56
- the neutral handoff preamble alongside the artefact (per
57
- `ai-council` skill § Neutrality — context-handoff).
58
-
59
- ### 2. Check the council is configured + price table fresh
60
-
61
- Read `.agent-settings.yml` → `ai_council`:
62
-
63
- - If `ai_council.enabled` is false → state that and offer to flip it
64
- on. Do not flip it autonomously.
65
- - If no member has `enabled: true` → list the install commands
66
- (`./agent-config keys:install-anthropic`, `./agent-config keys:install-openai`)
67
- and stop.
68
- - If a member is enabled but its `*.key` file is missing or has the
69
- wrong mode → tell the user which key to install. Do not fall back to
70
- env vars. Ever.
71
-
72
- Load the price table via `scripts.ai_council.pricing.load_prices()`
73
- (auto-bootstraps `.agent-prices.md` from defaults if missing). Run
74
- `pricing.is_stale(table)` and, if stale, surface the staleness gate
75
- from the `ai-council` skill (§ Stale price-table gate) before
76
- continuing.
77
-
78
- ### 2.5. Resolve per-member execution mode
79
-
80
- For each enabled member, resolve its mode via
81
- `scripts.ai_council.modes.resolve_mode(name, invocation_mode,
82
- member_settings, global_mode)`. Precedence: invocation flag >
83
- per-member setting > global setting > default (`api`).
84
-
85
- Construct each member from the resolved mode:
86
-
87
- - `api` → `AnthropicClient` / `OpenAIClient` (billable, cost-gated).
88
- - `manual` → `ManualClient` from `scripts.ai_council.clients`
89
- (`billable=False`, no API key, no SDK call).
90
- - `playwright` → reserved for Phase 2c. If a settings/invocation
91
- resolves to it, refuse with a one-line note.
92
-
93
- ### 3. Cost confirmation — ALWAYS ASK for billable members
94
-
95
- Council calls to billable members spend money. Even under
96
- `personal.autonomy: on`, the agent **must** ask before invoking any
97
- billable member.
98
-
99
- Compute `orchestrator.estimate(question, members, table)` over the
100
- **billable** subset only (`getattr(m, "billable", True)`). Manual
101
- members contribute `$0` and skip the estimate.
102
-
103
- Render the cost-confirmation numbered-options block per the
104
- `ai-council` skill (§ Pre-call estimate format) — per-member tokens
105
- + USD, projected total, budget caps, then `1. Run / 2. Cancel`. If
106
- the resolved member set is **all-manual**, skip the gate entirely
107
- (spend = $0) and proceed directly to Step 4.
108
-
109
- Wait for the user's pick. `1` proceeds; anything else aborts.
110
-
111
- ### 4. Bundle the context
112
-
113
- Use `scripts.ai_council.bundler`:
114
-
115
- - `prompt` mode → `bundle_prompt(text)`
116
- - `roadmap` mode → `bundle_roadmap(path)`
117
- - `diff` mode → `bundle_diff(base, head)`
118
- - `files` mode → `bundle_files(paths)`
119
-
120
- The bundler runs redaction + size guard. If `BundleTooLarge` raises,
121
- surface the byte count and ask the user to narrow scope. Do **not**
122
- truncate silently.
123
-
124
- Print the manifest (what was included) and the excluded list before
125
- sending — gives the user a chance to abort if scope is wrong.
126
-
127
- ### 5. Run the orchestrator
128
-
129
- Members are constructed from the settings file plus
130
- `load_anthropic_key()` / `load_openai_key()`. Cost budget comes from
131
- `ai_council.cost_budget`.
132
-
133
- Detect project context once via
134
- `scripts.ai_council.project_context.detect_project_context()` (reads
135
- `composer.json`, `package.json`, root `README.md` — never raises;
136
- empty-fields fall back to bare neutrality preamble).
137
-
138
- Call:
139
-
140
- ```python
141
- consult(
142
- members, question, budget,
143
- table=table,
144
- on_overrun=_handle_overrun,
145
- project=project,
146
- original_ask=original_ask,
147
- rounds=rounds, # 1 by default; 2-3 enables multi-round debate
148
- )
149
- ```
150
-
151
- `project` + `original_ask` flow into `handoff_preamble()` so each
152
- member receives a neutral context-handoff alongside the artefact
153
- (see `ai-council` skill § Neutrality — context-handoff). Members run
154
- **sequentially**; per-member errors are normalised — one failure
155
- does not abort the others. Define `_handle_overrun(event)` per the
156
- `ai-council` skill (§ Mid-flow overrun callback) to surface the user
157
- prompt before each breaching member.
158
-
159
- ### 6. Render the report
160
-
161
- Use `scripts.ai_council.orchestrator.render(responses)` for the
162
- per-member sections (stacked, not side-by-side — narrow terminals).
163
- Then write the **Convergence / Divergence** section yourself:
164
-
165
- - **Agreements** — points all members made (or did not contradict).
166
- - **Disagreements** — points where members took opposing positions.
167
- - **Unique insights** — points raised by exactly one member.
168
- - **Suggested next actions** — translated into concrete options for
169
- the user.
170
-
171
- End with a numbered-options block asking the user how to proceed
172
- (e.g. update the roadmap, request a second round, ignore the
173
- critique).
174
-
175
- ### 7. Hard floor — text only
176
-
177
- `/council` produces **text**. It does **NOT**:
178
-
179
- - Edit any file in the project.
180
- - Open, comment on, or merge any PR.
181
- - Run `git` commands beyond `git diff` (read-only).
182
- - Persist API responses outside the current chat unless the user
183
- explicitly asks (Phase 4 — out of scope for v1).
184
-
185
- This is restated in step 7 deliberately. The neutrality framing
186
- loses meaning if the council can act on the project directly.
187
-
188
- ## Failure modes
189
-
190
- - **Member SDK not installed** → tell the user exactly which `pip
191
- install` runs (`pip install anthropic` / `pip install openai`).
192
- Do not fall back to mocks.
193
- - **Key file mode drift** → refuse and point at the install script.
194
- The 0600 contract is non-negotiable.
195
- - **Manual mode + non-interactive stdin** → `ManualClient` reads
196
- pasted replies from stdin terminated by a line containing only
197
- `END`. If stdin is closed before any reply lands, the member
198
- returns empty text with `error="manual_aborted"`; render the
199
- partial result and ask the user.
200
- - **Invalid mode value** → `resolve_mode()` raises
201
- `InvalidModeError` with the exact settings path. Surface verbatim
202
- and stop.
203
- - **Cost budget exceeded mid-fan-out** → render the partial
204
- responses and clearly mark the unfinished members with their
205
- `cost_budget_exceeded` error. Do not silently retry.
206
- - **Stale price table, refresher fails (offline)** → state the
207
- failure, re-offer "continue with stale table / cancel", do not
208
- proceed silently.
209
- - **`.agent-prices.md` corrupt (missing frontmatter or columns)** →
210
- surface the parse error, suggest deleting the file to bootstrap
211
- fresh from defaults; never silently fall back.
212
- - **All members error** → render the errors and ask the user
213
- whether to fix and retry, or abort.
214
-
215
- ## See also
216
-
217
- - `ai-council` skill — neutrality guidelines, anti-patterns, redaction expectations.
218
- - `subagent-orchestration` skill — internal multi-agent variant (no network calls).
219
- - `docs/customization.md` § Available settings → `ai_council.*`.
12
+ # /council
13
+
14
+ Top-level orchestrator for the `/council` family. Replaces 4 standalone
15
+ commands with a single entry point + sub-command dispatch. Each lens
16
+ shares the same transport, neutrality preamble, and cost gate; the
17
+ sub-command swaps the mode-specific addendum.
18
+
19
+ ## Sub-commands
20
+
21
+ | Sub-command | Routes to | Purpose |
22
+ |---|---|---|
23
+ | `/council default` | `commands/council/default.md` | Generic neutral lens prompt, roadmap, diff, or files |
24
+ | `/council pr` | `commands/council/pr.md` | Pull a GitHub PR via `gh` and run the council on the diff with PR-specific framing |
25
+ | `/council design` | `commands/council/design.md` | Run the council on a design doc / ADR / architecture proposal |
26
+ | `/council optimize` | `commands/council/optimize.md` | Run the council on an optimization target — ranked, evidence-based suggestions |
27
+
28
+ Sub-command names match the locked contract in
29
+ [`docs/contracts/command-clusters.md`](../../docs/contracts/command-clusters.md).
30
+
31
+ ## Dispatch
32
+
33
+ 1. Parse the user's argument: `/council <sub-command> [args]`.
34
+ 2. Look up the sub-command in the table above.
35
+ 3. Load the body of the routed file and follow its `## Instructions` section
36
+ verbatim with the remaining args.
37
+ 4. If the sub-command is unknown or missing, print the table above and ask:
38
+
39
+ > 1. default neutral lens on a prompt / roadmap / diff / files
40
+ > 2. pr review a GitHub PR (read-only by default)
41
+ > 3. designreview a design doc / ADR / architecture proposal
42
+ > 4. optimize — ranked, evidence-based optimization advice
43
+
44
+ ## Rules
45
+
46
+ - **Do NOT commit, push, or open a PR** unless the sub-command explicitly
47
+ authorizes it. The PR sub-command can post **one** comment per
48
+ invocation, opt-in only.
49
+ - **Do NOT chain sub-commands.** One `/council <sub>` per turn.
50
+ - **Hard floor text only.** `/council` produces text and (under
51
+ `pr` with explicit opt-in) one PR comment. It does NOT edit files,
52
+ approve / merge PRs, or run optimizations.
53
+ - If the user invokes `/council` with no argument, **show the menu** —
54
+ do not guess which sub-command they meant.