@event4u/agent-config 1.14.0 → 1.16.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 (293) hide show
  1. package/.agent-src/commands/agent-handoff.md +1 -1
  2. package/.agent-src/commands/bug-fix.md +3 -3
  3. package/.agent-src/commands/bug-investigate.md +2 -2
  4. package/.agent-src/commands/chat-history-checkpoint.md +3 -3
  5. package/.agent-src/commands/chat-history-clear.md +2 -2
  6. package/.agent-src/commands/chat-history-resume.md +2 -2
  7. package/.agent-src/commands/chat-history.md +3 -3
  8. package/.agent-src/commands/check-current-md.md +44 -33
  9. package/.agent-src/commands/commit-in-chunks.md +43 -23
  10. package/.agent-src/commands/compress.md +34 -2
  11. package/.agent-src/commands/council-design.md +96 -0
  12. package/.agent-src/commands/council-optimize.md +115 -0
  13. package/.agent-src/commands/council-pr.md +123 -0
  14. package/.agent-src/commands/council.md +219 -0
  15. package/.agent-src/commands/create-pr.md +23 -0
  16. package/.agent-src/commands/do-and-judge.md +3 -3
  17. package/.agent-src/commands/do-in-steps.md +4 -4
  18. package/.agent-src/commands/e2e-heal.md +1 -1
  19. package/.agent-src/commands/e2e-plan.md +1 -1
  20. package/.agent-src/commands/feature-dev.md +8 -0
  21. package/.agent-src/commands/feature-explore.md +6 -1
  22. package/.agent-src/commands/feature-plan.md +33 -2
  23. package/.agent-src/commands/feature-refactor.md +5 -0
  24. package/.agent-src/commands/feature-roadmap.md +8 -3
  25. package/.agent-src/commands/feature.md +58 -0
  26. package/.agent-src/commands/fix-ci.md +5 -0
  27. package/.agent-src/commands/fix-portability.md +7 -2
  28. package/.agent-src/commands/fix-pr-bot-comments.md +5 -0
  29. package/.agent-src/commands/fix-pr-comments.md +5 -0
  30. package/.agent-src/commands/fix-pr-developer-comments.md +5 -0
  31. package/.agent-src/commands/fix-references.md +5 -0
  32. package/.agent-src/commands/fix-seeder.md +5 -0
  33. package/.agent-src/commands/fix.md +60 -0
  34. package/.agent-src/commands/jira-ticket.md +1 -1
  35. package/.agent-src/commands/judge.md +1 -1
  36. package/.agent-src/commands/memory-add.md +3 -3
  37. package/.agent-src/commands/memory-full.md +2 -2
  38. package/.agent-src/commands/memory-promote.md +2 -2
  39. package/.agent-src/commands/mode.md +5 -5
  40. package/.agent-src/commands/onboard.md +17 -8
  41. package/.agent-src/commands/optimize-agents.md +6 -1
  42. package/.agent-src/commands/optimize-augmentignore.md +14 -0
  43. package/.agent-src/commands/optimize-rtk-filters.md +5 -0
  44. package/.agent-src/commands/optimize-skills.md +6 -1
  45. package/.agent-src/commands/optimize.md +54 -0
  46. package/.agent-src/commands/propose-memory.md +2 -2
  47. package/.agent-src/commands/refine-ticket.md +9 -7
  48. package/.agent-src/commands/review-changes.md +61 -9
  49. package/.agent-src/commands/review-routing.md +1 -1
  50. package/.agent-src/commands/roadmap-create.md +42 -4
  51. package/.agent-src/commands/roadmap-execute.md +9 -7
  52. package/.agent-src/commands/set-cost-profile.md +11 -3
  53. package/.agent-src/commands/sync-agent-settings.md +11 -2
  54. package/.agent-src/commands/tests-create.md +1 -1
  55. package/.agent-src/commands/tests-execute.md +2 -3
  56. package/.agent-src/commands/upstream-contribute.md +1 -1
  57. package/.agent-src/contexts/authority/commit-mechanics.md +57 -0
  58. package/.agent-src/contexts/authority/destructive-mechanics.md +66 -0
  59. package/.agent-src/contexts/authority/scope-mechanics.md +87 -0
  60. package/.agent-src/contexts/execution/autonomy-detection.md +54 -0
  61. package/.agent-src/contexts/execution/autonomy-examples.md +90 -0
  62. package/.agent-src/contexts/execution/autonomy-mechanics.md +29 -0
  63. package/.agent-src/contexts/execution/verification-mechanics.md +80 -0
  64. package/.agent-src/personas/README.md +1 -1
  65. package/.agent-src/rules/agent-authority.md +24 -0
  66. package/.agent-src/rules/architecture.md +1 -1
  67. package/.agent-src/rules/artifact-drafting-protocol.md +1 -1
  68. package/.agent-src/rules/artifact-engagement-recording.md +2 -2
  69. package/.agent-src/rules/ask-when-uncertain.md +1 -1
  70. package/.agent-src/rules/augment-portability.md +56 -37
  71. package/.agent-src/rules/autonomous-execution.md +78 -114
  72. package/.agent-src/rules/capture-learnings.md +1 -1
  73. package/.agent-src/rules/chat-history-cadence.md +109 -0
  74. package/.agent-src/rules/chat-history-ownership.md +123 -0
  75. package/.agent-src/rules/chat-history-visibility.md +96 -0
  76. package/.agent-src/rules/cli-output-handling.md +1 -1
  77. package/.agent-src/rules/{command-suggestion.md → command-suggestion-policy.md} +10 -9
  78. package/.agent-src/rules/commit-conventions.md +1 -1
  79. package/.agent-src/rules/commit-policy.md +43 -61
  80. package/.agent-src/rules/context-hygiene.md +3 -3
  81. package/.agent-src/rules/direct-answers.md +2 -2
  82. package/.agent-src/rules/docs-sync.md +1 -1
  83. package/.agent-src/rules/e2e-testing.md +1 -1
  84. package/.agent-src/rules/guidelines.md +4 -4
  85. package/.agent-src/rules/improve-before-implement.md +2 -2
  86. package/.agent-src/rules/language-and-tone.md +41 -96
  87. package/.agent-src/rules/minimal-safe-diff.md +3 -3
  88. package/.agent-src/rules/model-recommendation.md +4 -4
  89. package/.agent-src/rules/no-cheap-questions.md +89 -0
  90. package/.agent-src/rules/non-destructive-by-default.md +25 -59
  91. package/.agent-src/rules/onboarding-gate.md +5 -5
  92. package/.agent-src/rules/review-routing-awareness.md +9 -9
  93. package/.agent-src/rules/roadmap-progress-sync.md +132 -80
  94. package/.agent-src/rules/role-mode-adherence.md +3 -3
  95. package/.agent-src/rules/scope-control.md +65 -46
  96. package/.agent-src/rules/security-sensitive-stop.md +2 -2
  97. package/.agent-src/rules/size-enforcement.md +3 -2
  98. package/.agent-src/rules/think-before-action.md +5 -5
  99. package/.agent-src/rules/token-efficiency.md +4 -4
  100. package/.agent-src/rules/{ui-audit-before-build.md → ui-audit-gate.md} +3 -3
  101. package/.agent-src/rules/user-interaction.md +31 -7
  102. package/.agent-src/rules/verify-before-complete.md +12 -67
  103. package/.agent-src/scripts/update_roadmap_progress.py +65 -8
  104. package/.agent-src/skills/ai-council/SKILL.md +333 -0
  105. package/.agent-src/skills/api-endpoint/SKILL.md +2 -2
  106. package/.agent-src/skills/blade-ui/SKILL.md +30 -11
  107. package/.agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
  108. package/.agent-src/skills/bug-analyzer/SKILL.md +1 -1
  109. package/.agent-src/skills/command-routing/SKILL.md +1 -1
  110. package/.agent-src/skills/command-writing/SKILL.md +16 -5
  111. package/.agent-src/skills/conventional-commits-writing/SKILL.md +1 -1
  112. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +2 -2
  113. package/.agent-src/skills/developer-like-execution/SKILL.md +2 -2
  114. package/.agent-src/skills/existing-ui-audit/SKILL.md +24 -9
  115. package/.agent-src/skills/fe-design/SKILL.md +20 -15
  116. package/.agent-src/skills/file-editor/SKILL.md +9 -0
  117. package/.agent-src/skills/flux/SKILL.md +1 -1
  118. package/.agent-src/skills/git-workflow/SKILL.md +1 -1
  119. package/.agent-src/skills/guideline-writing/SKILL.md +11 -11
  120. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +4 -4
  121. package/.agent-src/skills/livewire/SKILL.md +27 -8
  122. package/.agent-src/skills/override-management/SKILL.md +2 -2
  123. package/.agent-src/skills/php-coder/SKILL.md +1 -1
  124. package/.agent-src/skills/playwright-testing/SKILL.md +2 -2
  125. package/.agent-src/skills/readme-reviewer/SKILL.md +1 -1
  126. package/.agent-src/skills/readme-writing/SKILL.md +1 -1
  127. package/.agent-src/skills/readme-writing-package/SKILL.md +1 -1
  128. package/.agent-src/skills/receiving-code-review/SKILL.md +1 -1
  129. package/.agent-src/skills/refine-ticket/SKILL.md +30 -24
  130. package/.agent-src/skills/review-routing/SKILL.md +2 -2
  131. package/.agent-src/skills/roadmap-management/SKILL.md +22 -16
  132. package/.agent-src/skills/rule-writing/SKILL.md +1 -1
  133. package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
  134. package/.agent-src/skills/skill-writing/SKILL.md +6 -6
  135. package/.agent-src/skills/subagent-orchestration/SKILL.md +1 -0
  136. package/.agent-src/skills/systematic-debugging/SKILL.md +1 -1
  137. package/.agent-src/skills/upstream-contribute/SKILL.md +3 -3
  138. package/.agent-src/skills/validate-feature-fit/SKILL.md +2 -2
  139. package/.agent-src/skills/{verify-before-complete → verify-completion-evidence}/SKILL.md +2 -2
  140. package/.agent-src/templates/agent-settings.md +9 -9
  141. package/.agent-src/templates/contexts/auth-model.md +1 -1
  142. package/.agent-src/templates/roadmaps.md +9 -8
  143. package/.agent-src/templates/scripts/README.md +2 -2
  144. package/.agent-src/templates/scripts/memory_lookup.py +1 -1
  145. package/.agent-src/templates/scripts/telemetry/aggregator.py +16 -1
  146. package/.agent-src/templates/scripts/telemetry/engagement.py +59 -0
  147. package/.agent-src/templates/scripts/telemetry/report_renderer.py +28 -1
  148. package/.agent-src/templates/scripts/telemetry_record.py +14 -1
  149. package/.agent-src/templates/scripts/work_engine/__init__.py +2 -2
  150. package/.agent-src/templates/scripts/work_engine/cli.py +64 -461
  151. package/.agent-src/templates/scripts/work_engine/cli_args.py +116 -0
  152. package/.agent-src/templates/scripts/work_engine/delivery_state.py +3 -3
  153. package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +1 -1
  154. package/.agent-src/templates/scripts/work_engine/directives/backend/implement.py +1 -1
  155. package/.agent-src/templates/scripts/work_engine/directives/backend/memory.py +1 -1
  156. package/.agent-src/templates/scripts/work_engine/directives/backend/plan.py +1 -1
  157. package/.agent-src/templates/scripts/work_engine/directives/backend/report.py +1 -1
  158. package/.agent-src/templates/scripts/work_engine/dispatcher.py +1 -1
  159. package/.agent-src/templates/scripts/work_engine/emitters.py +43 -0
  160. package/.agent-src/templates/scripts/work_engine/errors.py +19 -0
  161. package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +76 -0
  162. package/.agent-src/templates/scripts/work_engine/input_builders.py +163 -0
  163. package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +34 -2
  164. package/.agent-src/templates/scripts/work_engine/persona_policy.py +1 -1
  165. package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +1 -1
  166. package/.agent-src/templates/scripts/work_engine/state_io.py +202 -0
  167. package/.claude-plugin/marketplace.json +10 -2
  168. package/AGENTS.md +16 -12
  169. package/CHANGELOG.md +206 -9
  170. package/README.md +51 -52
  171. package/config/agent-settings.template.yml +58 -1
  172. package/config/gitignore-block.txt +3 -0
  173. package/docs/MIGRATION.md +122 -0
  174. package/docs/architecture.md +83 -34
  175. package/docs/catalog.md +331 -0
  176. package/docs/contracts/STABILITY.md +134 -0
  177. package/docs/contracts/adr-chat-history-split.md +132 -0
  178. package/docs/contracts/adr-command-suggestion.md +146 -0
  179. package/docs/contracts/adr-implement-ticket-runtime.md +122 -0
  180. package/docs/contracts/adr-product-ui-track.md +384 -0
  181. package/docs/contracts/adr-prompt-driven-execution.md +187 -0
  182. package/docs/contracts/agent-memory-contract.md +149 -0
  183. package/docs/contracts/artifact-engagement-flow.md +262 -0
  184. package/docs/contracts/command-clusters.md +126 -0
  185. package/docs/contracts/command-suggestion-flow.md +148 -0
  186. package/docs/contracts/implement-ticket-flow.md +628 -0
  187. package/docs/contracts/linear-ai-rules-inclusion.md +143 -0
  188. package/docs/contracts/linear-ai-three-layers.md +131 -0
  189. package/docs/contracts/load-context-schema.md +186 -0
  190. package/docs/contracts/rule-interactions.md +107 -0
  191. package/docs/contracts/rule-interactions.yml +238 -0
  192. package/docs/contracts/rule-priority-hierarchy.md +87 -0
  193. package/docs/contracts/ui-stack-extension.md +236 -0
  194. package/docs/contracts/ui-track-flow.md +338 -0
  195. package/docs/customization.md +14 -0
  196. package/docs/end-to-end-walkthroughs.md +165 -0
  197. package/docs/getting-started.md +27 -9
  198. package/docs/github-topics.md +12 -3
  199. package/docs/guidelines/agent-infra/language-and-tone-examples.md +79 -0
  200. package/{.agent-src → docs}/guidelines/docs/readme-size-and-splitting.md +26 -25
  201. package/docs/guidelines/php/git.md +164 -0
  202. package/docs/installation.md +42 -6
  203. package/docs/migrations/commands-1.15.0.md +112 -0
  204. package/docs/showcase.md +9 -4
  205. package/docs/skills-catalog.md +14 -8
  206. package/docs/ui-track-mental-model.md +121 -0
  207. package/llms.txt +13 -7
  208. package/package.json +1 -1
  209. package/scripts/agent-config +23 -0
  210. package/scripts/ai_council/__init__.py +39 -0
  211. package/scripts/ai_council/_default_prices.py +41 -0
  212. package/scripts/ai_council/_one_off_rebalancing_audit.py +149 -0
  213. package/scripts/ai_council/_one_off_roundtrip.py +106 -0
  214. package/scripts/ai_council/budget_guard.py +172 -0
  215. package/scripts/ai_council/bundler.py +261 -0
  216. package/scripts/ai_council/clients.py +381 -0
  217. package/scripts/ai_council/modes.py +127 -0
  218. package/scripts/ai_council/orchestrator.py +350 -0
  219. package/scripts/ai_council/pricing.py +213 -0
  220. package/scripts/ai_council/project_context.py +159 -0
  221. package/scripts/ai_council/prompts.py +232 -0
  222. package/scripts/ai_council/session.py +144 -0
  223. package/scripts/build_linear_digest.py +4 -4
  224. package/scripts/check_always_budget.py +126 -0
  225. package/scripts/check_augmentignore.py +69 -0
  226. package/scripts/check_command_count_messaging.py +120 -0
  227. package/scripts/check_portability.py +57 -0
  228. package/scripts/check_public_catalog_links.py +122 -0
  229. package/scripts/check_public_links.py +185 -0
  230. package/scripts/check_references.py +5 -1
  231. package/scripts/check_roadmap_trackable.py +111 -0
  232. package/scripts/command_suggester/cooldown.py +1 -1
  233. package/scripts/generate_index.py +266 -0
  234. package/scripts/install_anthropic_key.sh +5 -0
  235. package/scripts/install_openai_key.sh +106 -0
  236. package/scripts/lint_load_context.py +163 -0
  237. package/scripts/lint_no_new_atomic_commands.py +179 -0
  238. package/scripts/lint_rule_interactions.py +149 -0
  239. package/scripts/memory_lookup.py +1 -1
  240. package/scripts/release.py +297 -64
  241. package/scripts/schemas/command.schema.json +20 -0
  242. package/scripts/schemas/rule.schema.json +10 -0
  243. package/scripts/skill_linter.py +26 -4
  244. package/scripts/sync_agent_settings.py +1 -1
  245. package/scripts/update_counts.py +19 -4
  246. package/scripts/update_prices.py +124 -0
  247. package/.agent-src/guidelines/php/git.md +0 -96
  248. package/.agent-src/rules/chat-history.md +0 -200
  249. /package/.agent-src/rules/{slash-commands.md → slash-command-routing-policy.md} +0 -0
  250. /package/{.agent-src → docs}/guidelines/agent-infra/agent-interaction-and-decision-quality.md +0 -0
  251. /package/{.agent-src → docs}/guidelines/agent-infra/break-glass-usage.md +0 -0
  252. /package/{.agent-src → docs}/guidelines/agent-infra/developer-judgment.md +0 -0
  253. /package/{.agent-src → docs}/guidelines/agent-infra/engineering-memory-data-format.md +0 -0
  254. /package/{.agent-src → docs}/guidelines/agent-infra/layered-settings.md +0 -0
  255. /package/{.agent-src → docs}/guidelines/agent-infra/memory-access.md +0 -0
  256. /package/{.agent-src → docs}/guidelines/agent-infra/naming.md +0 -0
  257. /package/{.agent-src → docs}/guidelines/agent-infra/output-patterns.md +0 -0
  258. /package/{.agent-src → docs}/guidelines/agent-infra/review-routing-data-format.md +0 -0
  259. /package/{.agent-src → docs}/guidelines/agent-infra/role-contracts.md +0 -0
  260. /package/{.agent-src → docs}/guidelines/agent-infra/role-mode-router.md +0 -0
  261. /package/{.agent-src → docs}/guidelines/agent-infra/runtime-layer.md +0 -0
  262. /package/{.agent-src → docs}/guidelines/agent-infra/self-improvement-pipeline.md +0 -0
  263. /package/{.agent-src → docs}/guidelines/agent-infra/size-and-scope.md +0 -0
  264. /package/{.agent-src → docs}/guidelines/agent-infra/tool-integration.md +0 -0
  265. /package/{.agent-src → docs}/guidelines/e2e/playwright.md +0 -0
  266. /package/{.agent-src → docs}/guidelines/php/api-design.md +0 -0
  267. /package/{.agent-src → docs}/guidelines/php/artisan-commands.md +0 -0
  268. /package/{.agent-src → docs}/guidelines/php/blade-ui.md +0 -0
  269. /package/{.agent-src → docs}/guidelines/php/controllers.md +0 -0
  270. /package/{.agent-src → docs}/guidelines/php/database.md +0 -0
  271. /package/{.agent-src → docs}/guidelines/php/eloquent.md +0 -0
  272. /package/{.agent-src → docs}/guidelines/php/flux.md +0 -0
  273. /package/{.agent-src → docs}/guidelines/php/general.md +0 -0
  274. /package/{.agent-src → docs}/guidelines/php/jobs.md +0 -0
  275. /package/{.agent-src → docs}/guidelines/php/livewire.md +0 -0
  276. /package/{.agent-src → docs}/guidelines/php/logging.md +0 -0
  277. /package/{.agent-src → docs}/guidelines/php/naming.md +0 -0
  278. /package/{.agent-src → docs}/guidelines/php/patterns/dependency-injection.md +0 -0
  279. /package/{.agent-src → docs}/guidelines/php/patterns/dtos.md +0 -0
  280. /package/{.agent-src → docs}/guidelines/php/patterns/events.md +0 -0
  281. /package/{.agent-src → docs}/guidelines/php/patterns/factory.md +0 -0
  282. /package/{.agent-src → docs}/guidelines/php/patterns/pipelines.md +0 -0
  283. /package/{.agent-src → docs}/guidelines/php/patterns/policies.md +0 -0
  284. /package/{.agent-src → docs}/guidelines/php/patterns/repositories.md +0 -0
  285. /package/{.agent-src → docs}/guidelines/php/patterns/service-layer.md +0 -0
  286. /package/{.agent-src → docs}/guidelines/php/patterns/strategy.md +0 -0
  287. /package/{.agent-src → docs}/guidelines/php/patterns.md +0 -0
  288. /package/{.agent-src → docs}/guidelines/php/performance.md +0 -0
  289. /package/{.agent-src → docs}/guidelines/php/resources.md +0 -0
  290. /package/{.agent-src → docs}/guidelines/php/security.md +0 -0
  291. /package/{.agent-src → docs}/guidelines/php/sql.md +0 -0
  292. /package/{.agent-src → docs}/guidelines/php/validations.md +0 -0
  293. /package/{.agent-src → docs}/guidelines/php/websocket.md +0 -0
@@ -0,0 +1,238 @@
1
+ # Rule-Interaction Matrix
2
+ # -----------------------
3
+ # Machine-readable contract for how the package's `always` rules relate
4
+ # when more than one fires on the same turn. Linted by
5
+ # `scripts/lint_rule_interactions.py`. Rendered diagram in
6
+ # `docs/contracts/rule-interactions.md`.
7
+ #
8
+ # Schema:
9
+ # version: integer
10
+ # rules: list of rule slugs that participate in any interaction (each
11
+ # must exist as `.agent-src.uncompressed/rules/<slug>.md`)
12
+ # pairs: list of pairwise interactions
13
+ # - id: kebab-case stable identifier
14
+ # rules: [senior, junior] — `senior` wins on conflict
15
+ # relation: overrides | narrows | defers_to | restates | gates | complements
16
+ # conflict: one-line trigger that causes both to fire
17
+ # resolution: one paragraph — what the agent does
18
+ # evidence: list of `file#anchor` citations
19
+ # tests: optional list of test paths
20
+ #
21
+ # Anchor pair: `non-destructive-by-default` × five rules per
22
+ # `road-to-post-pr29-optimize.md` Phase 2.
23
+
24
+ version: 1
25
+
26
+ rules:
27
+ - non-destructive-by-default
28
+ - autonomous-execution
29
+ - scope-control
30
+ - commit-policy
31
+ - ask-when-uncertain
32
+ - verify-before-complete
33
+ - agent-authority
34
+ - language-and-tone
35
+ - direct-answers
36
+
37
+ pairs:
38
+
39
+ - id: ndd-x-autonomous-execution
40
+ rules: [non-destructive-by-default, autonomous-execution]
41
+ relation: overrides
42
+ conflict: >-
43
+ Standing autonomy directive ("arbeite selbstständig") is active and
44
+ the next step crosses a Hard-Floor trigger (production-branch merge,
45
+ deploy, push, prod data/infra, whimsical bulk deletion, commit with
46
+ bulk deletion / infra change).
47
+ resolution: >-
48
+ Autonomy never lifts the floor. Stop, surface the action via one
49
+ numbered-options block, wait for explicit user confirmation on
50
+ this turn before proceeding.
51
+ evidence:
52
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#the-iron-law
53
+ - .agent-src.uncompressed/rules/autonomous-execution.md#hard-floor--see-non-destructive-by-default
54
+
55
+ - id: ndd-x-scope-control
56
+ rules: [non-destructive-by-default, scope-control]
57
+ relation: restates
58
+ conflict: >-
59
+ Push, merge, branch creation, PR ops, tag pushes — both rules speak
60
+ to the same git operations.
61
+ resolution: >-
62
+ `scope-control` is the canonical permission gate; the floor restates
63
+ the prod-trunk and deploy-tied subset so the never-overridable layer
64
+ cannot be weakened by future scope-control edits. On any conflict,
65
+ the floor wins.
66
+ evidence:
67
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#the-iron-law
68
+ - .agent-src.uncompressed/rules/scope-control.md#git-operations--permission-gated
69
+ - .agent-src.uncompressed/rules/scope-control.md#production-infrastructure-bulk-destructive--hard-floor
70
+
71
+ - id: ndd-x-commit-policy
72
+ rules: [non-destructive-by-default, commit-policy]
73
+ relation: gates
74
+ conflict: >-
75
+ A commit is otherwise authorized by one of `commit-policy`'s four
76
+ paths (user-this-turn, standing instruction, `/commit*` invocation,
77
+ roadmap pre-scan), but the diff contains bulk deletions or infra
78
+ changes (row 6 of the Hard Floor).
79
+ resolution: >-
80
+ The commit pre-scan triggers regardless of which authorization path
81
+ applies. Surface the diff (paths + counts), confirm this turn,
82
+ then commit. The four exceptions cover *whether* commits happen;
83
+ the floor covers *which diffs* still need a separate confirmation.
84
+ evidence:
85
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#the-iron-law
86
+ - .agent-src.uncompressed/rules/commit-policy.md#hard-floor-still-applies--bulk-deletions-and-infra-changes
87
+
88
+ - id: ndd-x-ask-when-uncertain
89
+ rules: [non-destructive-by-default, ask-when-uncertain]
90
+ relation: complements
91
+ conflict: >-
92
+ A floor trigger fires AND the request is ambiguous (e.g. "delete
93
+ the legacy folder" without a file list).
94
+ resolution: >-
95
+ Both rules require the same response — stop and ask. The floor
96
+ provides the categorical reason (destructive); ask-when-uncertain
97
+ provides the question shape (one numbered-options block, blocking).
98
+ No conflict; both fire harmoniously.
99
+ evidence:
100
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#failure-modes
101
+ - .agent-src.uncompressed/rules/ask-when-uncertain.md#vague-request-triggers--must-ask
102
+
103
+ - id: ndd-x-verify-before-complete
104
+ rules: [non-destructive-by-default, verify-before-complete]
105
+ relation: complements
106
+ conflict: >-
107
+ A floor-crossing action (deploy, prod-data write) was authorized
108
+ and executed; agent is about to claim "done".
109
+ resolution: >-
110
+ Both rules apply independently. Floor is satisfied by user
111
+ confirmation; verify-before-complete is satisfied by fresh
112
+ verification evidence in the same message. Skipping either is a
113
+ rule violation.
114
+ evidence:
115
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#the-iron-law
116
+ - .agent-src.uncompressed/rules/verify-before-complete.md#the-iron-law
117
+
118
+ - id: autonomy-x-scope-control
119
+ rules: [scope-control, autonomous-execution]
120
+ relation: gates
121
+ conflict: >-
122
+ Autonomy is `on` and the next step is a permission-gated git
123
+ operation (push, branch create/delete, PR open, tag push) below
124
+ the floor threshold.
125
+ resolution: >-
126
+ `scope-control`'s permission gate stays in force. Autonomy
127
+ suppresses *trivial* questions only; git-shape decisions are
128
+ blocking. Stop and ask.
129
+ evidence:
130
+ - .agent-src.uncompressed/rules/scope-control.md#git-operations--permission-gated
131
+ - .agent-src.uncompressed/rules/autonomous-execution.md#blocking--still-ask-regardless-of-personalautonomy
132
+
133
+ - id: autonomy-x-commit-policy
134
+ rules: [commit-policy, autonomous-execution]
135
+ relation: overrides
136
+ conflict: >-
137
+ Autonomy is `on` and the agent could plausibly "just commit" after
138
+ a green verification step.
139
+ resolution: >-
140
+ `commit-policy` Iron Law forbids both committing AND asking about
141
+ committing unless one of the four exceptions applies. Autonomy
142
+ does not add a fifth exception.
143
+ evidence:
144
+ - .agent-src.uncompressed/rules/commit-policy.md#the-iron-law
145
+ - .agent-src.uncompressed/rules/autonomous-execution.md#commit-policy--see-commit-policy
146
+
147
+ - id: authority-x-ndd
148
+ rules: [agent-authority, non-destructive-by-default]
149
+ relation: defers_to
150
+ conflict: >-
151
+ Both rules speak to "may the agent do this autonomously?" — the
152
+ Priority Index points to the Hard Floor as Band 1.
153
+ resolution: >-
154
+ `agent-authority` is a router, never a source of truth. The Hard
155
+ Floor's Iron Law lives verbatim in `non-destructive-by-default`
156
+ and wins every conflict. The index points; it never restates.
157
+ evidence:
158
+ - .agent-src.uncompressed/rules/agent-authority.md#index-rules
159
+ - .agent-src.uncompressed/rules/non-destructive-by-default.md#the-iron-law
160
+
161
+ - id: authority-x-scope-control
162
+ rules: [agent-authority, scope-control]
163
+ relation: defers_to
164
+ conflict: >-
165
+ Permission Gate questions (push, branch, PR, architectural change)
166
+ surface during routine work — the index labels Band 2.
167
+ resolution: >-
168
+ The Priority Index routes to `scope-control` for git-shape and
169
+ scope-expansion decisions. Index never narrows or weakens the
170
+ gate; canonical rule wins on any wording divergence.
171
+ evidence:
172
+ - .agent-src.uncompressed/rules/agent-authority.md#index-rules
173
+ - .agent-src.uncompressed/rules/scope-control.md#git-operations--permission-gated
174
+
175
+ - id: authority-x-commit-policy
176
+ rules: [agent-authority, commit-policy]
177
+ relation: defers_to
178
+ conflict: >-
179
+ The "about to commit" decision arises — the index labels it Band 3
180
+ (Commit Default = never, with four exceptions).
181
+ resolution: >-
182
+ `commit-policy` Iron Law is canonical. The Priority Index points
183
+ to it; it does not enumerate the four exceptions itself. Future
184
+ edits to commit-policy do not require Index updates unless the
185
+ band ordering changes.
186
+ evidence:
187
+ - .agent-src.uncompressed/rules/agent-authority.md#index-rules
188
+ - .agent-src.uncompressed/rules/commit-policy.md#exceptions--when-committing-is-allowed
189
+
190
+ - id: scope-x-commit-policy
191
+ rules: [scope-control, commit-policy]
192
+ relation: narrows
193
+ conflict: >-
194
+ `scope-control` § "Git operations" forbids committing without
195
+ explicit permission as one of several git-op gates; `commit-policy`
196
+ narrows the commit case to a never-ask default with four named
197
+ exceptions.
198
+ resolution: >-
199
+ `commit-policy` is the narrower, canonical rule for the commit
200
+ sub-case. `scope-control` continues to govern push, branch, PR,
201
+ tag operations. On commit specifics, defer to `commit-policy`;
202
+ on other git ops, defer to `scope-control`.
203
+ evidence:
204
+ - .agent-src.uncompressed/rules/scope-control.md#git-operations--permission-gated
205
+ - .agent-src.uncompressed/rules/commit-policy.md#the-iron-law
206
+
207
+ - id: ask-x-direct-answers
208
+ rules: [ask-when-uncertain, direct-answers]
209
+ relation: complements
210
+ conflict: >-
211
+ A vague request triggers `ask-when-uncertain` (must ask), but
212
+ `direct-answers` Iron Law 3 (brevity by default) discourages
213
+ overlong replies; could read as tension when the question needs
214
+ framing.
215
+ resolution: >-
216
+ Both rules apply. `ask-when-uncertain` decides *whether* to ask
217
+ and demands one question per turn with numbered options.
218
+ `direct-answers` shapes *how* the question reads — no flattery,
219
+ no padding, shortest form that fully states the choice.
220
+ evidence:
221
+ - .agent-src.uncompressed/rules/ask-when-uncertain.md#iron-law--one-question-per-turn-always
222
+ - .agent-src.uncompressed/rules/direct-answers.md#iron-law-3--brevity-by-default
223
+
224
+ - id: language-x-direct-answers
225
+ rules: [language-and-tone, direct-answers]
226
+ relation: complements
227
+ conflict: >-
228
+ User writes German; agent must mirror language AND avoid flattery,
229
+ invented facts, padding. Both rules speak to reply shape.
230
+ resolution: >-
231
+ `language-and-tone` decides the language token (mirror user's last
232
+ chat message); `direct-answers` decides content discipline (no
233
+ flattery, verified facts, brevity). They compose: a brief, direct,
234
+ flattery-free reply in the user's language. Neither weakens the
235
+ other.
236
+ evidence:
237
+ - .agent-src.uncompressed/rules/language-and-tone.md#iron-law--mirror-the-users-language-always
238
+ - .agent-src.uncompressed/rules/direct-answers.md#iron-law-1--no-flattery
@@ -0,0 +1,87 @@
1
+ ---
2
+ stability: beta
3
+ ---
4
+
5
+ # Rule Priority Hierarchy
6
+
7
+ > **Audience:** anyone reading or editing `.agent-src.uncompressed/rules/*.md`,
8
+ > or trying to predict which rule wins when several fire on the same turn.
9
+ > **Machine-readable counterpart:** [`rule-interactions.yml`](rule-interactions.yml)
10
+ > (linted by `scripts/lint_rule_interactions.py`).
11
+ > **Diagram + pair-by-pair narrative:** [`rule-interactions.md`](rule-interactions.md).
12
+
13
+ This document is the **ordered list** view. The matrix files describe
14
+ how *pairs* of rules interact; this file states **which band wins**
15
+ when the bands themselves disagree.
16
+
17
+ ## The four-line principle
18
+
19
+ ```
20
+ Safety beats autonomy.
21
+ Scope beats helpfulness.
22
+ Verification beats completion.
23
+ User intent beats command suggestion.
24
+ ```
25
+
26
+ Every band below is a concrete instance of one of those four lines.
27
+ When in doubt, walk the list top-down and stop at the first band that
28
+ fires — that band's canonical rule decides the turn.
29
+
30
+ ## The ordered list
31
+
32
+ | Band | Rule | What it gates | Lifts under |
33
+ |---|---|---|---|
34
+ | 1 | [`non-destructive-by-default`](../../.agent-src.uncompressed/rules/non-destructive-by-default.md) | Prod-trunk merge · deploy · push · prod data/infra · whimsical bulk deletion · bulk-deletion or infra commit | **Never.** Explicit user confirmation *this turn* only. |
35
+ | 2 | [`security-sensitive-stop`](../../.agent-src.uncompressed/rules/security-sensitive-stop.md) | Auth · billing · tenant boundaries · secrets · file uploads · webhooks · public endpoints | Threat-model pass completed and recorded *before* the edit. |
36
+ | 3 | [`scope-control`](../../.agent-src.uncompressed/rules/scope-control.md) | Git ops (branch · PR · tag · push · merge · rebase) · architectural changes · new libraries · scope expansion | Explicit user permission *this turn* or unrevoked standing instruction. |
37
+ | 4 | [`ask-when-uncertain`](../../.agent-src.uncompressed/rules/ask-when-uncertain.md) | Ambiguous requirements · vague-request triggers · fenced steps | Concrete evidence resolves the ambiguity, **or** user answers the single question. |
38
+ | 5 | [`commit-policy`](../../.agent-src.uncompressed/rules/commit-policy.md) | Any `git commit` | Four exceptions only — explicit "commit now", standing instruction, `/commit*` invocation, roadmap authorization. |
39
+ | 6 | [`verify-before-complete`](../../.agent-src.uncompressed/rules/verify-before-complete.md) | "Done" / "complete" claims · suggestions to commit, push, or PR | Fresh verification evidence in *this* message. |
40
+ | 7 | [`autonomous-execution`](../../.agent-src.uncompressed/rules/autonomous-execution.md) | Trivial-vs-blocking classification · autonomy opt-in detection | Per-step decision; never above bands 1–6. |
41
+ | 8 | [`command-suggestion-policy`](../../.agent-src.uncompressed/rules/command-suggestion-policy.md) | Surfacing slash-command matches as numbered options | User always picks; nothing auto-executes. |
42
+ | 9 | [`language-and-tone`](../../.agent-src.uncompressed/rules/language-and-tone.md) | First-token language of every reply · `.md` always English | Mirror the user's last chat message — no momentum exception. |
43
+
44
+ **Read direction:** top-to-bottom is *priority on conflict*, not chronology.
45
+ A turn typically touches several bands at once; the hierarchy decides
46
+ which one's Iron Law gets the final say.
47
+
48
+ ## Index rules
49
+
50
+ - **Higher band wins.** A band-3 permission does not lift band-1; a band-5
51
+ commit exception does not lift band-3. Each band's "Lifts under" column
52
+ is its own escape hatch and only its own.
53
+ - **No band restates an Iron Law.** Iron Laws live verbatim in the
54
+ canonical rule files. This hierarchy points; it does not paraphrase.
55
+ - **Bands 1–2 are *Hard Floors*.** No autonomy setting, no roadmap step,
56
+ no standing instruction lifts them. See
57
+ [`agent-authority`](../../.agent-src.uncompressed/rules/agent-authority.md)
58
+ § Index rules for the matching authority statement.
59
+ - **Unsure → ask.** [`ask-when-uncertain`](../../.agent-src.uncompressed/rules/ask-when-uncertain.md)
60
+ is the universal escape hatch when the band is unclear.
61
+
62
+ ## Worked examples
63
+
64
+ | Situation | Bands that fire | Winner | Why |
65
+ |---|---|---|---|
66
+ | Standing autonomy + roadmap step says "merge to `main`" | 1, 7 | **1** | Hard Floor predates and outranks autonomy; surface the merge, ask. |
67
+ | `/commit-in-chunks` on a diff that removes a directory | 1, 5 | **1** | Commit exception authorizes *commits*, not *bulk deletions*. Confirm diff this turn. |
68
+ | User asks "improve this" with no metric named | 4, 7 | **4** | Vague-request trigger fires before any autonomy decision; ask the one clarifying question. |
69
+ | Editing `app/Auth/PasswordReset.php` mid-feature | 2, 7 | **2** | Security-sensitive surface stops the edit until threat-model is recorded. |
70
+ | Agent about to claim "ready to merge" with no fresh test output | 5, 6 | **6** | Verification gate fires before the commit/push question is even valid. |
71
+ | User types free-form prompt that matches `/refine-ticket` | 8, 9 | **8 + 9** | Suggestion runs as numbered options, mirrored to user's language. No conflict. |
72
+
73
+ ## Cross-references
74
+
75
+ - [`agent-authority`](../../.agent-src.uncompressed/rules/agent-authority.md) — the four-band authority router (bands 1–3 + 7 of this hierarchy).
76
+ - [`rule-interactions.md`](rule-interactions.md) — pairwise interaction narrative + Mermaid diagram.
77
+ - [`rule-interactions.yml`](rule-interactions.yml) — machine-readable, CI-linted matrix.
78
+ - [`STABILITY.md`](STABILITY.md) — what the `stability: beta` tag means for breaking changes.
79
+
80
+ ## Stability
81
+
82
+ `beta` — the band ordering and four-line principle are settled, but
83
+ the *worked examples* and the inclusion of band 8 (`command-suggestion-policy`)
84
+ in the public hierarchy have not yet shipped through one major release.
85
+ A breaking change to the band ordering is a SemVer-minor-pre-1.0 bump
86
+ or a SemVer-major bump after 1.0. Adding a row, refining a "Lifts under"
87
+ clause, or expanding the worked-examples table is non-breaking.
@@ -0,0 +1,236 @@
1
+ ---
2
+ stability: beta
3
+ ---
4
+
5
+ # UI Stack Extension — adding a new frontend stack to the UI track
6
+
7
+ > **Audience:** maintainers adding a new stack (Svelte, SolidJS, Astro,
8
+ > Qwik, …) to the UI directive set. Consumers of the package never run
9
+ > this; they get the stacks shipped here.
10
+ > **Source of truth:** [`ui-track-flow.md`](ui-track-flow.md) for the
11
+ > contract; [`adr-product-ui-track.md`](adr-product-ui-track.md) for
12
+ > the rationale.
13
+ > **Status:** recipe only — R3 ships four stacks
14
+ > (`blade-livewire-flux`, `react-shadcn`, `vue`, `plain`); no
15
+ > additional stacks are scheduled. Add one only when a real consumer
16
+ > project asks for it.
17
+
18
+ ## What "adding a stack" actually means
19
+
20
+ Three artefacts plus a Golden fixture. The engine's directive set is
21
+ fixed; only the dispatch tables and the implementation skill bundles
22
+ change.
23
+
24
+ | Artefact | File | Change |
25
+ |---|---|---|
26
+ | Stack label | [`scripts/work_engine/stack/detect.py`](../../.agent-src.uncompressed/templates/scripts/work_engine/stack/detect.py) | New entry in `KNOWN_STACKS` + a heuristic in `detect_stack` |
27
+ | Apply skill | `.agent-src.uncompressed/skills/ui-apply-<stack>/SKILL.md` | New skill bundle |
28
+ | Review skill | `.agent-src.uncompressed/skills/ui-design-review-<stack>/SKILL.md` | New skill bundle |
29
+ | Polish skill | `.agent-src.uncompressed/skills/ui-polish-<stack>/SKILL.md` | New skill bundle |
30
+ | Dispatch tables | `directives/ui/{apply,review,polish}.py` | New row in each `STACK_DIRECTIVES` map |
31
+ | Golden fixture | `tests/golden/sandbox/recipes/gt_u<NN>_<stack>_*.py` | One happy-path baseline at minimum |
32
+
33
+ Skill names are not free — they are read by the dispatcher as
34
+ `ui-apply-<stack>`, `ui-design-review-<stack>`, `ui-polish-<stack>`.
35
+ A typo is silently handled by the `DEFAULT_DIRECTIVE` fallback
36
+ (`ui-apply-plain` / `ui-design-review-plain` / `ui-polish-plain`),
37
+ which is recoverable but probably not what the maintainer intended.
38
+
39
+ ## Step 1 — pick the label
40
+
41
+ Convention: lowercase, hyphenated, framework-only (no version pin).
42
+
43
+ | Good | Bad | Why |
44
+ |---|---|---|
45
+ | `svelte` | `svelte5` | Major-version drift handled by the audit's version-anchor warning, not by splitting the stack. |
46
+ | `solid` | `solid-js` | Match the package name developers say out loud. |
47
+ | `astro` | `astro-content` | Sub-modes (Astro components vs MDX) live inside the apply skill, not in the label. |
48
+
49
+ Add the label to `KNOWN_STACKS` (the frozenset is exported and used by
50
+ state validation; missing it makes detection silent-fail back to
51
+ `plain`).
52
+
53
+ ## Step 2 — heuristic in `detect_stack`
54
+
55
+ The detector reads `composer.json` and `package.json` once and applies
56
+ heuristics in **priority order** — first match wins. The order matters:
57
+ a Laravel + React project must hit `blade-livewire-flux` only when
58
+ Livewire and Flux are present, otherwise `react-shadcn`.
59
+
60
+ Insert the new heuristic **before** the `plain` fallback and **after**
61
+ any stack that could legitimately co-exist with yours. For Svelte:
62
+
63
+ ```python
64
+ def _has_svelte(package: dict[str, object]) -> bool:
65
+ deps = _all_dependencies(
66
+ package,
67
+ "dependencies",
68
+ "devDependencies",
69
+ "peerDependencies",
70
+ "optionalDependencies",
71
+ )
72
+ return "svelte" in deps
73
+ ```
74
+
75
+ ```python
76
+ # inside detect_stack(), before the `plain` fallback
77
+ if _has_svelte(package):
78
+ return StackResult(frontend="svelte", mtime=mtime)
79
+ ```
80
+
81
+ **Failure mode to watch.** A heuristic that overlaps with an existing
82
+ stack (Astro lists `react` as a peer dep when used with React adapters)
83
+ must be ordered carefully. Test against real fixtures, not hand-edited
84
+ JSON.
85
+
86
+ ## Step 3 — three skills, one shape
87
+
88
+ Each skill is a SKILL.md bundle with frontmatter and prose. The
89
+ contract for each:
90
+
91
+ ### `ui-apply-<stack>`
92
+
93
+ Reads `state.ui_design.brief` and `state.ui_audit.components_found`.
94
+ Writes a populated `state.ticket["ui_apply"]` envelope:
95
+
96
+ ```yaml
97
+ ui_apply:
98
+ files: ["resources/components/UserCard.svelte"]
99
+ rendered: # full text per file, microcopy-locked
100
+ "resources/components/UserCard.svelte": |
101
+ <script>...</script>
102
+ ...
103
+ components_added: ["UserCard"]
104
+ components_reused: ["Button", "Card"] # from audit
105
+ microcopy_lock: true # affirms strings come from brief verbatim
106
+ ```
107
+
108
+ **Hard rule:** strings in `rendered` must not contain
109
+ `PLACEHOLDER_PATTERNS` (`<placeholder>`, `lorem`, `todo:`, `tbd`,
110
+ `xxx`). The dispatcher rejects on producer side; the skill must reject
111
+ on consumer side too.
112
+
113
+ ### `ui-design-review-<stack>`
114
+
115
+ Reads `state.ui_apply` + `state.ui_design.brief`. Writes
116
+ `state.ui_review` with `findings: list` and `review_clean: bool`.
117
+ Findings are tagged `kind` ∈ `{token_violation, microcopy_drift,
118
+ a11y_gap, layout_break, prop_misuse, …}` — extend the kind set
119
+ sparingly. Token violations carry `category` and `value` so polish
120
+ can route them through token extraction.
121
+
122
+ ### `ui-polish-<stack>`
123
+
124
+ Reads `state.ui_review.findings` + `state.ui_audit.design_tokens`.
125
+ Writes a fix envelope and increments `state.ui_polish.rounds`. Hard
126
+ ceiling at `POLISH_CEILING = 2` is enforced by the dispatcher;
127
+ the skill does **not** check the ceiling itself but must respect
128
+ `token_repeat_threshold = 2` for unmatched-token extraction.
129
+
130
+ ## Step 4 — wire dispatch tables
131
+
132
+ Three identical edits in
133
+ [`directives/ui/apply.py`](../../.agent-src.uncompressed/templates/scripts/work_engine/directives/ui/apply.py),
134
+ [`directives/ui/review.py`](../../.agent-src.uncompressed/templates/scripts/work_engine/directives/ui/review.py),
135
+ and [`directives/ui/polish.py`](../../.agent-src.uncompressed/templates/scripts/work_engine/directives/ui/polish.py):
136
+
137
+ ```python
138
+ STACK_DIRECTIVES: dict[str, str] = {
139
+ "blade-livewire-flux": "ui-apply-blade-livewire-flux",
140
+ "react-shadcn": "ui-apply-react-shadcn",
141
+ "vue": "ui-apply-vue",
142
+ "plain": "ui-apply-plain",
143
+ "svelte": "ui-apply-svelte", # ← new row
144
+ }
145
+ ```
146
+
147
+ Same shape in `review.py` (`ui-design-review-svelte`) and `polish.py`
148
+ (`ui-polish-svelte`). The dispatcher does not validate that the skill
149
+ actually exists — it emits the `@agent-directive` and trusts the agent
150
+ loader. A typo or missing skill manifests as a halt loop the maintainer
151
+ notices on first replay.
152
+
153
+ ## Step 5 — version anchor in skill frontmatter
154
+
155
+ Every stack-specific skill declares the upstream library version it
156
+ was tested against, in frontmatter:
157
+
158
+ ```yaml
159
+ tested_against:
160
+ svelte: "5.x"
161
+ svelte_kit: "2.x" # if applicable
162
+ ```
163
+
164
+ The audit step reads installed versions from `package.json` and
165
+ compares against the anchor. A mismatch warns but does not block;
166
+ the user picks whether to proceed or pin. Forgetting the anchor
167
+ fails CI (`task lint-skills` enforces presence on `ui-apply-*`,
168
+ `ui-design-review-*`, `ui-polish-*`).
169
+
170
+ ## Step 6 — Golden fixture
171
+
172
+ Add at least one happy-path Golden that exercises the full UI flow
173
+ on the new stack. Recipe lives at
174
+ `tests/golden/sandbox/recipes/gt_u<NN>_<stack>_happy.py` and follows
175
+ the pattern of `gt_u11_high_confidence.py`:
176
+
177
+ 1. Seed state with a clear `ui-build` prompt and an audit that finds
178
+ exactly one strong match (so `audit_path = "high_confidence"`).
179
+ 2. Pin the halt budget — high-confidence happy path is **1 halt**
180
+ (design-brief sign-off only).
181
+ 3. Capture under `tests/golden/baseline/GT-U<NN>/` via `task golden-capture`.
182
+ 4. The replay harness (`tests/golden/test_replay.py`) auto-discovers
183
+ the new baseline; no Taskfile change needed.
184
+
185
+ For a complete pair, also add an `ambiguous` fixture — `2 halts max`,
186
+ matching `gt_u12_ambiguous.py`'s shape. Skip the greenfield branch
187
+ unless the stack has a meaningful difference there.
188
+
189
+ See [`tests/golden/CAPTURING.md`](../../tests/golden/CAPTURING.md)
190
+ for capture mechanics.
191
+
192
+ ## Step 7 — verify end-to-end
193
+
194
+ ```bash
195
+ task sync # propagate detect.py + skill changes
196
+ task generate-tools # refresh .claude/, .cursor/, etc.
197
+ task lint-skills # checks frontmatter + version anchor
198
+ task golden-replay # runs all R1+R2+R3 baselines
199
+ task ci # full pipeline
200
+ ```
201
+
202
+ If `golden-replay` regresses on a non-`<stack>` baseline, your
203
+ detector heuristic is over-matching — re-order the priority chain.
204
+
205
+ ## What you do **not** add
206
+
207
+ - **A new directive set.** UI / UI-trivial / mixed are exhaustive for
208
+ R3. A stack-specific directive set means you've reached for a hammer
209
+ the engine doesn't have.
210
+ - **A new entrypoint command.** `/work` and `/implement-ticket` route
211
+ through `directive_set` and `state.stack.frontend`; a `/build-svelte`
212
+ command would create a UX divergence the engine's intent classifier
213
+ is supposed to prevent.
214
+ - **`fe-design` content.** That skill is the framework-agnostic
215
+ reference; new stack-specific heuristics live in the apply skill,
216
+ not in `fe-design`.
217
+ - **Visual review.** Roadmap 4's headless-browser pipeline is the
218
+ destination for screenshot capture and a11y tooling. Stack
219
+ extensions don't need to wait on it.
220
+
221
+ ## When NOT to add a stack
222
+
223
+ Defer the work and stay on `plain` if any apply:
224
+
225
+ - Only one consumer project asks; the cost of maintaining the apply
226
+ skill exceeds the value.
227
+ - The framework's idiom is close enough to an existing stack that
228
+ the existing apply skill produces acceptable output (Preact ≈
229
+ `react-shadcn` for most components).
230
+ - The framework is in beta or pre-1.0 — the version anchor will drift
231
+ faster than you can re-capture goldens.
232
+
233
+ The audit gate is the safety net: even on `plain`, the audit finds
234
+ existing components and the design step uses them. The cost of
235
+ **not** adding a stack is generally lower than the cost of adding
236
+ one prematurely.