@event4u/agent-config 1.20.0 → 1.22.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 (268) hide show
  1. package/.agent-src/commands/agents.md +1 -1
  2. package/.agent-src/commands/bug-fix.md +2 -1
  3. package/.agent-src/commands/bug-investigate.md +3 -2
  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/chat-history/import.md +60 -64
  8. package/.agent-src/commands/compress.md +12 -0
  9. package/.agent-src/commands/context/create.md +2 -2
  10. package/.agent-src/commands/context.md +1 -1
  11. package/.agent-src/commands/copilot-agents.md +1 -1
  12. package/.agent-src/commands/council/default.md +69 -10
  13. package/.agent-src/commands/council.md +1 -1
  14. package/.agent-src/commands/create-pr.md +7 -3
  15. package/.agent-src/commands/e2e-heal.md +1 -1
  16. package/.agent-src/commands/e2e-plan.md +1 -1
  17. package/.agent-src/commands/feature/dev.md +3 -3
  18. package/.agent-src/commands/feature.md +1 -1
  19. package/.agent-src/commands/fix/seeder.md +2 -2
  20. package/.agent-src/commands/fix.md +1 -1
  21. package/.agent-src/commands/grill-me.md +38 -0
  22. package/.agent-src/commands/jira-ticket.md +1 -1
  23. package/.agent-src/commands/judge/steps.md +1 -1
  24. package/.agent-src/commands/judge.md +2 -2
  25. package/.agent-src/commands/memory.md +1 -1
  26. package/.agent-src/commands/mode.md +5 -5
  27. package/.agent-src/commands/module.md +1 -1
  28. package/.agent-src/commands/onboard.md +4 -4
  29. package/.agent-src/commands/optimize/augmentignore.md +1 -1
  30. package/.agent-src/commands/optimize-prompt.md +61 -0
  31. package/.agent-src/commands/optimize.md +1 -1
  32. package/.agent-src/commands/override.md +1 -1
  33. package/.agent-src/commands/review-changes.md +1 -1
  34. package/.agent-src/commands/review-routing.md +1 -1
  35. package/.agent-src/commands/roadmap/ai-council.md +183 -0
  36. package/.agent-src/commands/roadmap/create.md +6 -1
  37. package/.agent-src/commands/roadmap/process-full.md +58 -0
  38. package/.agent-src/commands/roadmap/process-phase.md +69 -0
  39. package/.agent-src/commands/roadmap/process-step.md +57 -0
  40. package/.agent-src/commands/roadmap.md +45 -17
  41. package/.agent-src/commands/set-cost-profile.md +3 -3
  42. package/.agent-src/commands/sync-agent-settings.md +2 -2
  43. package/.agent-src/commands/tests/create.md +2 -2
  44. package/.agent-src/commands/tests.md +1 -1
  45. package/.agent-src/commands/threat-model.md +5 -4
  46. package/.agent-src/contexts/augment-infrastructure.md +1 -1
  47. package/.agent-src/contexts/authority/commit-mechanics.md +14 -1
  48. package/.agent-src/contexts/authority/destructive-mechanics.md +14 -1
  49. package/.agent-src/contexts/authority/scope-mechanics.md +5 -0
  50. package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +76 -0
  51. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +54 -19
  52. package/.agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +98 -0
  53. package/.agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +93 -0
  54. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +128 -5
  55. package/.agent-src/contexts/execution/autonomy-mechanics.md +44 -0
  56. package/.agent-src/contexts/execution/roadmap-process-loop.md +125 -0
  57. package/.agent-src/contexts/model-recommendations.md +2 -2
  58. package/.agent-src/contexts/override-system.md +1 -1
  59. package/.agent-src/contexts/skills-and-commands.md +1 -1
  60. package/.agent-src/personas/product-owner.md +2 -2
  61. package/.agent-src/personas/qa.md +1 -1
  62. package/.agent-src/rules/agent-authority.md +5 -6
  63. package/.agent-src/rules/agent-docs.md +11 -53
  64. package/.agent-src/rules/analysis-skill-routing.md +10 -40
  65. package/.agent-src/rules/architecture.md +6 -1
  66. package/.agent-src/rules/artifact-drafting-protocol.md +5 -0
  67. package/.agent-src/rules/artifact-engagement-recording.md +23 -59
  68. package/.agent-src/rules/ask-when-uncertain.md +24 -47
  69. package/.agent-src/rules/augment-portability.md +14 -62
  70. package/.agent-src/rules/augment-source-of-truth.md +10 -1
  71. package/.agent-src/rules/autonomous-execution.md +17 -98
  72. package/.agent-src/rules/capture-learnings.md +9 -80
  73. package/.agent-src/rules/cli-output-handling.md +12 -42
  74. package/.agent-src/rules/command-suggestion-policy.md +25 -73
  75. package/.agent-src/rules/commit-conventions.md +9 -58
  76. package/.agent-src/rules/commit-policy.md +16 -47
  77. package/.agent-src/rules/context-hygiene.md +5 -0
  78. package/.agent-src/rules/direct-answers.md +21 -50
  79. package/.agent-src/rules/docker-commands.md +11 -45
  80. package/.agent-src/rules/docs-sync.md +10 -56
  81. package/.agent-src/rules/downstream-changes.md +5 -0
  82. package/.agent-src/rules/e2e-testing.md +9 -44
  83. package/.agent-src/rules/guidelines.md +13 -75
  84. package/.agent-src/rules/improve-before-implement.md +11 -2
  85. package/.agent-src/rules/invite-challenge.md +71 -0
  86. package/.agent-src/rules/language-and-tone.md +41 -106
  87. package/.agent-src/rules/laravel-translations.md +11 -40
  88. package/.agent-src/rules/markdown-safe-codeblocks.md +4 -0
  89. package/.agent-src/rules/minimal-safe-diff.md +4 -0
  90. package/.agent-src/rules/missing-tool-handling.md +4 -0
  91. package/.agent-src/rules/model-recommendation.md +9 -61
  92. package/.agent-src/rules/no-attribution-footers.md +5 -0
  93. package/.agent-src/rules/no-cheap-questions.md +11 -27
  94. package/.agent-src/rules/no-council-references.md +76 -0
  95. package/.agent-src/rules/no-roadmap-references.md +7 -0
  96. package/.agent-src/rules/non-destructive-by-default.md +13 -43
  97. package/.agent-src/rules/onboarding-gate.md +9 -117
  98. package/.agent-src/rules/package-ci-checks.md +10 -37
  99. package/.agent-src/rules/php-coding.md +10 -55
  100. package/.agent-src/rules/preservation-guard.md +9 -0
  101. package/.agent-src/rules/review-routing-awareness.md +9 -97
  102. package/.agent-src/rules/reviewer-awareness.md +8 -83
  103. package/.agent-src/rules/roadmap-progress-sync.md +7 -170
  104. package/.agent-src/rules/role-mode-adherence.md +6 -2
  105. package/.agent-src/rules/rule-type-governance.md +8 -66
  106. package/.agent-src/rules/runtime-safety.md +5 -0
  107. package/.agent-src/rules/scope-control.md +17 -62
  108. package/.agent-src/rules/security-sensitive-stop.md +7 -1
  109. package/.agent-src/rules/size-enforcement.md +6 -1
  110. package/.agent-src/rules/skill-improvement-trigger.md +9 -49
  111. package/.agent-src/rules/skill-quality.md +7 -113
  112. package/.agent-src/rules/slash-command-routing-policy.md +11 -63
  113. package/.agent-src/rules/think-before-action.md +22 -87
  114. package/.agent-src/rules/token-efficiency.md +10 -74
  115. package/.agent-src/rules/token-optimizer-maintenance.md +68 -0
  116. package/.agent-src/rules/tool-safety.md +4 -0
  117. package/.agent-src/rules/ui-audit-gate.md +25 -61
  118. package/.agent-src/rules/upstream-proposal.md +9 -67
  119. package/.agent-src/rules/user-interaction.md +22 -108
  120. package/.agent-src/rules/verify-before-complete.md +1 -1
  121. package/.agent-src/skills/adversarial-review/SKILL.md +1 -0
  122. package/.agent-src/skills/agent-docs-writing/SKILL.md +1 -1
  123. package/.agent-src/skills/ai-council/SKILL.md +197 -8
  124. package/.agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  125. package/.agent-src/skills/analysis-skill-router/SKILL.md +3 -3
  126. package/.agent-src/skills/artisan-commands/SKILL.md +2 -2
  127. package/.agent-src/skills/authz-review/SKILL.md +1 -1
  128. package/.agent-src/skills/aws-infrastructure/SKILL.md +5 -5
  129. package/.agent-src/skills/blast-radius-analyzer/SKILL.md +8 -8
  130. package/.agent-src/skills/bug-analyzer/SKILL.md +6 -5
  131. package/.agent-src/skills/code-refactoring/SKILL.md +4 -4
  132. package/.agent-src/skills/code-review/SKILL.md +2 -2
  133. package/.agent-src/skills/command-writing/SKILL.md +11 -0
  134. package/.agent-src/skills/composer-packages/SKILL.md +2 -2
  135. package/.agent-src/skills/context-authoring/SKILL.md +11 -0
  136. package/.agent-src/skills/context-document/SKILL.md +1 -1
  137. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +23 -0
  138. package/.agent-src/skills/copilot-config/SKILL.md +1 -1
  139. package/.agent-src/skills/dependency-upgrade/SKILL.md +2 -2
  140. package/.agent-src/skills/devcontainer/SKILL.md +2 -2
  141. package/.agent-src/skills/developer-like-execution/SKILL.md +1 -1
  142. package/.agent-src/skills/docker/SKILL.md +1 -1
  143. package/.agent-src/skills/dto-creator/SKILL.md +1 -1
  144. package/.agent-src/skills/estimate-ticket/SKILL.md +2 -2
  145. package/.agent-src/skills/fe-design/SKILL.md +4 -4
  146. package/.agent-src/skills/feature-planning/SKILL.md +5 -5
  147. package/.agent-src/skills/funnel-analysis/SKILL.md +1 -1
  148. package/.agent-src/skills/laravel/SKILL.md +1 -1
  149. package/.agent-src/skills/laravel-notifications/SKILL.md +5 -5
  150. package/.agent-src/skills/laravel-pennant/SKILL.md +1 -1
  151. package/.agent-src/skills/laravel-pulse/SKILL.md +4 -4
  152. package/.agent-src/skills/laravel-reverb/SKILL.md +2 -2
  153. package/.agent-src/skills/laravel-scheduling/SKILL.md +1 -1
  154. package/.agent-src/skills/migration-creator/SKILL.md +7 -7
  155. package/.agent-src/skills/multi-tenancy/SKILL.md +8 -8
  156. package/.agent-src/skills/performance-analysis/SKILL.md +3 -3
  157. package/.agent-src/skills/pest-testing/SKILL.md +6 -6
  158. package/.agent-src/skills/php-service/SKILL.md +2 -2
  159. package/.agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
  160. package/.agent-src/skills/project-analysis-react/SKILL.md +1 -1
  161. package/.agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
  162. package/.agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
  163. package/.agent-src/skills/project-analyzer/SKILL.md +4 -4
  164. package/.agent-src/skills/prompt-optimizer/SKILL.md +108 -0
  165. package/.agent-src/skills/readme-reviewer/SKILL.md +1 -1
  166. package/.agent-src/skills/roadmap-management/SKILL.md +7 -7
  167. package/.agent-src/skills/rule-writing/SKILL.md +33 -0
  168. package/.agent-src/skills/sentry-integration/SKILL.md +1 -1
  169. package/.agent-src/skills/skill-writing/SKILL.md +14 -0
  170. package/.agent-src/skills/systematic-debugging/SKILL.md +22 -2
  171. package/.agent-src/skills/technical-specification/SKILL.md +58 -1
  172. package/.agent-src/skills/terraform/SKILL.md +2 -2
  173. package/.agent-src/skills/terragrunt/SKILL.md +8 -8
  174. package/.agent-src/skills/test-performance/SKILL.md +5 -5
  175. package/.agent-src/skills/threat-modeling/SKILL.md +3 -2
  176. package/.agent-src/skills/token-optimizer/SKILL.md +110 -0
  177. package/.agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  178. package/.agent-src/templates/AGENTS.md +1 -1
  179. package/.agent-src/templates/agent-settings.md +35 -19
  180. package/.agent-src/templates/command.md +17 -1
  181. package/.agent-src/templates/contexts/tenant-boundaries.md +2 -2
  182. package/.agent-src/templates/contexts.md +1 -1
  183. package/.agent-src/templates/copilot-instructions.md +21 -0
  184. package/.agent-src/templates/copilot-review-instructions.md +76 -0
  185. package/.agent-src/templates/features.md +1 -1
  186. package/.agent-src/templates/roadmaps.md +10 -2
  187. package/.agent-src/templates/rule.md +129 -0
  188. package/.agent-src/templates/skill.md +17 -0
  189. package/.claude-plugin/marketplace.json +12 -2
  190. package/AGENTS.md +32 -5
  191. package/CHANGELOG.md +107 -3
  192. package/README.md +22 -21
  193. package/config/agent-settings.template.yml +66 -10
  194. package/config/gitignore-block.txt +7 -0
  195. package/docs/architecture.md +86 -5
  196. package/docs/catalog.md +16 -6
  197. package/docs/contracts/agent-memory-contract.md +1 -1
  198. package/docs/contracts/command-clusters.md +45 -1
  199. package/docs/contracts/context-paths.md +2 -1
  200. package/docs/contracts/file-ownership-matrix.json +354 -500
  201. package/docs/contracts/iron-law-overrides.txt +25 -0
  202. package/docs/contracts/kernel-membership.md +273 -0
  203. package/docs/contracts/load-context-schema.md +26 -11
  204. package/docs/contracts/pilot/agent-authority.md +24 -0
  205. package/docs/contracts/pilot/direct-answers.md +70 -0
  206. package/docs/contracts/pilot/language-and-tone.md +63 -0
  207. package/docs/contracts/rule-classification.md +170 -0
  208. package/docs/contracts/rule-router.md +153 -0
  209. package/docs/customization.md +17 -6
  210. package/docs/decisions/ADR-001-kernel-swap-deferred.md +109 -0
  211. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +124 -0
  212. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +126 -0
  213. package/docs/decisions/ADR-rule-kernel-and-router.md +122 -0
  214. package/docs/getting-started.md +2 -2
  215. package/docs/guidelines/agent-infra/naming.md +1 -1
  216. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +176 -0
  217. package/docs/guidelines/agent-infra/rule-type-governance.md +73 -0
  218. package/docs/guidelines/agent-infra/size-and-scope.md +13 -2
  219. package/docs/guidelines/agent-infra/skill-quality-checklist.md +119 -0
  220. package/docs/guidelines/augment-portability-patterns.md +68 -0
  221. package/docs/guidelines/php/php-coding-patterns.md +62 -0
  222. package/package.json +1 -1
  223. package/scripts/_p43_bodies.py +235 -0
  224. package/scripts/_p43_compress.py +118 -0
  225. package/scripts/_p4_migrate.py +199 -0
  226. package/scripts/_phase2_shim_helper.py +1 -1
  227. package/scripts/_pilot_council_question.py +57 -0
  228. package/scripts/_pilot_measure.py +53 -0
  229. package/scripts/ai_council/session.py +107 -5
  230. package/scripts/build_linear_digest.py +3 -5
  231. package/scripts/check_always_budget.py +39 -6
  232. package/scripts/check_compressed_paths.py +213 -0
  233. package/scripts/check_compression.py +15 -0
  234. package/scripts/check_context_paths.py +1 -0
  235. package/scripts/check_council_layout.py +105 -0
  236. package/scripts/check_council_references.py +145 -0
  237. package/scripts/check_portability.py +2 -0
  238. package/scripts/check_references.py +2 -0
  239. package/scripts/check_token_optimizer_freshness.py +131 -0
  240. package/scripts/compile_router.py +148 -0
  241. package/scripts/compress.py +219 -11
  242. package/scripts/council_cli.py +132 -11
  243. package/scripts/council_prune.py +81 -0
  244. package/scripts/count_token_optimizer_usage.sh +54 -0
  245. package/scripts/install.sh +44 -2
  246. package/scripts/iron_law_sha.py +98 -0
  247. package/scripts/lint_load_context.py +35 -5
  248. package/scripts/measure_rule_budget.py +314 -0
  249. package/scripts/migrate_command_suggestions.py +2 -2
  250. package/scripts/prototype_lint_contradictions.py +150 -0
  251. package/scripts/schemas/command.schema.json +5 -0
  252. package/scripts/schemas/rule.schema.json +60 -6
  253. package/scripts/schemas/skill.schema.json +5 -0
  254. package/scripts/skill_linter.py +197 -7
  255. package/scripts/smoke_path_resolution.py +93 -0
  256. package/scripts/validate_frontmatter.py +41 -1
  257. package/.agent-src/commands/roadmap/execute.md +0 -109
  258. package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +0 -72
  259. package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +0 -79
  260. package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +0 -87
  261. package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +0 -62
  262. package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +0 -78
  263. package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +0 -85
  264. package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +0 -65
  265. package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +0 -78
  266. package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +0 -53
  267. /package/{docs → .agent-src/contexts}/contracts/artifact-engagement-flow.md +0 -0
  268. /package/{docs → .agent-src/contexts}/contracts/command-suggestion-flow.md +0 -0
@@ -0,0 +1,126 @@
1
+ # ADR-003 — Flat Cluster Sub-Commands and Colon-Canonical Invocation
2
+
3
+ - **Status:** Accepted (2026-05-07)
4
+ - **Phase:** Command-cluster contract (Phase 2 follow-up)
5
+ - **Supersedes:** none — extends the locked cluster set in
6
+ `docs/contracts/command-clusters.md`.
7
+ - **Related:** `roadmap-process` migration (2026-05-07) — the trigger
8
+ that forced the decision; `contexts/execution/roadmap-process-loop.md`
9
+ (the shared mechanics extracted alongside).
10
+
11
+ ## Context
12
+
13
+ `roadmap-execute` was being replaced by an autonomous-execution surface
14
+ with three scopes: single step, single phase, full roadmap. The
15
+ question was where those three commands live in the cluster catalog.
16
+ Four shapes were on the table:
17
+
18
+ - **A — separate `/roadmap-process` cluster.** Two top-level clusters
19
+ (`/roadmap` for authoring, `/roadmap-process` for execution).
20
+ - **B — sub-sub-commands** (`/roadmap:process:phase`). One cluster,
21
+ two-level dispatch.
22
+ - **C — flat under `/roadmap`, no verb** (`/roadmap:step` ·
23
+ `/roadmap:phase` · `/roadmap:full`). Verb hidden in cluster
24
+ description.
25
+ - **D — flat under `/roadmap`, verb fused with scope**
26
+ (`/roadmap:process-step` · `/roadmap:process-phase` ·
27
+ `/roadmap:process-full`). One cluster, one dispatch level, composite
28
+ sub-name carries the verb.
29
+
30
+ Existing infrastructure assumed a single dispatch level: the contract
31
+ table at `docs/contracts/command-clusters.md`, the linter
32
+ `scripts/lint_no_new_atomic_commands.py`, and the dispatcher-shape
33
+ checker `scripts/check_cluster_patterns.py` all parse one column of
34
+ sub-names per cluster.
35
+
36
+ ## Decision
37
+
38
+ 1. **Cluster depth stays flat.** A cluster has exactly one level of
39
+ sub-commands. No sub-sub-commands. Option B is rejected.
40
+
41
+ 2. **Verb-and-scope sub-commands use a composite name** joined by `-`
42
+ (`process-step`, `process-phase`, `process-full`). The verb stays
43
+ visible in the autocomplete list; symmetry with sibling
44
+ sub-commands (`/roadmap:create`) is preserved as
45
+ verb-or-noun-per-sub. Option D wins over C.
46
+
47
+ 3. **Colon is the canonical invocation form** (`/<cluster>:<sub>`).
48
+ The space-separated form (`/<cluster> <sub>`) remains a
49
+ first-class equivalent — both forms route to the same dispatcher.
50
+ Autocompletion-aware UIs (Claude Code picker, IDE slash-menus,
51
+ shell completers) MUST surface the colon form because it stays a
52
+ single token.
53
+
54
+ 4. **Future verb+scope clusters follow the same shape.** Any future
55
+ cluster with multiple verbs (e.g. an authoring verb and an
56
+ execution verb) uses composite sub-names rather than introducing a
57
+ second cluster or a second dispatch level.
58
+
59
+ ## Rationale
60
+
61
+ - **Option A (separate cluster)** scatters one domain across two
62
+ top-level surfaces. Users have to remember which cluster owns
63
+ which verb; the catalog grows without adding capability.
64
+ - **Option B (sub-sub)** would be the first two-level dispatcher in
65
+ the repo. Cost: contract change in `command-clusters.md`,
66
+ linter change in `lint_no_new_atomic_commands.py` (parse a second
67
+ column), pattern-checker change in `check_cluster_patterns.py`
68
+ (allow nested dispatch sections), plus an ADR to set the precedent
69
+ — for a cohesion benefit that Option D delivers at zero
70
+ architectural cost.
71
+ - **Option C (no verb)** breaks symmetry: `/roadmap:create` is a
72
+ verb, `/roadmap:phase` is a scope. The mental model becomes
73
+ inconsistent in the same cluster.
74
+ - **Option D (composite verb-scope)** keeps the cluster flat, keeps
75
+ the verb visible, costs nothing in the linter or contract
76
+ parser (one row, four sub-names, kebab-case as before), and
77
+ scales to any future verb+scope cluster.
78
+
79
+ The colon form was already canonical for flag-clusters
80
+ (`/commit:in-chunks`, `/create-pr:description-only`). Promoting it
81
+ to the canonical form for dispatcher-clusters too unifies the
82
+ catalog: every sub-command is a single token.
83
+
84
+ ## Consequences
85
+
86
+ - **Pro:** Zero architectural cost. The locked contract, both
87
+ linters, the dispatcher pattern checker, and the routing rule all
88
+ keep working unchanged. The cluster row in
89
+ `docs/contracts/command-clusters.md` extends with three new
90
+ sub-names.
91
+ - **Pro:** Single-token autocompletion across the entire command
92
+ surface. Greppable in chat history and logs.
93
+ - **Pro:** Domain cohesion — `/roadmap:*` covers the full
94
+ authoring + execution lifecycle.
95
+ - **Con:** Sub-names get longer when the verb is non-obvious from the
96
+ cluster. `/roadmap:process-phase` is 24 chars vs.
97
+ `/roadmap-process:phase` (Option A, 23 chars) or
98
+ `/roadmap:phase` (Option C, 16 chars). Acceptable trade for
99
+ symmetry and zero contract churn.
100
+ - **Con:** A cluster cannot grow into a true two-level surface
101
+ without revisiting this ADR. Rolling back to Option B is the
102
+ escape hatch if a future cluster genuinely needs nested verbs.
103
+
104
+ ## Rollback
105
+
106
+ If a future cluster grows past ~8 sibling sub-commands and the
107
+ composite-name pattern produces ambiguous or unreadable
108
+ sub-commands, revisit by:
109
+
110
+ 1. Splitting the cluster into two flat clusters (Option A on a
111
+ case-by-case basis), or
112
+ 2. Introducing sub-sub-commands as a deliberate contract change —
113
+ updating `command-clusters.md`, `lint_no_new_atomic_commands.py`,
114
+ `check_cluster_patterns.py`, and superseding this ADR.
115
+
116
+ Both moves are reversible. This ADR locks the default, not the
117
+ ceiling.
118
+
119
+ ## See also
120
+
121
+ - [`docs/contracts/command-clusters.md`](../contracts/command-clusters.md)
122
+ — locked cluster set + sub-command naming contract.
123
+ - [`.agent-src.uncompressed/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md`](../../.agent-src.uncompressed/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md)
124
+ — runtime routing semantics and the colon-canonical rule.
125
+ - [`.agent-src.uncompressed/contexts/execution/roadmap-process-loop.md`](../../.agent-src.uncompressed/contexts/execution/roadmap-process-loop.md)
126
+ — the shared mechanics that motivated the cluster shape.
@@ -0,0 +1,122 @@
1
+ # ADR — Rule Kernel and Router (Roadmap Closure)
2
+
3
+ - **Status:** Accepted (2026-05-06)
4
+ - **Closes:** `agents/roadmaps/road-to-kernel-and-router.md`
5
+ - **Sibling roadmaps closed in the same window:**
6
+ `agents/roadmaps/road-to-token-optimization.md`
7
+ (Phase 1 shipped, Phase 2/3 deferred-with-trigger by design),
8
+ `agents/roadmaps/road-to-package-optimization.md`
9
+ (closed with null result per P1.1 binary acceptance gate).
10
+ - **Related ADRs:** ADR-001 (kernel-swap deferred), ADR-002
11
+ (kernel-bucket cap raise 25k → 26k, per-rule Iron-Law overrides).
12
+
13
+ ## Context
14
+
15
+ The agent rule set was an "always-loaded" surface: every conversation
16
+ paid the full 193k-char rule cost regardless of task. There was no
17
+ deterministic way to load only the policy actually relevant to the
18
+ current intent, and no mechanical guard against rule-bucket creep.
19
+
20
+ ## Decision
21
+
22
+ Adopt a **Kernel + Router** loading model with three tiers and three
23
+ cost profiles, governed by a compiled router manifest and CI-enforced
24
+ size budgets.
25
+
26
+ ### What shipped
27
+
28
+ - **Kernel:** 9 always-loaded Iron-Law rules (`agent-authority`,
29
+ `ask-when-uncertain`, `commit-policy`, `direct-answers`,
30
+ `language-and-tone`, `no-cheap-questions`,
31
+ `non-destructive-by-default`, `scope-control`,
32
+ `verify-before-complete`). Locked set:
33
+ [`docs/contracts/kernel-membership.md`](../contracts/kernel-membership.md).
34
+ - **Router:** `router.json` compiled deterministically from rule
35
+ frontmatter (`tier:`, `triggers:`, `routes_to:`) by
36
+ `scripts/compile_router.py`. Contract:
37
+ [`docs/contracts/rule-router.md`](../contracts/rule-router.md).
38
+ - **Cost profiles:** `minimal` = kernel only · `balanced` = kernel +
39
+ tier-1 (default) · `full` = kernel + tier-1 + tier-2.
40
+ - **Budget gates:** `task lint-rule-budget` enforces kernel ≤ 26k chars
41
+ and per-rule ≤ 2.5k (Iron-Law overrides up to 4.0k via ADR-002).
42
+ Daily snapshots in `agents/.rule-budget-history.jsonl`.
43
+ - **Compression discipline:** P4.3 brought the auto-bucket from
44
+ ~75k → 59 220 chars (under the 60k target) without behaviour drift.
45
+
46
+ ### What we cut
47
+
48
+ - **P4.1 / P4.2** — auto-rule → skill / guideline migrations.
49
+ Cancelled as scope-cut after P4.3 compression alone landed the
50
+ auto-bucket under target. The migrations were a means, not an end.
51
+ - **road-to-package-optimization Phase 1.2 / 1.3 / Phase 2 / Phase 3**
52
+ — cancelled per P1.1's binary acceptance gate. The prototype
53
+ contradiction linter scanned 317 artefacts in 0.034 s and flagged
54
+ zero cross-artefact contradictions. The artefact surface is
55
+ empirically already well-governed on the heuristics tested; building
56
+ a production linter for a non-existent failure mode is not honest.
57
+ - **road-to-token-optimization Phase 2 / Phase 3** — *not* cut, just
58
+ trigger-deferred by design (telemetry threshold + `/cost:report`
59
+ ship). Will reopen autonomously when their declared signals fire.
60
+
61
+ ### What stayed
62
+
63
+ - All Iron-Law fences. SHA-verified preserved by
64
+ `scripts/iron_law_sha.py` across the kernel compression pass.
65
+ - Behaviour parity. Golden transcripts pass under all three profiles.
66
+ - The pre-existing `auto`-tier rules; only their compressed bodies
67
+ changed, never their obligation surface.
68
+
69
+ ## Profile semantics
70
+
71
+ | Profile | Buckets loaded | Use case |
72
+ |---|---|---|
73
+ | `minimal` | kernel only | Tightly bounded automation, CLI shell-outs, "run this one command" |
74
+ | `balanced` *(default)* | kernel + tier-1 | Day-to-day engineering work; matches pre-roadmap behaviour superset |
75
+ | `full` | kernel + tier-1 + tier-2 | Architectural / cross-wing / governance sessions |
76
+
77
+ Consumer projects opt in via `personal.cost_profile` in
78
+ `.agent-settings.yml`. The install script keeps user-set values; only
79
+ the template default is `balanced`.
80
+
81
+ ## Reversibility
82
+
83
+ If the Kernel + Router model needs unwinding:
84
+
85
+ 1. Set every rule's frontmatter `tier:` to `kernel` and rebuild
86
+ `router.json` — every rule loads on every turn (legacy behaviour).
87
+ 2. Drop `lint-rule-budget` from `task ci`.
88
+ 3. The compiled `router.json` is a derived artefact; deleting it and
89
+ running `compile_router.py --no-router` returns the always-loaded
90
+ model.
91
+
92
+ No data migration, no irreversible compression. Iron-Law SHA fences
93
+ mean Iron Laws can be diffed against the pre-roadmap baseline at any
94
+ point.
95
+
96
+ ## Final measurements (2026-05-06)
97
+
98
+ | Metric | Pre-roadmap | Post-roadmap | Δ |
99
+ |---|---:|---:|---:|
100
+ | kernel bucket | n/a (always-loaded) | 25 590 | new gate |
101
+ | auto bucket | ~75 000 | 59 220 | −21 % |
102
+ | total rule chars | ~193 000 | 84 810 | −56 % |
103
+ | rule count | 56 | 57 (added `token-optimizer-maintenance`) | +1 |
104
+ | skills count | 134 | 135 (added `token-optimizer`) | +1 |
105
+
106
+ Kernel-bucket-check: PASS. Per-rule cap: 16 rules over 2.5k target,
107
+ all within 4.0k Iron-Law override per ADR-002. Trend snapshot
108
+ appended to `agents/.rule-budget-history.jsonl`.
109
+
110
+ ## Consequences
111
+
112
+ - New rule submissions must declare `tier:` + `triggers:` + (when
113
+ applicable) `routes_to:` in frontmatter; the router compiler
114
+ rejects malformed entries.
115
+ - Editing Iron-Law-fenced bodies requires a fresh
116
+ `scripts/iron_law_sha.py --update` pass; CI fails on hash drift.
117
+ - The `token-optimizer` skill is now the single consult surface for
118
+ token-cost decisions; editing any cited asset requires a same-commit
119
+ catalog update per `token-optimizer-maintenance` rule (CI-backstopped
120
+ by `scripts/check_token_optimizer_freshness.py`).
121
+ - Deferred phases (token-opt P2/P3, kernel-swap from ADR-001) remain
122
+ reopenable on their declared triggers without further roadmap work.
@@ -115,7 +115,7 @@ Your agent is now:
115
115
  - **Respecting your codebase** — no conflicting patterns
116
116
  - **Following standards** — consistent code quality
117
117
 
118
- This is enforced automatically by 56 rules. No configuration needed.
118
+ This is enforced automatically by 59 rules. No configuration needed.
119
119
 
120
120
  ---
121
121
 
@@ -153,7 +153,7 @@ Your agent now understands slash commands:
153
153
  | `/quality-fix` | Run and fix all quality checks |
154
154
  | `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
155
155
 
156
- → [Browse all 94 active commands](../.agent-src/commands/)
156
+ → [Browse all 95 active commands](../.agent-src/commands/)
157
157
 
158
158
  ---
159
159
 
@@ -41,7 +41,7 @@ source: package
41
41
  | Pattern | When | Examples |
42
42
  |---|---|---|
43
43
  | `{verb}-{target}` | Action commands | `create-pr`, `fix-ci`, `commit` |
44
- | `{target}-{verb}` | Target-first grouping | `roadmap-create`, `roadmap-execute` |
44
+ | `{target}-{verb}` | Target-first grouping | `roadmap-create` (legacy atomic; current cluster form is `/roadmap:create` and `/roadmap:process-step|phase|full`) |
45
45
  | `{scope}-{action}` | Scoped actions | `optimize-agents`, `review-changes` |
46
46
 
47
47
  ### Guidelines
@@ -0,0 +1,176 @@
1
+ # Roadmap Progress Sync
2
+
3
+ > Any touch to agents/roadmaps/ — create/rename/delete/move, edit checkboxes ([x]/[~]/[-]), add/rename/remove phases — must regenerate dashboard and archive if 0 open items, same response
4
+
5
+ _Origin: migrated from `.agent-src.uncompressed/rules/roadmap-progress-sync.md` per P4.2 of `road-to-kernel-and-router.md`._
6
+
7
+ <!-- cloud_safe: degrade -->
8
+ <!-- Authoring discipline applies in cloud; local script + regen are no-ops there. -->
9
+
10
+ # Roadmap Progress Sync
11
+
12
+ > **Enforced by:** [`scripts/roadmap_progress_hook.py`](../../scripts/roadmap_progress_hook.py)
13
+ > on Augment + Claude Code (`PostToolUse`). Hook is primary; the prose
14
+ > below is the specification the hook implements and the fallback when
15
+ > the platform has no hook surface.
16
+
17
+ ## Iron Law — dashboard sync
18
+
19
+ ```
20
+ ANY ROADMAP TOUCH → REGENERATE THE DASHBOARD, SAME RESPONSE.
21
+ NO EXCEPTIONS. NO "I'LL DO IT AT THE END". NO BATCHING ACROSS TURNS.
22
+ A ROADMAP NOT IN THE DASHBOARD IS A RULE VIOLATION, NOT AN OVERSIGHT.
23
+ ```
24
+
25
+ **Roadmap touch =** create the file, rename it, delete it, move it
26
+ between `roadmaps/` ↔ `archive/` ↔ `skipped/`, add/rename/remove a
27
+ phase, **OR** flip any checkbox (`[ ]` ↔ `[x]` ↔ `[~]` ↔ `[-]`).
28
+
29
+ `agents/roadmaps-progress.md` is the read-only dashboard. Every
30
+ unsynced edit makes it lie to the next reader. Created a roadmap
31
+ without regenerating? The dashboard claims it does not exist. Marked
32
+ 8 steps `[x]` and forgot the regen? The dashboard says 0 done.
33
+
34
+ ## Iron Law — every active roadmap is trackable
35
+
36
+ ```
37
+ EVERY ACTIVE ROADMAP MUST CONTAIN AT LEAST ONE TRACKABLE CHECKBOX
38
+ (`- [ ]`) PER NON-INTRO PHASE. ROADMAPS WITHOUT EXECUTABLE STEPS
39
+ EITHER GET A CHECKLIST OR THE `status: draft` FLAG.
40
+ CI-ENFORCED: `scripts/check_roadmap_trackable.py` (CANNOT BE DEFERRED).
41
+ ```
42
+
43
+ **Active roadmap =** any file in `agents/roadmaps/` (root, not
44
+ `archive/` or `skipped/`) without `status: draft` frontmatter.
45
+
46
+ **Trackable checkbox =** an actionable `- [ ]` line under a `## Phase N`
47
+ or `### Phase N` heading (numeric `Phase 1`, roman `Phase II`, or
48
+ letter-track `Phase A1` — matched by the dashboard's `PHASE_RE`).
49
+ Tables of decisions, ICE matrices, ADR captures, and "block
50
+ sequencing" tables are valid **rationale**, but they do not satisfy
51
+ this rule on their own — they must be paired with at least one
52
+ `## Phase N` section whose checkboxes execute the decision.
53
+ Headings such as `## Phase steps`, `### Sequencing — Phase 1 …`,
54
+ `### P0 #1 — …`, or `## Block A` do **not** count — only the
55
+ canonical `Phase <id>` form parsed by the dashboard.
56
+
57
+ **CI backstop.** `scripts/check_roadmap_trackable.py` (package-shipped,
58
+ wire into the consumer's pre-commit / pre-push / Actions gate) fails
59
+ when an active roadmap has zero canonical `Phase` headings or when
60
+ any parsed phase has zero checkboxes. Last line of defence — real-time
61
+ authoring still flips checkboxes and regenerates the dashboard the
62
+ same response.
63
+
64
+ ## Status — binary `ready` (default) vs `draft`
65
+
66
+ ```yaml
67
+ ---
68
+ status: draft # hidden from the dashboard until flipped
69
+ ---
70
+ ```
71
+
72
+ Two values, no synonyms. Anything else — no frontmatter at all,
73
+ `status: ready`, an unknown value — counts as **ready** and lands
74
+ in the dashboard.
75
+
76
+ - **Ready** is the implicit default. New roadmaps are created
77
+ ready unless the user explicitly says draft. Ready roadmaps are
78
+ listed in the dashboard, count towards open/done totals, and
79
+ trip the "completed but not archived" warning when they close.
80
+ - **Draft** hides the file from the dashboard entirely (not
81
+ counted, not listed). Use it while the roadmap is still being
82
+ authored, while waiting for upstream decisions, or as a
83
+ capture-only synthesis that has not yet been promoted to
84
+ executable phases. Flip to ready (or remove the field) the
85
+ moment the roadmap is ready to track.
86
+
87
+ **Completion = archival, same response.** When the edit takes a
88
+ roadmap to `count_open == 0` (every item is `[x]`, `[~]`, or `[-]`),
89
+ `git mv` it into `agents/roadmaps/archive/` (or `skipped/` if no `[x]`
90
+ at all) **before** regenerating the dashboard. A 100%-complete
91
+ roadmap left under `agents/roadmaps/` is a rule violation, not an
92
+ optional cleanup. See `roadmap-management` skill for the archive vs
93
+ skipped decision table.
94
+
95
+ ## Agent-authored roadmaps — placement is mandatory
96
+
97
+ ```
98
+ A FILE THE AGENT DROPS INTO agents/roadmaps/ MUST EITHER
99
+ (a) PASS check_roadmap_trackable.py AND LAND IN THE DASHBOARD, OR
100
+ (b) NOT BE IN agents/roadmaps/ AT ALL.
101
+ NO "DECISION MATRIX" / "DESIGN NOTE" SHORTCUT.
102
+ ```
103
+
104
+ When the agent autonomously creates a roadmap, it owns the placement
105
+ in the **same response**:
106
+
107
+ - **Phase plan** (checkboxes, multi-turn execution) → `agents/roadmaps/<name>.md`, `status: ready` (default), regen dashboard.
108
+ - **Decision matrix / ADR / pattern / lookup** (no `Phase N`, durable rationale) → `agents/contexts/<name>.md`.
109
+ - **Completed work snapshot** → `agents/roadmaps/archive/<name>.md`.
110
+
111
+ A non-trackable file in `agents/roadmaps/` is a rule violation — the
112
+ trackable CI fails it, the dashboard hides it. The agent that
113
+ created it moves it the same response. If the autonomous run also
114
+ **finishes** the roadmap within the session (every box `[x]`/`[~]`/`[-]`),
115
+ the completion-archival rule above fires too — same response.
116
+
117
+ ## Autonomous execution — checkbox cadence
118
+
119
+ When executing a roadmap autonomously (multi-turn, no per-step user
120
+ prompt), the user loses progress visibility unless checkboxes flip
121
+ **as work lands**, not in a batch at the end. Iron Law:
122
+
123
+ ```
124
+ EVERY DONE STEP FLIPS [ ] → [x] IN NEXT REPLY THAT ACKNOWLEDGES IT.
125
+ NO "I UPDATE ROADMAP AT END OF PHASE."
126
+ NO "FOUR STEPS DONE, ONE COMMIT, ONE REGEN."
127
+ ```
128
+
129
+ Step counts as completed when:
130
+
131
+ - Code / docs change for that step has been **written and saved** AND
132
+ - Verification cited in the step (project CI command, targeted test, lint) has
133
+ **passed in this response or an earlier one** — fresh output, not memory.
134
+
135
+ Then in the **same reply**: flip the checkbox, regenerate the
136
+ dashboard, commit if commit policy allows.
137
+
138
+ **Forbidden:** four turns of step work, dashboard flat, single regen at the end.
139
+ **Required:** each turn — implement step, flip `[x]`, regen, commit (if policy allows).
140
+ A reply that lands a verified step without flipping its checkbox is a rule violation.
141
+
142
+ **In-progress marker:** when a step takes more than one reply,
143
+ mark it `[~]` the moment work starts on it and regenerate. The
144
+ user sees one row move from `[ ]` to `[~]` to `[x]` instead of
145
+ silent rows. `[~]` is treated as open for `count_open` but moves
146
+ the phase percentage forward in the dashboard.
147
+
148
+ ## Mechanics — triggers, regen command, self-check, failures
149
+
150
+ The triggers table, the regen command (`./agent-config roadmap:progress`),
151
+ the mandatory pre-send self-check, the failure-mode catalog, and the
152
+ `Do NOT` list live in
153
+ [`contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md`](../contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md).
154
+ Pull it whenever a trigger fires — the rule above is the obligation
155
+ surface; the mechanics file is the lookup material.
156
+
157
+ ## Copilot fallback
158
+
159
+ GitHub Copilot has no `PostToolUse` hook surface, so
160
+ `scripts/roadmap_progress_hook.py` cannot detect roadmap-file writes
161
+ structurally. The dashboard at `agents/roadmaps-progress.md` will
162
+ not regenerate on its own.
163
+
164
+ The cooperative path: every time a roadmap touch fires (per the
165
+ trigger list in the mechanics context above), the agent regenerates
166
+ the dashboard in the same response — which is the same Iron Law the
167
+ hook enforces, just executed manually:
168
+
169
+ ```bash
170
+ ./agent-config roadmap:progress
171
+ ```
172
+
173
+ The hook implementation is the specification; on Copilot the agent
174
+ runs the regenerator itself after the same triggers fire. Skipping
175
+ it is a rule violation, not a hook gap — the Iron Law on dashboard
176
+ sync survives the missing hook surface.
@@ -0,0 +1,73 @@
1
+ # Rule Type Governance
2
+
3
+ > Creating or editing rules, or auditing rule types — decides when a rule should be always vs auto
4
+
5
+ _Origin: migrated from `.agent-src.uncompressed/rules/rule-type-governance.md` per P4.2 of `road-to-kernel-and-router.md`._
6
+
7
+ # rule-type-governance
8
+
9
+ ## `always` = loaded every conversation
10
+
11
+ Use ONLY when the rule applies to virtually every interaction:
12
+
13
+ - Universal agent behavior (language, tone, interaction style)
14
+ - Safety constraints (scope control, verification before completion)
15
+ - Token/efficiency constraints
16
+ - First-message checks that cannot wait for auto-trigger
17
+
18
+ ## `auto` = loaded on demand by description match
19
+
20
+ Use for everything else:
21
+
22
+ - Language-specific rules (PHP, JS, SQL)
23
+ - Tool-specific rules (Docker, Git, quality tools)
24
+ - Workflow-specific rules (commands, skill creation, E2E testing)
25
+ - Domain-specific rules (translations, architecture)
26
+
27
+ ## Decision test
28
+
29
+ > "Does this rule need to be active when the user asks a simple question, reviews a PR, or discusses architecture?"
30
+
31
+ - Yes → `always`
32
+ - No → `auto` with a clear trigger description
33
+
34
+ ## Auto description quality
35
+
36
+ The `description` field IS the trigger. It must describe **when** the rule applies, not **what** it contains.
37
+
38
+ - ❌ `"PHP coding standards"` — too vague, won't match reliably
39
+ - ✅ `"Writing or reviewing PHP code — strict types, naming, Eloquent conventions"`
40
+
41
+ ## Hard constraint
42
+
43
+ - Default to `auto`. Justify `always`.
44
+ - If >50% of conversations don't need a rule → it must be `auto`.
45
+ - `optimize-agents` command checks this and suggests changes.
46
+
47
+ ## Hardening tier — required on new or edited rules
48
+
49
+ Every new rule, and every edited rule whose body changes the trigger
50
+ or the obligation, MUST classify itself against the hardening tiers
51
+ documented in [`rule-trigger-matrix.md`](../../agents/contexts/rule-trigger-matrix.md):
52
+
53
+ | Tier | Meaning |
54
+ |---|---|
55
+ | `1` | Mechanically enforceable — hook acts, rule body stays minimal. |
56
+ | `2a` | Marker nudge — hook injects signal, agent acts on it. |
57
+ | `2b` | Structured injection / tool-call gate — hook reads/writes state, may deny. |
58
+ | `3` | Soft, judgment-bound — no platform surface; self-check rule. |
59
+ | `safety-floor` | Iron-Law subset, never modified. |
60
+ | `mechanical-already` | Precedent — script enforces, rule body documents. |
61
+
62
+ Classification surface: the optional `tier:` frontmatter field
63
+ (declared in `scripts/schemas/rule.schema.json`). Recommended for new
64
+ rules; bulk-retrofit of existing rules is tracked separately.
65
+
66
+ Tier 3 dispositions are recorded centrally in
67
+ [`agents/contexts/tier-3-dispositions.md`](../../agents/contexts/tier-3-dispositions.md)
68
+ with a 6-month re-audit clock. New Tier 3 rules append to that list
69
+ on landing.
70
+
71
+ The `optimize-agents` command checks the tier alongside `type`/`source`
72
+ and suggests escalations when a rule's trigger matches a hardening
73
+ opportunity that has shipped since the rule was authored.
@@ -33,6 +33,11 @@ Size is a signal — not the goal.
33
33
  - Acceptable: **< 100–120 lines**
34
34
  - Hard limit: **< 200 lines**
35
35
 
36
+ Linter (council review 2026-05-06): the > 40 / > 60 line warnings are
37
+ **density-gated** — rules with ≥ 30 % fenced content (verbatim Iron-Law
38
+ blocks, worked-example fences) are exempt from the line-count warning.
39
+ The 200-line hard error stays unconditional.
40
+
36
41
  Reason:
37
42
  - Loaded frequently
38
43
  - Must be reliably followed
@@ -43,8 +48,10 @@ Reason:
43
48
  ## Skills
44
49
 
45
50
  - Target: **300–900 words**
46
- - Warning: **>1200 words**
47
- - Strong split signal: **>1500 words**
51
+ - Warning: **> 400 lines** (raised from 300, council review 2026-05-06)
52
+ - Strong split signal: reference-rich skills (analyzer, quality-tool
53
+ catalog, council orchestration) may legitimately sit between 300 and
54
+ 400 lines without being split-candidates
48
55
 
49
56
  Focus:
50
57
  - scanability
@@ -57,6 +64,10 @@ Focus:
57
64
 
58
65
  - Target: **200–600 words**
59
66
  - Acceptable: **up to ~1000 words**
67
+ - Warning: **> 1000 words AND lacks delegation structure** (< 5
68
+ sub-sections OR < 3 code blocks). Well-factored orchestrators with ≥ 5
69
+ sub-sections AND ≥ 3 code blocks are exempt — the size reflects
70
+ dispatch breadth, not bloat (council review 2026-05-06).
60
71
 
61
72
  Commands orchestrate — not implement.
62
73