@event4u/agent-config 1.15.0 → 1.17.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 (354) hide show
  1. package/.agent-src/commands/{agents-audit.md → agents/audit.md} +4 -3
  2. package/.agent-src/commands/{agents-cleanup.md → agents/cleanup.md} +12 -6
  3. package/.agent-src/commands/{agents-prepare.md → agents/prepare.md} +4 -3
  4. package/.agent-src/commands/agents.md +46 -0
  5. package/.agent-src/commands/bug-fix.md +1 -1
  6. package/.agent-src/commands/bug-investigate.md +2 -2
  7. package/.agent-src/commands/{chat-history-checkpoint.md → chat-history/checkpoint.md} +5 -5
  8. package/.agent-src/commands/{chat-history-clear.md → chat-history/clear.md} +5 -5
  9. package/.agent-src/commands/{chat-history-resume.md → chat-history/resume.md} +4 -4
  10. package/.agent-src/commands/chat-history/show.md +107 -0
  11. package/.agent-src/commands/chat-history.md +33 -89
  12. package/.agent-src/commands/check-current-md.md +1 -1
  13. package/.agent-src/commands/{commit-in-chunks.md → commit/in-chunks.md} +15 -13
  14. package/.agent-src/commands/commit.md +22 -2
  15. package/.agent-src/commands/{context-create.md → context/create.md} +4 -3
  16. package/.agent-src/commands/{context-refactor.md → context/refactor.md} +4 -3
  17. package/.agent-src/commands/context.md +44 -0
  18. package/.agent-src/commands/{copilot-agents-init.md → copilot-agents/init.md} +4 -3
  19. package/.agent-src/commands/{copilot-agents-optimize.md → copilot-agents/optimize.md} +4 -3
  20. package/.agent-src/commands/copilot-agents.md +44 -0
  21. package/.agent-src/commands/council/default.md +221 -0
  22. package/.agent-src/commands/council/design.md +97 -0
  23. package/.agent-src/commands/council/optimize.md +116 -0
  24. package/.agent-src/commands/council/pr.md +124 -0
  25. package/.agent-src/commands/council.md +54 -0
  26. package/.agent-src/commands/{create-pr-description.md → create-pr/description-only.md} +4 -2
  27. package/.agent-src/commands/create-pr.md +49 -5
  28. package/.agent-src/commands/e2e-heal.md +1 -1
  29. package/.agent-src/commands/e2e-plan.md +1 -1
  30. package/.agent-src/commands/{feature-dev.md → feature/dev.md} +6 -3
  31. package/.agent-src/commands/{feature-explore.md → feature/explore.md} +5 -4
  32. package/.agent-src/commands/{feature-plan.md → feature/plan.md} +32 -5
  33. package/.agent-src/commands/{feature-refactor.md → feature/refactor.md} +4 -3
  34. package/.agent-src/commands/{feature-roadmap.md → feature/roadmap.md} +7 -6
  35. package/.agent-src/commands/feature.md +52 -0
  36. package/.agent-src/commands/{fix-ci.md → fix/ci.md} +4 -3
  37. package/.agent-src/commands/{fix-portability.md → fix/portability.md} +4 -3
  38. package/.agent-src/commands/{fix-pr-bot-comments.md → fix/pr-bots.md} +4 -3
  39. package/.agent-src/commands/{fix-pr-developer-comments.md → fix/pr-developers.md} +4 -3
  40. package/.agent-src/commands/{fix-pr-comments.md → fix/pr.md} +7 -6
  41. package/.agent-src/commands/{fix-references.md → fix/refs.md} +4 -3
  42. package/.agent-src/commands/{fix-seeder.md → fix/seeder.md} +4 -3
  43. package/.agent-src/commands/fix.md +54 -0
  44. package/.agent-src/commands/jira-ticket.md +1 -1
  45. package/.agent-src/commands/{do-and-judge.md → judge/on-diff.md} +7 -6
  46. package/.agent-src/commands/judge/solo.md +90 -0
  47. package/.agent-src/commands/{do-in-steps.md → judge/steps.md} +8 -7
  48. package/.agent-src/commands/judge.md +35 -70
  49. package/.agent-src/commands/{memory-add.md → memory/add.md} +7 -6
  50. package/.agent-src/commands/{memory-full.md → memory/load.md} +6 -5
  51. package/.agent-src/commands/{memory-promote.md → memory/promote.md} +6 -5
  52. package/.agent-src/commands/{propose-memory.md → memory/propose.md} +6 -5
  53. package/.agent-src/commands/memory.md +48 -0
  54. package/.agent-src/commands/mode.md +5 -5
  55. package/.agent-src/commands/{module-create.md → module/create.md} +4 -3
  56. package/.agent-src/commands/{module-explore.md → module/explore.md} +4 -3
  57. package/.agent-src/commands/module.md +44 -0
  58. package/.agent-src/commands/onboard.md +3 -3
  59. package/.agent-src/commands/{optimize-agents.md → optimize/agents.md} +5 -4
  60. package/.agent-src/commands/{optimize-augmentignore.md → optimize/augmentignore.md} +4 -4
  61. package/.agent-src/commands/{optimize-rtk-filters.md → optimize/rtk.md} +4 -3
  62. package/.agent-src/commands/{optimize-skills.md → optimize/skills.md} +5 -4
  63. package/.agent-src/commands/optimize.md +48 -0
  64. package/.agent-src/commands/{override-create.md → override/create.md} +4 -3
  65. package/.agent-src/commands/{override-manage.md → override/manage.md} +4 -3
  66. package/.agent-src/commands/override.md +44 -0
  67. package/.agent-src/commands/review-changes.md +26 -1
  68. package/.agent-src/commands/review-routing.md +1 -1
  69. package/.agent-src/commands/{roadmap-create.md → roadmap/create.md} +33 -5
  70. package/.agent-src/commands/{roadmap-execute.md → roadmap/execute.md} +4 -3
  71. package/.agent-src/commands/roadmap.md +44 -0
  72. package/.agent-src/commands/set-cost-profile.md +3 -3
  73. package/.agent-src/commands/sync-agent-settings.md +2 -2
  74. package/.agent-src/commands/{tests-create.md → tests/create.md} +5 -4
  75. package/.agent-src/commands/{tests-execute.md → tests/execute.md} +4 -3
  76. package/.agent-src/commands/tests.md +44 -0
  77. package/.agent-src/commands/upstream-contribute.md +1 -1
  78. package/.agent-src/contexts/authority/commit-mechanics.md +57 -0
  79. package/.agent-src/contexts/authority/destructive-mechanics.md +66 -0
  80. package/.agent-src/contexts/authority/scope-mechanics.md +87 -0
  81. package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +72 -0
  82. package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +79 -0
  83. package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +98 -0
  84. package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +87 -0
  85. package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +62 -0
  86. package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +78 -0
  87. package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +85 -0
  88. package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +65 -0
  89. package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +78 -0
  90. package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +62 -0
  91. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +55 -0
  92. package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +53 -0
  93. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +77 -0
  94. package/.agent-src/contexts/execution/autonomy-detection.md +54 -0
  95. package/.agent-src/contexts/execution/autonomy-examples.md +90 -0
  96. package/.agent-src/contexts/execution/autonomy-mechanics.md +29 -0
  97. package/.agent-src/contexts/execution/verification-mechanics.md +80 -0
  98. package/.agent-src/contexts/judges/no-consolidate-rationale.md +102 -0
  99. package/.agent-src/contexts/judges/persona-voice-rubric.md +140 -0
  100. package/.agent-src/personas/README.md +1 -1
  101. package/.agent-src/rules/agent-authority.md +24 -0
  102. package/.agent-src/rules/architecture.md +1 -1
  103. package/.agent-src/rules/artifact-drafting-protocol.md +1 -1
  104. package/.agent-src/rules/artifact-engagement-recording.md +14 -70
  105. package/.agent-src/rules/ask-when-uncertain.md +28 -43
  106. package/.agent-src/rules/augment-portability.md +15 -61
  107. package/.agent-src/rules/augment-source-of-truth.md +27 -93
  108. package/.agent-src/rules/autonomous-execution.md +78 -114
  109. package/.agent-src/rules/capture-learnings.md +1 -1
  110. package/.agent-src/rules/chat-history-cadence.md +3 -3
  111. package/.agent-src/rules/chat-history-ownership.md +3 -3
  112. package/.agent-src/rules/chat-history-visibility.md +3 -3
  113. package/.agent-src/rules/cli-output-handling.md +10 -76
  114. package/.agent-src/rules/command-suggestion-policy.md +93 -0
  115. package/.agent-src/rules/commit-conventions.md +17 -14
  116. package/.agent-src/rules/commit-policy.md +14 -42
  117. package/.agent-src/rules/context-hygiene.md +3 -3
  118. package/.agent-src/rules/direct-answers.md +34 -49
  119. package/.agent-src/rules/docker-commands.md +5 -5
  120. package/.agent-src/rules/docs-sync.md +16 -70
  121. package/.agent-src/rules/e2e-testing.md +1 -1
  122. package/.agent-src/rules/guidelines.md +4 -4
  123. package/.agent-src/rules/improve-before-implement.md +2 -2
  124. package/.agent-src/rules/language-and-tone.md +50 -133
  125. package/.agent-src/rules/minimal-safe-diff.md +3 -3
  126. package/.agent-src/rules/missing-tool-handling.md +28 -22
  127. package/.agent-src/rules/model-recommendation.md +4 -4
  128. package/.agent-src/rules/no-cheap-questions.md +82 -0
  129. package/.agent-src/rules/no-roadmap-references.md +73 -0
  130. package/.agent-src/rules/non-destructive-by-default.md +15 -49
  131. package/.agent-src/rules/onboarding-gate.md +5 -5
  132. package/.agent-src/rules/package-ci-checks.md +21 -61
  133. package/.agent-src/rules/preservation-guard.md +64 -29
  134. package/.agent-src/rules/review-routing-awareness.md +26 -45
  135. package/.agent-src/rules/roadmap-progress-sync.md +28 -96
  136. package/.agent-src/rules/role-mode-adherence.md +2 -2
  137. package/.agent-src/rules/scope-control.md +65 -46
  138. package/.agent-src/rules/security-sensitive-stop.md +9 -9
  139. package/.agent-src/rules/size-enforcement.md +1 -1
  140. package/.agent-src/rules/skill-quality.md +16 -48
  141. package/.agent-src/rules/{slash-commands.md → slash-command-routing-policy.md} +7 -4
  142. package/.agent-src/rules/think-before-action.md +55 -45
  143. package/.agent-src/rules/token-efficiency.md +4 -4
  144. package/.agent-src/rules/tool-safety.md +19 -16
  145. package/.agent-src/rules/{ui-audit-before-build.md → ui-audit-gate.md} +27 -41
  146. package/.agent-src/rules/user-interaction.md +16 -71
  147. package/.agent-src/rules/verify-before-complete.md +12 -67
  148. package/.agent-src/scripts/update_roadmap_progress.py +9 -4
  149. package/.agent-src/skills/ai-council/SKILL.md +335 -0
  150. package/.agent-src/skills/api-endpoint/SKILL.md +2 -2
  151. package/.agent-src/skills/api-testing/SKILL.md +1 -1
  152. package/.agent-src/skills/blade-ui/SKILL.md +1 -1
  153. package/.agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
  154. package/.agent-src/skills/bug-analyzer/SKILL.md +1 -1
  155. package/.agent-src/skills/check-refs/SKILL.md +59 -40
  156. package/.agent-src/skills/command-routing/SKILL.md +1 -1
  157. package/.agent-src/skills/command-writing/SKILL.md +1 -1
  158. package/.agent-src/skills/conventional-commits-writing/SKILL.md +86 -28
  159. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +7 -7
  160. package/.agent-src/skills/developer-like-execution/SKILL.md +6 -6
  161. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +101 -65
  162. package/.agent-src/skills/flux/SKILL.md +31 -11
  163. package/.agent-src/skills/git-workflow/SKILL.md +1 -1
  164. package/.agent-src/skills/github-ci/SKILL.md +2 -2
  165. package/.agent-src/skills/guideline-writing/SKILL.md +11 -11
  166. package/.agent-src/skills/judge-code-quality/SKILL.md +7 -8
  167. package/.agent-src/skills/judge-security-auditor/SKILL.md +4 -5
  168. package/.agent-src/skills/judge-test-coverage/SKILL.md +3 -4
  169. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +4 -4
  170. package/.agent-src/skills/lint-skills/SKILL.md +57 -39
  171. package/.agent-src/skills/livewire/SKILL.md +1 -1
  172. package/.agent-src/skills/md-language-check/SKILL.md +61 -39
  173. package/.agent-src/skills/override-management/SKILL.md +7 -7
  174. package/.agent-src/skills/php-coder/SKILL.md +1 -1
  175. package/.agent-src/skills/playwright-testing/SKILL.md +2 -2
  176. package/.agent-src/skills/quality-tools/SKILL.md +2 -2
  177. package/.agent-src/skills/react-shadcn-ui/SKILL.md +116 -43
  178. package/.agent-src/skills/readme-reviewer/SKILL.md +31 -30
  179. package/.agent-src/skills/readme-writing/SKILL.md +79 -54
  180. package/.agent-src/skills/readme-writing-package/SKILL.md +51 -48
  181. package/.agent-src/skills/receiving-code-review/SKILL.md +53 -48
  182. package/.agent-src/skills/refine-prompt/SKILL.md +0 -1
  183. package/.agent-src/skills/requesting-code-review/SKILL.md +35 -30
  184. package/.agent-src/skills/review-routing/SKILL.md +2 -2
  185. package/.agent-src/skills/rule-writing/SKILL.md +1 -1
  186. package/.agent-src/skills/security/SKILL.md +7 -2
  187. package/.agent-src/skills/security-audit/SKILL.md +7 -3
  188. package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
  189. package/.agent-src/skills/skill-writing/SKILL.md +3 -3
  190. package/.agent-src/skills/subagent-orchestration/SKILL.md +1 -0
  191. package/.agent-src/skills/systematic-debugging/SKILL.md +69 -61
  192. package/.agent-src/skills/test-driven-development/SKILL.md +59 -57
  193. package/.agent-src/skills/test-performance/SKILL.md +0 -1
  194. package/.agent-src/skills/traefik/SKILL.md +4 -4
  195. package/.agent-src/skills/upstream-contribute/SKILL.md +1 -1
  196. package/.agent-src/skills/validate-feature-fit/SKILL.md +2 -2
  197. package/.agent-src/skills/{verify-before-complete → verify-completion-evidence}/SKILL.md +30 -28
  198. package/.agent-src/templates/agent-settings.md +8 -8
  199. package/.agent-src/templates/contexts/auth-model.md +1 -1
  200. package/.agent-src/templates/scripts/README.md +2 -2
  201. package/.agent-src/templates/scripts/telemetry/aggregator.py +16 -1
  202. package/.agent-src/templates/scripts/telemetry/engagement.py +59 -0
  203. package/.agent-src/templates/scripts/telemetry/report_renderer.py +28 -1
  204. package/.agent-src/templates/scripts/telemetry_record.py +14 -1
  205. package/.claude-plugin/marketplace.json +31 -12
  206. package/AGENTS.md +11 -9
  207. package/CHANGELOG.md +213 -2
  208. package/README.md +43 -44
  209. package/config/agent-settings.template.yml +58 -1
  210. package/config/gitignore-block.txt +3 -0
  211. package/docs/architecture.md +5 -7
  212. package/docs/catalog.md +359 -0
  213. package/docs/contracts/STABILITY.md +46 -1
  214. package/docs/contracts/adr-chat-history-split.md +1 -3
  215. package/docs/contracts/adr-command-suggestion.md +3 -5
  216. package/docs/contracts/adr-implement-ticket-runtime.md +1 -2
  217. package/docs/contracts/adr-product-ui-track.md +5 -8
  218. package/docs/contracts/adr-prompt-driven-execution.md +3 -4
  219. package/docs/contracts/agent-memory-contract.md +8 -13
  220. package/docs/contracts/artifact-engagement-flow.md +7 -10
  221. package/docs/contracts/command-clusters.md +56 -46
  222. package/docs/contracts/command-suggestion-flow.md +4 -6
  223. package/docs/contracts/context-paths.md +99 -0
  224. package/docs/contracts/file-ownership-matrix.json +6722 -0
  225. package/docs/contracts/file-ownership-matrix.md +134 -0
  226. package/docs/contracts/implement-ticket-flow.md +8 -11
  227. package/docs/contracts/linear-ai-rules-inclusion.md +1 -2
  228. package/docs/contracts/linear-ai-three-layers.md +0 -2
  229. package/docs/contracts/load-context-budget-model.md +178 -0
  230. package/docs/contracts/load-context-schema.md +184 -0
  231. package/docs/contracts/rule-interactions.md +0 -1
  232. package/docs/contracts/rule-interactions.yml +96 -0
  233. package/docs/contracts/rule-priority-hierarchy.md +87 -0
  234. package/docs/contracts/ui-track-flow.md +8 -18
  235. package/docs/customization.md +16 -0
  236. package/docs/end-to-end-walkthroughs.md +165 -0
  237. package/docs/getting-started.md +29 -10
  238. package/docs/github-topics.md +12 -3
  239. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +100 -0
  240. package/docs/guidelines/agent-infra/language-and-tone-examples.md +79 -0
  241. package/{.agent-src → docs}/guidelines/docs/readme-size-and-splitting.md +26 -25
  242. package/docs/guidelines/php/git.md +164 -0
  243. package/docs/migrations/commands-1.15.0.md +1 -1
  244. package/docs/showcase.md +9 -4
  245. package/docs/skills-catalog.md +14 -8
  246. package/docs/ui-track-mental-model.md +2 -2
  247. package/llms.txt +13 -7
  248. package/package.json +1 -1
  249. package/scripts/_one_off_phase4_dispatch_latency.py +108 -0
  250. package/scripts/_one_off_phase6_trigger_jaccard.py +92 -0
  251. package/scripts/_phase2_shim_helper.py +109 -0
  252. package/scripts/agent-config +33 -0
  253. package/scripts/ai_council/__init__.py +39 -0
  254. package/scripts/ai_council/_default_prices.py +41 -0
  255. package/scripts/ai_council/_one_off_2a4_acceptance.py +208 -0
  256. package/scripts/ai_council/_one_off_context_layer_v1_estimate.py +67 -0
  257. package/scripts/ai_council/_one_off_context_layer_v1_review.py +292 -0
  258. package/scripts/ai_council/_one_off_followups_review.py +259 -0
  259. package/scripts/ai_council/_one_off_nondestructive_inline_audit.py +209 -0
  260. package/scripts/ai_council/_one_off_phase_2a_budget_rebalance.py +257 -0
  261. package/scripts/ai_council/_one_off_phase_2a_post_revert.py +197 -0
  262. package/scripts/ai_council/_one_off_rebalancing_audit.py +149 -0
  263. package/scripts/ai_council/_one_off_roundtrip.py +106 -0
  264. package/scripts/ai_council/_one_off_rule_hardening_v1.py +251 -0
  265. package/scripts/ai_council/_one_off_structural_open_questions.py +232 -0
  266. package/scripts/ai_council/_one_off_structural_optimization.py +144 -0
  267. package/scripts/ai_council/_one_off_structural_v3_gaps.py +252 -0
  268. package/scripts/ai_council/_one_off_structural_v3_review.py +240 -0
  269. package/scripts/ai_council/budget_guard.py +172 -0
  270. package/scripts/ai_council/bundler.py +261 -0
  271. package/scripts/ai_council/clients.py +381 -0
  272. package/scripts/ai_council/modes.py +127 -0
  273. package/scripts/ai_council/orchestrator.py +350 -0
  274. package/scripts/ai_council/pricing.py +213 -0
  275. package/scripts/ai_council/project_context.py +159 -0
  276. package/scripts/ai_council/prompts.py +232 -0
  277. package/scripts/ai_council/session.py +144 -0
  278. package/scripts/check_always_budget.py +444 -0
  279. package/scripts/check_augmentignore.py +69 -0
  280. package/scripts/check_cluster_patterns.py +159 -0
  281. package/scripts/check_command_count_messaging.py +127 -0
  282. package/scripts/check_context_paths.py +201 -0
  283. package/scripts/check_no_roadmap_refs.py +155 -0
  284. package/scripts/check_phase_coupling.py +148 -0
  285. package/scripts/check_portability.py +57 -0
  286. package/scripts/check_public_catalog_links.py +122 -0
  287. package/scripts/check_references.py +33 -3
  288. package/scripts/check_roadmap_trackable.py +111 -0
  289. package/scripts/check_safety_floor_untouched.py +125 -0
  290. package/scripts/command_suggester/cooldown.py +1 -1
  291. package/scripts/command_suggester/loader.py +4 -1
  292. package/scripts/compress.py +59 -13
  293. package/scripts/generate_index.py +270 -0
  294. package/scripts/generate_ownership_matrix.py +323 -0
  295. package/scripts/hooks/augment-roadmap-progress.sh +57 -0
  296. package/scripts/install.py +49 -28
  297. package/scripts/install_anthropic_key.sh +5 -0
  298. package/scripts/install_openai_key.sh +106 -0
  299. package/scripts/lint_load_context.py +163 -0
  300. package/scripts/lint_no_new_atomic_commands.py +12 -11
  301. package/scripts/requirements-evals.txt +1 -0
  302. package/scripts/roadmap_progress_hook.py +159 -0
  303. package/scripts/schemas/command.schema.json +22 -1
  304. package/scripts/schemas/rule.schema.json +10 -0
  305. package/scripts/skill_linter.py +13 -4
  306. package/scripts/sync_agent_settings.py +26 -3
  307. package/scripts/update_counts.py +16 -4
  308. package/scripts/update_prices.py +124 -0
  309. package/.agent-src/guidelines/php/git.md +0 -96
  310. package/.agent-src/rules/command-suggestion.md +0 -134
  311. /package/{.agent-src → docs}/guidelines/agent-infra/agent-interaction-and-decision-quality.md +0 -0
  312. /package/{.agent-src → docs}/guidelines/agent-infra/break-glass-usage.md +0 -0
  313. /package/{.agent-src → docs}/guidelines/agent-infra/developer-judgment.md +0 -0
  314. /package/{.agent-src → docs}/guidelines/agent-infra/engineering-memory-data-format.md +0 -0
  315. /package/{.agent-src → docs}/guidelines/agent-infra/layered-settings.md +0 -0
  316. /package/{.agent-src → docs}/guidelines/agent-infra/memory-access.md +0 -0
  317. /package/{.agent-src → docs}/guidelines/agent-infra/naming.md +0 -0
  318. /package/{.agent-src → docs}/guidelines/agent-infra/output-patterns.md +0 -0
  319. /package/{.agent-src → docs}/guidelines/agent-infra/review-routing-data-format.md +0 -0
  320. /package/{.agent-src → docs}/guidelines/agent-infra/role-contracts.md +0 -0
  321. /package/{.agent-src → docs}/guidelines/agent-infra/role-mode-router.md +0 -0
  322. /package/{.agent-src → docs}/guidelines/agent-infra/runtime-layer.md +0 -0
  323. /package/{.agent-src → docs}/guidelines/agent-infra/self-improvement-pipeline.md +0 -0
  324. /package/{.agent-src → docs}/guidelines/agent-infra/size-and-scope.md +0 -0
  325. /package/{.agent-src → docs}/guidelines/agent-infra/tool-integration.md +0 -0
  326. /package/{.agent-src → docs}/guidelines/e2e/playwright.md +0 -0
  327. /package/{.agent-src → docs}/guidelines/php/api-design.md +0 -0
  328. /package/{.agent-src → docs}/guidelines/php/artisan-commands.md +0 -0
  329. /package/{.agent-src → docs}/guidelines/php/blade-ui.md +0 -0
  330. /package/{.agent-src → docs}/guidelines/php/controllers.md +0 -0
  331. /package/{.agent-src → docs}/guidelines/php/database.md +0 -0
  332. /package/{.agent-src → docs}/guidelines/php/eloquent.md +0 -0
  333. /package/{.agent-src → docs}/guidelines/php/flux.md +0 -0
  334. /package/{.agent-src → docs}/guidelines/php/general.md +0 -0
  335. /package/{.agent-src → docs}/guidelines/php/jobs.md +0 -0
  336. /package/{.agent-src → docs}/guidelines/php/livewire.md +0 -0
  337. /package/{.agent-src → docs}/guidelines/php/logging.md +0 -0
  338. /package/{.agent-src → docs}/guidelines/php/naming.md +0 -0
  339. /package/{.agent-src → docs}/guidelines/php/patterns/dependency-injection.md +0 -0
  340. /package/{.agent-src → docs}/guidelines/php/patterns/dtos.md +0 -0
  341. /package/{.agent-src → docs}/guidelines/php/patterns/events.md +0 -0
  342. /package/{.agent-src → docs}/guidelines/php/patterns/factory.md +0 -0
  343. /package/{.agent-src → docs}/guidelines/php/patterns/pipelines.md +0 -0
  344. /package/{.agent-src → docs}/guidelines/php/patterns/policies.md +0 -0
  345. /package/{.agent-src → docs}/guidelines/php/patterns/repositories.md +0 -0
  346. /package/{.agent-src → docs}/guidelines/php/patterns/service-layer.md +0 -0
  347. /package/{.agent-src → docs}/guidelines/php/patterns/strategy.md +0 -0
  348. /package/{.agent-src → docs}/guidelines/php/patterns.md +0 -0
  349. /package/{.agent-src → docs}/guidelines/php/performance.md +0 -0
  350. /package/{.agent-src → docs}/guidelines/php/resources.md +0 -0
  351. /package/{.agent-src → docs}/guidelines/php/security.md +0 -0
  352. /package/{.agent-src → docs}/guidelines/php/sql.md +0 -0
  353. /package/{.agent-src → docs}/guidelines/php/validations.md +0 -0
  354. /package/{.agent-src → docs}/guidelines/php/websocket.md +0 -0
@@ -1,8 +1,10 @@
1
1
  ---
2
- type: "always"
3
- description: "User interaction — numbered options, progress indicators, summaries"
4
- alwaysApply: true
2
+ type: "auto"
3
+ description: "Asking the user a question, presenting options, or summarizing progress — numbered-options Iron Law, single-recommendation rule, progress indicators"
4
+ alwaysApply: false
5
5
  source: package
6
+ load_context:
7
+ - .agent-src.uncompressed/contexts/communication/rules-auto/user-interaction-mechanics.md
6
8
  ---
7
9
 
8
10
  # User Interaction
@@ -55,7 +57,7 @@ recommendation line is mandatory.
55
57
  - Hiding behind "you know the project better"
56
58
  - Inline `(recommended)` tag with no follow-up `Recommendation: N` line
57
59
 
58
- **Slip handling — same protocol as [`language-and-tone`](language-and-tone.md#when-the-user-calls-out-a-language-slip).**
60
+ **Slip handling — same protocol as [`language-and-tone`](language-and-tone.md#slip-handling).**
59
61
  User calls out a missing or wrong recommendation → acknowledge once
60
62
  in the user's language, rewrite the reply with a recommendation,
61
63
  ship. No "from now on" promises — only the next reply proves
@@ -84,12 +86,11 @@ Mechanical backstop: `python3 scripts/check_reply_consistency.py --stdin < draft
84
86
  (non-zero exit on any rule above). Self-scan is the primary gate; the
85
87
  script is the deterministic safety net for ambiguous cases.
86
88
 
87
- ### Common failure modes known, named, no excuses
88
-
89
- - **End-of-turn menu skipped.** Reply answers the question fine, then ends with `> 1. Foo > 2. Bar > 3. Stop` and no `Empfehlung:`. Iron Law 1 was violated — these are numbered options, position is irrelevant.
90
- - **"Genuinely no preference" hedge.** Pick anyway. The agent has more context than the user on the trade-off; refusing to pick dumps the work back. Pick the safest option, name the flip-condition.
91
- - **"User knows the project better" hedge.** Same failure mode, different costume. The user asked for an opinion by virtue of accepting the options block; deliver it.
92
- - **Multi-block reply with one recommendation.** Two options blocks but only one `Empfehlung:` line — the second block is unguarded. Rule 5 above closes this.
89
+ Common failure modes (end-of-turn menu skipped, "no preference"
90
+ hedges, multi-block reply with one recommendation) and the named
91
+ slip catalog live in
92
+ [`contexts/communication/rules-auto/user-interaction-mechanics.md`](../contexts/communication/rules-auto/user-interaction-mechanics.md)
93
+ § Common failure modes.
93
94
 
94
95
  ## Numbered Options — Always
95
96
 
@@ -117,65 +118,9 @@ just a number (e.g., `1`) instead of typing a sentence.
117
118
  - **Use the user's language** for the question and options.
118
119
  - **Accept both** the number and a natural language answer (e.g., "1" or "the first one").
119
120
 
120
- ### Examples
121
-
122
- **Binary choice:**
123
-
124
- ```
125
- > 1. Interactive — ask before each comment
126
- > 2. Automatic — handle all independently
127
-
128
- **Recommendation: 1 — Interactive** — the comments touch security-sensitive code,
129
- so a wrong auto-fix is more expensive than approving each one. Caveat: flip to 2
130
- if the comments turn out to be pure formatting.
131
- ```
132
-
133
- **Multiple choice with skip:**
134
-
135
- ```
136
- > 1. Fix the code
137
- > 2. Fix the test
138
- > 3. Skip
139
-
140
- **Recommendation: 1 — Fix the code** — the test asserts the documented behaviour;
141
- the production code drifted from the contract. Caveat: pick 2 only if the contract
142
- itself is wrong.
143
- ```
144
-
145
- **Confirmation with context:**
146
-
147
- ```
148
- > Found PR #1399 on branch `chore/refactor-agent-setup-2`.
149
- >
150
- > 1. Yes, that's the right PR
151
- > 2. No, different PR — I'll provide the URL
121
+ ### Examples and "when NOT to use" — see mechanics
152
122
 
153
- **Recommendation: 1 Yes** the branch name matches the PR title exactly.
154
- Caveat: flip to 2 if the PR was reopened from a different branch.
155
- ```
156
-
157
- ### When NOT to use numbered options
158
-
159
- - **Open-ended questions** where the answer is free text (e.g., "What should the class be named?").
160
- - **Simple yes/no** can use numbered options OR accept "ja"/"nein" directly.
161
- Even for yes/no, prefer numbered options if there's additional context to show.
162
-
163
- ## Progress Indicators
164
-
165
- When processing multiple items (e.g., review comments, test failures), show progress:
166
-
167
- ```
168
- **Comment 3/7** — `filename.php:42`
169
- ```
170
-
171
- ## Summaries
172
-
173
- After completing a batch of actions, provide a summary table:
174
-
175
- ```
176
- | # | File | Action |
177
- |---|---|---|
178
- | 1 | `file.php` | Fixed null check |
179
- | 2 | `test.php` | Updated assertion |
180
- | 3 | `config.php` | Skipped (intentional) |
181
- ```
123
+ Worked examples (binary choice, multiple choice with skip,
124
+ confirmation with context), the "when NOT to use numbered options"
125
+ catalog, progress indicators, and summary-table patterns live in
126
+ [`contexts/communication/rules-auto/user-interaction-mechanics.md`](../contexts/communication/rules-auto/user-interaction-mechanics.md).
@@ -3,6 +3,8 @@ type: "always"
3
3
  description: "Verify before completion — run tests and quality tools before claiming done"
4
4
  alwaysApply: true
5
5
  source: package
6
+ load_context:
7
+ - .agent-src.uncompressed/contexts/execution/verification-mechanics.md
6
8
  ---
7
9
 
8
10
  # Verify Before Completion
@@ -15,25 +17,6 @@ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
15
17
 
16
18
  If you haven't run the verification command **in this message**, you cannot claim it passes.
17
19
 
18
- ## When to run what — timing matters
19
-
20
- **Quality tools (PHPStan, Rector, ECS) run ONCE at the very end** — not after every edit.
21
- Do NOT run quality checks between tasks if you have more work to do.
22
- Only run the full quality pipeline when you are about to finish all work in the current conversation.
23
-
24
- **Tests: as targeted as possible, as little as necessary.**
25
- - During work: run ONLY the specific test class or test case affected by the change.
26
- Use `--filter=ClassName` or `--filter=test_name` — NEVER the full suite mid-work.
27
- - Only run tests when you genuinely need to verify behavior (not "just to be safe").
28
- - Full test suite: ONCE at the very end, before quality tools.
29
-
30
- **The sequence at the end:**
31
- 1. All code changes are done
32
- 2. Run tests — targeted first (`--filter`), full suite only if targeted passes
33
- 3. Run quality pipeline (PHPStan → Rector → ECS → PHPStan)
34
- 4. Fix any issues from step 2-3
35
- 5. ONLY THEN claim completion or suggest commit/push/PR
36
-
37
20
  ## The Gate
38
21
 
39
22
  Before claiming ANY work is complete:
@@ -67,54 +50,16 @@ Skip any step = the claim is unverified.
67
50
  For specific commands → see the `quality-tools` skill.
68
51
 
69
52
  For the detailed evidence-gate playbook (claim→command mapping, output
70
- inspection, end-of-work sequence) → see the `verify-before-complete`
53
+ inspection, end-of-work sequence) → see the `verify-completion-evidence`
71
54
  skill.
72
55
 
73
- ## Minimum verification per task type
74
-
75
- | Task | Required evidence |
76
- |---|---|
77
- | Code change | Tests + PHPStan |
78
- | New feature | Tests + PHPStan + smoke test |
79
- | Bug fix | Regression test + full suite |
80
- | Refactoring | Full suite + PHPStan + Rector |
81
- | Config/migration | Relevant tests or command output |
82
- | API endpoint | curl/HTTP response output |
83
- | Documentation only | No verification needed |
84
-
85
- **Never accept** as proof: "should work", "looks correct", "logic is sound".
86
- No captured output = not verified.
87
-
88
- ## Confidence gating
89
-
90
- State confidence explicitly before claiming completion on non-trivial work.
91
-
92
- - **High** — runtime path read end-to-end, relevant tests inspected or run,
93
- no hidden side-effects (queues/events/observers) unaccounted for.
94
- - **Medium** — main path verified but one gap remains; list the gap in the
95
- completion message.
96
- - **Low** — broad implementation NOT allowed; switch to analysis, narrow
97
- the scope, or ask the user before proceeding.
98
-
99
- For high-risk areas (auth, tenancy, migrations, queues, dependencies,
100
- external APIs, data exposure), "high" requires tests AND a cross-layer
101
- read — not inference from a single file.
102
-
103
- ## Break-glass reduction
104
-
105
- During a live production incident the verification gate is **narrowed**,
106
- never skipped. Break-glass requires explicit user invocation (e.g.
107
- `break-glass: true`, "this is a hotfix"). Never enter it unilaterally.
108
-
109
- Minimum evidence:
110
-
111
- - **Targeted test(s)** covering the exact regression — zero tests is not
112
- acceptable.
113
- - **Smoke check** of the fixed path (curl, manual trigger, log tail) with
114
- output captured in the message.
115
- - **Explicit list of skipped validations** and a **follow-up commitment**
116
- (ticket or PR line) to run them within 24h.
56
+ ## Mechanics when to run what, per-task evidence, confidence, break-glass
117
57
 
118
- Completion wording: _"hotfix applied, full verification deferred per
119
- break-glass"_ never _"done"_ or _"verified"_. The normal gate resumes
120
- on the follow-up PR.
58
+ The decision logic for **when** to run quality tools vs. tests, the
59
+ per-task-type minimum-evidence table, confidence gating (High /
60
+ Medium / Low), and the break-glass reduction during live incidents
61
+ all live in
62
+ [`verification-mechanics`](../contexts/execution/verification-mechanics.md).
63
+ The Iron Law and the Gate above are the obligation surface; the
64
+ mechanics context is the lookup material the agent pulls when the
65
+ gate fires.
@@ -44,17 +44,21 @@ from pathlib import Path
44
44
 
45
45
  CHECKBOX_RE = re.compile(r"^\s*[-*]\s+\[([ xX~\-])\]\s", re.MULTILINE)
46
46
  # H2 or H3 heading starting with "Phase <id>"; separator (colon, em-dash,
47
- # hyphen, or whitespace) and name are optional. The id supports three
47
+ # hyphen, or whitespace) and name are optional. The id supports four
48
48
  # project-level conventions:
49
49
  # - numeric `Phase 0`, `Phase 10`
50
+ # - numeric+sub `Phase 2a`, `Phase 10c` (digit run + single
51
+ # lowercase letter for sub-phases)
50
52
  # - roman I..XXXIX `Phase I`, `Phase III`
51
53
  # - letter track `Phase A`, `Phase B1` (single uppercase letter,
52
54
  # optional trailing digits for sub-track IDs)
53
55
  # Roman is capped at [IVX]+ (up to XXXIX) on purpose: the broader
54
56
  # [IVXLCDM]+ would also match all-caps words like `Phase LIVE`. Letter
55
57
  # is [A-Z] not [A-Za-z] so `## Phase overview` stays a non-phase anchor.
58
+ # The numeric+sub branch keeps the lowercase-letter restriction so
59
+ # `Phase abc` (no digits) still falls through to the rejection branch.
56
60
  PHASE_RE = re.compile(
57
- r"^(#{2,3})\s+Phase\s+(\d+|[IVX]+|[A-Z](?:\d+)?)"
61
+ r"^(#{2,3})\s+Phase\s+(\d+[a-z]?|[IVX]+|[A-Z](?:\d+)?)"
58
62
  r"(?:[\s:\u2014\-]+(.*?))?\s*$",
59
63
  re.MULTILINE,
60
64
  )
@@ -74,8 +78,9 @@ DRAFT_VALUES = frozenset({"draft"})
74
78
  @dataclass
75
79
  class PhaseStats:
76
80
  # Phase identifier as it appears in the heading: numeric ("0"),
77
- # roman ("III"), or letter-track ("A", "B1"). Kept as a string so
78
- # non-numeric conventions survive round-tripping through render().
81
+ # numeric+sub ("2a"), roman ("III"), or letter-track ("A", "B1").
82
+ # Kept as a string so non-numeric conventions survive round-tripping
83
+ # through render().
79
84
  id: str
80
85
  name: str
81
86
  done: int = 0
@@ -0,0 +1,335 @@
1
+ ---
2
+ name: ai-council
3
+ description: "Use when polling external AIs (OpenAI, Anthropic) outside the host session for a neutral second opinion on a roadmap, diff, prompt, or file set — or 'cross-check with another model'."
4
+ source: package
5
+ ---
6
+
7
+ > **Experimental.** AI Council is not yet validated by external users. API costs apply per consultation.
8
+
9
+ # ai-council
10
+
11
+ ## When to use
12
+
13
+ * The host agent has drafted a roadmap, plan, or design and wants an
14
+ **external** critique that is not biased by its own framing.
15
+ * The user asks "what would Claude / GPT say about this?" or invokes
16
+ `/council`.
17
+ * A PR diff or commit range needs a second-opinion review beyond the
18
+ internal four-judge pass.
19
+ * A free-form proposal benefits from being challenged by an outside
20
+ reviewer before it calcifies into work.
21
+
22
+ Do NOT use when:
23
+
24
+ * The decision is internal-only and budget matters more than diversity
25
+ of opinion → use `subagent-orchestration` (in-session, no network,
26
+ no money).
27
+ * The artefact contains secrets that cannot be redacted with the
28
+ bundler's pattern set → ask the user before sending.
29
+ * The user has not configured any council member → state that and stop;
30
+ do not silently fall back to anything.
31
+
32
+ ## Goal
33
+
34
+ Bring in **independent** external models to critique a project
35
+ artefact. Independent means: the council members never see the host
36
+ agent's reasoning, internal state, or framing language — only the
37
+ artefact (roadmap, diff, prompt, file set) plus a neutral system
38
+ prompt that asks them to think on their own merits.
39
+
40
+ ## Neutrality guidelines (Iron Law)
41
+
42
+ ```
43
+ THE COUNCIL DOES NOT SEE THE HOST AGENT'S ANALYSIS.
44
+ THE COUNCIL DOES NOT SEE PRIOR REPLIES.
45
+ THE COUNCIL SEES THE ARTEFACT + THE NEUTRAL SYSTEM PROMPT. NOTHING ELSE.
46
+ ```
47
+
48
+ If you find yourself wanting to "frame" the artefact for the council,
49
+ stop. Framing is exactly what kills the second-opinion value. Use the
50
+ unbiased system prompts in `scripts/ai_council/prompts.py`; do not
51
+ roll your own.
52
+
53
+ ### Neutrality — context-handoff
54
+
55
+ External reviewers do better critique when they know **what the
56
+ project is**, not just what the artefact looks like. The council
57
+ ships a neutral **handoff preamble** (modelled on `/agent-handoff`)
58
+ in front of every member's system prompt, assembled by
59
+ `prompts.handoff_preamble(project, original_ask)`:
60
+
61
+ | Carried | Forbidden |
62
+ |---|---|
63
+ | Project name (from `composer.json` / `package.json` / repo dir) | Host-agent identity (Augment, Claude Code, Cursor, Cline, Windsurf, Copilot agent) — stripped line-by-line before send |
64
+ | Stack one-liner inferred from manifest files | Host-agent reasoning, prior turns, internal analysis |
65
+ | One paragraph of repo purpose from `README.md` (max 400 chars) | Host-agent framing language ("I think this looks weak", "the user probably wants…") |
66
+ | The user's **original ask** verbatim (the free-form sentence that triggered `/council`) | Anything the host agent generated about the artefact |
67
+
68
+ `detect_project_context()` in `scripts/ai_council/project_context.py`
69
+ reads only the manifest files + root README; missing fields collapse
70
+ to `None` and the preamble silently omits the line. With both
71
+ `project=None` and `original_ask=""`, the preamble degrades to the
72
+ bare `NEUTRALITY_PREAMBLE` (v1 shape — back-compat for callers that
73
+ have not migrated yet).
74
+
75
+ ## Execution modes
76
+
77
+ A council member can run in one of three transports. The neutrality
78
+ preamble is identical across all of them — only the path the bytes
79
+ travel changes.
80
+
81
+ | Mode | Client | Billable | Transport | Status |
82
+ |---|---|---|---|---|
83
+ | `api` | `AnthropicClient` / `OpenAIClient` | yes | provider SDK + key from `~/.config/agent-config/<provider>.key` | shipped |
84
+ | `manual` | `ManualClient` | no | `stdout` (prompt block) + `stdin` (user pastes the web-UI reply, terminated by a line containing only `END`) | shipped (Phase 2b) |
85
+ | `playwright` | `PlaywrightClient` | no | persistent-profile browser at the provider's chat URL via DOM adapter | reserved (Phase 2c — capture-only) |
86
+
87
+ Resolution lives in `scripts/ai_council/modes.py`:
88
+ `resolve_mode(name, invocation_mode, member_settings, global_mode)`
89
+ with precedence **invocation flag > per-member setting > global
90
+ setting > default (`api`)**. Whitespace-and-case insensitive; empty
91
+ strings fall through; unknown values raise `InvalidModeError` with
92
+ the offending settings path (`ai_council.mode`,
93
+ `ai_council.members.<name>.mode`, or `/council mode=`).
94
+
95
+ ### Manual-mode UX
96
+
97
+ `ManualClient` is the user-as-transport variant: the agent prints
98
+ one Markdown block per member (system prompt + handoff preamble +
99
+ artefact between two `═` rules), the user pastes it into a web
100
+ chat (Claude.ai, ChatGPT, Gemini), then pastes the reply back
101
+ ending with a line containing only `END`. After each reply, a 1/2/3
102
+ menu surfaces:
103
+
104
+ 1. More feedback for this member (continue this thread)
105
+ 2. Done with this member, move to the next
106
+ 3. Abort the council run
107
+
108
+ `1` re-emits a follow-up block addressed to the **same chat
109
+ thread** (no system prompt repetition). `2` records the round and
110
+ moves to the next member. `3` returns `error="manual_aborted"` for
111
+ that member and the orchestrator stops the fan-out.
112
+
113
+ ### Cost-gate bypass for non-billable members
114
+
115
+ `ExternalAIClient.billable` is the contract. Clients with
116
+ `billable=False` (today: `ManualClient`; future: `PlaywrightClient`)
117
+ bypass the cost gate entirely — the orchestrator skips the
118
+ projection check, the `on_overrun` callback, and the USD-budget
119
+ short-circuit for that member, but still records the response's
120
+ token counts (from the manual-paste length heuristic or the
121
+ provider's reply, when available) for observability. Mixed runs
122
+ (one manual + one api) gate only the api members.
123
+
124
+ ## Procedure
125
+
126
+ 1. **Resolve target.** Identify the artefact mode (`prompt`, `roadmap`,
127
+ `diff`, `files`) and locate the source. Refuse to proceed if the
128
+ target is ambiguous.
129
+ 2. **Bundle + redact.** Call `scripts/ai_council/bundler.py` to produce
130
+ a redacted artefact bundle. If `BundleTooLarge` fires, surface the
131
+ size and ask the user to narrow scope — do NOT truncate silently.
132
+ 3. **Confirm spend.** Before any network call, surface members + cost
133
+ ceiling and require an explicit user `1` to proceed. Autonomy
134
+ settings do not override this gate.
135
+ 4. **Fan out.** Dispatch the bundle to each enabled council member via
136
+ `scripts/ai_council/orchestrator.py`. Each member receives the
137
+ neutrality preamble from `prompts.py` plus the artefact — nothing
138
+ from the host agent's prior reasoning.
139
+ 5. **Render results.** Stack each member's response under its own
140
+ provider-attributed heading. Never merge or paraphrase responses
141
+ into the host agent's voice.
142
+ 6. **Summarise.** Write a `Convergence / Divergence` block listing
143
+ agreements, disagreements, and unique insights — provider-attributed.
144
+ 7. **Translate to options.** Convert actionable council suggestions
145
+ into concrete numbered options for the user. The user decides;
146
+ the council advises.
147
+
148
+ ## Output format
149
+
150
+ Every council reply MUST contain, in this order:
151
+
152
+ 1. **Header line** with mode, member count, and total token cost.
153
+ 2. **One section per member**, titled `### <provider> · <model>`,
154
+ containing the member's verbatim output.
155
+ 3. **Convergence / Divergence summary** — bullet list, every claim
156
+ attributed by provider name.
157
+ 4. **User-facing options** — numbered block per `user-interaction`,
158
+ with "discard council input" always present as an option.
159
+
160
+ The host agent NEVER ships council output as its own reasoning.
161
+ Provider attribution stays visible in every render.
162
+
163
+ ## Do NOT
164
+
165
+ - Do NOT paraphrase council output into the host agent's voice — strip
166
+ attribution and you've stripped the value.
167
+ - Do NOT pre-warm the council with the host agent's analysis or
168
+ identity — that primes the reviewer and collapses diversity.
169
+ - Do NOT silently truncate a too-large bundle — surface the size and
170
+ ask for narrower scope.
171
+ - Do NOT auto-spend tokens under `personal.autonomy: on` — the cost
172
+ gate fires every time, no exceptions.
173
+ - Do NOT reuse SDK clients across invocations — re-load keys via
174
+ `load_*_key()` each call.
175
+
176
+ ## Gotchas
177
+
178
+ Real failure modes seen in the wild:
179
+
180
+ - **Bias-by-framing:** agent pastes "I think X is the right answer,
181
+ what do you think?" → council rubber-stamps. Symptom: 100%
182
+ convergence, zero unique insight. Fix: send artefact only, neutral
183
+ preamble, no host reasoning.
184
+ - **Silent budget overrun:** `cost_budget_exceeded` mid-fan-out, agent
185
+ retries one member to "complete" the council. Result: skewed sample,
186
+ hidden spend. Fix: surface partial result, stop, ask user.
187
+ - **Identity leak:** roadmap text contains "the agent decided…" —
188
+ reviewer infers host model and mirrors it. Fix: redact host-agent
189
+ identity strings before bundling.
190
+
191
+ | Anti-pattern | Why it's wrong | Correct approach |
192
+ |---|---|---|
193
+ | "Pre-warm" the council with the agent's own analysis. | Bias attack — collapses the reviewer to a yes-man. | Send the artefact text only. |
194
+ | Paste the host-agent identity ("I am Augment / Claude Code…") | Identity primes the reviewer's model. | Neutrality preamble in `prompts.py` already handles this. |
195
+ | Silently truncate a too-large bundle. | Misleads the reviewer into thinking they saw the whole thing. | Bundler raises `BundleTooLarge`; surface and ask for narrower scope. |
196
+ | Reuse the same SDK client across calls without re-loading the key. | Leaks the key in long-lived process state. | Each invocation builds fresh clients from `load_*_key()`. |
197
+ | Auto-spend tokens under `personal.autonomy: on`. | Autonomy ≠ permission to spend money. | Always ask before consultation, even under autonomy. |
198
+
199
+ ## Redaction expectations
200
+
201
+ The bundler's redaction pass strips:
202
+
203
+ - Paths matching `~/.config/agent-config/*.key`.
204
+ - Lines starting with `Authorization:`.
205
+ - `key = …`, `secret = …`, `token = …`, `password = …` assignments.
206
+ - `sk-ant-…` and `sk-…` token-like strings.
207
+
208
+ If your artefact contains other sensitive data (customer names,
209
+ internal hostnames, contractual prose) you are responsible for
210
+ scrubbing it before bundling. The redaction pass is a **floor**, not
211
+ a ceiling.
212
+
213
+ ## Cost awareness
214
+
215
+ Every consultation hits a paid API. The orchestrator enforces
216
+ per-invocation caps from `ai_council.cost_budget`:
217
+
218
+ - `max_input_tokens` / `max_output_tokens` — token caps across all members.
219
+ - `max_total_usd` — per-invocation USD ceiling. `0` disables the USD ceiling (token caps still apply).
220
+ - `max_calls` — maximum number of council members per invocation.
221
+ - `daily_limit_usd` — rolling 24h spend cap across all `/council`
222
+ invocations. `0` disables. Persists in
223
+ `~/.config/agent-config/council-spend.jsonl` (mode 0600). Breach
224
+ fires `on_overrun(event)` with `event.breach_kind == "daily"` and,
225
+ if the callback returns False or is absent, tags the member
226
+ `daily_budget_exceeded` instead of `cost_budget_exceeded`.
227
+
228
+ Prices come from `.agent-prices.md` (gitignored, refreshed weekly).
229
+ The pricing module bootstraps it from `_default_prices.py` on first
230
+ use and flags it stale when older than the most recent Monday 00:00
231
+ UTC.
232
+
233
+ ### Pre-call estimate format
234
+
235
+ Before the cost gate, compute `orchestrator.estimate(question, members,
236
+ table)` and render a per-member table. Heuristic: `len(text) / 4` for
237
+ input, member's `max_tokens` ceiling for output (actual spend is
238
+ usually lower).
239
+
240
+ > External council call — billable
241
+ >
242
+ > Mode: roadmap · Target: `agents/roadmaps/<name>.md` (~3 KB after redaction)
243
+ >
244
+ > | member | est. in / out tokens | est. USD |
245
+ > |---------------------------------|---------------------:|---------:|
246
+ > | anthropic / claude-sonnet-4-5 | ~750 / 1024 | $0.0176 |
247
+ > | openai / gpt-4o | ~750 / 1024 | $0.0121 |
248
+ > | **total** | | **$0.0297** |
249
+ >
250
+ > Budget: 50k in / 20k out tokens · USD ceiling: $0.50
251
+ >
252
+ > 1. Run the consultation
253
+ > 2. Cancel
254
+
255
+ ### Stale price-table gate
256
+
257
+ If `pricing.is_stale(table)` returns true, ask before proceeding:
258
+
259
+ > Price table is stale (last_updated: YYYY-MM-DD)
260
+ > 1. Refresh now (`python3 scripts/update_prices.py`)
261
+ > 2. Continue with the stale table
262
+ > 3. Cancel
263
+
264
+ Do not silently auto-refresh — the user keeps control.
265
+
266
+ ### Mid-flow overrun callback (`on_overrun`)
267
+
268
+ The orchestrator runs members **sequentially**. Before each member
269
+ whose projected spend would breach a cap, it invokes the
270
+ `on_overrun(event)` callback. The callback returns `True` to proceed
271
+ with that member (raises the effective ceiling for THIS call only)
272
+ or `False` to skip and record `cost_budget_exceeded`. The callback
273
+ fires again for every subsequent breaching member — the user keeps
274
+ control on each step.
275
+
276
+ > Cost budget overrun — pausing before next member
277
+ >
278
+ > Member: openai / gpt-4o (member 2 of 2)
279
+ > Already spent: ~620 in / ~480 out tokens · $0.0094
280
+ > Next call estimate: ~750 in / 1024 out tokens · $0.0121
281
+ > **Projected total after this call: $0.0215** (ceiling: $0.0150)
282
+ >
283
+ > 1. Continue with this member
284
+ > 2. Skip this member (records `cost_budget_exceeded`, continues with the rest)
285
+
286
+ Without `on_overrun`, breaching short-circuits all remaining members
287
+ (v1 fallback). Do not retry silently. Surface the partial result and
288
+ ask the user.
289
+
290
+ ## Multi-round debate (`rounds:N`)
291
+
292
+ `consult(..., rounds=N)` enables 2-3 round critique loops. Round 1
293
+ runs the standard single-round flow. Round 2+ rebuilds the user
294
+ prompt as `<original artefact> + <prior round, anonymised>` so each
295
+ member can refine, agree, or push back on the previous critique
296
+ without seeing which provider produced which point.
297
+
298
+ | Property | Behaviour |
299
+ |---|---|
300
+ | Anonymisation | Provider/model identity is stripped. Reviewers are labelled `Reviewer A / B / C…` in input order. |
301
+ | Errored prior responses | Skipped — they reveal nothing useful and can leak provider error formats. |
302
+ | Cost budget | Accumulates across rounds. A round-2 call that breaches the cap fires `on_overrun` exactly like a round-1 breach. |
303
+ | Daily limit | Same — every billable round-2 call records spend in the rolling 24h ledger. |
304
+ | Return value | Final round only. Use `on_round_complete(round_idx, responses)` to capture intermediate rounds for rendering. |
305
+
306
+ > Iron Law: anonymisation is non-negotiable. If you ever need to
307
+ > surface "which model said what" between rounds, that is a different
308
+ > feature — debug-only, off by default, never enabled in user-facing
309
+ > output. The neutrality contract dies the moment a member learns it
310
+ > is talking to Claude vs GPT in round 2.
311
+
312
+ Pre-call estimate must surface the round count: total = `N × single-round cost`. Render inline:
313
+
314
+ ```
315
+ External council call — billable · 2 rounds
316
+ Round 1: artefact only
317
+ Round 2: artefact + anonymised round 1 critiques
318
+
319
+ | member | per-round | × 2 |
320
+ |--------------------|----------:|--------:|
321
+ | anthropic/sonnet | $0.0176 | $0.0352 |
322
+ | openai/gpt-4o | $0.0121 | $0.0242 |
323
+ | **total** | | $0.0594 |
324
+ ```
325
+
326
+ ## See also
327
+
328
+ - `/council` command — the user-facing entry point.
329
+ - `subagent-orchestration` skill — internal multi-agent variant (no
330
+ network, no spend, but no diversity of weights either).
331
+ - `scripts/ai_council/prompts.py` — neutrality preamble + per-mode
332
+ system prompts.
333
+ - `scripts/ai_council/bundler.py` — redaction pattern set + size
334
+ guard.
335
+ - `docs/customization.md` § `ai_council.*` — settings reference.
@@ -28,8 +28,8 @@ Do NOT use when:
28
28
 
29
29
  ### What to generate
30
30
 
31
- 1. **Controller** — Single Action (invokable). Read `agents/docs/controller.md` and `.augment/guidelines/php/controllers.md`.
32
- 2. **FormRequest** — Validation rules, `authorize()` via policies. Read `.augment/guidelines/php/validations.md`.
31
+ 1. **Controller** — Single Action (invokable). Read `agents/docs/controller.md` and `../../../docs/guidelines/php/controllers.md`.
32
+ 2. **FormRequest** — Validation rules, `authorize()` via policies. Read `../../../docs/guidelines/php/validations.md`.
33
33
  3. **Resource** — JSON response transformation. Read `agents/docs/api-resources.md`.
34
34
  4. **Route** — Add to the correct versioned route file.
35
35
  5. **Policy** — If authorization is needed.
@@ -13,7 +13,7 @@ contract validation, response structure checks, or external service mocking.
13
13
 
14
14
  ## Procedure: Write API tests
15
15
 
16
- 1. **Understand the endpoint** — Read controller, form request, existing tests. Understand expected behavior and edge cases before writing anything.
16
+ 1. **Understand the endpoint** — Read the controller, form request, and existing tests. Understand expected behavior, edge cases, and auth requirements before writing anything.
17
17
  2. **Set up test data** — Use seeders (preferred) or factories. Mock external services with `Http::fake()`.
18
18
  3. **Write test cases** — Cover success, validation errors, authorization failures, edge cases.
19
19
  4. **Assert response** — Check status code, JSON structure, data values. Use `assertJsonStructure()`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: blade-ui
3
- description: "Stack-implementation skill for Laravel Blade — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Blade. Covers views, components, partials, layouts, and view logic."
3
+ description: "Use when the project's frontend stack is Blade — dispatched by `directives/ui/{apply,review,polish}.py`. Covers views, components, partials, layouts, and view logic."
4
4
  source: package
5
5
  ---
6
6
 
@@ -81,7 +81,7 @@ For every dependency, mark:
81
81
 
82
82
  ### 5. Consult engineering memory
83
83
 
84
- Via [`memory-access`](../../guidelines/agent-infra/memory-access.md) call
84
+ Via [`memory-access`](../../../docs/guidelines/agent-infra/memory-access.md) call
85
85
  `retrieve(types=["architecture-decisions", "ownership"],
86
86
  keys=<changed paths + changed symbol>, limit=5)`. Surface:
87
87
 
@@ -84,7 +84,7 @@ Gather all available evidence before forming any hypothesis:
84
84
  - Read each file in the call chain to understand the data flow.
85
85
  - Check existing context docs (`agents/contexts/`) for the affected area.
86
86
  - **Consult engineering memory.** Via
87
- [`memory-access`](../../guidelines/agent-infra/memory-access.md) call
87
+ [`memory-access`](../../../docs/guidelines/agent-infra/memory-access.md) call
88
88
  `retrieve(types=["historical-patterns", "incident-learnings"],
89
89
  keys=[<error class>, <affected file paths>], limit=3)`. A prior
90
90
  matching pattern or incident is the single most reliable accelerator