@event4u/agent-config 8.13.0 → 9.0.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 (279) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +136 -0
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/agent-handoff.md +35 -0
  5. package/dist/agent-src/commands/agents/init.md +1 -0
  6. package/dist/agent-src/commands/agents/optimize.md +1 -0
  7. package/dist/agent-src/commands/agents/user/accept.md +3 -2
  8. package/dist/agent-src/commands/agents/user/init.md +5 -4
  9. package/dist/agent-src/commands/agents/user/update.md +3 -2
  10. package/dist/agent-src/commands/agents/user.md +1 -0
  11. package/dist/agent-src/commands/agents.md +1 -0
  12. package/dist/agent-src/commands/analytics/show.md +1 -0
  13. package/dist/agent-src/commands/analytics.md +1 -0
  14. package/dist/agent-src/commands/analyze/decision.md +1 -0
  15. package/dist/agent-src/commands/analyze/incident.md +1 -0
  16. package/dist/agent-src/commands/analyze/near-miss.md +1 -0
  17. package/dist/agent-src/commands/analyze/postmortem.md +1 -0
  18. package/dist/agent-src/commands/analyze/premortem.md +1 -0
  19. package/dist/agent-src/commands/analyze/reference-repo.md +1 -0
  20. package/dist/agent-src/commands/analyze.md +3 -2
  21. package/dist/agent-src/commands/brand/identity.md +6 -5
  22. package/dist/agent-src/commands/brand/review.md +6 -5
  23. package/dist/agent-src/commands/brand/strategy.md +6 -4
  24. package/dist/agent-src/commands/brand/tokens.md +7 -6
  25. package/dist/agent-src/commands/brand/voice.md +5 -4
  26. package/dist/agent-src/commands/brand.md +9 -7
  27. package/dist/agent-src/commands/bug/fix.md +1 -0
  28. package/dist/agent-src/commands/bug/investigate.md +1 -0
  29. package/dist/agent-src/commands/bug.md +2 -1
  30. package/dist/agent-src/commands/challenge-me/vision.md +1 -0
  31. package/dist/agent-src/commands/challenge-me/with-docs.md +1 -0
  32. package/dist/agent-src/commands/challenge-me.md +28 -6
  33. package/dist/agent-src/commands/chat-history.md +1 -0
  34. package/dist/agent-src/commands/check-current-md.md +1 -0
  35. package/dist/agent-src/commands/commit.md +1 -0
  36. package/dist/agent-src/commands/context/create.md +3 -2
  37. package/dist/agent-src/commands/context.md +1 -0
  38. package/dist/agent-src/commands/cost/profile.md +1 -0
  39. package/dist/agent-src/commands/cost.md +2 -1
  40. package/dist/agent-src/commands/council/analysis.md +1 -0
  41. package/dist/agent-src/commands/council/debate.md +1 -0
  42. package/dist/agent-src/commands/council/default.md +21 -20
  43. package/dist/agent-src/commands/council/design.md +1 -0
  44. package/dist/agent-src/commands/council/optimize.md +1 -0
  45. package/dist/agent-src/commands/council/pr.md +1 -0
  46. package/dist/agent-src/commands/council.md +1 -0
  47. package/dist/agent-src/commands/estimate-ticket.md +1 -0
  48. package/dist/agent-src/commands/feature/dev.md +1 -0
  49. package/dist/agent-src/commands/feature/explore.md +1 -0
  50. package/dist/agent-src/commands/feature/plan.md +1 -0
  51. package/dist/agent-src/commands/feature/refactor.md +1 -0
  52. package/dist/agent-src/commands/feature/roadmap.md +1 -0
  53. package/dist/agent-src/commands/feature.md +2 -1
  54. package/dist/agent-src/commands/fix/pr-comments.md +19 -0
  55. package/dist/agent-src/commands/fix.md +2 -1
  56. package/dist/agent-src/commands/ghostwriter/delete.md +1 -0
  57. package/dist/agent-src/commands/ghostwriter/fetch.md +1 -0
  58. package/dist/agent-src/commands/ghostwriter/show.md +1 -0
  59. package/dist/agent-src/commands/ghostwriter/write.md +1 -0
  60. package/dist/agent-src/commands/ghostwriter.md +1 -0
  61. package/dist/agent-src/commands/grill-me.md +17 -12
  62. package/dist/agent-src/commands/humanize.md +1 -0
  63. package/dist/agent-src/commands/image/analyse.md +2 -1
  64. package/dist/agent-src/commands/image/create.md +1 -0
  65. package/dist/agent-src/commands/image/verify.md +1 -0
  66. package/dist/agent-src/commands/image.md +16 -12
  67. package/dist/agent-src/commands/implement-ticket.md +1 -0
  68. package/dist/agent-src/commands/judge/on-diff.md +1 -0
  69. package/dist/agent-src/commands/judge/solo.md +1 -0
  70. package/dist/agent-src/commands/judge/steps.md +1 -0
  71. package/dist/agent-src/commands/judge.md +1 -0
  72. package/dist/agent-src/commands/knowledge/cross-repo.md +1 -0
  73. package/dist/agent-src/commands/knowledge/forget.md +1 -0
  74. package/dist/agent-src/commands/knowledge/ingest.md +1 -0
  75. package/dist/agent-src/commands/knowledge/list.md +10 -0
  76. package/dist/agent-src/commands/knowledge.md +1 -0
  77. package/dist/agent-src/commands/memory/learn-low-impact.md +1 -0
  78. package/dist/agent-src/commands/memory/mine-session.md +1 -0
  79. package/dist/agent-src/commands/memory/promote.md +3 -2
  80. package/dist/agent-src/commands/memory.md +1 -0
  81. package/dist/agent-src/commands/mission/upgrade.md +45 -24
  82. package/dist/agent-src/commands/mode.md +1 -0
  83. package/dist/agent-src/commands/module/create.md +1 -0
  84. package/dist/agent-src/commands/module/explore.md +1 -0
  85. package/dist/agent-src/commands/module.md +1 -0
  86. package/dist/agent-src/commands/optimize/agents-dir.md +1 -0
  87. package/dist/agent-src/commands/optimize/project.md +1 -0
  88. package/dist/agent-src/commands/optimize/prompt.md +1 -0
  89. package/dist/agent-src/commands/optimize.md +2 -1
  90. package/dist/agent-src/commands/orchestrate.md +1 -0
  91. package/dist/agent-src/commands/override.md +1 -0
  92. package/dist/agent-src/commands/package.md +2 -1
  93. package/dist/agent-src/commands/post-as/ghostwriter.md +1 -0
  94. package/dist/agent-src/commands/post-as/me.md +1 -0
  95. package/dist/agent-src/commands/post-as.md +1 -0
  96. package/dist/agent-src/commands/pr/create/description-only.md +1 -0
  97. package/dist/agent-src/commands/pr/create.md +19 -17
  98. package/dist/agent-src/commands/prediction-pool.md +7 -6
  99. package/dist/agent-src/commands/prepare-for-review.md +1 -0
  100. package/dist/agent-src/commands/profile/activate.md +1 -0
  101. package/dist/agent-src/commands/profile/deactivate.md +1 -0
  102. package/dist/agent-src/commands/profile.md +1 -0
  103. package/dist/agent-src/commands/project.md +2 -1
  104. package/dist/agent-src/commands/refine-ticket.md +7 -0
  105. package/dist/agent-src/commands/research/deep.md +1 -0
  106. package/dist/agent-src/commands/research.md +1 -0
  107. package/dist/agent-src/commands/review/routing.md +1 -0
  108. package/dist/agent-src/commands/review.md +2 -1
  109. package/dist/agent-src/commands/roadmap/ai-council.md +1 -0
  110. package/dist/agent-src/commands/roadmap/materialize.md +1 -0
  111. package/dist/agent-src/commands/roadmap/process-full.md +1 -0
  112. package/dist/agent-src/commands/roadmap/process-phase.md +1 -0
  113. package/dist/agent-src/commands/roadmap/process-step.md +1 -0
  114. package/dist/agent-src/commands/roadmap.md +1 -0
  115. package/dist/agent-src/commands/security-audit-config.md +2 -1
  116. package/dist/agent-src/commands/skill/preview.md +1 -0
  117. package/dist/agent-src/commands/skill.md +1 -0
  118. package/dist/agent-src/commands/skills/discover.md +1 -0
  119. package/dist/agent-src/commands/skills.md +1 -0
  120. package/dist/agent-src/commands/sync/agent-settings.md +1 -0
  121. package/dist/agent-src/commands/sync.md +2 -1
  122. package/dist/agent-src/commands/team/adversarial.md +3 -2
  123. package/dist/agent-src/commands/team/delegate.md +3 -2
  124. package/dist/agent-src/commands/team/review.md +3 -2
  125. package/dist/agent-src/commands/team/status.md +49 -18
  126. package/dist/agent-src/commands/team-knowledge.md +8 -6
  127. package/dist/agent-src/commands/team.md +21 -16
  128. package/dist/agent-src/commands/tests/e2e-heal.md +1 -0
  129. package/dist/agent-src/commands/tests/e2e-plan.md +1 -0
  130. package/dist/agent-src/commands/tests/execute.md +1 -0
  131. package/dist/agent-src/commands/tests.md +2 -1
  132. package/dist/agent-src/commands/update-form-request-messages.md +1 -0
  133. package/dist/agent-src/commands/upstream-contribute.md +1 -0
  134. package/dist/agent-src/commands/video/from-script.md +3 -2
  135. package/dist/agent-src/commands/video/from-song.md +22 -21
  136. package/dist/agent-src/commands/video/scene.md +1 -0
  137. package/dist/agent-src/commands/video/stitch.md +2 -1
  138. package/dist/agent-src/commands/video/storyboard.md +1 -0
  139. package/dist/agent-src/commands/video.md +1 -0
  140. package/dist/agent-src/commands/work.md +1 -0
  141. package/dist/agent-src/commands/worktree/cleanup.md +8 -7
  142. package/dist/agent-src/commands/worktree/create.md +1 -0
  143. package/dist/agent-src/commands/worktree/verify.md +1 -0
  144. package/dist/agent-src/commands/worktree.md +1 -0
  145. package/dist/agent-src/rules/active-remediation.md +12 -36
  146. package/dist/agent-src/rules/artifact-drafting-protocol.md +7 -64
  147. package/dist/agent-src/rules/context-hygiene.md +19 -113
  148. package/dist/agent-src/rules/design-fidelity.md +4 -60
  149. package/dist/agent-src/rules/domain-adoption-policy.md +10 -106
  150. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +12 -60
  151. package/dist/agent-src/rules/improve-before-implement.md +4 -0
  152. package/dist/agent-src/rules/minimal-safe-diff.md +6 -86
  153. package/dist/agent-src/rules/size-enforcement.md +10 -0
  154. package/dist/agent-src/rules/tool-safety.md +17 -3
  155. package/dist/agent-src/skills/agent-security-review/SKILL.md +12 -1
  156. package/dist/agent-src/skills/ai-council/SKILL.md +11 -0
  157. package/dist/agent-src/skills/bug-analyzer/SKILL.md +24 -2
  158. package/dist/agent-src/skills/code-review/SKILL.md +105 -93
  159. package/dist/agent-src/skills/code-review/checklists/backend.md +50 -0
  160. package/dist/agent-src/skills/code-review/checklists/database.md +19 -0
  161. package/dist/agent-src/skills/code-review/checklists/dependency.md +18 -0
  162. package/dist/agent-src/skills/code-review/checklists/docs.md +14 -0
  163. package/dist/agent-src/skills/code-review/checklists/frontend.md +19 -0
  164. package/dist/agent-src/skills/code-review/checklists/infra.md +17 -0
  165. package/dist/agent-src/skills/code-review/checklists/producing-the-review.md +62 -0
  166. package/dist/agent-src/skills/code-review/checklists/test-only.md +13 -0
  167. package/dist/agent-src/skills/code-review/evals/evals.json +53 -15
  168. package/dist/agent-src/skills/condense-memory/SKILL.md +3 -2
  169. package/dist/agent-src/skills/conventional-commits-writing/evals/evals.json +15 -0
  170. package/dist/agent-src/skills/docker/SKILL.md +10 -0
  171. package/dist/agent-src/skills/docx-authoring/SKILL.md +102 -0
  172. package/dist/agent-src/skills/github-ci/evals/evals.json +25 -0
  173. package/dist/agent-src/skills/humanizer/SKILL.md +79 -3
  174. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +112 -0
  175. package/dist/agent-src/skills/humanizer/references/fixtures.md +70 -0
  176. package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +7 -1
  177. package/dist/agent-src/skills/laravel/SKILL.md +10 -0
  178. package/dist/agent-src/skills/launch-readiness/SKILL.md +35 -0
  179. package/dist/agent-src/skills/merge-conflicts/SKILL.md +30 -0
  180. package/dist/agent-src/skills/pdf-tools/SKILL.md +101 -0
  181. package/dist/agent-src/skills/quality-tools/evals/evals.json +15 -0
  182. package/dist/agent-src/skills/security-audit/SKILL.md +29 -0
  183. package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +90 -0
  184. package/dist/agent-src/skills/security-maturity-assessment/evals/triggers.json +52 -0
  185. package/dist/agent-src/skills/skill-writing/SKILL.md +79 -0
  186. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +11 -3
  187. package/dist/agent-src/skills/subagent-orchestration/schemas/team-review-status.json +103 -0
  188. package/dist/agent-src/skills/terraform/SKILL.md +10 -0
  189. package/dist/agent-src/skills/test-driven-development/SKILL.md +31 -0
  190. package/dist/agent-src/skills/threat-modeling/SKILL.md +15 -0
  191. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  192. package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  193. package/dist/agent-src/templates/scripts/telemetry/engagement.ts +30 -0
  194. package/dist/agent-src/templates/scripts/telemetry/report_renderer.ts +22 -9
  195. package/dist/agent-src/templates/scripts/telemetry_record.ts +5 -0
  196. package/dist/discovery/deprecation-report.md +1 -1
  197. package/dist/discovery/discovery-manifest.json +256 -190
  198. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  199. package/dist/discovery/discovery-manifest.summary.md +5 -5
  200. package/dist/discovery/orphan-report.md +1 -1
  201. package/dist/discovery/packs.json +20 -17
  202. package/dist/discovery/trust-report.md +3 -3
  203. package/dist/discovery/workspaces.json +16 -13
  204. package/dist/install/install.mjs +10 -2
  205. package/dist/mcp/registry-manifest.json +3 -3
  206. package/dist/router.json +1 -1
  207. package/dist/scripts/condense.js +5 -0
  208. package/dist/scripts/condense.js.map +1 -1
  209. package/dist/server/schemas/settings.js +5 -1
  210. package/dist/server/schemas/settings.js.map +1 -1
  211. package/docs/CLAIMS.md +8 -1
  212. package/docs/SKILL_CENSUS.md +8 -0
  213. package/docs/architecture.md +2 -2
  214. package/docs/benchmark.md +67 -2
  215. package/docs/catalog.md +2 -2
  216. package/docs/contracts/ai-council-config.md +9 -2
  217. package/docs/contracts/ai-team-config.md +37 -4
  218. package/docs/contracts/prelaunch-diagnostics.md +151 -0
  219. package/docs/contracts/release-pr-gating.md +1 -0
  220. package/docs/decisions/ADR-049-configuration-trust-boundary.md +9 -1
  221. package/docs/featured-skills.md +2 -2
  222. package/docs/getting-started-by-role.md +1 -1
  223. package/docs/getting-started.md +16 -5
  224. package/docs/governance-advantage.md +1 -1
  225. package/docs/guidelines/agent-infra/active-remediation-mechanics.md +45 -0
  226. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +28 -0
  227. package/docs/guidelines/agent-infra/artifact-drafting-protocol-mechanics.md +76 -0
  228. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +90 -0
  229. package/docs/guidelines/agent-infra/domain-adoption-gates.md +112 -0
  230. package/docs/guidelines/agent-infra/framework-neutrality-patterns.md +66 -0
  231. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +99 -0
  232. package/docs/guidelines/agent-infra/skill-quality-checklist.md +13 -0
  233. package/docs/guidelines/design-fidelity-mechanics.md +76 -0
  234. package/docs/parity/command-frontmatter.md +60 -0
  235. package/docs/proof.md +6 -5
  236. package/package.json +1 -1
  237. package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
  238. package/src/agent-src/templates/scripts/telemetry/engagement.ts +30 -0
  239. package/src/agent-src/templates/scripts/telemetry/report_renderer.ts +22 -9
  240. package/src/agent-src/templates/scripts/telemetry_record.ts +5 -0
  241. package/src/config/agent-settings.template.yml +34 -10
  242. package/src/config/prelaunch-areas.yml +36 -0
  243. package/src/scripts/_cli/cmd_doctor.ts +118 -26
  244. package/src/scripts/_lib/claude_plugin.ts +77 -2
  245. package/src/scripts/_lib/orchestration_record.ts +5 -0
  246. package/src/scripts/_lib/tool_adapter_registry.ts +120 -0
  247. package/src/scripts/ai_team/config.ts +73 -1
  248. package/src/scripts/ai_team/review_gate.ts +636 -0
  249. package/src/scripts/ai_team/team_dispatch.ts +612 -0
  250. package/src/scripts/bench_ab_task_runner.ts +11 -1
  251. package/src/scripts/bench_parity_count.ts +279 -0
  252. package/src/scripts/build_linear_digest.ts +3 -1
  253. package/src/scripts/check_bridge_derivation.ts +172 -0
  254. package/src/scripts/check_consumer_scope_flip.ts +179 -0
  255. package/src/scripts/check_council_config_location.ts +115 -15
  256. package/src/scripts/check_host_loadability.ts +81 -0
  257. package/src/scripts/condense.ts +5 -0
  258. package/src/scripts/hook_manifest.yaml +12 -1
  259. package/src/scripts/lint_handoffs.ts +42 -0
  260. package/src/scripts/lint_skill_descriptions.ts +228 -0
  261. package/src/scripts/lint_skill_descriptions_allowlist.json +1 -0
  262. package/src/scripts/lint_skill_scripts_readonly.ts +145 -0
  263. package/src/scripts/lint_skill_scripts_readonly_allowlist.json +8 -0
  264. package/src/scripts/lint_supported_tools_matrix.ts +35 -0
  265. package/src/scripts/optimize_skill_description.ts +144 -0
  266. package/src/scripts/orchestration_record.ts +2 -1
  267. package/src/scripts/prelaunch_diagnostics.ts +248 -0
  268. package/src/scripts/run_skill_evals.ts +70 -4
  269. package/src/scripts/schemas/command.schema.json +7 -0
  270. package/src/scripts/schemas/evals.schema.json +105 -14
  271. package/src/scripts/schemas/prelaunch-report.schema.json +107 -0
  272. package/src/scripts/schemas/skill.schema.json +18 -1
  273. package/src/scripts/schemas/subagent.schema.json +6 -0
  274. package/src/scripts/skill_linter.ts +43 -3
  275. package/src/scripts/smoke_host_loadability.sh +73 -0
  276. package/src/scripts/team_review_gate_hook.ts +115 -0
  277. package/src/scripts/trigger_eval_grandfather.json +1 -2
  278. package/src/scripts/utilization_report.ts +225 -0
  279. package/src/server/schemas/settings.ts +9 -1
package/docs/catalog.md CHANGED
@@ -569,11 +569,11 @@ are excluded.
569
569
  | command | [`team-knowledge`](../dist/agent-src/commands/team-knowledge.md) | cluster: team-knowledge | Team-knowledge orchestrator — routes to consolidate and bootstrap |
570
570
  | command | [`team-knowledge-bootstrap`](../dist/agent-src/commands/team-knowledge/bootstrap.md) | cluster: team-knowledge | One-shot deterministic seed for a fresh project's knowledge layer — stages template pages from real config/directory detection, never LLM-invented claims. Review-then-commit. |
571
571
  | command | [`team-knowledge-consolidate`](../dist/agent-src/commands/team-knowledge/consolidate.md) | cluster: team-knowledge | Review pending typed knowledge-observation events and file them into agents/knowledge/ pages as a human-reviewed batch — never writes without approval. |
572
- | command | [`team`](../dist/agent-src/commands/team.md) | cluster: team | Team orchestrator — cross-model depth review (one strong model builds, a second reviews the real diff); routes to review, adversarial, delegate, status |
572
+ | command | [`team`](../dist/agent-src/commands/team.md) | cluster: team | Team orchestrator — governed cross-model access layer (a second strong model reviews the real diff; read-only multi-host fallback); routes to review, adversarial, delegate, status |
573
573
  | command | [`team-adversarial`](../dist/agent-src/commands/team/adversarial.md) | cluster: team | Thin wrapper — adversarial cross-model review on a named focus via the official plugin (/codex:adversarial-review). Escalation rung above the single-model adversarial-review skill. |
574
574
  | command | [`team-delegate`](../dist/agent-src/commands/team/delegate.md) | cluster: team | Thin wrapper — hand a task to the second model as a native worker via the official plugin (/codex:rescue). The only write-access wrapper; double-gated behind ai_team.allow_delegate. |
575
575
  | command | [`team-review`](../dist/agent-src/commands/team/review.md) | cluster: team | Thin wrapper — cross-model review of the current diff via the official plugin (/codex:review). Gated on ai_team.enabled; fails closed when the plugin is absent. |
576
- | command | [`team-status`](../dist/agent-src/commands/team/status.md) | cluster: team | Thin wrapper — plugin job status via /codex:status plus a ledger line with today's cli_call_budget openai count. Gated on ai_team.enabled; fails closed when the plugin is absent. |
576
+ | command | [`team-status`](../dist/agent-src/commands/team/status.md) | cluster: team | Thin wrapper — plugin job status via /codex:status plus a quota block showing the shared openai counter against both ceilings (team + council). Gated on ai_team.enabled; fails closed when the plugin… |
577
577
  | command | [`tests`](../dist/agent-src/commands/tests.md) | cluster: tests | Tests orchestrator — routes to create, execute, e2e-plan, e2e-heal |
578
578
  | command | [`tests-create`](../dist/agent-src/commands/tests/create.md) | cluster: tests | Write meaningful tests for the current branch — stack-adaptive (pest / phpunit / vitest / jest / pytest / …) |
579
579
  | command | [`tests-e2e-heal`](../dist/agent-src/commands/tests/e2e-heal.md) | cluster: tests | Find, debug, and fix failing Playwright E2E tests |
@@ -787,11 +787,18 @@ error) when any of these hold:
787
787
 
788
788
  ## Migration footprint (Phase 0)
789
789
 
790
+ > Historical record of the Step-2 consolidation. **The project-local file
791
+ > described below is no longer read** — ADR-104 (superseding ADR-093) moved
792
+ > the council config to the user-global location documented at the top of
793
+ > this contract. A `.ai-council.yml` under any project `agents/` tree is
794
+ > ignored. Read this section for provenance only, not for placement.
795
+
790
796
  - `.agent-settings.yml` → 14-key inventory under `ai_council:` removed
791
797
  after a one-line breadcrumb comment is in place pointing at this
792
798
  contract.
793
799
  - `.agent-settings.template.yml` → same removal.
794
- - New file `agents/settings/.ai-council.yml` checked in with two enabled
800
+ - New file `agents/settings/.ai-council.yml` checked in with two enabled <!-- council-config-allowed -->
795
801
  providers (anthropic + openai) and three disabled
796
802
  (gemini + xai + perplexity). Models pre-filled from the Phase 0
797
- default set; comments mirror this contract.
803
+ default set; comments mirror this contract. *(This project-tracked file
804
+ was later removed; per ADR-104 the config is user-global only.)*
@@ -47,6 +47,9 @@ ai_team:
47
47
  allow_delegate: <bool> # second opt-in for the write path, default false
48
48
  max_calls_per_day: <int >= 0> # default 50; counts into the shared openai bucket
49
49
  suppress_setup_hint: <bool> # default false; cosmetic wizard-hint suppression
50
+ review_gate: # managed governance of the plugin's Stop-hook Review Gate
51
+ managed: <bool> # default false = byte-identical pre-Phase-4 behavior
52
+ max_consecutive_blocks: <int >= 1> # default 3; circuit-breaker loop bound
50
53
  ```
51
54
 
52
55
  | Key | Type | Default | Semantics |
@@ -56,6 +59,8 @@ ai_team:
56
59
  | `allow_delegate` | bool | `false` | Second opt-in for the **only** wrapper that delegates write access (`/team:delegate`). Refuses with an enable pointer until BOTH `enabled` and `allow_delegate` are `true`. |
57
60
  | `max_calls_per_day` | int ≥ 0 | `50` | Per-day ceiling on team calls, read against the **shared** `cli_call_budget` openai bucket (see § Quota). `0` blocks all team calls. |
58
61
  | `suppress_setup_hint` | bool | `false` | Suppress the one-line wizard/init recommendation to install the codex plugin on Claude-Code hosts. Cosmetic only. |
62
+ | `review_gate.managed` | bool | `false` | Managed governance of the codex plugin's Stop-hook Review Gate (Phase 4). `false` = no counting, no circuit breaker — the Stop path is byte-identical to pre-Phase-4 dispatch. `true` = consecutive BLOCK verdicts are counted per session (first-line `ALLOW:`/`BLOCK:` contract of the gate transcript; anything else is honestly `UNKNOWN` and never counted) and the circuit breaker trips at the bound. |
63
+ | `review_gate.max_consecutive_blocks` | int ≥ 1 | `3` | Circuit-breaker bound. At this many CONSECUTIVE BLOCKs in one session a visible notice is injected **exactly once** and the managed layer stops re-blocking — the user decides, never an infinite Claude↔Codex loop. An ALLOW verdict resets the counter. Unknown keys inside `review_gate` are rejected fail-closed, same as the parent block. |
59
64
 
60
65
  ### Why `model: 'auto'` instead of a pinned ID
61
66
 
@@ -68,10 +73,14 @@ default, and only the codex CLI knows what that currently is. `'auto'`
68
73
  therefore delegates the choice to the CLI; a set value is a user pin and
69
74
  passes through verbatim — the loader never rewrites or "corrects" it.
70
75
 
71
- **Future keys:** `review_gate` (managed, loop-bound governance of the
72
- plugin's Stop-hook Review Gate) is reserved for a later team-mode phase
73
- (Phase 4). Do not add it — or any other key — ahead of its phase; the
74
- loader rejects unknown keys today by design.
76
+ **`review_gate` (Phase 4, shipped):** the loop-bound governance block is
77
+ live — module `src/scripts/ai_team/review_gate.ts` (counter state under
78
+ `agents/runtime/state/team-review-gate.json`, ledger under
79
+ `agents/runtime/team/events.log`, one `team.gate: BLOCK 2/3` /
80
+ `ALLOW reset` line per gate verdict). The gate itself stays upstream's;
81
+ upstream's own warning applies while it is enabled unmanaged: "The
82
+ review gate can create a long-running Claude/Codex loop and may drain
83
+ usage limits quickly." Any other key stays rejected fail-closed.
75
84
 
76
85
  ## Role semantics — the council-verdict design constraint
77
86
 
@@ -141,6 +150,30 @@ same *counter*: whichever path a call takes, it increments the one shared
141
150
  bucket, and each surface enforces its own configured cap against that
142
151
  shared count.
143
152
 
153
+ **Worked example — two ceilings, one counter.** Council ceiling
154
+ `cli_call_budget.max_calls_per_day.openai: 100`, team ceiling
155
+ `ai_team.max_calls_per_day: 50`, shared counter at 45 openai calls today:
156
+ both paths are open. Five team calls later the counter reads 50 — team
157
+ calls are now blocked (50 >= 50) while council CLI calls continue until
158
+ the counter reaches 100. Whichever path fires a call, the same counter
159
+ moves; each surface only decides where *its* ceiling sits on that shared
160
+ count. `/team status` renders exactly this state: the live counter, both
161
+ ceilings, and which path (if any) is currently blocked.
162
+
163
+ ### Team-review envelope
164
+
165
+ Every `/team:review` return — plugin path and multi-host fallback alike — is emitted in the
166
+ team-review status envelope (`src/skills/subagent-orchestration/schemas/team-review-status.json`),
167
+ which extends the `subagent-status.json` frame: `status` (`DONE | DONE_WITH_CONCERNS |
168
+ NEEDS_CONTEXT | BLOCKED`), `findings[]` (`severity`/`evidence`/`suggested_fix`/`location?`),
169
+ `reviewed_ref` (HEAD sha of the bundle), `model` (`'auto'` = codex CLI default), and
170
+ `quota` (`{used, ceiling}` on the shared `cli_call_budget` openai bucket); unparseable model
171
+ output is preserved verbatim in `raw` with status `DONE_WITH_CONCERNS` — never silently dropped.
172
+ Plugin text is summarized INTO the envelope and preserved verbatim beneath — never rewritten.
173
+ <!-- PLACEHOLDER: the team-review-envelope subsection (review-gate ledger
174
+ line format `team.gate: BLOCK n/N` read by /team status) is inserted
175
+ here by the orchestrator in a later step. Do not remove this marker. -->
176
+
144
177
  ## Validation rules (fail-closed)
145
178
 
146
179
  `load_ai_team_config` / `build_ai_team_config`
@@ -0,0 +1,151 @@
1
+ # Pre-Launch Diagnostics — finding IDs, epistemics, regression gate
2
+
3
+ > Contract for the consumer-facing launch diagnostic
4
+ > (road-to-ecosystem-harvest-prelaunch-diagnostics, Source L — a
5
+ > production-readiness diagnostic skill; provenance in the harvest index).
6
+ > The consumer-side sibling of the suite's own claims-ledger: a "ready"
7
+ > verdict cannot be reached by assertion.
8
+ >
9
+ > Schema: [`prelaunch-report.schema.json`](../../src/scripts/schemas/prelaunch-report.schema.json) ·
10
+ > Area vocabulary: [`prelaunch-areas.yml`](../../src/config/prelaunch-areas.yml) ·
11
+ > Tooling: [`prelaunch_diagnostics.ts`](../../src/scripts/prelaunch_diagnostics.ts) ·
12
+ > Skill surface: [`launch-readiness`](../../src/skills/launch-readiness/SKILL.md).
13
+
14
+ ## 1 — Finding-ID grammar (immutable, diff-stable)
15
+
16
+ ```
17
+ AC-<AREA>-NNN e.g. AC-AUTH-003, AC-RBK-001
18
+ ```
19
+
20
+ - `<AREA>` — the uppercase code of a coverage area from
21
+ [`prelaunch-areas.yml`](../../src/config/prelaunch-areas.yml). The vocabulary
22
+ is **append-only**: codes are never renamed or re-used.
23
+ - `NNN` — zero-padded, monotonically assigned per area, **never re-assigned**.
24
+ A finding that is retitled, re-scoped, or resolved keeps its ID forever; a
25
+ genuinely new problem gets the next number. Resolved findings stay in the
26
+ report with a flipped `status` — the entry never disappears, so baselines
27
+ diff cleanly across months.
28
+ - The **ID is the diff key**. Titles, evidence, and severity are mutable
29
+ metadata; two runs are compared by ID set + per-ID state, never by prose.
30
+
31
+ ## 2 — Epistemics (Pass needs evidence; Unknown ≠ Pass)
32
+
33
+ Every coverage area carries exactly one state:
34
+
35
+ | State | Meaning | Requirement |
36
+ |---|---|---|
37
+ | `pass` | Diagnosed clean | **Cited evidence required** — file:line, command output, run URL. A pass without evidence fails validation: that is assertion, not diagnosis. |
38
+ | `finding` | At least one open finding | The finding IDs live in `findings[]`. |
39
+ | `unknown` | Not diagnosed | The honest default. **Absence of findings is `unknown`, never an automatic `pass`.** An area missing from the report entirely is `unknown` by definition. |
40
+ | `not-applicable` | Does not exist on this surface | **Reason required** ("no DB → no migrations"). |
41
+
42
+ Verdict rule (the launch gate):
43
+
44
+ ```
45
+ ANY OPEN P0 FINDING → NOT READY, REGARDLESS OF EVERY OTHER AREA.
46
+ ANY OPEN P1, OR A launch_gate AREA NOT AT pass/not-applicable → NOT READY.
47
+ READY IS THE RESIDUAL STATE, NEVER THE DEFAULT.
48
+ ```
49
+
50
+ `launch_gate: true` areas (auth, migrations, secrets, rollback) block the
51
+ verdict while `unknown`; non-gate areas (observability, agent-governance)
52
+ surface as unknowns + questions but do not block alone.
53
+
54
+ ## 3 — Coverage backbone
55
+
56
+ The area vocabulary is deliberately pruned to the stacks this suite targets:
57
+ **auth · migrations · secrets · observability · rollback · agent-governance**.
58
+ It is not a generic compliance matrix — new areas enter by appending to
59
+ `prelaunch-areas.yml` with a maintainer-reviewed `launch_gate` decision.
60
+
61
+ Every report may carry a `questions` list — **questions that would change the
62
+ diagnosis** ("is the admin panel exposed on the same origin?"). Questions are
63
+ the actionable rendering of unknowns; the next run should convert them into
64
+ evidence or findings.
65
+
66
+ ## 4 — Regression gate (findings diff)
67
+
68
+ `prelaunch_diagnostics.ts diff <baseline.json> <current.json>` compares two
69
+ reports **by ID**:
70
+
71
+ - **new** — ID in current, not in baseline.
72
+ - **resolved** — open in baseline, `fixed` in current.
73
+ - **regressed** — a `launch_gate` area that was `pass` in the baseline and is
74
+ `finding`/`unknown` in current (Pass→Finding flip).
75
+ - **retitled findings do not appear in the diff** — the ID survives the
76
+ rename (acceptance-tested).
77
+
78
+ `--ci` mode exits non-zero when the diff contains a **new open P0/P1** or a
79
+ **Pass→Finding flip in a launch-gate area** — the consumer-side sibling of the
80
+ suite's claims-ledger CI. Everything else (new P2/P3, resolved findings,
81
+ question churn) reports informationally and exits 0.
82
+
83
+ ## 5 — Suppression (evidence-backed, never silent)
84
+
85
+ A consumer may suppress a finding via the project-local suppression file
86
+ `agents/settings/prelaunch-suppressions.yml`:
87
+
88
+ ```yaml
89
+ schema_version: prelaunch-suppressions-v1
90
+ suppressions:
91
+ - id: AC-OBS-002
92
+ reason: "Dashboards land with the Q3 observability epic; alerting for the launch path exists."
93
+ evidence: "agents/evidence/prelaunch/obs-alerting.png"
94
+ ```
95
+
96
+ - A finding with `status: suppressed-with-evidence` MUST have a matching
97
+ suppression entry carrying **both** `reason` and `evidence` — validation
98
+ fails otherwise.
99
+ - Suppressed findings are excluded from the `--ci` triggers but **render in a
100
+ collapsible "suppressed" section** of the report output — the same
101
+ transparency contract as the review cluster's dropped-false-positives list.
102
+ Suppression hides nothing; it moves the item behind a fold with its receipt.
103
+ - Suppressing a P0 does not restore a ready verdict — P0 caps the verdict
104
+ regardless (§ 2).
105
+
106
+ ## 6 — Consumer recipe (opt-in CI gating)
107
+
108
+ 1. Run the diagnostic (via `launch-readiness` § epistemics) and save the
109
+ report to `agents/evidence/prelaunch/baseline.json`. Commit it.
110
+ 2. Before a launch, produce a fresh `current.json` and run
111
+ `prelaunch_diagnostics.ts diff baseline.json current.json --ci` in the
112
+ pipeline — red on a new P0/P1 or a launch-gate Pass→Finding flip.
113
+ 3. After the launch settles, promote `current.json` to the new committed
114
+ baseline (a reviewed diff, like any lockfile bump).
115
+
116
+ ## 7 — Fix-loop discipline (Phase 3)
117
+
118
+ - Rank open findings by severity, then by launch-gate membership.
119
+ - Propose the **safest first approval batch** — explicitly the first *safe*
120
+ batch (reversible, small blast radius), not the full backlog. Approval is
121
+ the user's; the diagnostic never self-authorizes fixes
122
+ ([`autonomous-execution`](../../src/rules/autonomous-execution.md) and the
123
+ reversibility floor govern, unrestated).
124
+ - Per-finding status vocabulary (schema-enforced): `open · fixed ·
125
+ accepted-risk · deferred-with-reason · suppressed-with-evidence ·
126
+ not-applicable` — everything except open/fixed carries a `reason`.
127
+ - **Rescore whenever evidence changes** — a fix, a new probe, or an answered
128
+ question re-runs the affected area, never the memory of it.
129
+
130
+ ## 8 — Read-only guarantee
131
+
132
+ The diagnostic **never mutates a consumer project**: the tooling reads
133
+ reports and writes nothing outside its own output. Fixes flow through the
134
+ normal approval-gated engines, not through this contract.
135
+
136
+ ## 9 — Score: council-locked (do not add)
137
+
138
+ The pass-1 council **dropped the 0–100 readiness score** (gameable false
139
+ precision). A severity-capped, never-published internal-ordering variant is
140
+ **surfaced for council re-evaluation in the roadmap's revisit note — not
141
+ adopted**. Until that revisit resolves: no numeric score field in the schema,
142
+ no score in any rendered output, no score in CI messages. The ID scheme,
143
+ epistemics, diff gate, and suppression above stand on their own.
144
+
145
+ ## See also
146
+
147
+ - [`launch-readiness`](../../src/skills/launch-readiness/SKILL.md) — the skill
148
+ surface that produces the report.
149
+ - [`docs/proof.md`](../proof.md) — the suite-side claims-ledger this mirrors.
150
+ - `road-to-ecosystem-harvest-reliability-measurement` (archived) — measures the
151
+ *suite itself*; this contract measures the *consumer's launch surface*.
@@ -81,6 +81,7 @@ the feature-PR floor by adding:
81
81
  | `release-validation.yml` (Phase B) | `changelog-entry` | CHANGELOG carries an entry matching the head-branch version |
82
82
  | `release-validation.yml` (Phase B) | `version-consistency` | `package.json` / `marketplace.json` / pack manifests agree on the version |
83
83
  | `consumer-matrix.yml` | `consumer-matrix` · `publish-dry-run` · `mcp-worker-dry-run` · `plugin-bootstrap` | pack-based consumer E2E + pre-tag dry-runs of the release-adjacent workflows — see the exemption note below |
84
+ | (maintainer-local) | `task smoke-host-loadability REQUIRE=1` | real-host loadability — `claude plugin validate` + temp-home plugin install + metadata cross-consistency (marketplace ↔ plugin dirs ↔ docs). Optional in CI (runners lack the claude CLI, the step self-skips); **required before a release is cut** — `REQUIRE=1` turns a missing CLI into a failure |
84
85
 
85
86
  ## Consumer-matrix exemption — the tarball window
86
87
 
@@ -44,7 +44,9 @@ filtered** to a small curated set (`MERGEABLE_KEYS` = `name`, `ide`,
44
44
  ignored. `ai_council` is not on the whitelist, and council configuration lives
45
45
  project-local in `agents/settings/.ai-council.yml` (per
46
46
  [`ai-council-config`](../contracts/ai-council-config.md), the Phase-0 single
47
- source of truth).
47
+ source of truth). <!-- Council placement superseded by ADR-104: the config is
48
+ now user-global only (`~/.event4u/agent-config/settings/.ai-council.yml`),
49
+ never project-local. The trust-boundary reasoning below is unaffected. -->
48
50
 
49
51
  The maintainer questioned whether that project-local placement is a bug. The AI
50
52
  council was asked to decide and **converged** that it is **not** a bug — the
@@ -72,6 +74,12 @@ personas, rule tier) **belongs in version control**, and onboarding stays clean
72
74
  for council config is `agents/settings/.ai-council.yml`
73
75
  ([`ai-council-config`](../contracts/ai-council-config.md)); personas live in
74
76
  the project surface. Neither is a user-global concern.
77
+ <!-- Superseded for the COUNCIL part by ADR-104: council config is now
78
+ user-global only, never project-local (personas are unaffected). -->
79
+ **Update (ADR-104):** the council half of this decision was reversed — the
80
+ council config now lives user-global only
81
+ (`~/.event4u/agent-config/settings/.ai-council.yml`) and the project tree is
82
+ never read. Personas stay project-local as stated.
75
83
 
76
84
  3. **Only secrets and the curated identity whitelist are global.** Provider API
77
85
  keys already live global in `~/.event4u/agent-config/<provider>.key` (0600);
@@ -1,6 +1,6 @@
1
1
  # Featured Skills
2
2
 
3
- A curated subset of the 271 skills. Three tiers, one per primary audience. Full catalog lives in [`dist/agent-src/skills/`](../dist/agent-src/skills/); see also [`docs/catalog.md`](catalog.md) for the complete index and [`docs/featured-commands.md`](featured-commands.md) for command-level highlights.
3
+ A curated subset of the 274 skills. Three tiers, one per primary audience. Full catalog lives in [`dist/agent-src/skills/`](../dist/agent-src/skills/); see also [`docs/catalog.md`](catalog.md) for the complete index and [`docs/featured-commands.md`](featured-commands.md) for command-level highlights.
4
4
 
5
5
  > **Eval-gated messaging note.** Until `task bench --corpus non-dev` reports `selection_accuracy >= 0.60` (see `road-to-product-adoption.md` Phase 1), this page is documentation, not marketing. The entries below are the candidates the corpus tests against; their description quality is what the eval validates.
6
6
 
@@ -92,4 +92,4 @@ task lint-featured-skills
92
92
 
93
93
  CI runs this in `taskfiles/ci-fast.yml`. Stale entries (renamed / removed skill or command) fail the build. See [`scripts/lint_featured_skills.py`](../src/scripts/lint_featured_skills.py) for the matcher.
94
94
 
95
- → Browse all 271 skills: [`dist/agent-src/skills/`](../dist/agent-src/skills/) · all 183 commands: [`dist/agent-src/commands/`](../dist/agent-src/commands/)
95
+ → Browse all 274 skills: [`dist/agent-src/skills/`](../dist/agent-src/skills/) · all 183 commands: [`dist/agent-src/commands/`](../dist/agent-src/commands/)
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Pick the entry that matches what you do day-to-day. Each section names the three skills you will reach for first and shows whether MCP (no terminal) or CLI (terminal) is the simpler install path for that role.
4
4
 
5
- `agent-config` ships 271 skills, 104 governed rules, and 183 commands. You do not need all of them. Each role below filters to the slice that pays back in week one; the rest stays available and shows up on demand when a task references it.
5
+ `agent-config` ships 274 skills, 104 governed rules, and 183 commands. You do not need all of them. Each role below filters to the slice that pays back in week one; the rest stays available and shows up on demand when a task references it.
6
6
 
7
7
  > **Taglines at a glance →** [`docs/role-experiences.md`](role-experiences.md) — the one-line pitch per role experience, in one table.
8
8
 
@@ -180,19 +180,30 @@ Your agent now understands slash commands:
180
180
 
181
181
  ## Team mode — cross-model review (default off)
182
182
 
183
- Team mode pairs two strong models on one change: one model builds, a
184
- second reviews the **real diff** in your working tree and hands the
185
- findings back for a fix round. It is the depth complement to the
183
+ Team mode is a governed access layer with a read-only multi-host
184
+ fallback: a second strong model reviews the **real diff** in your
185
+ working tree and returns its findings. It is the depth complement to the
186
186
  [AI council](../dist/agent-src/skills/ai-council/SKILL.md): the council
187
187
  collects many cheap, neutral opinions on an artefact's *text*; team mode
188
- puts one strong, opinionated reviewer *inside the repo*.
188
+ puts one strong, opinionated reviewer *inside the repo*. An iterated
189
+ build→review→fix loop is gated future work — it unlocks only with a
190
+ positive verdict from the pre-registered benchmark.
189
191
 
190
192
  | Axis | Council | Team mode |
191
193
  |---|---|---|
192
194
  | Repo access | none — members see only the artefact text | full — the reviewer reads the real diff and git state |
193
- | Shape | breadth — N neutral opinions, one round | depth — one strong reviewer, build→review→fix iteration |
195
+ | Shape | breadth — N neutral opinions, one round | depth — one strong reviewer on the real diff |
194
196
  | Cost model | API-billed members (per-token) | subscription-authed `codex` CLI (runs under your existing plan) |
195
197
 
198
+ **Host support.** Only Claude Code with the Codex plugin gets the native
199
+ path; every other host runs a reduced, read-only fallback — no host
200
+ outside Claude Code has feature parity.
201
+
202
+ | Host | Path | Capability |
203
+ |---|---|---|
204
+ | Claude Code + Codex plugin | native — wrappers delegate to the plugin's `/codex:*` commands | full wrapper set: review, adversarial, status (incl. plugin job view), delegate (double-opt-in write path) |
205
+ | Any other host | read-only fallback via the `codex` CLI (repo-diff bundle) | review-shaped output only — no plugin job control, no background jobs, no delegate write path |
206
+
196
207
  **Setup.** Run `agent-config doctor --check team` — it verifies the
197
208
  `codex` binary + auth and, on Claude Code hosts, the Codex plugin, and
198
209
  prints the exact remediation command for anything missing.
@@ -33,7 +33,7 @@ the host lacks (a static host gives it no runtime attention guarantee, but a
33
33
  runtime-only system gives it nothing at all here). A runtime-only system contributes *nothing* on these hosts.
34
34
 
35
35
  ### 2. Intent routing, not a 500-artefact dump
36
- A prompt does not load all 271 skills. `dist/router.json` (100 routed rules, intent →
36
+ A prompt does not load all 274 skills. `dist/router.json` (100 routed rules, intent →
37
37
  skill, keyword/phrase/path triggers) carries the right skill on intent. The
38
38
  governance value is *selection discipline* — the host gets the relevant rule
39
39
  set, not the whole catalogue as context ballast.
@@ -0,0 +1,45 @@
1
+ # Active Remediation — Mechanics
2
+
3
+ > Ladder detail, version-gated modernization, and anti-nagging guardrails for the `active-remediation` rule
4
+
5
+ _Origin: migrated from `src/rules/active-remediation.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, the ladder tier names, and the live-security carve-out stay in the rule; this file carries the per-tier criteria and the modernization gates._
6
+
7
+ ## The ladder — classify, then act
8
+
9
+ ### Fix now (autonomous, inline) — a bounded amendment to `minimal-safe-diff`
10
+
11
+ Allowed **only** when ALL hold — this is the testable "small + task-aligned" definition:
12
+
13
+ - **Same request path / module** as the current task (not an unrelated feature).
14
+ - **≤ ~10 changed lines** in one production file plus its test file — no wider cross-file ripple.
15
+ - **No public-API / response-shape change**, no new parameter.
16
+ - **No dependency bump, no migration, no data change.**
17
+ - **Its verification ships in the same commit** — e.g. the security fix's negative test, or the correctness fix's case.
18
+
19
+ Under those constraints the fix is auditable in the same diff and is *not* scope creep — it corrects a boundary the agent touched. Anything outside them → the fix is **note + ask**, never auto. (`minimal-safe-diff` still governs everything else: no reformatting, no opportunistic refactor, no drive-by rename.)
20
+
21
+ ### Note + ask (batched)
22
+
23
+ Bigger, or diverges from the task → do **not** refactor inline, do **not** interrupt the flow. Note the site (file:line + the issue). Surface the batch as **one** numbered-options prompt (per `user-interaction`, one recommendation line) **after the task is delivered** — or mid-work only when the flow makes it natural. Each option must carry a real trade-off (`no-cheap-questions`). Refactor only on an explicit yes, as a separate scoped change (`scope-control`, `downstream-changes`).
24
+
25
+ ### Propose a follow-up PR (many spots)
26
+
27
+ When the issues are too many to fold in without blowing the current diff's scope, propose **one or more separate follow-up PRs** (or a roadmap under `agents/roadmaps/`, using the shared-prefix convention) so the user reviews the changes before merge. Creating the PR/roadmap is **permission-gated** — propose, get a yes, then create (`scope-control`, `commit-policy`).
28
+
29
+ ## Version-gated modernization
30
+
31
+ Update stale idioms to the version the project **actually runs** — but only when that version is **verified**:
32
+
33
+ - **Establish the version first** from the manifest constraint (`composer.json` `require`, `package.json` `engines`, `.tool-versions`, lockfile) — use the **lowest** bound; on an ambiguous/monorepo range, ask once. **Unknown version → do not touch** (must fit the project structure — this is the `source-discovery` gate).
34
+ - **Syntax-only, behavior-preserving idioms** (e.g. `array()` → `[]`, `isset($x)?$x:$d` → `$x ?? $d`, string concat → template) that are provably equivalent → treat as a small fix (auto per the ladder).
35
+ - **Behavioral changes** (`readonly`/typed properties, new language semantics) and **any dependency/version bump** → **ask only**, never auto (a version bump stays under `minimal-safe-diff`'s no-dependency-bump prohibition; a pure syntax idiom is categorically different).
36
+
37
+ ## Guardrails — don't become a nagging machine
38
+
39
+ - Subordinate to `no-cheap-questions` (self-check items 3 & 14 — real trade-off, not a disguised continuation/commit ask), `autonomous-execution` (the end-of-session batch must not read as "shall I continue?"), `user-interaction`, `ask-when-uncertain` (one batched prompt = one question).
40
+ - Threshold to surface at all: a **real, nameable** improvement with a concrete benefit. Cosmetic nitpicks with no trade-off → drop silently. The live-security carve-out is the only case that interrupts or overrides autonomy.
41
+
42
+ ## See also
43
+
44
+ - [`active-remediation`](../../../src/rules/active-remediation.md) — the rule this file details (Iron Law + ladder + live-security carve-out).
45
+ - [`minimal-safe-diff`](minimal-safe-diff-mechanics.md) — the diff-shape mechanics the fix-now tier amends.
@@ -101,6 +101,34 @@ _Origin: migrated from `src/rules/improve-before-implement.md` per the P4 patter
101
101
 
102
102
  Before coding a new feature, refactor, module, or behavior-altering change, quickly verify:
103
103
 
104
+ ### 8-pre. Demand gate — should this exist at all? (build / defer)
105
+
106
+ One altitude ABOVE engineering-fit. Fires on a "build me an app / add this
107
+ feature" ask, before checks 8a–8c. It is a three-question advisor, NOT a
108
+ product-management framework — surface it in one short block, then proceed on
109
+ the user's answer (never block; `improve-before-implement`'s golden rule holds).
110
+
111
+ Three questions:
112
+
113
+ 1. **Who requested this?** (a real user / segment, or an internal hunch?)
114
+ 2. **What happens if you DON'T build it?** (churn / blocked deal, or nothing measurable?)
115
+ 3. **What's the demand evidence?** (requests, usage data, lost revenue — or a feeling?)
116
+
117
+ Map the answers to a compressed feature-demand hierarchy and recommend:
118
+
119
+ | Level | Signal | Recommendation |
120
+ |---|---|---|
121
+ | L0 | Founder/agent anxiety — "it feels missing" | **Defer** — validate demand first |
122
+ | L1 | One anecdotal request, no pattern | **Defer** — watch for repetition |
123
+ | L2 | Repeated requests, no measured impact | **Validate** — instrument before building |
124
+ | L3 | Blocks activation/retention for a real segment | **Build** |
125
+ | L4 | Users are churning / deals lost without it | **Build now** |
126
+
127
+ Build only at **L3–L4**; L0–L2 get a defer/validate recommendation with the
128
+ one missing evidence named. This is advisory — the user decides; a "just build
129
+ it" answer proceeds immediately to 8a. No network, no case-memory API (the
130
+ source's remote lookup is dropped — a lethal-trifecta egress concern).
131
+
104
132
  ### 8a. Is the request clear?
105
133
 
106
134
  - Are acceptance criteria defined or derivable?
@@ -0,0 +1,76 @@
1
+ # Artifact Drafting Protocol — Mechanics
2
+
3
+ > Phase A/B/C detail and the roadmap batch-mode carve-out for the `artifact-drafting-protocol` rule
4
+
5
+ _Origin: migrated from `src/rules/artifact-drafting-protocol.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, the trigger surface, and the golden rules stay in the rule; this file carries the per-phase procedure._
6
+
7
+ ## Phase A — Understand
8
+
9
+ Ask up to **5** clarifying questions (numbered options, each with a
10
+ *"skip / I don't know yet"* escape):
11
+
12
+ 1. **Problem** — what does this solve that no existing artifact solves?
13
+ 2. **Trigger surface** — which user phrasings should fire this?
14
+ 3. **Should-trigger examples** — 2-3 in the user's words.
15
+ 4. **Near-miss cases** — 2-3 phrasings that must **not** fire.
16
+ 5. **Artifact type** — skill, rule, command, or guideline? Offer a
17
+ 3-line primer if unsure.
18
+
19
+ If the user skips Q1 or Q5, stop and surface the ambiguity — don't guess.
20
+
21
+ ## Phase B — Research
22
+
23
+ Run the **search protocol** from
24
+ [`learning-to-rule-or-skill` § 4](../../../src/skills/learning-to-rule-or-skill/SKILL.md)
25
+ — `ls` all four surfaces (`skills/`, `rules/`, `guidelines/`, `commands/`),
26
+ grep with **solution-words AND problem-words**, scan sub-directory
27
+ taxonomies, then **open and skim** the 3 nearest matches. A negative grep
28
+ alone is not proof of no overlap. Report the top 3-5 most-similar
29
+ artifacts and ask (numbered options):
30
+
31
+ - Extend an existing one?
32
+ - Create a new one — gap is real?
33
+ - Show overlap first?
34
+ - Promote via `learning-to-rule-or-skill` instead?
35
+
36
+ Carry the summary into the commit message (*"Reviewed before drafting:
37
+ X, Y"*).
38
+
39
+ ## Phase C — Draft
40
+
41
+ Propose **2-3 description variants** — Conservative / Pushy
42
+ (per `skill-quality`) / Concrete (embedded trigger example). User picks
43
+ or merges. Only then draft the body. Surface every structural choice
44
+ (size class, section order) as numbered options if in doubt.
45
+
46
+ Enforce size live: *"Body is at 420/500 lines. Split?"* (budgets per
47
+ `size-enforcement`). New skills also get an `evals/triggers.json` stub
48
+ (5 should-trigger + 5 should-not-trigger). See `skill-writing` § 1c.
49
+
50
+ ## Roadmap-run batch mode — the ONE structured bypass
51
+
52
+ When a `/roadmap:process-*` run starts under an **accepted execution
53
+ contract** (`roadmap-execution-contract`) whose pre-scan detected
54
+ artifact-authoring steps, the protocol runs in batch mode for exactly
55
+ those artifacts:
56
+
57
+ - **Phase B (Research) runs ONCE at contract time, against the CURRENT
58
+ artifact state** — one overlap scan covering every artifact the
59
+ roadmap plans; results (nearest matches, extend-vs-create verdicts)
60
+ are surfaced inside the contract summary the user accepts. This is
61
+ why authoring-time-only checking is not enough: a sibling roadmap may
62
+ have landed overlapping artifacts between authoring and execution.
63
+ - **Phases A (Understand) and C (Draft) run non-interactively during
64
+ the run** — the roadmap step text is the Understand input; the
65
+ contract acceptance is the approval that the per-phase prompts exist
66
+ to obtain.
67
+ - **Scope is the batch, nothing more.** An artifact NOT declared in the
68
+ roadmap (discovered mid-run) triggers the full interactive protocol —
69
+ or, under the contract, the scope-out-of-roadmap halt.
70
+ - Batch mode never skips the Research pass itself — it relocates and
71
+ batches it. `artifact_protocol: skip` does not exist.
72
+
73
+ ## See also
74
+
75
+ - `artifact-drafting-protocol` (rule) — Iron Law, triggers, golden rules.
76
+ - `ask-when-uncertain` · `improve-before-implement` · `user-interaction` · `skill-quality` — the protocol extends these; cross-link, don't restate.
@@ -0,0 +1,90 @@
1
+ # Context Hygiene — Mechanics
2
+
3
+ > Suggestion templates, state-dump format, read-loop self-checks, and host fallbacks for the `context-hygiene` rule
4
+
5
+ _Origin: migrated from `src/rules/context-hygiene.md` per the P4 pattern of `road-to-kernel-and-router.md`. The freshness thresholds, the 3-failure rule (with failure-identity and hard-blocker classes), the tool-loop cap, and the read-loop 15/25 Iron Law stay in the rule; this file carries the templates and per-host procedures._
6
+
7
+ ## Conversation-freshness suggestion — how to phrase it
8
+
9
+ Estimate token cost: responses × ~1,500 tokens.
10
+
11
+ ```
12
+ > ⚡ This conversation has ~{N} messages (~{N×1500} tokens history cost — charged on EVERY request).
13
+ > A fresh chat saves ~{N×1500} input tokens per request.
14
+ >
15
+ > 1. Start fresh — I'll initiate a session handoff
16
+ > 2. Continue here
17
+ ```
18
+
19
+ **If the user picks 1:** Initiate a session handoff or start fresh.
20
+
21
+ ## Read-loop self-check (fires at the 15-min warning)
22
+
23
+ 1. Source expectation known? If no → read **once**, then act.
24
+ 2. Can a single failing test name the error? If yes → run it now.
25
+ 3. Regression in working code? → `git log` + `git show <sha> -- <file>`.
26
+ 4. Guessing at mock / payload shape? → read the producer **once**.
27
+
28
+ ## Read-loop abort block (the 25-min stop)
29
+
30
+ ```
31
+ > ⛔ Loop: N read-only turns, ~M min. Read: <files>. Hypothesis: <X>.
32
+ > 1. Different approach (suggestion: <Y>)
33
+ > 2. Point me at the right spot
34
+ > 3. Fresh chat with state dump
35
+ ```
36
+
37
+ Non-bypassable. An autonomous mandate (`/work`, `/roadmap:process-*`,
38
+ "entscheide selbst") does **not** lift the abort — it is the safety
39
+ net that protects autonomy from becoming a token sink.
40
+
41
+ Debug procedure for "I'm in a read loop fixing tests" →
42
+ `systematic-debugging` § Debug micro-loop (one test, one fix, one re-run).
43
+
44
+ ## State dump format
45
+
46
+ ```
47
+ ## State Dump: [Task]
48
+ ### Tried: 1. [Approach] → [Why failed] 2. ... 3. ...
49
+ ### Known: [Key facts]
50
+ ### Hypothesis: [Best guess for root cause]
51
+ ### Recommendation: [Next approach for fresh session]
52
+ ```
53
+
54
+ Use `/agent-handoff` to generate a context summary for a fresh conversation.
55
+
56
+ ## Augment-specific: ignored-skills recovery
57
+
58
+ Skills excluded via `.augmentignore` don't appear in `<available_skills>`.
59
+ If you need an ignored skill: read its SKILL.md directly, apply guidance, then ask:
60
+
61
+ ```
62
+ > 💡 I loaded `{name}` manually — currently ignored in `.augmentignore`.
63
+ > 1. Remove from ignore — relevant for this project
64
+ > 2. Keep ignored — one-off
65
+ ```
66
+
67
+ ## Copilot fallback
68
+
69
+ GitHub Copilot has no `PostToolUse` hook surface, so
70
+ `scripts/context_hygiene_hook.ts` cannot run structurally and
71
+ `agents/runtime/state/context-hygiene.json` is not maintained automatically
72
+ (turn count, loop signal, freshness milestones at 20/40/60).
73
+
74
+ The cooperative path: track turns and tool-loop signals from memory
75
+ during the conversation and apply the suggest-a-new-chat / 3-failure
76
+ stop / loop-detection rules. To refresh the state file manually so the
77
+ dashboard or another tool can read the latest counters, run:
78
+
79
+ ```bash
80
+ ./scripts-run src/scripts/context_hygiene_hook < /dev/null
81
+ ```
82
+
83
+ The script reads from stdin if a JSON envelope is provided and
84
+ otherwise writes a no-op snapshot under the shared dispatcher lock.
85
+ Exit code is always 0 — hooks must never block the agent loop.
86
+
87
+ ## See also
88
+
89
+ - `context-hygiene` (rule) — thresholds, 3-failure rule, tool-loop cap, read-loop Iron Law.
90
+ - `systematic-debugging` § Debug micro-loop — the one-test-one-fix-one-rerun procedure.