@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
@@ -2,126 +2,18 @@
2
2
  type: "auto"
3
3
  tier: "1"
4
4
  description: "First turn of a conversation on a project — check onboarding.onboarded in .agent-settings.yml; when false, prompt the user to run /onboard before executing any other request"
5
- alwaysApply: false
6
5
  source: package
6
+ triggers:
7
+ - phrase: "first turn"
8
+ - keyword: "onboarding"
9
+ - path_prefix: ".agent-settings.yml"
10
+ routes_to:
11
+ - "command:onboard"
7
12
  ---
8
13
 
9
14
  # Onboarding Gate
10
15
 
11
- > **Enforced by:** [`scripts/onboarding_gate_hook.py`](../../scripts/onboarding_gate_hook.py)
12
- > on Augment + Claude Code (`SessionStart`). The hook refreshes
13
- > `agents/state/onboarding-gate.json` from `.agent-settings.yml`; the
14
- > prose below is the spec the hook implements and the fallback for
15
- > platforms without a hook surface.
16
+ **Iron Law.** First turn of a project: if `onboarding.onboarded` is false, prompt `/onboard` before executing any other request.
16
17
 
17
- Forces a one-time `/onboard` run for each developer on each project. This
18
- replaces the previously scattered "ask once" patterns across `user_name`,
19
- `personal.ide`, `personal.rtk_installed`, and cost profile confirmation.
20
-
21
- ## When to activate
22
-
23
- Read `onboarding.onboarded` from `.agent-settings.yml` **once per
24
- conversation**, on the very first agent turn.
25
-
26
- - Key missing entirely → **legacy project**. Treat as onboarded, do
27
- nothing. Do not write the key.
28
- - `true` → do nothing. Rule is inert for the rest of the conversation.
29
- - `false` → gate is active for this conversation (see below).
30
-
31
- Cache the result for the whole conversation. Do not re-read on every turn.
32
-
33
- ## Gate behavior when `onboarded: false`
34
-
35
- On the **first** turn of the conversation, before executing the user's
36
- request, emit this prompt and stop:
37
-
38
- ```
39
- > 👋 First-run setup hasn't been completed for this project.
40
- >
41
- > Run /onboard once (≈2 minutes) to capture:
42
- > • your name, IDE, and rtk status
43
- > • cost profile + learning loop confirmation
44
- >
45
- > 1. Run /onboard now
46
- > 2. Skip — mark as onboarded and continue with the request
47
- > 3. Snooze — continue just this turn; ask again next conversation
48
- ```
49
-
50
- - `1` → invoke `/onboard`. Resume the user's original request afterwards.
51
- - `2` → set `onboarding.onboarded: true` in `.agent-settings.yml` (touch
52
- only that field; preserve comments and order). Then execute the
53
- original request.
54
- - `3` → proceed with the original request. Do not ask again in this
55
- conversation. Do not write the file.
56
-
57
- Free-text replies (`"mach weiter"`, `"just do it"`) count as `3`.
58
-
59
- ## Exceptions — do NOT block
60
-
61
- Skip the gate when the user's request already is an onboarding or
62
- settings operation, so we don't prompt users mid-setup:
63
-
64
- - `/onboard`, `/set-cost-profile`, `/mode`
65
- - The user explicitly asks about `.agent-settings.yml` or onboarding
66
- - Incident / break-glass signals (`hotfix`, `break-glass`, `"prod is
67
- down"`). The gate waits for normal operations to resume.
68
-
69
- ## Non-blocking for legacy projects
70
-
71
- If `.agent-settings.yml` exists but has no `onboarding` section at all,
72
- treat as onboarded. Only `onboarded: false` (explicit) triggers the
73
- gate. This protects projects that were set up before this rule shipped.
74
-
75
- ## What this rule does NOT do
76
-
77
- - Write `onboarded: true` automatically. Only `/onboard` (step 6) and
78
- the user's explicit `2` choice do that.
79
- - Re-prompt across turns in the same conversation. One prompt per
80
- conversation, max.
81
- - Replace normal settings edits. Mid-life changes are ad-hoc (edit the
82
- file directly or ask the agent, which follows
83
- [`layered-settings`](../../docs/guidelines/agent-infra/layered-settings.md#section-aware-merge-rules));
84
- this rule is a one-time gate.
85
- - Run on every agent turn. First turn only.
86
-
87
- ## Interactions
88
-
89
- - `ask-when-uncertain` — the gate uses its numbered-options iron law;
90
- one question per turn.
91
- - `language-and-tone` — prompt is translated to the user's language at
92
- runtime; `.md` source stays English.
93
- - `scope-control` — option `2` writes exactly one key; no side effects.
94
- - `role-mode-adherence` — gate runs BEFORE the mode marker is emitted.
95
-
96
- ## Copilot fallback
97
-
98
- GitHub Copilot has no `SessionStart` hook surface, so
99
- `scripts/onboarding_gate_hook.py` cannot run structurally and
100
- `agents/state/onboarding-gate.json` is not refreshed for the agent.
101
- On the first turn of a Copilot conversation:
102
-
103
- 1. Read `onboarding.onboarded` from `.agent-settings.yml` directly
104
- (one read per conversation, then cache as the prose above
105
- describes).
106
- 2. Optionally refresh the state file manually so other tooling sees
107
- the same value the hook would have written:
108
-
109
- ```bash
110
- python3 scripts/onboarding_gate_hook.py < /dev/null
111
- ```
112
-
113
- The script reads `.agent-settings.yml`, atomically writes
114
- `agents/state/onboarding-gate.json`, and exits 0 — same payload
115
- the Augment / Claude / Cursor / Cline / Windsurf / Gemini hook
116
- would have produced.
117
- 3. Apply the gate behavior from "Gate behavior when `onboarded:
118
- false`" above. The cooperative path is the spec; the hook is the
119
- cache.
120
-
121
- ## See also
122
-
123
- - [`/onboard`](../commands/onboard.md) — the command this gate invokes
124
- - [`layered-settings`](../../docs/guidelines/agent-infra/layered-settings.md) — merge rules for mid-life edits
125
- - [`agent-settings` template](../templates/agent-settings.md) — `onboarding.onboarded` reference
126
- - [`rule-type-governance`](rule-type-governance.md) — why this is `always`
127
- - [`hardening-pattern`](../../agents/contexts/hardening-pattern.md) — Tier 1 mechanical-rule contract
18
+ Body migrated to `command:onboard` (per P4 of `road-to-kernel-and-router.md`).
19
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -1,46 +1,19 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "mechanical-already"
4
- alwaysApply: false
5
4
  description: "Before pushing to remote or creating a PR in the agent-config package — run all CI checks locally first"
6
5
  source: package
7
- load_context:
8
- - .agent-src.uncompressed/contexts/communication/rules-auto/package-ci-checks-mechanics.md
6
+ triggers:
7
+ - phrase: "task ci"
8
+ - phrase: "before push"
9
+ - phrase: "before pr"
10
+ routes_to:
11
+ - "skill:lint-skills"
9
12
  ---
10
13
 
11
- # Package CI Checks
14
+ # Package Ci Checks
12
15
 
13
- ## When this applies
16
+ **Iron Law.** Run `task ci` locally and confirm green before pushing or opening a PR in this package.
14
17
 
15
- Before **any** push to remote or PR creation in the **agent-config** package.
16
- This rule is specific to this package it does NOT apply to consumer projects.
17
-
18
- ## The Iron Law
19
-
20
- ```
21
- NEVER push without running ALL CI checks locally first.
22
- ```
23
-
24
- Every CI pipeline failure is preventable by running these checks before pushing.
25
-
26
- ## Required checks — see mechanics
27
-
28
- Five checks must pass locally before push, in this order:
29
-
30
- 1. **Sync** — `compress.sh --check` and `--check-hashes`.
31
- 2. **Consistency** — `check_compression.py`, `check_references.py`, `check_portability.py`.
32
- 3. **Linter** — `skill_linter.py --all`, 0 FAIL required.
33
- 4. **Tests** — `pytest tests/`.
34
- 5. **README** — `readme_linter.py`.
35
-
36
- The full command snippets, common-failure notes per step, the quick
37
- chained one-liner, and the post-edit workflow ("after editing
38
- skills/rules", "after editing `scripts/compress.py`") all live in
39
- [`contexts/communication/rules-auto/package-ci-checks-mechanics.md`](../contexts/communication/rules-auto/package-ci-checks-mechanics.md).
40
- Pull it whenever pre-push verification is needed.
41
-
42
- ## Do NOT
43
-
44
- - Do NOT push "to see if CI passes" — that wastes pipeline minutes
45
- - Do NOT skip hash checks because "I only changed one file"
46
- - Do NOT assume tests pass because linter passes — they check different things
18
+ Body migrated to `skill:lint-skills` (per P4 of `road-to-kernel-and-router.md`).
19
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -2,63 +2,18 @@
2
2
  type: "auto"
3
3
  tier: "3"
4
4
  description: "Writing or reviewing PHP code — strict types, naming, comparisons, early returns, Eloquent conventions"
5
- alwaysApply: false
6
5
  source: package
6
+ triggers:
7
+ - file_pattern: "*.php"
8
+ - keyword: "phpstan"
9
+ - keyword: "ecs"
10
+ routes_to:
11
+ - "guideline:php/php-coding-patterns"
7
12
  ---
8
13
 
9
- # PHP Coding Rules
14
+ # Php Coding
10
15
 
11
- - Use `declare(strict_types=1)` in every **new** PHP file. Not required when modifying existing files that don't have it.
12
- - If the project has a `Math` helper class, use it for ALL business calculations. Never use native PHP arithmetic operators (`+`, `-`, `*`, `/`) for business calculations. Search for the `Math` class in the project.
13
- - Never use `var_dump()`, `print_r()`, or `dd()` — they are disallowed by PHPStan config. Exception: legacy projects where these are already used and no alternative is feasible.
14
- - Never use `float` for money — use `decimal` or the `Math` helper.
15
- - Always use `===` / `!==` (strict comparison), Yoda style: `null === $var`.
16
- - Early return over nested if/else.
17
- - No one-liner if statements.
18
- - Single quotes for strings without interpolation. `sprintf()` for complex strings.
19
- - Variables: `camelCase`. Array keys: `snake_case`. Constants: `UPPER_SNAKE_CASE`.
20
- - Typed properties, parameters, and return types — always.
21
- - Constructor property promotion where it makes sense.
16
+ **Iron Law.** PHP: strict types, named comparisons, early returns, Eloquent conventions full pattern library in the guideline.
22
17
 
23
- ## Eloquent Models Attribute Access
24
-
25
- Read `eloquent.access_style` from `.agent-settings.yml` to determine the preferred style.
26
- Default: `getters_setters`. See the `eloquent` skill for the full reference table and examples.
27
-
28
- - **`getters_setters`** (strict): Every attribute has a typed getter + fluent setter. Inside the model: `getAttribute('column_name')`/`setAttribute('column_name', $value)`. Outside: always getters/setters. If a getter doesn't exist yet, create it first.
29
- - **`get_attribute`**: Use `getAttribute('column_name')`/`setAttribute('column_name', $value)` everywhere, no getters/setters needed.
30
- - **`magic_properties`**: Laravel default `$model->column_name` everywhere.
31
-
32
- ### Relationship Getters
33
-
34
- - Every relationship MUST have a typed getter method **above** the relationship method.
35
- - **Inside the getter:** use `$this->getAttribute('relationship_name')`, NEVER `$this->relationship_name`.
36
- - **Outside the model:** ALWAYS use the getter (`$model->getEquipment()`), NEVER access the magic property (`$model->equipment`).
37
- - Use `instanceof` checks instead of `null ===` when checking relationship results.
38
-
39
- ## Eloquent Models — Observers over `booted()`
40
-
41
- - Do NOT use `booted()` / `boot()` for model lifecycle hooks (saving, saved, deleted, etc.).
42
- - Use a dedicated **Observer** class registered via `#[ObservedBy]` attribute.
43
- - This keeps models slim and lifecycle logic testable and discoverable.
44
-
45
- ## PHPStan
46
-
47
- - Always fix the root cause. Do NOT add entries to `phpstan-baseline.neon`.
48
- - Adding `ignoreErrors` to `phpstan.neon` is allowed for **structural toolchain limitations** (e.g., Pest runtime bindings). NOT for individual code issues. **If unsure → ask the user.**
49
- - If a fix is truly impossible (confirmed false positive), use an inline ignore as last resort:
50
- ```php
51
- // @phpstan-ignore-next-line — false positive: reason here
52
- ```
53
-
54
- ## Testing
55
-
56
- - Always write tests in **Pest**, not PHPUnit class syntax — unless the user explicitly asks for PHPUnit.
57
- - Pest tests in `tests/Unit/` automatically use `UnitTestCase` as the base class (configured in `tests/Pest.php`).
58
-
59
- ## PHPDoc
60
-
61
- - Only add PHPDoc when type hints are insufficient (e.g. generic arrays: `@param array<int, MyObject> $items`).
62
- - Do NOT add PHPDoc that just repeats the method signature.
63
- - One docblock per method — never split into multiple `/** */` blocks.
64
- - Tag order: `@param` → `@return` → `@throws`.
18
+ Body migrated to `guideline:php/php-coding-patterns` (per P4 of `road-to-kernel-and-router.md`).
19
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -4,6 +4,15 @@ tier: "2b"
4
4
  alwaysApply: false
5
5
  description: "When merging, refactoring, compressing, or restructuring skills, rules, commands, or guidelines — prevent quality loss"
6
6
  source: package
7
+ triggers:
8
+ - intent: "merge skill"
9
+ - intent: "compress rule"
10
+ - intent: "refactor artifact"
11
+ - keyword: "Iron Law"
12
+ validator_ignore:
13
+ - type: "substring"
14
+ pattern: ".agent-src.uncompressed/"
15
+ reason: "Rule references the authoring tree as the operand of compression/preservation."
7
16
  ---
8
17
 
9
18
  # Preservation Guard
@@ -3,105 +3,17 @@ type: "auto"
3
3
  tier: "2a"
4
4
  description: "When routing reviewers or flagging risk hotspots — consult ownership-map and historical-bug-patterns before suggesting reviewers or claiming a change is safe"
5
5
  source: package
6
- load_context:
7
- - .agent-src.uncompressed/contexts/communication/rules-auto/review-routing-awareness-mechanics.md
6
+ triggers:
7
+ - keyword: "reviewer"
8
+ - phrase: "risk hotspot"
9
+ - phrase: "ownership map"
10
+ routes_to:
11
+ - "skill:review-routing"
8
12
  ---
9
13
 
10
14
  # Review Routing Awareness
11
15
 
12
- Before suggesting reviewers or declaring a change safe, the agent consults
13
- two project-local data sources — if they exist — to ground the routing in
14
- the consumer's actual organizational memory:
16
+ **Iron Law.** Consult ownership-map and historical-bug-patterns before suggesting reviewers or claiming a change is safe.
15
17
 
16
- 1. **Ownership map** which roles/teams own which paths, with per-path
17
- risk notes.
18
- 2. **Historical bug patterns** — recurring failure modes or technical debt
19
- the project has paid for before.
20
-
21
- Both live in the consumer repository (never in package-shipped files) and
22
- are optional. Absence is not an error — the agent falls back to
23
- generic, role-based suggestions from [`reviewer-awareness`](reviewer-awareness.md).
24
-
25
- ## When this rule applies
26
-
27
- - The agent is classifying PR risk, suggesting reviewers, writing a PR
28
- description, or producing a review plan.
29
- - The agent is reviewing its own diff before asking for human review.
30
- - The change modifies more than a trivial amount of code (≥ 1 file
31
- outside docs).
32
-
33
- ## Required behavior
34
-
35
- ### 1. Check for project data
36
-
37
- Look, in order, for:
38
-
39
- - `.github/ownership-map.yml` (or `agents/ownership-map.yml`)
40
- - `.github/historical-bug-patterns.yml` (or
41
- `agents/historical-bug-patterns.yml`)
42
-
43
- If neither file exists, fall back to the engineering-memory layer.
44
- Memory-lookup snippet and merge semantics live in
45
- [`contexts/communication/rules-auto/review-routing-awareness-mechanics.md`](../contexts/communication/rules-auto/review-routing-awareness-mechanics.md)
46
- § Memory-lookup fallback. If both memory and project YAMLs are absent,
47
- skip this rule and rely on
48
- [`reviewer-awareness`](reviewer-awareness.md) defaults. **Do not
49
- invent owners or patterns** from context.
50
-
51
- ### 2. Match the diff
52
-
53
- For every changed file, collect:
54
-
55
- - **Matching ownership entries** — each yields a role, optional focus
56
- note, and optional risk hint.
57
- - **Matching historical patterns** — each yields a named prior failure
58
- mode and the minimum control or test the project expects.
59
-
60
- Matching uses glob patterns (see
61
- [`review-routing-data-format`](../../docs/guidelines/agent-infra/review-routing-data-format.md)
62
- for the schema).
63
-
64
- ### 3. Surface findings
65
-
66
- When producing a review plan, include owner-mapped roles (preferred
67
- over generic), historical-pattern warnings (with required control),
68
- and a staleness note if the ownership map's `updated` field is older
69
- than 6 months. Worked examples for each in
70
- [`contexts/communication/rules-auto/review-routing-awareness-mechanics.md`](../contexts/communication/rules-auto/review-routing-awareness-mechanics.md)
71
- § Surface findings.
72
-
73
- ### 4. Do NOT overreach
74
-
75
- The "do NOT overreach" guardrails (no path renames as side effects, no
76
- "safe because no match", no pattern names in diffs/commits) live in
77
- [`contexts/communication/rules-auto/review-routing-awareness-mechanics.md`](../contexts/communication/rules-auto/review-routing-awareness-mechanics.md)
78
- § Do NOT overreach.
79
-
80
- ## Interaction with other rules
81
-
82
- - Feeds [`reviewer-awareness`](reviewer-awareness.md) — this rule
83
- **resolves** owners; reviewer-awareness **formats** them.
84
- - Extends [`verify-before-complete`](verify-before-complete.md) — if a
85
- historical pattern demands a regression test, the verification gate
86
- requires that test before completion is claimed.
87
- - Does not override [`minimal-safe-diff`](minimal-safe-diff.md) — a
88
- matched pattern is a reason to **add a test**, never a reason to
89
- expand scope into unrelated refactors.
90
-
91
- ## Anti-patterns
92
-
93
- The four anti-pattern rejections (invented owners, invented patterns,
94
- downgrading high-severity hits, treating stale maps as absent) live in
95
- [`contexts/communication/rules-auto/review-routing-awareness-mechanics.md`](../contexts/communication/rules-auto/review-routing-awareness-mechanics.md)
96
- § Anti-patterns.
97
-
98
- ## See also
99
-
100
- - [`reviewer-awareness`](reviewer-awareness.md) — formatting reviewer
101
- suggestions.
102
- - [`review-routing-data-format`](../../docs/guidelines/agent-infra/review-routing-data-format.md)
103
- — YAML schemas for ownership-map and historical-bug-patterns.
104
- - [`review-routing`](../skills/review-routing/SKILL.md) — the skill
105
- that produces the merged routing report.
106
- - [`judge-test-coverage`](../skills/judge-test-coverage/SKILL.md) —
107
- consumes the "required test" output from historical patterns.
18
+ Body migrated to `skill:review-routing` (per P4 of `road-to-kernel-and-router.md`).
19
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.
@@ -3,91 +3,16 @@ type: "auto"
3
3
  tier: "2a"
4
4
  description: "When suggesting reviewers for a change — anchor the choice in paths and risk, never prestige or seniority; require primary + secondary role for medium/high risk"
5
5
  source: package
6
+ triggers:
7
+ - keyword: "reviewer"
8
+ - phrase: "suggest reviewers"
9
+ routes_to:
10
+ - "skill:review-routing"
6
11
  ---
7
12
 
8
13
  # Reviewer Awareness
9
14
 
10
- When a change is medium- or high-risk, the agent suggests reviewer **roles**
11
- (not individuals) based on what the diff actually touches — not who is
12
- loudest, most senior, or who "usually reviews this kind of thing".
15
+ **Iron Law.** Anchor reviewer choice in paths and risk, never seniority; medium / high risk requires primary + secondary role.
13
16
 
14
- ## When this rule applies
15
-
16
- - The agent is asked to suggest reviewers, draft a PR description, or
17
- consolidate a review plan.
18
- - The change is classified medium or high risk by
19
- [`review-routing`](../skills/review-routing/SKILL.md), the
20
- `pr_risk_review.py` script, or explicit user judgment.
21
- - For **low-risk** changes, reviewer suggestions are optional and may be
22
- omitted.
23
-
24
- ## Required behavior
25
-
26
- 1. **Anchor every suggestion in the diff.** Name the path or change that
27
- triggered the role — "backend because `app/Services/PaymentGateway.php`
28
- changed", not "backend because it's a code change".
29
- 2. **Two roles minimum for medium/high risk** — one **primary** (the
30
- domain most at risk) and one **secondary** (cross-cutting sanity:
31
- security, infra, domain owner).
32
- 3. **Explain the focus area** for each reviewer — what they should look
33
- at, not just that they should look. "security: confirm the new
34
- authorization boundary actually denies cross-tenant reads".
35
- 4. **Prefer ownership-mapped owners** when an ownership map exists
36
- (see [`review-routing-awareness`](review-routing-awareness.md)). Fall
37
- back to generic roles only when no mapping matches.
38
- 5. **Never name individual reviewers** in package-shipped artifacts.
39
- The consumer repo's CODEOWNERS or ownership map does the mapping
40
- role → person.
41
-
42
- ## Reviewer roles
43
-
44
- The reference set — extend per project, but keep these as the common
45
- vocabulary:
46
-
47
- | Role | Typical focus |
48
- |---|---|
49
- | `backend` | business logic, validation, side effects, data integrity |
50
- | `frontend` | UX, accessibility, client-side state, rendering |
51
- | `security` | authz, secrets, trust boundaries, data exposure |
52
- | `infra` / `ops` | rollout, migration safety, observability, retries |
53
- | `database` | schema changes, indexes, query plans, rollback realism |
54
- | `domain owner` | business invariants, policy intent, edge-case correctness |
55
- | `qa` | test coverage, regression scenarios, flake risk |
56
-
57
- ## Anti-patterns — reject them
58
-
59
- - "Reviewers: @alice, @bob" inside a shared package artifact — individuals
60
- live in the consumer's CODEOWNERS, not in package output.
61
- - "Any senior engineer" — prestige is not a review strategy.
62
- - "Whoever reviewed this last time" — selection by habit, not by
63
- current risk.
64
- - One role for a 🔴 high-risk change — single-reviewer risk, especially
65
- when the change crosses an authorization or tenancy boundary.
66
- - Suggesting reviewers without naming what they should look at — a
67
- rubber-stamp invitation.
68
-
69
- ## Format
70
-
71
- When the agent proposes reviewers, use this block:
72
-
73
- ```
74
- Suggested reviewers (role-based):
75
- • primary: <role> — focus: <one line, anchored in diff>
76
- • secondary: <role> — focus: <one line, anchored in diff>
77
- (optional) additional: <role> — focus: …
78
- ```
79
-
80
- ## Rationale
81
-
82
- The right reviewer reduces blind spots more than the loudest reviewer.
83
- Blind-spot reduction comes from role diversity (different angles on the
84
- same diff), not from seniority.
85
-
86
- ## See also
87
-
88
- - [`review-routing-awareness`](review-routing-awareness.md) — how
89
- ownership maps and historical patterns feed reviewer selection.
90
- - [`review-routing`](../skills/review-routing/SKILL.md) — the skill that
91
- produces the reviewer block.
92
- - [`requesting-code-review`](../skills/requesting-code-review/SKILL.md) —
93
- PR preparation and self-review before asking for reviewers.
17
+ Body migrated to `skill:review-routing` (per P4 of `road-to-kernel-and-router.md`).
18
+ Trigger-set above activates this routing under the `balanced` and `full` profiles.