@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
@@ -5,16 +5,11 @@ description: "Commit policy — never commit and never ask about committing unle
5
5
  alwaysApply: true
6
6
  source: package
7
7
  load_context:
8
- - .agent-src.uncompressed/contexts/authority/commit-mechanics.md
8
+ - ../contexts/authority/commit-mechanics.md
9
9
  ---
10
10
 
11
11
  # Commit Policy
12
12
 
13
- Local commits do not change remote state, but committing prematurely
14
- makes review harder. This is the **canonical** rule for committing,
15
- referenced by [`autonomous-execution`](autonomous-execution.md),
16
- [`scope-control`](scope-control.md), and the roadmap commands.
17
-
18
13
  ## The Iron Law
19
14
 
20
15
  ```
@@ -22,61 +17,35 @@ NEVER COMMIT. NEVER ASK ABOUT COMMITTING.
22
17
  EXCEPTIONS ARE EXPLICIT, NOT INFERRED.
23
18
  ```
24
19
 
25
- Applies regardless of `personal.autonomy`, conversation momentum, or
26
- "but it's a clean stopping point". Default is **no commit, no
27
- question**.
20
+ Applies regardless of `personal.autonomy`, conversation momentum, or "clean stopping point". Default: **no commit, no question**.
28
21
 
29
22
  ## Exceptions — when committing IS allowed
30
23
 
31
- Exactly four ways the agent may commit:
24
+ Exactly four:
32
25
 
33
- 1. **User says so this turn** — explicit phrase like "commit this now",
34
- "go ahead and commit". Permission is for **this commit only**, not
35
- standing.
36
- 2. **Standing instruction not yet revoked** user said earlier in
37
- the conversation "commit after every phase" or similar, and has not
38
- revoked it. Cache and honor.
39
- 3. **Commit command invoked** — `/commit` (with confirmation) or
40
- `/commit-in-chunks` (auto-split, no confirmation).
41
- 4. **Roadmap authorization** — the roadmap file lists explicit commit
42
- steps and the user invoked roadmap execution.
26
+ 1. **User says so this turn** — "commit this now", "go ahead and commit". This commit only, not standing.
27
+ 2. **Standing instruction not yet revoked** — "commit after every phase" earlier in the conversation; cache and honor.
28
+ 3. **Commit command invoked** — `/commit` (with confirmation) or `/commit:in-chunks` (auto-split, no confirmation).
29
+ 4. **Roadmap authorization** roadmap file lists explicit commit steps and the user invoked roadmap execution.
43
30
 
44
- Anything else → no commit. Hard Floor (bulk deletions, infra changes)
45
- still fires on top of any exception — see
46
- [`commit-mechanics`](../contexts/authority/commit-mechanics.md) for
47
- the diff triggers and the roadmap-authorized commit flow.
31
+ Anything else → no commit. Hard Floor (bulk deletions, infra changes) still fires on top of any exception — see [`commit-mechanics`](../contexts/authority/commit-mechanics.md) for diff triggers and roadmap-authorized commit flow.
48
32
 
49
33
  ## NEVER ask about committing
50
34
 
51
- Asking "should I commit this?", "do we want to commit?", or any
52
- variant is **forbidden**. The user invokes a command or says so
53
- explicitly. Don't surface a commit option in numbered-options blocks
54
- unless the rest of the message would be incomplete without it.
35
+ "Should I commit this?" / "do we want to commit?" — **forbidden**. The user invokes a command or says so explicitly. Don't surface a commit option in numbered-options blocks unless the rest of the message would be incomplete without it.
55
36
 
56
- Quoted commit phrases (chat-log paste, log excerpt, roadmap snippet)
57
- are **not** permission — see
58
- [`commit-mechanics`](../contexts/authority/commit-mechanics.md)
59
- § Speech-act check.
37
+ Quoted commit phrases (chat-log paste, log excerpt, roadmap snippet) are **not** permission — see [`commit-mechanics § Speech-act check`](../contexts/authority/commit-mechanics.md).
60
38
 
61
39
  ## NEVER write commit steps into roadmaps unsolicited
62
40
 
63
- When **creating** a roadmap (via `/roadmap-create`,
64
- `/feature-roadmap`, or any roadmap-producing flow), do **not** include
65
- commit steps unless the user explicitly requested them. Commits are a
66
- delivery decision; roadmaps plan **work**.
41
+ When **creating** a roadmap (`/roadmap-create`, `/feature-roadmap`, any roadmap-producing flow) — do **not** include commit steps unless the user explicitly requested them. Commits are a delivery decision; roadmaps plan **work**.
67
42
 
68
- If the user explicitly wants commit steps in the roadmap, write them
69
- clearly and unambiguously (e.g. "Commit phase X: chore: …").
43
+ If the user explicitly wants commit steps, write them clearly (e.g. "Commit phase X: chore: …").
70
44
 
71
45
  ## See also
72
46
 
73
- - [`autonomous-execution`](autonomous-execution.md) — when to suppress
74
- trivial questions; this rule survives the suppression.
75
- - [`no-cheap-questions`](no-cheap-questions.md) — commit asks are
76
- cheap by construction; this rule is the canonical Iron Law, the
77
- cheap-questions rule cites it and refuses to surface the option.
78
- - [`scope-control`](scope-control.md) — git-ops permission gate
79
- (push, merge, branch, PR, tag stay separately permission-gated).
47
+ - [`autonomous-execution`](autonomous-execution.md) — trivial-question suppression; this rule survives the suppression.
48
+ - [`no-cheap-questions`](no-cheap-questions.md) — commit asks are cheap by construction; this rule is the canonical Iron Law.
49
+ - [`scope-control`](scope-control.md) — git-ops permission gate (push, merge, branch, PR, tag).
80
50
  - [`/commit`](../commands/commit.md) — split and commit with confirmation.
81
- - [`/commit-in-chunks`](../commands/commit-in-chunks.md) — auto-split
82
- and commit without confirmation.
51
+ - [`/commit:in-chunks`](../commands/commit/in-chunks.md) — auto-split, no confirmation.
@@ -4,6 +4,11 @@ tier: "1"
4
4
  alwaysApply: false
5
5
  description: "When debugging, fixing errors, or running long conversations — 3-failure stop rule, tool-loop detection, fresh-chat triggers"
6
6
  source: package
7
+ triggers:
8
+ - intent: "long conversation"
9
+ - intent: "tool loop"
10
+ - intent: "fresh chat"
11
+ - keyword: "3-failure"
7
12
  ---
8
13
 
9
14
  # Context Hygiene
@@ -8,8 +8,7 @@ source: package
8
8
 
9
9
  # Direct Answers
10
10
 
11
- Three Iron Laws govern every reply. They override conversation
12
- momentum, politeness defaults, and the urge to fill space.
11
+ Three Iron Laws govern every reply.
13
12
 
14
13
  ## Iron Law 1 — No Flattery
15
14
 
@@ -19,11 +18,10 @@ NEVER PRAISE THE USER'S IDEA TO MAKE THEM HAPPY.
19
18
  ANSWER THE SUBSTANCE. SHIP THE TRUTH.
20
19
  ```
21
20
 
22
- - No positive adjectives about user, question, idea, or work product as opener.
23
- - No subjective judgments on user's code/decisions ("nice approach", "boring") unless evaluation was asked.
24
- - "Good catch" / "you're right" only when literally true and load-bearing.
25
- - Acknowledge mistakes without performative apologies — one sentence, switch behavior.
26
- - Failure mode — praise hedging bad news; drop the cushion, deliver the news.
21
+ - No positive-adjective opener about user / question / idea / work.
22
+ - No subjective judgment on user code unless evaluation was asked.
23
+ - "Good catch" / "you're right" only when literally true.
24
+ - Mistakes — one-sentence acknowledge, switch behavior, no apology theatre.
27
25
 
28
26
  ## Iron Law 2 — No Invented Facts (severity-tiered)
29
27
 
@@ -33,16 +31,14 @@ THE MORE LOAD-BEARING THE CLAIM, THE HARDER YOU VERIFY.
33
31
  WHEN VERIFICATION IS NOT WORTH THE COST → ASK.
34
32
  ```
35
33
 
36
- | Severity | Required action |
34
+ | Severity | Action |
37
35
  |---|---|
38
- | **High — load-bearing** (file paths, signatures, version numbers, security claims, "this test passes") | MUST verify with `view`, `grep`, `codebase-retrieval`, or fresh command output. Too expensive → ask. |
39
- | **Medium — project-shape** ("uses X for Y", conventions, file location) | Verify if one tool call reaches it; otherwise hedge: *"I'd guess X — not checked"*. |
40
- | **Low — well-known idioms** (generic language/framework idioms, public APIs) | Inference acceptable. Mark as inference if not 100% sure. |
36
+ | **High** — load-bearing (paths, signatures, versions, security, "this passes") | Verify with `view` / `grep` / `codebase-retrieval` / fresh output. Too expensive → ask. |
37
+ | **Medium** — project-shape (conventions, file location) | One-tool-call verify, else hedge: *"I'd guess X — not checked"*. |
38
+ | **Low** — well-known idioms | Inference OK; mark as inference if not 100% sure. |
41
39
 
42
- Examples + hedge-language patterns:
43
- [`asking-and-brevity-examples`](../../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--severity-tiered-claim-examples).
44
- Override: "just guess", "rough estimate is fine", "skip the verify"
45
- → drop to Low for that turn.
40
+ Override: "just guess" / "rough estimate" / "skip verify" → drop to Low for that turn.
41
+ Examples + hedge patterns: [`asking-and-brevity-examples § severity`](../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--severity-tiered-claim-examples).
46
42
 
47
43
  ## Iron Law 3 — Brevity by Default
48
44
 
@@ -51,49 +47,24 @@ THE SHORTEST REPLY THAT FULLY ANSWERS THE QUESTION IS THE RIGHT REPLY.
51
47
  LONG ANSWERS ARE A FAILURE MODE, NOT A SIGN OF EFFORT.
52
48
  ```
53
49
 
54
- - Skip restating the user's question.
55
- - Skip announcing intent ("Let me…", "I will now…") — just do.
50
+ - Skip restating the question; skip "Let me…" intent announcements.
56
51
  - Skip explaining tool use — the call result speaks.
57
52
  - Skip post-hoc summary unless rechecking a decision.
58
- - Multi-step → bullets, not paragraphs.
59
- - One-true-answer question → one sentence + the answer.
53
+ - Multi-step → bullets. One-true-answer → one sentence.
60
54
 
61
- `token-efficiency` covers the loop side; this rule covers per-reply
62
- length. **Never overrides** `user-interaction` (numbered options stay)
63
- or command-mandated steps.
55
+ Never overrides `user-interaction` (numbered options stay) or command-mandated steps.
64
56
 
65
57
  ## Emoji Scope — functional markers only
66
58
 
67
- **Whitelist:** mode markers from `role-mode-adherence`;
68
- CLI status `❌` / `✅` / `⚠️` (two-space rule from `language-and-tone`);
69
- roadmap checkboxes `[x]` / `[~]` / `[-]`.
59
+ **Whitelist:** mode markers (`role-mode-adherence`); CLI status `❌` / `✅` / `⚠️`; roadmap checkboxes `[x]` / `[~]` / `[-]`.
60
+ **Blacklist:** opening flair (✨, 🚀, 🎉, 💡, 🔥, 👍); empathy (❤️, 🤗, 😊); section dividers; reaction emojis. Unsure → blacklist.
70
61
 
71
- **Blacklist (never in prose):** opening flair (✨, 🚀, 🎉, 💡, 🔥, 👍);
72
- empathy (❤️, 🤗, 😊); section dividers, headline ornaments, reaction
73
- emojis. Unsure → assume blacklist.
62
+ ## Failure modes & examples
74
63
 
75
- ## Failure modes
76
-
77
- Trigger phrases + in-language correction pattern:
78
- [`asking-and-brevity-examples`](../../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--failure-modes-the-user-will-call-out).
79
- On call-out: acknowledge once in the user's language, switch, no
80
- excuses (mirrors `language-and-tone` § slip handling).
64
+ Trigger phrases + correction pattern: [`asking-and-brevity-examples § failure-modes`](../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--failure-modes-the-user-will-call-out).
65
+ Pattern Memory (wrong / right / why): [`direct-answers-demos`](../docs/guidelines/agent-infra/direct-answers-demos.md).
66
+ Outcome baseline: [`tests/golden/outcomes/direct_answers.json`](../../tests/golden/outcomes/direct_answers.json).
81
67
 
82
68
  ## Interactions
83
69
 
84
- - `language-and-tone` language mirroring, `.md` always English,
85
- CLI-icon two-space rule.
86
- - `ask-when-uncertain` — resolution surface for Iron Law 2 gaps.
87
- - `think-before-action` — how to verify code-behavior claims.
88
- - `verify-before-complete` — completion-claim evidence gate.
89
- - `token-efficiency` — loop-side brevity.
90
- - `user-interaction` — numbered-options Iron Law overrides brevity.
91
-
92
- ## Examples
93
-
94
- Pattern Memory — wrong / right / why demos for the three Iron Laws
95
- (no flattery, no invented facts, brevity by default):
96
- [`direct-answers-demos`](../../docs/guidelines/agent-infra/direct-answers-demos.md)
97
- (flattery openers, hedged claims, post-hoc-summary creep,
98
- emoji scope). Outcome baseline locked at
99
- [`tests/golden/outcomes/direct_answers.json`](../../tests/golden/outcomes/direct_answers.json).
70
+ `language-and-tone` · `ask-when-uncertain` · `think-before-action` · `verify-before-complete` · `token-efficiency` · `user-interaction` (overrides brevity).
@@ -1,54 +1,20 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "3"
4
- alwaysApply: false
5
4
  description: "Running PHP commands inside Docker containers — artisan, composer, phpstan, rector, ecs, phpunit, tests, migrations, and any CLI tool execution"
6
5
  source: package
6
+ triggers:
7
+ - keyword: "docker"
8
+ - keyword: "artisan"
9
+ - keyword: "composer"
10
+ - phrase: "inside the container"
11
+ routes_to:
12
+ - "skill:docker"
7
13
  ---
8
14
 
9
- # Docker Container Commands
15
+ # Docker Commands
10
16
 
11
- All PHP commands (PHPStan, Rector, Composer, PHPUnit, Artisan) must be executed **inside the Docker container**, not on the host.
17
+ **Iron Law.** Run PHP / artisan / composer / phpstan / rector / ecs / phpunit inside the project container, never on the host.
12
18
 
13
- ## Container Detection
14
-
15
- Detect the correct PHP container service name from `docker-compose.yml` / `compose.yaml`.
16
- Read the compose file to find the PHP service name — it varies per project.
17
-
18
- Use `docker compose exec -T <service> ...` for non-interactive commands (scripts, CI).
19
- Use `make console` to enter the container interactively (if available).
20
-
21
- ## Tooling Detection
22
-
23
- Check if `artisan` exists in the project root:
24
-
25
- - **Laravel** (`artisan` exists): `php artisan test`, `vendor/bin/phpstan analyse`, `vendor/bin/rector process`
26
- - **Composer** (no `artisan`): `vendor/bin/phpunit`, `vendor/bin/phpstan analyse`, `vendor/bin/rector process`
27
-
28
- ## Examples (Laravel project)
29
-
30
- ```bash
31
- docker compose exec -T <php-service> vendor/bin/phpstan analyse
32
- docker compose exec -T <php-service> vendor/bin/rector process
33
- docker compose exec -T <php-service> vendor/bin/ecs check --fix
34
- docker compose exec -T <php-service> php artisan test
35
- ```
36
-
37
- ## Examples (Composer project)
38
-
39
- ```bash
40
- docker compose exec -T <php-service> vendor/bin/phpstan analyse
41
- docker compose exec -T <php-service> vendor/bin/rector process
42
- docker compose exec -T <php-service> vendor/bin/ecs check --fix
43
- docker compose exec -T <php-service> vendor/bin/phpunit
44
- ```
45
-
46
- ## Build / Task Runner
47
-
48
- Before using raw `docker compose exec` commands, check if the consumer
49
- project ships a `Makefile` for common targets (e.g. `make console`,
50
- `make test`, `make phpstan`). Read the Makefile first to discover
51
- available shortcuts. If the project uses a different task runner,
52
- inspect its config file before defaulting to raw `docker compose exec`.
53
-
54
- Frontend commands (npm, webpack) run on the host or in the node container.
19
+ Body migrated to `skill:docker` (per P4 of `road-to-kernel-and-router.md`).
20
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -3,64 +3,18 @@ type: "auto"
3
3
  tier: "2a"
4
4
  description: "Keeping .augment/ contexts, counts, and cross-references in sync when creating, renaming, or deleting skills, commands, rules, guidelines, templates, or any agent infrastructure files"
5
5
  source: package
6
- load_context:
7
- - .agent-src.uncompressed/contexts/communication/rules-auto/docs-sync-mechanics.md
6
+ triggers:
7
+ - path_prefix: ".agent-src.uncompressed/"
8
+ - path_prefix: ".augment/"
9
+ - keyword: "rename"
10
+ - keyword: "delete"
11
+ routes_to:
12
+ - "skill:agent-docs-writing"
8
13
  ---
9
14
 
10
15
  # Docs Sync
11
16
 
12
- ## Rule
17
+ **Iron Law.** On any add / rename / delete of skill / rule / command / guideline, update counts and cross-references in the same edit.
13
18
 
14
- **CRITICAL ZERO TOLERANCE:** When a file in `.augment/` is **created, renamed, or deleted**,
15
- or its **name, description, scope, or counts change**, all related files **must be updated
16
- in the same response** — not later, not in a follow-up, not when reminded.
17
-
18
- A new rule/skill/command without its index entry, count update, and context update is **incomplete work**.
19
-
20
- **Mandatory sequence when creating/deleting any `.augment/` file:**
21
- 1. Create/delete the file
22
- 2. **Immediately** update `contexts/augment-infrastructure.md` (counts + category tables)
23
- 3. Check cross-references in contexts and routing hints (inline "see X skill" references)
24
- 4. If a **skill** was added/renamed/deleted: update distribution manifests
25
- 5. If a **hook** was added/renamed/deleted: update hook registries
26
- 6. If **content** changed: run the consistency grep across other artefacts
27
-
28
- Steps 2–6 are NOT optional. Do NOT present the result to the user until all steps are done.
29
-
30
- **Two modes:**
31
- - **Reactive** (automatic): Triggered by add/remove/rename or scope/description/count changes → sync counts, contexts, cross-references, manifests, registries.
32
- - **Proactive** (on demand): Full audit → find duplicates, thin skills, redundancy, stale content → fix or merge. Ask before destructive actions.
33
-
34
- ## Settings template sync
35
-
36
- When a skill, rule, or command **reads a new setting** from `.agent-settings.yml` that does not yet
37
- exist in `.augment/templates/agent-settings.md`:
38
-
39
- 1. **Add the key** with its default value to the template block.
40
- 2. **Add a row** to the Settings Reference table.
41
- 3. **Add a comment** above the key explaining what it does.
42
- 4. **Update the local `.agent-settings.yml`** — add the new key with its default value.
43
- Preserve all existing values, apply template order and comments. Follow the
44
- [section-aware merge rules](../../docs/guidelines/agent-infra/layered-settings.md#section-aware-merge-rules)
45
- so the user benefits immediately without running a separate command.
46
-
47
- **This step is mandatory.** If the template gains a new key but the local `.agent-settings.yml`
48
- is not updated, the user cannot discover the new setting exists.
49
-
50
- ## Lookup tables and details — see mechanics
51
-
52
- The exact "what to update" tables, cross-reference targets,
53
- distribution-manifest update tables (`marketplace.json` etc.), hook
54
- registry update tables (`__init__.py`, consumer-settings JSON), the
55
- failure mode that motivated the manifest section, and the content
56
- consistency `grep` snippet all live in
57
- [`contexts/communication/rules-auto/docs-sync-mechanics.md`](../contexts/communication/rules-auto/docs-sync-mechanics.md).
58
- Pull it whenever a sync trigger fires.
59
-
60
- ## Do NOT
61
-
62
- - Do NOT rewrite entire files — only update the affected entries.
63
- - Do NOT ask the user for permission — this is an automatic maintenance step, like updating imports.
64
- - Do NOT skip cross-reference updates — stale links are worse than no links.
65
- - Do NOT present a new `.augment/` file to the user without having completed all sync steps first.
66
- - Do NOT defer sync to a "follow-up" — it must happen in the same response as the creation/deletion.
19
+ Body migrated to `skill:agent-docs-writing` (per P4 of `road-to-kernel-and-router.md`).
20
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -4,6 +4,11 @@ tier: "2b"
4
4
  alwaysApply: false
5
5
  description: "After EVERY code edit, find ALL downstream changes needed to existing files, including callers, tests, imports, types, and documentation"
6
6
  source: package
7
+ triggers:
8
+ - intent: "after code edit"
9
+ - keyword: "callers"
10
+ - keyword: "imports"
11
+ - keyword: "downstream"
7
12
  ---
8
13
 
9
14
  # Downstream Changes
@@ -1,54 +1,19 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "3"
4
- alwaysApply: false
5
4
  description: "Playwright E2E tests — locators, assertions, Page Objects, fixtures, CI, and flaky test prevention"
6
5
  source: package
6
+ triggers:
7
+ - keyword: "playwright"
8
+ - keyword: "e2e"
9
+ - phrase: "page object"
10
+ routes_to:
11
+ - "command:e2e-heal"
7
12
  ---
8
13
 
9
14
  # E2E Testing
10
15
 
11
- ## Before writing E2E tests
16
+ **Iron Law.** Playwright E2E: stable locators, no `waitForTimeout`, Page Objects for shared flows, fixtures over `beforeEach`.
12
17
 
13
- 1. **Read the guideline** — `../../docs/guidelines/e2e/playwright.md` for all conventions and patterns.
14
- 2. **Check existing tests** match the project's structure, fixtures, and Page Object patterns.
15
- 3. **Check `playwright.config.ts`** — base URL, browsers, timeouts, projects.
16
-
17
- ## Locator rules
18
-
19
- - **Always prefer semantic locators**: `getByRole` > `getByLabel` > `getByText` > `getByTestId` > CSS.
20
- - Never use auto-generated class names, dynamic IDs, or XPath.
21
- - If no semantic locator works, add a `data-testid` to the component.
22
-
23
- ## Assertion rules
24
-
25
- - **Always use web-first assertions** (`toBeVisible`, `toHaveText`, `toHaveURL`).
26
- - Never use `expect(await ...)` pattern — it doesn't auto-retry.
27
- - Never use `page.waitForTimeout()` — wait for a condition instead.
28
-
29
- ## Test structure rules
30
-
31
- - One test = one user workflow or behavior.
32
- - Tests must be **fully isolated** — no shared state, no execution order dependency.
33
- - Page Objects contain **actions only**, never assertions.
34
- - Use **fixtures** for reusable setup (auth, page objects, test data).
35
- - Use **API calls** for test data setup — faster and more reliable than UI interactions.
36
-
37
- ## CI rules
38
-
39
- - Set `workers: 1` in CI for stability.
40
- - Set `retries: 2` in CI, `0` locally.
41
- - Set `forbidOnly: !!process.env.CI` to prevent `.only` in CI.
42
- - Collect `trace: 'on-first-retry'` — not on every run.
43
- - Only install browsers you need (`npx playwright install chromium --with-deps`).
44
- - Upload `playwright-report/` as CI artifact.
45
-
46
- ## Quality checks
47
-
48
- Before claiming E2E tests are complete:
49
-
50
- 1. All tests pass locally: `npx playwright test`
51
- 2. No `waitForTimeout` calls in the code.
52
- 3. No CSS/XPath selectors where semantic locators work.
53
- 4. No `.only` left in test files.
54
- 5. Page Objects have no assertions.
18
+ Body migrated to `command:e2e-heal` (per P4 of `road-to-kernel-and-router.md`).
19
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -4,88 +4,26 @@ tier: "3"
4
4
  description: "Writing or reviewing code — check relevant guideline before writing or reviewing code"
5
5
  alwaysApply: false
6
6
  source: package
7
+ load_context:
8
+ - ../contexts/communication/rules-auto/guidelines-mechanics.md
9
+ triggers:
10
+ - intent: "writing code"
11
+ - intent: "reviewing code"
12
+ - keyword: "convention"
7
13
  ---
8
14
 
9
15
  # Guidelines
10
16
 
11
- Coding guidelines live in `.augment/guidelines/` organized by language.
12
- **Always check the relevant guideline** before writing or reviewing code.
13
-
14
- ## Available Guidelines
15
-
16
- ### PHP (`../../docs/guidelines/php/`)
17
-
18
- | File | Topic |
19
- |---|---|
20
- | `php.md` | General PHP style — strict types, naming, comparisons, early returns, JSON handling |
21
- | `controllers.md` | Thin controllers, single responsibility, delegation to services |
22
- | `eloquent.md` | Model conventions, relationships, scopes, accessors/mutators |
23
- | `validations.md` | FormRequest patterns, custom rules, validation structure |
24
- | `resources.md` | API Resource conventions, response structure |
25
- | `jobs.md` | Queue job patterns, serialization, retry strategies |
26
- | `git.md` | Branch naming, commit messages, PR conventions |
27
- | `api-design.md` | API conventions — response format, status codes, pagination, error handling |
28
- | `artisan-commands.md` | Console command conventions — naming, structure, safety, scheduling |
29
- | `blade-ui.md` | Blade template conventions — views, components, forms, escaping |
30
- | `database.md` | Database conventions — indexing, query optimization, migrations, transactions |
31
- | `flux.md` | Flux UI component conventions — usage, variants, forms, Livewire integration |
32
- | `livewire.md` | Livewire component conventions — state, actions, forms, performance, Alpine.js |
33
- | `logging.md` | Logging conventions — levels, structured context, Sentry patterns |
34
- | `naming.md` | Naming conventions — classes, database, routes, variables, modules, agent infra |
35
- | `performance.md` | Performance conventions — caching, Redis, eager loading, response time targets |
36
- | `security.md` | Security conventions — auth, authorization, SQL injection, XSS, CSRF, headers |
37
- | `sql.md` | Raw SQL conventions — parameterization, MariaDB syntax, common mistakes |
38
- | `websocket.md` | WebSocket conventions — Broadcasting, channel types, connection management |
39
- | `patterns.md` | Design patterns index (links to `patterns/` subdirectory) |
40
-
41
- ### PHP Patterns (`../../docs/guidelines/php/patterns/`)
42
-
43
- | File | Pattern |
44
- |---|---|
45
- | `service-layer.md` | Service classes, business logic encapsulation |
46
- | `repositories.md` | Repository pattern, query encapsulation |
47
- | `dtos.md` | Data Transfer Objects, SimpleDto conventions |
48
- | `dependency-injection.md` | Constructor injection, service container |
49
- | `events.md` | Event/Listener patterns, dispatching |
50
- | `policies.md` | Authorization policies, gate definitions |
51
- | `factory.md` | Factory pattern usage |
52
- | `pipelines.md` | Laravel Pipeline pattern |
53
- | `strategy.md` | Strategy pattern implementation |
54
-
55
- ### E2E (`../../docs/guidelines/e2e/`)
56
-
57
- Playwright best practices, Page Objects, fixtures, CI.
58
-
59
- ### Agent Infrastructure (`../../docs/guidelines/agent-infra/`)
60
-
61
- | File | Topic |
62
- |---|---|
63
- | `size-and-scope.md` | Size limits and scope boundaries for rules, skills, commands, guidelines, AGENTS.md, copilot-instructions.md |
64
- | `output-patterns.md` | Redirect/Summarize/Target pattern, targeted operations, tool-first policy, general CLI rules |
17
+ Coding guidelines live under `docs/guidelines/` organized by language. **Always check the relevant guideline** before writing or reviewing code.
65
18
 
66
19
  ## How guidelines work
67
20
 
68
- - **Guidelines** = detailed coding conventions (reference material, read on demand)
69
- - **Rules** = always-active behavior constraints (auto-loaded every conversation)
70
- - **Skills** = agent capabilities and workflows (matched by topic)
71
-
72
- Guidelines are the "how to write code" docs. Rules enforce critical subsets automatically.
73
- Skills reference guidelines when performing related tasks.
74
-
75
- ## Boundary: Guidelines vs Skills
76
-
77
- - Guidelines contain **conventions and reference knowledge**. Skills contain **executable workflows**.
78
- - A skill may reference a guideline for conventions, but must NOT outsource its core execution steps to a guideline.
79
- - Do NOT move a skill's operational core (procedure, validation, decision logic) into a guideline.
80
- - If a skill becomes "go read the guideline", it has lost its purpose — restore the workflow.
81
-
82
- ## Adding new guidelines
21
+ - **Guidelines** = detailed coding conventions (reference material, read on demand).
22
+ - **Rules** = always-active behavior constraints (auto-loaded every conversation).
23
+ - **Skills** = agent capabilities and workflows (matched by topic).
83
24
 
84
- When a new language or framework is introduced, create a directory:
85
- ```
86
- .augment/guidelines/{language}/
87
- ```
25
+ Guidelines are the "how to write code" docs. Rules enforce critical subsets automatically. Skills reference guidelines when performing related tasks.
88
26
 
89
- Follow the existing PHP structure as a template.
27
+ ## Index see mechanics
90
28
 
91
- Read the specific guideline file on demand don't memorize the full list.
29
+ The full file index (PHP, PHP patterns, E2E, agent-infra) plus the guidelines-vs-skills boundary and the "adding new guidelines" template live in [`contexts/communication/rules-auto/guidelines-mechanics.md`](../contexts/communication/rules-auto/guidelines-mechanics.md). The rule above is the obligation surface; the mechanics file is the catalog.
@@ -4,6 +4,15 @@ tier: "2b"
4
4
  description: "Before implementing features or architectural changes — validate the request against existing code, challenge weak requirements, and suggest improvements"
5
5
  alwaysApply: false
6
6
  source: package
7
+ council_depth: deep
8
+ triggers:
9
+ - intent: "implement feature"
10
+ - intent: "architectural change"
11
+ - keyword: "refactor"
12
+ validator_ignore:
13
+ - type: "substring"
14
+ pattern: ".agent-src.uncompressed/"
15
+ reason: "Rule cites the authoring tree when describing where examples live."
7
16
  ---
8
17
 
9
18
  # Improve Before Implement
@@ -42,10 +51,10 @@ Before coding, quickly verify:
42
51
  - Does it follow established patterns in the codebase?
43
52
  - Does it contradict existing conventions?
44
53
  - Do **multiple valid patterns/frameworks** already exist (e.g. Tailwind + Flux, multiple form libraries, competing state stores)? If yes, do NOT pick one arbitrarily — ask which to use.
45
- - Is the change a **second branch on the same discriminator** — second `match`/`switch` arm, second `if/elseif`, or second class hardcoded to one enum value (e.g. `Provider::FOO`, `'stripe'`)? If yes, run the Strategy sniff test before adding the branch — see [`docs/guidelines/php/patterns/strategy.md`](../../docs/guidelines/php/patterns/strategy.md#sniff-test--when-an-enumstring-discriminator-wants-to-become-a-strategy).
54
+ - Is the change a **second branch on the same discriminator** — second `match`/`switch` arm, second `if/elseif`, or second class hardcoded to one enum value (e.g. `Provider::FOO`, `'stripe'`)? If yes, run the Strategy sniff test before adding the branch — see [`docs/guidelines/php/patterns/strategy.md`](../docs/guidelines/php/patterns/strategy.md#sniff-test--when-an-enumstring-discriminator-wants-to-become-a-strategy).
46
55
 
47
56
  **If misfit** → show evidence (file references), propose alternative.
48
- **If multiple valid options** → list them, ask which to use. See [`no blind implementation`](../../docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md#2-no-blind-implementation).
57
+ **If multiple valid options** → list them, ask which to use. See [`no blind implementation`](../docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md#2-no-blind-implementation).
49
58
 
50
59
  ### 3. Is the approach sound?
51
60
 
@@ -0,0 +1,71 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2b"
4
+ description: "Before executing a complex plan or non-trivial design — proactively ask 'am I solving the right problem?' and pause for user confirmation, even when no ambiguity is detected"
5
+ alwaysApply: false
6
+ source: package
7
+ council_depth: deep
8
+ triggers:
9
+ - intent: "complex plan"
10
+ - intent: "design decision"
11
+ - intent: "architectural plan"
12
+ - intent: "multi-step implementation"
13
+ - keyword: "plan"
14
+ - keyword: "design"
15
+ - keyword: "architecture"
16
+ - keyword: "approach"
17
+ ---
18
+
19
+ # invite-challenge
20
+
21
+ ## The Iron Law
22
+
23
+ ```
24
+ BEFORE EXECUTING A COMPLEX PLAN — ASK ONCE:
25
+ "AM I SOLVING THE RIGHT PROBLEM?"
26
+ PAUSE. WAIT FOR CONFIRMATION. THEN PROCEED.
27
+ ```
28
+
29
+ Proactive confirmation checkpoint. Distinct from [`direct-answers`](direct-answers.md) (reactive — fires after misdirection is detected) and [`ask-when-uncertain`](ask-when-uncertain.md) (info-gathering — fires when context is missing). This rule fires when context is **sufficient** and direction **looks correct** but the plan is heavy enough that a silent misread would be expensive.
30
+
31
+ ## When to activate
32
+
33
+ Two or more of:
34
+
35
+ - Touches ≥ 3 files or ≥ 2 modules
36
+ - New abstraction, pattern, or library
37
+ - Security / billing / tenant / data-boundary path
38
+ - Migration, schema change, or backwards-incompatible API change
39
+ - Estimated effort > 30 min of agent work
40
+ - High-level goal ("rebuild the dashboard") rather than a bounded task ("rename this method")
41
+
42
+ **Does NOT activate for:** evidenced bug fixes · trivial edits · user-fenced tasks ("just do it") · steps inside an already-confirmed plan (ask once per plan, not per step) · cases handled by [`improve-before-implement`](improve-before-implement.md) Phase 1.
43
+
44
+ ## How to challenge
45
+
46
+ One question, one turn. Numbered options per [`user-interaction`](user-interaction.md):
47
+
48
+ ```
49
+ > Before I start, one check:
50
+ >
51
+ > Goal as I read it: {1-sentence restatement}
52
+ > Plan: {2-3 bullet shape, not full implementation}
53
+ > Risk if I misread: {what would be wasted}
54
+ >
55
+ > 1. Goal + plan match — proceed
56
+ > 2. Goal right, plan needs adjustment — say what
57
+ > 3. Goal wrong — let me restate
58
+ ```
59
+
60
+ The restatement is the load-bearing part. Pick 1 → execute. Pick 2 or 3 → fold the correction in, do not re-ask.
61
+
62
+ ## Scope limits
63
+
64
+ - **One challenge per plan**, not per step.
65
+ - **Skip when the user already restated the goal** in the same turn.
66
+ - **Skip when [`scope-control § fenced step`](scope-control.md) applies** — deliver the plan, hand back, no confirmation question appended.
67
+ - **Never argue the goal twice** — user's restatement is final for the turn.
68
+
69
+ ## Interactions
70
+
71
+ [`direct-answers`](direct-answers.md) fires after misdirection · [`ask-when-uncertain`](ask-when-uncertain.md) fires on missing context · [`improve-before-implement`](improve-before-implement.md) Phase 1 already runs a clarity check (do not double-ask) · [`scope-control § fenced step`](scope-control.md) handback wins · [`no-cheap-questions`](no-cheap-questions.md) — checkpoint must carry a real goal restatement, not a content-free "ready?".