@event4u/agent-config 1.21.0 → 1.23.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 (130) hide show
  1. package/.agent-src/commands/agents/cleanup.md +31 -17
  2. package/.agent-src/commands/bug-fix.md +1 -0
  3. package/.agent-src/commands/bug-investigate.md +1 -0
  4. package/.agent-src/commands/challenge-me/vision.md +348 -0
  5. package/.agent-src/commands/challenge-me/with-docs.md +333 -0
  6. package/.agent-src/commands/challenge-me.md +61 -0
  7. package/.agent-src/commands/commit/in-chunks.md +30 -10
  8. package/.agent-src/commands/commit.md +46 -6
  9. package/.agent-src/commands/compress.md +19 -13
  10. package/.agent-src/commands/cost-report.md +120 -0
  11. package/.agent-src/commands/council/default.md +64 -17
  12. package/.agent-src/commands/create-pr/description-only.md +8 -0
  13. package/.agent-src/commands/create-pr.md +99 -80
  14. package/.agent-src/commands/feature/plan.md +13 -7
  15. package/.agent-src/commands/grill-me.md +38 -0
  16. package/.agent-src/commands/judge/steps.md +1 -1
  17. package/.agent-src/commands/memory/add.md +16 -8
  18. package/.agent-src/commands/memory/promote.md +17 -9
  19. package/.agent-src/commands/optimize/rtk.md +16 -11
  20. package/.agent-src/commands/prepare-for-review.md +12 -6
  21. package/.agent-src/commands/project-analyze.md +31 -20
  22. package/.agent-src/commands/review-changes.md +24 -15
  23. package/.agent-src/commands/roadmap/ai-council.md +183 -0
  24. package/.agent-src/commands/roadmap/create.md +20 -10
  25. package/.agent-src/commands/roadmap/process-full.md +58 -0
  26. package/.agent-src/commands/roadmap/process-phase.md +69 -0
  27. package/.agent-src/commands/roadmap/process-step.md +57 -0
  28. package/.agent-src/commands/roadmap.md +44 -16
  29. package/.agent-src/commands/threat-model.md +1 -0
  30. package/.agent-src/contexts/augment-infrastructure.md +1 -1
  31. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +53 -18
  32. package/.agent-src/contexts/contracts/frugality-charter.md +57 -0
  33. package/.agent-src/contexts/execution/roadmap-process-loop.md +125 -0
  34. package/.agent-src/contexts/skills-and-commands.md +1 -1
  35. package/.agent-src/rules/architecture.md +9 -0
  36. package/.agent-src/rules/ask-when-uncertain.md +3 -13
  37. package/.agent-src/rules/caveman-speak.md +78 -0
  38. package/.agent-src/rules/direct-answers.md +5 -14
  39. package/.agent-src/rules/improve-before-implement.md +1 -0
  40. package/.agent-src/rules/invite-challenge.md +71 -0
  41. package/.agent-src/rules/markdown-safe-codeblocks.md +6 -7
  42. package/.agent-src/rules/no-cheap-questions.md +4 -14
  43. package/.agent-src/rules/token-efficiency.md +5 -7
  44. package/.agent-src/skills/adr-create/SKILL.md +197 -0
  45. package/.agent-src/skills/adversarial-review/SKILL.md +1 -0
  46. package/.agent-src/skills/agent-docs-writing/SKILL.md +23 -1
  47. package/.agent-src/skills/ai-council/SKILL.md +132 -8
  48. package/.agent-src/skills/bug-analyzer/SKILL.md +1 -0
  49. package/.agent-src/skills/command-writing/SKILL.md +23 -0
  50. package/.agent-src/skills/context-authoring/SKILL.md +23 -0
  51. package/.agent-src/skills/conventional-commits-writing/SKILL.md +23 -0
  52. package/.agent-src/skills/guideline-writing/SKILL.md +22 -0
  53. package/.agent-src/skills/persona-writing/SKILL.md +153 -0
  54. package/.agent-src/skills/readme-writing/SKILL.md +20 -0
  55. package/.agent-src/skills/readme-writing-package/SKILL.md +19 -0
  56. package/.agent-src/skills/roadmap-management/SKILL.md +7 -7
  57. package/.agent-src/skills/roadmap-writing/SKILL.md +157 -0
  58. package/.agent-src/skills/rule-writing/SKILL.md +22 -0
  59. package/.agent-src/skills/script-writing/SKILL.md +226 -0
  60. package/.agent-src/skills/skill-writing/SKILL.md +23 -0
  61. package/.agent-src/skills/systematic-debugging/SKILL.md +22 -2
  62. package/.agent-src/skills/technical-specification/SKILL.md +58 -1
  63. package/.agent-src/skills/test-driven-development/SKILL.md +24 -0
  64. package/.agent-src/skills/threat-modeling/SKILL.md +1 -0
  65. package/.agent-src/templates/agent-settings.md +87 -3
  66. package/.agent-src/templates/command.md +30 -9
  67. package/.agent-src/templates/roadmaps.md +10 -2
  68. package/.agent-src/templates/rule.md +8 -0
  69. package/.agent-src/templates/skill.md +49 -0
  70. package/.claude-plugin/marketplace.json +14 -2
  71. package/AGENTS.md +3 -3
  72. package/CHANGELOG.md +73 -0
  73. package/README.md +5 -5
  74. package/config/agent-settings.template.yml +22 -0
  75. package/docs/architecture.md +4 -4
  76. package/docs/contracts/command-clusters.md +45 -1
  77. package/docs/customization.md +72 -0
  78. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +126 -0
  79. package/docs/decisions/INDEX.md +15 -0
  80. package/docs/getting-started.md +2 -2
  81. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +27 -19
  82. package/docs/guidelines/agent-infra/carve-out-predicates.md +17 -0
  83. package/docs/guidelines/agent-infra/mcp-request-signing.md +199 -0
  84. package/docs/guidelines/agent-infra/naming.md +1 -1
  85. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +11 -4
  86. package/package.json +1 -1
  87. package/scripts/_lib/__init__.py +5 -0
  88. package/scripts/_lib/script_output.py +140 -0
  89. package/scripts/_phase2_shim_helper.py +1 -1
  90. package/scripts/adr/regenerate_index.py +79 -0
  91. package/scripts/ai_council/one_off_archive/2026-05/_one_off_add_quiet.py +149 -0
  92. package/scripts/ai_council/one_off_archive/2026-05/_one_off_inject_quiet_flag.py +33 -0
  93. package/scripts/ai_council/one_off_archive/2026-05/_one_off_measure_v2.sh +36 -0
  94. package/scripts/ai_council/one_off_archive/2026-05/_one_off_measure_verbosity.sh +26 -0
  95. package/scripts/ai_council/one_off_archive/2026-05/_one_off_per_task.sh +41 -0
  96. package/scripts/ai_council/one_off_archive/2026-05/_one_off_silent_taskfiles.py +98 -0
  97. package/scripts/check_augmentignore.py +4 -1
  98. package/scripts/check_command_count_messaging.py +4 -1
  99. package/scripts/check_compressed_paths.py +4 -1
  100. package/scripts/check_council_layout.py +4 -1
  101. package/scripts/check_council_references.py +4 -1
  102. package/scripts/check_iron_law_prominence.py +3 -1
  103. package/scripts/check_md_language.py +3 -1
  104. package/scripts/check_memory_proposal.py +3 -1
  105. package/scripts/check_public_catalog_links.py +4 -1
  106. package/scripts/check_reply_consistency.py +8 -2
  107. package/scripts/check_roadmap_trackable.py +4 -1
  108. package/scripts/compile_router.py +27 -0
  109. package/scripts/compress.py +33 -19
  110. package/scripts/cost/budget.mjs +152 -0
  111. package/scripts/cost/track.mjs +144 -0
  112. package/scripts/council_cli.py +127 -10
  113. package/scripts/first-run.sh +3 -9
  114. package/scripts/install-hooks.sh +19 -1
  115. package/scripts/install.py +17 -12
  116. package/scripts/install.sh +19 -8
  117. package/scripts/lint_examples.py +6 -2
  118. package/scripts/lint_handoffs.py +4 -1
  119. package/scripts/lint_load_context.py +4 -1
  120. package/scripts/lint_roadmap_complexity.py +6 -2
  121. package/scripts/lint_rule_interactions.py +4 -1
  122. package/scripts/lint_rule_tiers.py +4 -1
  123. package/scripts/measure_frugality_savings.py +164 -0
  124. package/scripts/migrate_command_suggestions.py +2 -2
  125. package/scripts/runtime_dispatcher.py +11 -0
  126. package/scripts/schemas/command.schema.json +5 -0
  127. package/scripts/schemas/rule.schema.json +5 -0
  128. package/scripts/schemas/skill.schema.json +5 -0
  129. package/scripts/skill_linter.py +208 -3
  130. package/.agent-src/commands/roadmap/execute.md +0 -109
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: adr-create
3
+ description: "Use when capturing an architectural decision — naming the file, picking the next ADR number, filling Status / Context / Decision / Consequences, and regenerating the index — even without saying 'ADR'."
4
+ source: package
5
+ execution:
6
+ type: assisted
7
+ handler: shell
8
+ timeout_seconds: 30
9
+ allowed_tools: []
10
+ command:
11
+ - python3
12
+ - scripts/adr/regenerate_index.py
13
+ ---
14
+
15
+ # adr-create
16
+
17
+ ## When to use
18
+
19
+ Use this skill when:
20
+
21
+ - A non-trivial architectural choice needs a written record (kernel
22
+ membership, cap raises, contract changes, library swap, deprecation).
23
+ - A decision overrides a previous one and needs `supersedes:` linkage.
24
+ - A roadmap phase closes and the chosen variant must be cited.
25
+ - The user says "write an ADR for X", "decision log this", "we need
26
+ a record of why we picked Y".
27
+
28
+ Do NOT use when:
29
+
30
+ - The change is reversible without governance impact (typo, lint
31
+ fix, refactor that stays inside one module).
32
+ - The decision is already covered by an existing ADR — extend or
33
+ supersede it instead of duplicating.
34
+ - A skill, rule, or guideline is the better home (use those skills).
35
+
36
+ ## Goal
37
+
38
+ - Sequential `ADR-NNN-<slug>.md` numbering with no gaps.
39
+ - Standard template: Status, Context, Decision, Consequences,
40
+ Alternatives, References.
41
+ - Regenerated index so readers find the ADR by topic, not by ls.
42
+ - Zero MCP-tool dependency — pure filesystem + Python.
43
+
44
+ ## Preconditions
45
+
46
+ - An ADR directory exists (default `docs/adr/`; `docs/decisions/` is
47
+ the recognised alias used in this package and many older projects).
48
+ - The decision is **already made** — ADRs record outcomes, they do
49
+ not run the decision process. For unresolved trade-offs, run the
50
+ council or consult `adversarial-review` first.
51
+
52
+ ## Procedure
53
+
54
+ ### 1. Inspect and resolve the ADR directory
55
+
56
+ Identify the canonical directory in this order:
57
+
58
+ 1. `docs/adr/` — default per spec.
59
+ 2. `docs/decisions/` — accepted alias if `docs/adr/` is missing.
60
+ 3. Anything else — fail, ask the user to pick one of the two
61
+ canonical paths. Do not invent a third location.
62
+
63
+ ### 2. Pick the next ADR number
64
+
65
+ Scan the directory for `ADR-*.md`, parse the leading 3-digit number,
66
+ take `max + 1` (zero-padded). For an empty directory, start at `001`.
67
+ Reject re-use of an existing number — the index regenerator treats
68
+ duplicates as a hard failure.
69
+
70
+ ### 3. Pick a slug
71
+
72
+ Short, hyphen-lowercase, scope-revealing. Match peer ADRs in the
73
+ directory. Examples: `kernel-swap-deferred`, `flat-cluster-subs`,
74
+ `http-bridge-deferred-with-trigger`. Reject slugs longer than 60 chars.
75
+
76
+ ### 4. Author the ADR
77
+
78
+ Use the standard template (frontmatter + body). All sections are
79
+ required; "n/a" is acceptable for genuinely empty Alternatives or
80
+ References blocks but never for Status, Context, Decision, or
81
+ Consequences.
82
+
83
+ ```markdown
84
+ ---
85
+ adr: NNN
86
+ status: proposed | accepted | superseded | deprecated
87
+ date: YYYY-MM-DD
88
+ decision: <slug>
89
+ supersedes: — | ADR-MMM
90
+ superseded_by: — | ADR-MMM
91
+ phase: <roadmap> · <phase-id>
92
+ ---
93
+
94
+ # ADR-NNN — <Decision Title>
95
+
96
+ ## Status
97
+
98
+ **<Proposed | Accepted | …>** · YYYY-MM-DD.
99
+
100
+ ## Context
101
+
102
+ What problem forced this decision? What constraints applied? What
103
+ alternatives were on the table at decision time?
104
+
105
+ ## Decision
106
+
107
+ The chosen variant, in one paragraph. Concrete enough that a reader
108
+ six months later knows what was actually picked.
109
+
110
+ ## Consequences
111
+
112
+ ### Accepted
113
+
114
+ - Hard guarantees we now make.
115
+
116
+ ### Trade-offs
117
+
118
+ - What we gave up. Mitigations, if any.
119
+
120
+ ## Alternatives considered
121
+
122
+ - **Variant X — <name>.** Rejected because <reason>.
123
+ - **Variant Y — <name>.** Rejected because <reason>.
124
+
125
+ ## References
126
+
127
+ - Linked roadmap, contract, prior ADR, council session id.
128
+ ```
129
+
130
+ ### 5. Regenerate the index
131
+
132
+ Run the dispatcher:
133
+
134
+ ```bash
135
+ python3 scripts/runtime_dispatcher.py run --skill adr-create
136
+ # or directly:
137
+ python3 scripts/adr/regenerate_index.py --dir docs/adr/
138
+ ```
139
+
140
+ The script scans `ADR-*.md`, reads frontmatter (`adr`, `status`,
141
+ `date`, `decision`, `supersedes`), and writes `INDEX.md` with one
142
+ table row per ADR plus broken-supersede warnings on stderr.
143
+
144
+ ### 6. Validate
145
+
146
+ - `python3 scripts/adr/regenerate_index.py --check` exits 0
147
+ (index is up to date, no number gaps, no broken supersedes).
148
+ - The project's CI / quality pipeline passes locally.
149
+
150
+ ## Output format
151
+
152
+ 1. Path of the new `ADR-NNN-<slug>.md` file.
153
+ 2. Path of the regenerated `INDEX.md`.
154
+ 3. One-line summary of the decision.
155
+ 4. Linked roadmap or phase, if any.
156
+
157
+ ## Gotchas
158
+
159
+ - `docs/adr/` is the default path; some projects use
160
+ `docs/decisions/` (this package included). Pass `--dir` to the
161
+ index regenerator when running outside the default.
162
+ - Frontmatter `adr:` is the canonical number; the filename prefix
163
+ must match. The index regenerator fails on mismatch.
164
+ - ADRs are append-only history. To revise a decision, write a new
165
+ ADR with `supersedes: ADR-MMM` and flip the old one's status to
166
+ `superseded`.
167
+ - Never delete an ADR file — supersede it. Deletion breaks
168
+ historical links and round-trips through git history checks.
169
+
170
+ ## Frugality Standards
171
+
172
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
173
+ to every ADR you author.
174
+
175
+ **Examples in this artifact:**
176
+ - Per the charter's default-terse rule, `## Context` states the
177
+ forcing function in 2–3 sentences; no historical narrative.
178
+ - Per the cite-don't-restate principle, `## Decision` links the
179
+ rules / contracts it overrides; no rule body is quoted in full.
180
+ - Per the cheap-question check, `## Alternatives considered` lists
181
+ genuine design alternatives, not strawmen.
182
+
183
+ **Pre-save self-check:**
184
+ 1. Does `## Context` carry more than 5 sentences of setup?
185
+ 2. Does `## Decision` restate rule text instead of citing the rule?
186
+ 3. Are alternatives evaluated with a real consequence each, or with
187
+ stylistic preference?
188
+ 4. Does the ADR forecast consequences with hedge phrases ("might",
189
+ "could potentially") instead of decidable claims?
190
+
191
+ ## Do NOT
192
+
193
+ - Skip Context — a decision without context is folklore.
194
+ - Reuse an existing ADR number — the index regenerator hard-fails.
195
+ - Author ADRs for reversible refactors or minor cleanups.
196
+ - Cite a council session id without ensuring the file is committed
197
+ or otherwise reachable from the repo (per `no-council-references`).
@@ -4,6 +4,7 @@ description: "ONLY when user explicitly requests adversarial review, devil's adv
4
4
  personas:
5
5
  - critical-challenger
6
6
  source: package
7
+ council_depth: deep
7
8
  ---
8
9
 
9
10
  # Adversarial Review
@@ -168,6 +168,7 @@ When starting work, read documentation in this order:
168
168
  | Significant multi-step change | Ask user about creating a roadmap in `agents/roadmaps/` |
169
169
  | New convention introduced | Update relevant doc in `./agents/` or `.augment/guidelines/` |
170
170
  | Database schema changed | Update `agents/docs/database-setup.md` |
171
+ | Architectural decision made | Use the [`adr-create`](../adr-create/SKILL.md) skill — writes a numbered ADR under `docs/adr/` (or `docs/decisions/`) and regenerates the index |
171
172
 
172
173
  ## When to update documentation
173
174
 
@@ -187,7 +188,7 @@ After completing a significant code change, run this mental checklist:
187
188
  | New API endpoint | OpenAPI annotations, `AGENTS.md` API section |
188
189
  | New module created | Create `app/Modules/{Module}/agents/` |
189
190
  | Service/repository signature changed | Check if referenced in `agents/docs/services-and-repos.md` |
190
- | New environment variable | `.env.example`, `AGENTS.md` env section |
191
+ | New environment variable | `.env.example`, `AGENTS.md` environment section |
191
192
  | Docker/compose change | `agents/docs/docker.md`, `Makefile` documentation |
192
193
  | New Artisan command | `AGENTS.md` commands section |
193
194
  | New pattern/convention introduced | Relevant guideline in `.augment/guidelines/` |
@@ -220,6 +221,27 @@ Do NOT auto-update docs without the user's knowledge. Flag what needs updating a
220
221
  - AGENTS.md and copilot-instructions.md have different audiences — don't copy content between them.
221
222
  - Module docs go in `app/Modules/*/agents/`, NOT in the central `agents/` directory.
222
223
 
224
+ ## Frugality Standards
225
+
226
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
227
+ to every agent-doc update you author.
228
+
229
+ **Examples in this artifact:**
230
+ - Per the charter's default-terse rule, doc updates state what
231
+ changed; no "In this section we will…" frames.
232
+ - Per the cheap-question check, AGENTS.md surface offers options
233
+ only where the project genuinely diverges.
234
+ - Per the post-action summary suppression, doc edits append change
235
+ notes to the existing log entry; no new "Summary of changes" block.
236
+
237
+ **Pre-save self-check:**
238
+ 1. Does the doc open with a narrative intro instead of the actual
239
+ content?
240
+ 2. Are paragraphs added that summarize an existing table?
241
+ 3. Does the doc duplicate the rule index instead of linking the
242
+ relevant rule?
243
+ 4. Is German prose present outside `DE: / EN:` anchor blocks?
244
+
223
245
  ## Do NOT
224
246
 
225
247
  - Do NOT create docs unless there's a real need (new module, significant change).
@@ -43,6 +43,7 @@ prompt that asks them to think on their own merits.
43
43
  THE COUNCIL DOES NOT SEE THE HOST AGENT'S ANALYSIS.
44
44
  THE COUNCIL DOES NOT SEE PRIOR REPLIES.
45
45
  THE COUNCIL SEES THE ARTEFACT + THE NEUTRAL SYSTEM PROMPT. NOTHING ELSE.
46
+ THE HOST AGENT IS THE CONVENER, NEVER A REVIEWER.
46
47
  ```
47
48
 
48
49
  If you find yourself wanting to "frame" the artefact for the council,
@@ -50,6 +51,13 @@ stop. Framing is exactly what kills the second-opinion value. Use the
50
51
  unbiased system prompts in `scripts/ai_council/prompts.py`; do not
51
52
  roll your own.
52
53
 
54
+ The host runs the council and synthesises convergence — it is the
55
+ convener, not a reviewer. The reviewer-ban is structural: the host
56
+ wrote (or framed) the artefact and cannot critique it independently.
57
+ Anonymising the host as "Reviewer C" is worse than excluding it — the
58
+ user is told they got an outside vote when they did not. Externals
59
+ down → surface and skip; never substitute the host as a reviewer.
60
+
53
61
  ### Neutrality — context-handoff
54
62
 
55
63
  External reviewers do better critique when they know **what the
@@ -120,6 +128,27 @@ token counts (from the manual-paste length heuristic or the
120
128
  provider's reply, when available) for observability. Mixed runs
121
129
  (one manual + one api) gate only the api members.
122
130
 
131
+ ## Degradation modes
132
+
133
+ How the council behaves when fewer than two billable members are
134
+ reachable. The orchestrator never silently substitutes — degradation
135
+ is visible to the user.
136
+
137
+ | Reachable | Behaviour | Independence |
138
+ |---|---|---|
139
+ | **2+** | Full fan-out, multi-round debate. Default. | High — cross-provider diversity. |
140
+ | **1** | Single-voice critique with a degraded-run warning. Multi-round mode lets the model see its own anonymised reply, but convergence ≠ correctness. | Low — shared blind spots. |
141
+ | **0** | Council skipped. Surface the failure, proceed without external review. **Never** substitute the host or an unrequested manual pass. | None. |
142
+
143
+ Rejected anti-patterns (council convergence, 2026-05-06): persona
144
+ prompts (same model, same blind spots, more cost), temperature
145
+ spread (noise, not signal), host-as-fallback (Iron Law breach).
146
+ Supported single-provider strategy is **sibling models on the same
147
+ provider** (e.g. Sonnet ↔ Opus, gpt-4o ↔ o1) — different training
148
+ cutoffs / reasoning architectures within one provider family. Cost
149
+ is real (siblings price-tier higher); explicit opt-in per invocation,
150
+ not a default.
151
+
123
152
  ## Procedure
124
153
 
125
154
  1. **Resolve target.** Identify the artefact mode (`prompt`, `roadmap`,
@@ -140,9 +169,61 @@ provider's reply, when available) for observability. Mixed runs
140
169
  into the host agent's voice.
141
170
  6. **Summarise.** Write a `Convergence / Divergence` block listing
142
171
  agreements, disagreements, and unique insights — provider-attributed.
143
- 7. **Translate to options.** Convert actionable council suggestions
144
- into concrete numbered options for the user. The user decides;
145
- the council advises.
172
+ 7. **Critically evaluate** every finding before it leaves the host
173
+ (see *Critical evaluation* below). The host is the convener **and**
174
+ the skeptic — never a reviewer of the artefact itself, but always a
175
+ reviewer of the **council's output**.
176
+ 8. **Translate validated findings to options.** Convert each finding
177
+ the host accepts (or accepts with modification) into a concrete
178
+ numbered option for the user. Tag every option with the host's
179
+ verdict so the user sees the agent's reasoned position, not the
180
+ council's raw output. The user decides; the council advises; the
181
+ host filters.
182
+
183
+ ## Critical evaluation — convener-skeptic stance
184
+
185
+ ```
186
+ COUNCIL CONVERGENCE IS NOT CORRECTNESS.
187
+ DO NOT BLINDLY ACCEPT FINDINGS. DO NOT BLINDLY REJECT THEM.
188
+ EVERY FINDING GETS A REASONED VERDICT BEFORE IT REACHES THE USER.
189
+ ```
190
+
191
+ The council is **uninformed about the codebase, ADRs, locked
192
+ contracts, prior decisions, and project history** — it sees only the
193
+ artefact + neutrality preamble. That is the source of its diversity
194
+ **and** its blind spots. Convergence between members can mean shared
195
+ generic best-practice priors, not project-specific correctness.
196
+
197
+ The host applies a critical lens to **every finding** (convergence
198
+ **and** divergence) before surfacing it as a numbered option:
199
+
200
+ | Check | Question | Tool |
201
+ |---|---|---|
202
+ | **Codebase fit** | Does the finding match the actual code, files, signatures, conventions? | `view` / `codebase-retrieval` / `grep` |
203
+ | **Locked-decision conflict** | Does it contradict an ADR, kernel rule, contract under `docs/contracts/`, or `docs/decisions/`? | `view` |
204
+ | **Already addressed** | Is it a generic best-practice already covered by an existing rule, skill, or test? | `view` / `grep` |
205
+ | **Cost / benefit** | Is the change worth the diff size, churn, and review cost vs. the marginal benefit? | reasoning |
206
+ | **Hallucination** | Does the finding cite a file, function, or behavior that does not exist? | `view` |
207
+
208
+ Each finding receives one of three verdicts:
209
+
210
+ - **`accept`** — codebase fits, no locked-decision conflict, benefit clears cost. Surface as a normal numbered option.
211
+ - **`accept-with-modification`** — core insight valid, but the proposed shape needs adjusting (wrong file, contradicts ADR detail, scope creep). Surface with the **modified** patch and a one-line note.
212
+ - **`reject`** — finding is wrong (hallucinated reference, contradicts a locked decision, already addressed, generic noise). Surface as a **Rejected by host** entry with a one-line reason. Still visible — the user can override.
213
+
214
+ The verdict is the host's **own** reasoning, not the council's.
215
+ Pretending convergence equals correctness, or paraphrasing council
216
+ output as host analysis, both breach the [`direct-answers`](../../rules/direct-answers.md)
217
+ no-invented-facts rule. When the host cannot reach a confident
218
+ verdict on a finding (mixed evidence, ambiguous scope), it surfaces
219
+ the finding as `needs-input` with the open question — the user
220
+ decides, the host does not guess.
221
+
222
+ ### What this is NOT
223
+
224
+ - **Not a re-review by the host.** The host did not write the artefact independently and cannot critique it independently — that boundary still holds.
225
+ - **Not a vote against the council.** Rejecting a finding requires evidence (file, line, contract reference), not preference.
226
+ - **Not silent filtering.** Every finding reaches the user with its verdict and reason. The user can pick a `reject` option and override the host.
146
227
 
147
228
  ## Output path convention
148
229
 
@@ -195,16 +276,26 @@ Every council reply MUST contain, in this order:
195
276
  containing the member's verbatim output.
196
277
  3. **Convergence / Divergence summary** — bullet list, every claim
197
278
  attributed by provider name.
198
- 4. **User-facing options** — numbered block per `user-interaction`,
199
- with "discard council input" always present as an option.
200
-
201
- The host agent NEVER ships council output as its own reasoning.
202
- Provider attribution stays visible in every render.
279
+ 4. **Host verdict per finding** — one row per finding with `accept`
280
+ / `accept-with-modification` / `reject` / `needs-input` plus a
281
+ one-line reason citing host evidence (file:line, ADR, contract).
282
+ See *Critical evaluation* above.
283
+ 5. **User-facing options** numbered block per `user-interaction`,
284
+ carrying the host verdict in each option, with "discard council
285
+ input" always present as an option.
286
+
287
+ The host agent NEVER ships council output as its own reasoning, and
288
+ NEVER ships the host verdict as council output. Provider attribution
289
+ stays visible in the per-member sections; host verdicts stay
290
+ attributed to the host.
203
291
 
204
292
  ## Do NOT
205
293
 
206
294
  - Do NOT paraphrase council output into the host agent's voice — strip
207
295
  attribution and you've stripped the value.
296
+ - Do NOT surface council findings to the user without a host verdict
297
+ — convergence ≠ correctness, and the user deserves the agent's
298
+ reasoned filter, not a raw forward.
208
299
  - Do NOT pre-warm the council with the host agent's analysis or
209
300
  identity — that primes the reviewer and collapses diversity.
210
301
  - Do NOT silently truncate a too-large bundle — surface the size and
@@ -236,6 +327,9 @@ Real failure modes seen in the wild:
236
327
  | Silently truncate a too-large bundle. | Misleads the reviewer into thinking they saw the whole thing. | Bundler raises `BundleTooLarge`; surface and ask for narrower scope. |
237
328
  | Reuse the same SDK client across calls without re-loading the key. | Leaks the key in long-lived process state. | Each invocation builds fresh clients from `load_*_key()`. |
238
329
  | Auto-spend tokens under `personal.autonomy: on`. | Autonomy ≠ permission to spend money. | Always ask before consultation, even under autonomy. |
330
+ | Forward council convergence to the user as numbered options without a host verdict. | Convergence ≠ correctness; the council never saw the codebase. | Apply the *Critical evaluation* lens; tag every finding `accept` / `accept-with-modification` / `reject` / `needs-input` with one-line reason. |
331
+ | Reject a finding on preference, not evidence. | "I don't like this" is not a verdict. | Cite the file, line, ADR, or contract that justifies the rejection — or surface as `needs-input`. |
332
+ | Paraphrase council output into the host's own analysis to defend a verdict. | Strips attribution, breaches `direct-answers` no-invented-facts. | Verdict cites host evidence (file:line); council output stays attributed in the per-member sections. |
239
333
 
240
334
  ## Redaction expectations
241
335
 
@@ -343,9 +437,39 @@ at least once before convergence). The host agent does **not** ask
343
437
  the settings owner already made that decision. Ask only when a
344
438
  genuinely complex artefact justifies more depth than the default.
345
439
 
440
+ ### Deep-reasoning tier (`council_depth: deep`)
441
+
442
+ Architecture review, refactoring proposals, and bug-diagnosis runs
443
+ benefit from an extra critique round. The deep tier is opt-in per
444
+ artefact:
445
+
446
+ 1. The consuming **rule, skill, or command** declares
447
+ `council_depth: deep` in its frontmatter. The schema accepts
448
+ **only `deep`** — `standard` is the implicit default and is
449
+ rejected by the linter (every frontmatter byte costs context
450
+ window; see `scripts/schemas/{rule,skill,command}.schema.json`).
451
+ To return an artefact to default depth, **delete the key**.
452
+ 2. The **host agent** reads that frontmatter when it dispatches the
453
+ council and passes `--depth deep` to `council_cli`. If multiple
454
+ active artefacts disagree, **deep wins** (max policy).
455
+ 3. The **CLI** floors the round count at
456
+ `max(ai_council.deep_min_rounds, ai_council.min_rounds)` —
457
+ defaults to `3` and `2` respectively. Lowering `deep_min_rounds`
458
+ below `min_rounds` has no effect (defensive max).
459
+
460
+ The CLI itself has no knowledge of frontmatter; the contract is the
461
+ flag. Resolution chain (highest priority first):
462
+
463
+ ```
464
+ --rounds N → explicit, any value (user override)
465
+ --depth deep → max(deep_min_rounds, min_rounds)
466
+ (no flag) → min_rounds (default 2)
467
+ ```
468
+
346
469
  | Property | Behaviour |
347
470
  |---|---|
348
471
  | Default count | `ai_council.min_rounds` (default `2`). Override per-invocation with `rounds:N` (or `--rounds N` to the CLI). |
472
+ | Deep floor | `ai_council.deep_min_rounds` (default `3`). Activated by `council_depth: deep` in artefact frontmatter (host translates to `--depth deep`) or explicit `--depth deep` on the CLI. Floored at `min_rounds`. |
349
473
  | Anonymisation | Provider/model identity is stripped. Reviewers are labelled `Reviewer A / B / C…` in input order. |
350
474
  | Errored prior responses | Skipped — they reveal nothing useful and can leak provider error formats. |
351
475
  | Cost budget | Accumulates across rounds. A round-2 call that breaches the cap fires `on_overrun` exactly like a round-1 breach. |
@@ -2,6 +2,7 @@
2
2
  name: bug-analyzer
3
3
  description: "Use when the user shares a Sentry error, Jira bug ticket, or error description and wants root cause analysis. Also for proactive bug hunting and code audits for hidden bugs."
4
4
  source: package
5
+ council_depth: deep
5
6
  ---
6
7
 
7
8
  # bug-analyzer
@@ -166,6 +166,29 @@ multi-paragraph explanation, extract it into a skill and call it.
166
166
  `.agent-src.uncompressed/`.
167
167
  * Duplicating another command's workflow instead of delegating via `skills:`.
168
168
 
169
+ ## Frugality Standards
170
+
171
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
172
+ to every command you author.
173
+
174
+ **Examples in this artifact:**
175
+ - Per the charter's default-terse rule, command output blocks state
176
+ the action result, not "Now we will execute…".
177
+ - Per the post-action summary suppression, the success path emits
178
+ the artifact (PR URL, commit hash) without a wrapping summary.
179
+ - Per the cheap-question check, never offer "preview vs. execute"
180
+ as a numbered option when the command's role is to execute.
181
+
182
+ **Pre-save self-check:**
183
+ 1. Does any command step prescribe a "Let me…" or "Found it" output
184
+ line?
185
+ 2. Does the command default to multi-line summaries when a one-line
186
+ outcome suffices?
187
+ 3. Is a confirmation gate used outside the Iron-Law / Routine /
188
+ Contextual taxonomy?
189
+ 4. Are template placeholders (`{{var}}`) accompanied by setup prose
190
+ instead of action prose?
191
+
169
192
  ## Do NOT
170
193
 
171
194
  * Do NOT set `disable-model-invocation: false`
@@ -156,6 +156,29 @@ schema regex and by `scripts/lint_load_context.py`. Body links to
156
156
  Canonical reference: `rule-writing` § 3b and
157
157
  `docs/contracts/load-context-schema.md`.
158
158
 
159
+ ## Frugality Standards
160
+
161
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
162
+ to every context file you author.
163
+
164
+ **Examples in this artifact:**
165
+ - Per the charter's index nature, context files are reviewer fuel —
166
+ they hold mechanics, not Iron-Law obligations.
167
+ - Per the cite-don't-restate principle, when a section mirrors a
168
+ rule, link the rule and stop.
169
+ - Per the act-skip-narration rule, lookup tables open the section;
170
+ explanatory prose follows only if the table is ambiguous.
171
+
172
+ **Pre-save self-check:**
173
+ 1. Does the context file restate Iron-Law text instead of linking
174
+ the rule?
175
+ 2. Does any section open with "This document explains…" instead of
176
+ the lookup material?
177
+ 3. Are placeholders (`<add me>`, `TBD`) shipped instead of actual
178
+ content?
179
+ 4. Are the cited rules linked with stable anchors (verified to
180
+ exist)?
181
+
159
182
  ## Do NOT
160
183
 
161
184
  - Do NOT copy content between projects. Every context file is local to its
@@ -113,6 +113,29 @@ Or add `BREAKING CHANGE:` in the commit body/footer.
113
113
  - Squash merge titles should describe the net effect, not every internal detail
114
114
  - `refactor` means NO behavior change — if behavior changes, use `feat` or `fix`
115
115
 
116
+ ## Frugality Standards
117
+
118
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
119
+ to every commit message you author.
120
+
121
+ **Examples in this artifact:**
122
+ - Per the charter's default-terse rule, the subject states the
123
+ change in 50 chars; no scaffolding ("This commit will…").
124
+ - Per the post-action summary suppression, the body lists changed
125
+ surfaces in bullets — no closing paragraph re-summarizing them.
126
+ - Per the cheap-question check, never propose a `feat` vs. `chore`
127
+ numbered choice when the type is decidable from the diff.
128
+
129
+ **Pre-save self-check:**
130
+ 1. Does the subject line carry filler ("various improvements",
131
+ "general updates")?
132
+ 2. Does the body re-narrate the diff instead of stating intent?
133
+ 3. Are co-author / attribution footers present without explicit user
134
+ request (per
135
+ [`no-attribution-footers`](../../rules/no-attribution-footers.md))?
136
+ 4. Is the type / scope chosen from the diff, not from the asker's
137
+ framing?
138
+
116
139
  ## Do NOT
117
140
 
118
141
  - Do NOT use vague messages: `update stuff`, `fix bug`, `changes`
@@ -130,6 +130,28 @@ Above the split signal, break by sub-topic into sibling files in the same folder
130
130
  * Hollowing out a skill into "see guideline" — the skill must remain
131
131
  executable (see `preservation-guard`).
132
132
 
133
+ ## Frugality Standards
134
+
135
+ Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)
136
+ to every guideline you author.
137
+
138
+ **Examples in this artifact:**
139
+ - Per the charter's index nature, guidelines describe practice
140
+ patterns; they do **not** restate Iron-Laws from rules.
141
+ - Per the act-skip-narration rule, code examples lead with the
142
+ pattern, not its motivation.
143
+ - Per the cheap-question check, guidelines do not prescribe stylistic
144
+ forks ("table vs. paragraph") — pick one.
145
+
146
+ **Pre-save self-check:**
147
+ 1. Does the guideline restate text from a rule body instead of
148
+ linking the rule?
149
+ 2. Are code examples preceded by narrative ramp-up?
150
+ 3. Does the guideline introduce a new convention without citing the
151
+ rule that holds the obligation?
152
+ 4. Are sections labeled "Overview" / "Background" carrying only
153
+ restatement?
154
+
133
155
  ## Do NOT
134
156
 
135
157
  * Do NOT add `type:` or `alwaysApply:` to the frontmatter