@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
@@ -1,158 +1,122 @@
1
1
  ---
2
- type: "always"
3
- description: "Suppress trivial workflow questions and act on the obvious next step; defers to non-destructive-by-default for the safety floor; never commit and never ask about committing except via /commit-in-chunks or explicit user instruction"
4
- alwaysApply: true
2
+ type: "auto"
3
+ description: "Deciding whether to ask the user or just act on a workflow step trivial-vs-blocking classification, autonomy opt-in detection, commit default; defers to non-destructive-by-default for the Hard Floor"
4
+ alwaysApply: false
5
5
  source: package
6
+ load_context:
7
+ - .agent-src.uncompressed/contexts/execution/autonomy-detection.md
8
+ - .agent-src.uncompressed/contexts/execution/autonomy-mechanics.md
9
+ - .agent-src.uncompressed/contexts/execution/autonomy-examples.md
6
10
  ---
7
11
 
8
12
  # Autonomous Execution
9
13
 
10
14
  User's time is the scarce resource. Trivial workflow questions are
11
- noise. Defines **trivial** (just act), **blocking** (still ask), the
12
- **hard floor** (always ask, no override), and the **commit default**
13
- (never commit, never ask — review-first by design).
15
+ noise. This rule defines **trivial** (just act), **blocking** (still
16
+ ask), the **hard floor** (always ask, no override), and the **commit
17
+ default** (never commit, never ask — review-first by design).
14
18
 
15
19
  ## Hard Floor — see [`non-destructive-by-default`](non-destructive-by-default.md)
16
20
 
17
- Universal safety floor (production-branch merges, deploys, pushes,
21
+ The universal safety floor (production-branch merges, deploys, pushes,
18
22
  prod data/infra, whimsical bulk deletions, and commits containing
19
23
  bulk deletions or infra changes) is governed by the canonical
20
24
  [`non-destructive-by-default`](non-destructive-by-default.md) rule.
21
-
22
- Applies regardless of `personal.autonomy`, a standing autonomy
23
- directive (anchor list in [Opt-in detection](#opt-in-detection--match-by-intent-not-exact-string)),
24
- or any roadmap authorization. Nothing in **this** rule lifts it. If a
25
- trigger from that rule fires, stop and ask — every section below
26
- assumes the floor has cleared.
25
+ It applies regardless of `personal.autonomy`, a standing autonomy
26
+ directive, or any roadmap authorization. Nothing in **this** rule
27
+ lifts it. If a trigger fires, stop and ask — every other section
28
+ below assumes the floor has already been cleared.
27
29
 
28
30
  ## Setting — `personal.autonomy`
29
31
 
30
- | Value | Behavior |
31
- |---|---|
32
- | `on` | Suppress trivial questions. Act on obvious next step. Still ask on blocking decisions; ALWAYS ask on Hard-Floor triggers. |
33
- | `off` | Ask trivial questions too. Use to check in on each workflow step. |
34
- | `auto` (default) | Like `off` until user expresses "stop asking, just work" — then `on` for the rest of the chat. See **Opt-in detection** below; match by **intent**, not exact string. The flip never lifts the Hard Floor. |
35
-
36
- Read once on first turn (per [`layered-settings`](../guidelines/agent-infra/layered-settings.md#section-aware-merge-rules))
37
- and cache. Missing key → treat as `on`.
32
+ Three values: `on` (suppress trivial questions), `off` (ask trivial
33
+ questions too), `auto` (default — same as `off` until the user opts
34
+ in via a standing autonomy directive). Read once on the first turn
35
+ (per [`layered-settings`](../../docs/guidelines/agent-infra/layered-settings.md#section-aware-merge-rules))
36
+ and cache. Missing key treat as `on`. Full table, semantics, and
37
+ cloud behavior:
38
+ [`contexts/execution/autonomy-mechanics.md`](../contexts/execution/autonomy-mechanics.md).
38
39
 
39
40
  ## Opt-in detection — match by intent, not exact string
40
41
 
41
- In `auto`, flip to `on` for the rest of the chat when the user expresses
42
- **"stop asking on trivial steps, just work"**. Recognize the **intent**,
43
- not the literal substring semantic equivalent in either language.
44
-
45
- Anchor examples (illustrative, not exhaustive):
46
-
47
- - DE: "arbeite selbstständig" · "frag nicht jedes Mal" · "tue es einfach"
48
- - EN: "work autonomously" · "don't ask" · "just do it"
49
-
50
- Litmus test: standing permission to skip trivial questions? → flip.
51
- Single-decision delegation ("you decide for this step") → handle that
52
- step, do **not** flip standing mode.
53
-
54
- ### Speech-act check — meta-instruction, not content
55
-
56
- Before flipping, verify the phrase is **addressed to the agent as
57
- guidance about how to work**, not a literal substring inside another
58
- instruction. Do **not** flip when the phrase is:
59
-
60
- - **Content / copy** — "Put the slogan 'just do it' on the landing page."
61
- - **Quote / reference** — "Nike's tagline is 'just do it' — write a blog post."
62
- - **Subject of a request** — "Write docs about the 'work autonomously' modes."
63
- - **Code / data** — string literals, fixtures, translations, JSON.
64
- - **About a third party** — "My colleague works autonomously."
65
- - **Question / hypothetical** — "Should I set `don't ask` as the default?"
66
-
67
- Heuristic: strip quotes, code blocks, embedded content. Read what's
68
- **left**. Still a directive to the agent about its working style →
69
- flip. Otherwise → don't.
70
-
71
- Opt-out (reversed intent) flips back to `off`:
42
+ In `auto` mode, flip to `on` for the rest of the conversation when
43
+ the user expresses **"stop asking on trivial steps, just work"**.
44
+ Recognize **intent**, not the literal substring. Opt-out (same intent,
45
+ reversed) flips back to `off`. Both directions are
46
+ **speech-act-checked**: the phrase must be a meta-instruction to the
47
+ agent, not content / quote / subject / code / third-party reference /
48
+ hypothetical. In doubt keep current mode, no speculative flips.
72
49
 
73
- - DE: "frag mich wieder" · "frag mich erst" · "stop autonomous mode"
74
- - EN: "ask me first" · "ask me again" · "stop being autonomous"
75
-
76
- Same speech-act check applies.
77
-
78
- Counter-examples — do **not** flip on meta-questions, self-descriptions,
79
- or one-shot delegations: "why don't you ask that yourself?", "I'm
80
- working autonomously right now", "can you decide that yourself?".
81
-
82
- In doubt → keep current mode, no speculative flips.
50
+ Algorithm and speech-act heuristic:
51
+ [`contexts/execution/autonomy-detection.md`](../contexts/execution/autonomy-detection.md).
52
+ Anchor phrases (DE+EN), no-flip patterns, counter-examples:
53
+ [`contexts/execution/autonomy-examples.md`](../contexts/execution/autonomy-examples.md).
83
54
 
84
55
  ## Trivial — JUST ACT, do not ask
85
56
 
86
- Examples (matches `personal.autonomy: on` or `auto`-after-opt-in):
87
-
88
- - "Step 2 or Step 3?" — pick the obvious next roadmap step; if blocked, name the blocker, otherwise go.
89
- - "Commit now or after the next change?" — answered by the commit-default below.
90
- - "How should I split the commits?" — never asked; either `/commit-in-chunks` was invoked (split + commit) or it wasn't (don't commit).
91
- - "Run linter / tests now or later?" — `verify-before-complete` decides; act.
92
- - "Found 3 follow-ups — fix all or stop?" — if within scope and minimal-safe-diff allows, fix; if scope expands, stop and surface as list.
93
- - "Filename `X.md` or `Y.md`?" when one matches convention — pick convention-matching one.
94
- - "Verification table or paragraph?" — pick whichever fits; format isn't a decision worth a turn.
95
- - "Show me a diff before regenerating output from a tracked source?"
96
- — compression, code-gen, formatter passes, lock-file rebuilds — run
97
- it and report the result. Reversibility comes from the source, not
98
- from per-file confirmation. See [`non-destructive-by-default`](non-destructive-by-default.md#not-in-scope--deterministic-regeneration)
99
- § Not in scope.
100
-
101
- `personal.autonomy: off`: ask these. `on` or `auto`-after-opt-in: act.
57
+ In `personal.autonomy: on` or `auto`-after-opt-in, do not ask
58
+ trivial workflow questions — pick the obvious next step and proceed.
59
+ In `personal.autonomy: off`, ask them. Worked cases:
60
+ [`contexts/execution/autonomy-examples.md`](../contexts/execution/autonomy-examples.md).
102
61
 
103
62
  ## Blocking — STILL ASK regardless of `personal.autonomy`
104
63
 
105
- Beyond the Hard Floor, the autonomy setting also never overrides:
64
+ Beyond the Hard Floor above, the autonomy setting also never
65
+ overrides:
106
66
 
107
- - **Vague-request triggers** in [`ask-when-uncertain`](ask-when-uncertain.md) — ambiguous stays ambiguous; pick-one-and-pray is wrong.
108
- - **Architectural / structural choices** the codebase hasn't settled (multi-stack picks, library introductions).
67
+ - **Vague-request triggers** in [`ask-when-uncertain`](ask-when-uncertain.md)
68
+ ambiguous requirements stay ambiguous; pick-one-and-pray is wrong.
69
+ - **Architectural / structural choices** that the codebase doesn't
70
+ already settle (multi-stack picks, library introductions).
109
71
  - **Security-sensitive paths** — see [`security-sensitive-stop`](security-sensitive-stop.md).
110
- - **Scope expansion** beyond stated task — see [`scope-control`](scope-control.md).
111
- - **Remote-state ops** — push, merge, rebase, force-push, branch create/delete/switch, PR create/close/retarget, tag/release. Permission-gated by [`scope-control`](scope-control.md); the prod-trunk and deploy-tied subset is governed by [`non-destructive-by-default`](non-destructive-by-default.md).
112
- - **Destructive ops** — see [`non-destructive-by-default`](non-destructive-by-default.md) for the full taxonomy (whimsical bulk deletions, content destruction, commits containing bulk deletions or infra changes).
113
-
114
- In doubt blocking. Ask.
72
+ - **Scope expansion** beyond the stated task — see [`scope-control`](scope-control.md).
73
+ - **Remote-state operations** — push, merge, rebase, force-push,
74
+ branch create/delete/switch, PR create/close/retarget, tag/release.
75
+ Permission-gated by [`scope-control`](scope-control.md); the
76
+ prod-trunk and deploy-tied subset is governed by
77
+ [`non-destructive-by-default`](non-destructive-by-default.md).
78
+ - **Destructive ops** — see [`non-destructive-by-default`](non-destructive-by-default.md)
79
+ for the full taxonomy (whimsical bulk deletions, content
80
+ destruction, commits containing bulk deletions or infra changes).
81
+
82
+ When in doubt whether something is trivial or blocking → it is
83
+ blocking. Ask.
115
84
 
116
85
  ## Commit policy — see [`commit-policy`](commit-policy.md)
117
86
 
118
- Committing is governed by [`commit-policy`](commit-policy.md), which
119
- applies regardless of `personal.autonomy`. Summary:
87
+ Committing is governed by the canonical [`commit-policy`](commit-policy.md)
88
+ rule, which applies regardless of `personal.autonomy`. Summary:
120
89
 
121
90
  - NEVER commit unless user said so this turn, a commit command was
122
91
  invoked, a standing instruction is active, or the roadmap authorizes it.
123
- - NEVER ask about committing.
124
- - In autonomous mode, the **only** permitted commit-related question
125
- is the one-shot pre-scan ask at the start of roadmap execution.
92
+ - NEVER ask about committing. The user invokes a command or says so.
93
+ - In autonomous mode, the **only** permitted commit-related question is
94
+ the one-shot pre-scan ask at the start of roadmap execution.
126
95
 
127
- Push, merge, rebase, branch creation, PR ops, tags remain
128
- permission-gated per [`scope-control`](scope-control.md#git-operations--permission-gated).
96
+ Push, merge, rebase, branch creation, PR operations, and tags remain
97
+ permission-gated by [`scope-control`](scope-control.md#git-operations--permission-gated).
129
98
 
130
99
  ## Failure modes
131
100
 
132
- - Asking "Step 2 or Step 3?" when the roadmap orders them.
133
- - "Should I run the CI checks?" — `verify-before-complete` decides; act.
134
- - "Do we want to commit this?" — no, by default. Don't ask.
135
- - Numbered-options block whose only difference is sequencing ("A then B" vs "B then A") with no real trade-off.
136
- - Asking after user already issued a standing autonomy directive earlier (cache the opt-in for `auto`).
137
-
138
- For Hard-Floor failure modes (treating autonomy as cover for a
139
- floor-crossing action, reading a roadmap step as deploy authorization,
140
- refusing task-aligned WIP deletions, committing bulk-deletion / infra
141
- diffs without surfacing them) see
101
+ Autonomy-side wrong-behavior patterns (sequencing-only asks, CI-run
102
+ asks, commit asks, no-trade-off option blocks, re-asking after a
103
+ standing opt-in):
104
+ [`contexts/execution/autonomy-examples.md`](../contexts/execution/autonomy-examples.md).
105
+ For Hard-Floor failure modes see
142
106
  [`non-destructive-by-default`](non-destructive-by-default.md#failure-modes).
143
107
 
144
- ## Cloud Behavior
145
-
146
- Settings reads degrade gracefully on cloud platforms (no
147
- `.agent-settings.yml`). Treat as `personal.autonomy: on` — user had to
148
- deliberately ship a custom skill bundle and is unlikely to want
149
- trivial-question friction.
150
-
151
108
  ## See also
152
109
 
153
- - [`non-destructive-by-default`](non-destructive-by-default.md) — universal safety floor; never overridden by autonomy
154
- - [`scope-control`](scope-control.md) git-ops permission gate (push/merge/branch/PR/tag stays explicit)
155
- - [`ask-when-uncertain`](ask-when-uncertain.md) — vague-request triggers that always require asking
156
- - [`direct-answers`](direct-answers.md) Iron Laws on brevity and no-flattery (this rule extends to no-trivial-questions)
110
+ - [`non-destructive-by-default`](non-destructive-by-default.md) —
111
+ universal safety floor; never overridden by autonomy
112
+ - [`scope-control`](scope-control.md) — git-ops permission gate
113
+ (push/merge/branch/PR/tag stays explicit)
114
+ - [`ask-when-uncertain`](ask-when-uncertain.md) — vague-request
115
+ triggers that always require asking
116
+ - [`no-cheap-questions`](no-cheap-questions.md) — mode-independent
117
+ floor against context-derived, sequencing-only, and
118
+ Iron-Law-violating asks (applies in `off` and pre-opt-in `auto` too)
119
+ - [`direct-answers`](direct-answers.md) — Iron Laws on brevity and
120
+ no-flattery (this rule extends to no-trivial-questions)
157
121
  - [`/commit-in-chunks`](../commands/commit-in-chunks.md) — auto-split and commit without confirmation
158
122
  - [`/commit`](../commands/commit.md) — split and commit with confirmation
@@ -82,7 +82,7 @@ Body: 1-paragraph **pattern** (not anecdote) + 1 concrete example.
82
82
  A learning file is the input to `learning-to-rule-or-skill`, which
83
83
  produces a proposal draft under `agents/proposals/`. The proposal is
84
84
  then gated by `scripts/check_proposal.py`; see
85
- [`self-improvement-pipeline`](../guidelines/agent-infra/self-improvement-pipeline.md).
85
+ [`self-improvement-pipeline`](../../docs/guidelines/agent-infra/self-improvement-pipeline.md).
86
86
 
87
87
  The `agents/learnings/` and `agents/proposals/` directories are
88
88
  consumer-owned — the package ships templates and schemas, never the
@@ -0,0 +1,109 @@
1
+ ---
2
+ type: "auto"
3
+ description: "Appending to .agent-chat-history — cadence boundaries (per_turn/per_phase/per_tool), turn-check ownership refusal handling, never writing the file directly; cadence is the trigger, not reply length"
4
+ alwaysApply: false
5
+ source: package
6
+ ---
7
+
8
+ <!-- cloud_safe: noop -->
9
+
10
+ # Chat History — Cadence
11
+
12
+ Owns gate 2 of the chat-history Iron Law: WHEN to call `append`.
13
+ Ownership (gate 1) lives in [`chat-history-ownership`](chat-history-ownership.md);
14
+ visibility (gate 3) lives in [`chat-history-visibility`](chat-history-visibility.md).
15
+ File I/O is owned by [`scripts/chat_history.py`](../../../scripts/chat_history.py)
16
+ — this rule decides the trigger boundaries, not the file format.
17
+
18
+ ## Iron Law — gate 2 (append at every cadence boundary)
19
+
20
+ ```
21
+ EVERY CADENCE BOUNDARY GETS ONE append CALL — WITH --first-user-msg.
22
+ SKIPPING IS A RULE VIOLATION. NEVER WRITE .agent-chat-history DIRECTLY.
23
+ ON HOOK / ENGINE PATHS, THE PLATFORM / ENGINE PERFORMS append STRUCTURALLY
24
+ — THE AGENT MUST NOT DUPLICATE.
25
+ ```
26
+
27
+ Cadence is **gated by ownership**: gate 1 (turn-check from
28
+ [`chat-history-ownership`](chat-history-ownership.md)) must have cleared
29
+ this turn before any append fires. Skip turn-check → append refuses with
30
+ exit `3` (`OWNERSHIP_REFUSED`).
31
+
32
+ ## Append cadence — boundaries
33
+
34
+ Cadence comes from `chat_history.frequency` in `.agent-settings.yml`:
35
+
36
+ - `per_turn` → one entry at the end of every agent turn.
37
+ - `per_phase` → at phase boundaries (user question answered, decision
38
+ taken, task-list item completed, significant tool sequence finished).
39
+ Pure clarification turns may skip.
40
+ - `per_tool` → after each tool-call sequence.
41
+
42
+ Every append goes through
43
+
44
+ ```bash
45
+ scripts/chat_history.py append --first-user-msg "<msg>" \
46
+ --type <user|agent|tool|decision|phase> --json '<obj>'
47
+ ```
48
+
49
+ Never write the file directly. Prefer `phase` over `agent` for boundaries.
50
+ **Cadence is the trigger, not reply length** — a one-line reply that
51
+ crosses a boundary still appends; a 200-line reply that doesn't cross
52
+ one still doesn't. **Do not batch missed turns** — crashes happen
53
+ between turns, and a batched append loses the timeline that crash
54
+ recovery depends on.
55
+
56
+ ## Ownership refusal — exit `3`
57
+
58
+ `append` exits `3` when the file's ownership header doesn't match the
59
+ current session (`turn-check` was skipped or the file was hijacked
60
+ between turns). Surface the failure to the user, **do not swallow it**:
61
+
62
+ 1. Stop the current append.
63
+ 2. Render the Foreign-Prompt from [`chat-history-ownership`](chat-history-ownership.md)
64
+ so the user re-handshakes.
65
+ 3. Resume cadence only after gate 1 clears again.
66
+
67
+ This is the structural enforcement layer that catches the case where
68
+ an agent technically called `turn-check` but on the wrong platform path
69
+ (e.g. HOOK platform also tried CHECKPOINT cooperative gates and the
70
+ file got into a mixed state).
71
+
72
+ ## Path-specific behavior
73
+
74
+ **CHECKPOINT path** — gates 1 + 2 are cooperative. The agent runs
75
+ `turn-check` first, then runs `append` at every cadence boundary.
76
+ `/chat-history-checkpoint` is the recommended boundary-trigger; it
77
+ captures phase entries with the right metadata.
78
+
79
+ **HOOK path** — `work_engine` and platform `SessionStart` /
80
+ `PreToolUse` hooks fire `turn-check` and `append` structurally. The
81
+ agent must **not** call either — double-write produces interleaved
82
+ entries and breaks the JSONL schema. Hooks emit the same exit codes,
83
+ so refusal handling stays identical.
84
+
85
+ **ENGINE path** — `work_engine` fires `append --type phase` per
86
+ successful step and `append --type decision` on halt. Free-form prose
87
+ around the engine output falls back to whatever path the platform
88
+ supplies (HOOK or CHECKPOINT). Engine-driven turns inherit the
89
+ structural guarantee for the duration of the dispatch cycle only.
90
+
91
+ ## What this rule does NOT do
92
+
93
+ Manage ownership decisions (handshake, foreign/returning) — those
94
+ live in [`chat-history-ownership`](chat-history-ownership.md).
95
+ Manage the heartbeat marker — that lives in [`chat-history-visibility`](chat-history-visibility.md).
96
+ Decide cadence dynamically based on reply content — cadence is
97
+ the configured frequency, period.
98
+
99
+ ## Cloud Behavior
100
+
101
+ On cloud surfaces (Claude.ai Web, Skills API) cadence is **inert** —
102
+ no append calls, no `scripts/`, no JSONL file. Treat
103
+ `chat_history.enabled` as `false`.
104
+
105
+ ## Interactions & references
106
+
107
+ - Sibling rules: [`chat-history-ownership`](chat-history-ownership.md) (gate 1 — turn-check) · [`chat-history-visibility`](chat-history-visibility.md) (gate 3 — heartbeat marker).
108
+ - `token-efficiency` — never load the full log; cadence keeps appends small and bounded.
109
+ - API: [`scripts/chat_history.py`](../../../scripts/chat_history.py) `append` subcommand. Settings: [`agent-settings`](../templates/agent-settings.md) `chat_history.frequency`. Engine hooks: [`agents/contexts/work-engine-hooks.md`](../../../agents/contexts/work-engine-hooks.md).
@@ -0,0 +1,123 @@
1
+ ---
2
+ type: "auto"
3
+ description: "First turn or reference to .agent-chat-history — detects ownership (match/returning/foreign/missing) and HOOK/ENGINE/CHECKPOINT/MANUAL path classification with numbered-options prompt"
4
+ alwaysApply: false
5
+ source: package
6
+ ---
7
+
8
+ <!-- cloud_safe: noop -->
9
+
10
+ # Chat History — Ownership
11
+
12
+ Owns gate 1 of the chat-history Iron Law: the first-turn handshake
13
+ that decides whose `.agent-chat-history` file the current session is
14
+ talking to. Cadence (gate 2) lives in [`chat-history-cadence`](chat-history-cadence.md);
15
+ visibility (gate 3) lives in [`chat-history-visibility`](chat-history-visibility.md).
16
+ File I/O is owned by [`scripts/chat_history.py`](../../../scripts/chat_history.py)
17
+ — this rule says **when** to handshake, not how the file is structured.
18
+
19
+ ## Two paths — platform decides which Iron Law applies
20
+
21
+ Population of `.agent-chat-history` is **structural** (platform-driven)
22
+ on platforms with native lifecycle hooks, and **cooperative**
23
+ (agent-driven) on platforms without. Both paths converge on the same
24
+ JSONL schema; only the trigger differs. Per-platform classification
25
+ lives in
26
+ [`agents/contexts/chat-history-platform-hooks.md`](../../../agents/contexts/chat-history-platform-hooks.md).
27
+
28
+ | Path | Platforms / Surfaces | Trigger | Agent's role |
29
+ |---|---|---|---|
30
+ | **HOOK** | Claude Code, Augment CLI, Cursor 1.7+, Cline non-Windows, Windsurf, Gemini CLI | Platform fires native lifecycle hooks → `./agent-config chat-history:hook --platform <name>` | Read-only — observe, do not duplicate appends |
31
+ | **ENGINE** | `/implement-ticket`, `/work`, any flow driven by `scripts/work_engine/cli.py` | `work_engine` fires `turn-check` (before-dispatch), `append --type phase` (per successful step), `--type decision` (on-halt), `heartbeat` (after-dispatch) via the hook layer | Read-only during engine-driven turns — do not duplicate appends. See [`agents/contexts/work-engine-hooks.md`](../../../agents/contexts/work-engine-hooks.md) |
32
+ | **CHECKPOINT** | Augment IDE plugin, Cursor < 1.7, Cline on Windows | Agent invokes `/chat-history-checkpoint` at phase boundaries | Cooperative — gates 1 + 2 + 3 are mandatory |
33
+ | **MANUAL** | Cloud surfaces (Claude.ai Web, Skills API) | Rule is inert — see Cloud Behavior | None |
34
+
35
+ Detect the path on first turn: read `chat_history.platform` from
36
+ `.agent-settings.yml` if set, else fall back to `chat_history.path`
37
+ (`hook` / `checkpoint` / `manual`). Missing both → assume CHECKPOINT
38
+ (safest cooperative default; HOOK platforms install the platform
39
+ config explicitly via `scripts/install.py`).
40
+
41
+ ## Iron Law — gate 1 (turn-check is the first tool call)
42
+
43
+ ```
44
+ ON CHECKPOINT, turn-check IS THE FIRST TOOL CALL OF EVERY SESSION.
45
+ ON HOOK, THE PLATFORM FIRES turn-check STRUCTURALLY — DO NOT DUPLICATE.
46
+ ON ENGINE, work_engine FIRES turn-check BEFORE DISPATCH — DO NOT DUPLICATE.
47
+ ```
48
+
49
+ CHECKPOINT path — run silently before any other tool call:
50
+
51
+ ```bash
52
+ scripts/chat_history.py turn-check --first-user-msg "<first-user-msg>"
53
+ ```
54
+
55
+ Exit codes: `0` = `ok`/`disabled` (proceed), `10` = `missing`
56
+ (run `init --first-user-msg "..." --freq <freq>`), `11` = `foreign`
57
+ (render Foreign-Prompt + stop), `12` = `returning` (render
58
+ Returning-Prompt + stop). The script writes a one-line
59
+ `ACTION REQUIRED:` hint to stderr on non-zero exits.
60
+
61
+ ## Activation & handshake
62
+
63
+ Read `chat_history.*` from `.agent-settings.yml` **once per conversation**
64
+ (first turn) and cache. `enabled: false` or section missing → all three
65
+ chat-history rules are a **no-op** (do not read, write, or mention the
66
+ file). Otherwise cache `frequency`, `max_size_kb`, `on_overflow`, and
67
+ the **path** (HOOK / CHECKPOINT / MANUAL — see the table above).
68
+
69
+ **HOOK path** — skip `turn-check` entirely. The platform's
70
+ `SessionStart` hook already initialized the file; the agent's job is to
71
+ read `status` once for context awareness (header preview, entry count)
72
+ and otherwise leave I/O to the hook dispatcher. Foreign / Returning
73
+ prompts still apply because hooks call into the same ownership state
74
+ machine — when the dispatcher reports `foreign` or `returning` via
75
+ exit code or stderr, render the corresponding prompt.
76
+
77
+ **CHECKPOINT path** — run `turn-check` as the first tool call. State
78
+ token branches to one of: `missing` → `init`, `ok` → continue,
79
+ `foreign` → Foreign-Prompt, `returning` → Returning-Prompt.
80
+ `/chat-history-checkpoint` is the recommended way to satisfy gate 2
81
+ at phase boundaries (see [`chat-history-cadence`](chat-history-cadence.md)).
82
+
83
+ In `foreign` and `returning`, **always read the file's current contents
84
+ into the agent's working context before any write** — the user chose to
85
+ log history for a reason; losing it silently is never acceptable. The
86
+ legacy `state` subcommand still works for shell scripts; agents prefer
87
+ `turn-check` (folds in `enabled` + distinct exit codes).
88
+
89
+ ## Foreign / Returning prompts — full mechanics
90
+
91
+ When `turn-check` exits `11` (foreign) or `12` (returning), render the
92
+ matching numbered-options block from
93
+ [`agents/contexts/chat-history-handshake.md`](../../../agents/contexts/chat-history-handshake.md).
94
+ That doc holds the prompt bodies, the option → script-call mapping
95
+ (`adopt` / `init` / `prepend` / `reset`), the in-memory entries-list
96
+ shape, free-text fallbacks, and the overflow handling per
97
+ `on_overflow` (`rotate` / `compress`). Read it once on first foreign
98
+ or returning event; cache the chosen option for the rest of the
99
+ conversation.
100
+
101
+ ## What this rule does NOT do
102
+
103
+ Display/reload/clear (`/chat-history*` commands). Auto-flip `enabled` or
104
+ `on_overflow`. Run when `enabled: false`. Decide ownership
105
+ heuristically — only `turn-check` / `state` does that. Double-write on
106
+ HOOK platforms — when hooks fire structurally, the agent does **not**
107
+ also call `turn-check`. Cadence (gate 2) and heartbeat (gate 3) are
108
+ covered in their sibling rules.
109
+
110
+ ## Cloud Behavior
111
+
112
+ On cloud surfaces (Claude.ai Web, Skills API) the rule is **fully inert** —
113
+ no `.agent-chat-history`, no `scripts/`, no Iron Law gates, no foreign/returning
114
+ prompts. Treat `chat_history.enabled` as `false`; persistence is a
115
+ local-agent concern.
116
+
117
+ ## Interactions & references
118
+
119
+ - Sibling rules: [`chat-history-cadence`](chat-history-cadence.md) (gate 2 — append timing) · [`chat-history-visibility`](chat-history-visibility.md) (gate 3 — heartbeat marker).
120
+ - `ask-when-uncertain` + `user-interaction` — foreign/returning prompts use numbered options, one question per turn.
121
+ - `language-and-tone` — prompt translated at runtime; `.md` stays English.
122
+ - `onboarding-gate` — runs first; this rule activates only after it clears.
123
+ - API: [`scripts/chat_history.py`](../../../scripts/chat_history.py). Commands: [`/chat-history`](../commands/chat-history.md), [`/chat-history-resume`](../commands/chat-history-resume.md), [`/chat-history-clear`](../commands/chat-history-clear.md), [`/chat-history-checkpoint`](../commands/chat-history-checkpoint.md). Settings: [`agent-settings`](../templates/agent-settings.md). Platform classification: [`agents/contexts/chat-history-platform-hooks.md`](../../../agents/contexts/chat-history-platform-hooks.md). Types: [`rule-type-governance`](rule-type-governance.md).
@@ -0,0 +1,96 @@
1
+ ---
2
+ type: "auto"
3
+ description: "Emitting the chat-history heartbeat marker — paste subprocess stdout verbatim or nothing, never type from memory, hybrid mode prints on drift only, slip handling per language-and-tone"
4
+ alwaysApply: false
5
+ source: package
6
+ ---
7
+
8
+ <!-- cloud_safe: noop -->
9
+
10
+ # Chat History — Visibility
11
+
12
+ Owns gate 3 of the chat-history Iron Law: the heartbeat marker that
13
+ makes append-cadence drift visible. Ownership (gate 1) lives in
14
+ [`chat-history-ownership`](chat-history-ownership.md); cadence (gate 2)
15
+ lives in [`chat-history-cadence`](chat-history-cadence.md). File I/O is
16
+ owned by [`scripts/chat_history.py`](../../../scripts/chat_history.py).
17
+
18
+ ## Iron Law — gate 3 (heartbeat is subprocess stdout, not memory)
19
+
20
+ ```
21
+ HEARTBEAT IS THE SCRIPT OUTPUT OF THE CURRENT TURN, VERBATIM, OR NOTHING.
22
+ NEVER TYPE THE LINE FROM MEMORY. NEVER REUSE THE PRIOR TURN'S MARKER.
23
+ EMPTY STDOUT → NO MARKER LINE.
24
+ ```
25
+
26
+ Run silently before emitting the final reply:
27
+
28
+ ```bash
29
+ scripts/chat_history.py heartbeat --first-user-msg "<first-user-msg>"
30
+ ```
31
+
32
+ Stdout is **at most** one line, e.g.
33
+ `📒 chat-history: ok · 9 entries · per_phase · last 30s ago`. Non-empty →
34
+ paste **verbatim** as the last line of the reply. Empty → emit nothing.
35
+ Always exits 0 — observability, not a gate.
36
+
37
+ ## Visibility modes — `chat_history.heartbeat`
38
+
39
+ | Mode | When marker prints | Token cost |
40
+ |---|---|---|
41
+ | `on` | every reply (legacy) | ~20 tokens / reply |
42
+ | `off` | never — full silence | 0 |
43
+ | `hybrid` *(default)* | drift states only (`missing`/`foreign`/`returning`) | 0 in normal flow, ~20 on drift |
44
+
45
+ `hybrid` ships zero tokens when healthy, loud on ownership drift. YAML 1.1
46
+ booleanizes bare `on`/`off`; the reader coerces both back, so
47
+ `heartbeat: on` works unquoted.
48
+
49
+ ## Memory-typing the marker — rule violation, not a slip
50
+
51
+ Format is memorizable; counts and timestamps are not. A typed-from-
52
+ memory line shows stale entries and a healthy-looking `ok` while the
53
+ file is silently behind — observability collapses, invisible until
54
+ `status` is checked. Heartbeat is the script output of the **current
55
+ turn**, verbatim, or nothing.
56
+
57
+ **Self-check before send — MANDATORY.** (1) Did `heartbeat` run on
58
+ this turn? (2) Is the line byte-identical to that subprocess stdout?
59
+ (3) Empty stdout → no marker line. Any "no" → drop it.
60
+
61
+ **Slip handling.** Stale marker called out → acknowledge once in the
62
+ user's language; run `status`; on CHECKPOINT call `append` for
63
+ missed phase-boundaries (see [`chat-history-cadence`](chat-history-cadence.md));
64
+ run a real `heartbeat`; paste stdout verbatim or nothing. Don't promise
65
+ "from now on" — only behaviour proves compliance (mirrors
66
+ `language-and-tone` § slip handling).
67
+
68
+ ## Path-specific behavior
69
+
70
+ Heartbeat (gate 3) stays useful for visibility on **every** path —
71
+ HOOK, ENGINE, CHECKPOINT — because the marker reports the file's
72
+ state, not the agent's intent. On HOOK and ENGINE paths the agent
73
+ still emits the marker even though it didn't fire `turn-check` or
74
+ `append` itself: the marker is read-only observability over whatever
75
+ the platform / engine wrote.
76
+
77
+ ## What this rule does NOT do
78
+
79
+ Manage ownership decisions — those live in [`chat-history-ownership`](chat-history-ownership.md).
80
+ Manage append timing — that lives in [`chat-history-cadence`](chat-history-cadence.md).
81
+ Auto-decide visibility mode — `chat_history.heartbeat` is the only
82
+ trigger. Insert decoration: the marker is functional output per
83
+ [`direct-answers`](direct-answers.md) emoji whitelist, not a status
84
+ badge.
85
+
86
+ ## Cloud Behavior
87
+
88
+ On cloud surfaces (Claude.ai Web, Skills API) heartbeat is **inert** —
89
+ no marker line, no `scripts/`. Treat `chat_history.enabled` as `false`.
90
+
91
+ ## Interactions & references
92
+
93
+ - Sibling rules: [`chat-history-ownership`](chat-history-ownership.md) (gate 1 — turn-check) · [`chat-history-cadence`](chat-history-cadence.md) (gate 2 — append).
94
+ - `direct-answers` — emoji whitelist permits the `📒` marker as functional output, not decoration.
95
+ - `language-and-tone` § slip handling — stale-marker acknowledgement.
96
+ - API: [`scripts/chat_history.py`](../../../scripts/chat_history.py) `heartbeat` and `status` subcommands. Settings: [`agent-settings`](../templates/agent-settings.md) `chat_history.heartbeat`.
@@ -36,7 +36,7 @@ the `rtk-output-filtering` skill.
36
36
 
37
37
  ### Use what you already have
38
38
 
39
- - Edited a file → `str-replace-editor` showed the result. Skip re-reading.
39
+ - Edited a file → the edit tool already returned the result. Skip re-reading.
40
40
  - Ran a command → you have the output. Skip re-running to "verify".
41
41
  - File in context from recent messages → skip reloading.
42
42
  - Found a symbol → use it. Skip searching again differently.
@@ -1,7 +1,7 @@
1
1
  ---
2
- type: "always"
3
- description: "Surface matching slash commands as numbered options when user intent matches a command's purpose — never auto-executes; user always picks (read-only suggestion layer)."
4
- alwaysApply: true
2
+ type: "auto"
3
+ description: "User prompt without /command but matching an eligible slash command — surface matches as numbered options with as-is escape hatch; never auto-executes, user always picks"
4
+ alwaysApply: false
5
5
  source: package
6
6
  ---
7
7
 
@@ -12,9 +12,10 @@ as a **numbered option** alongside an "as-is" escape hatch. The user
12
12
  always picks. **Nothing auto-executes.** The suggestion layer is a
13
13
  read-only shortcut *finder*, not an invocation path.
14
14
 
15
- Engine: `scripts/command_suggester/`. Eligibility table:
15
+ The deterministic engine lives in `scripts/command_suggester/`. The
16
+ locked eligibility table lives in
16
17
  [`agents/contexts/command-suggestion-eligibility.md`](../../agents/contexts/command-suggestion-eligibility.md).
17
- Design:
18
+ The full design lives in
18
19
  [`road-to-context-aware-command-suggestion`](../../agents/roadmaps/road-to-context-aware-command-suggestion.md).
19
20
 
20
21
  ## Iron Law — never auto-execute
@@ -24,7 +25,7 @@ SUGGEST. NEVER INVOKE. THE USER PICKS, ALWAYS.
24
25
  ```
25
26
 
26
27
  A suggestion block emits options. It does **not** start a command
27
- flow. The user picking option N triggers `slash-commands` on the
28
+ flow. The user picking option N triggers `slash-command-routing-policy` on the
28
29
  **next** turn — with all the command's own halts intact.
29
30
 
30
31
  ## When to fire
@@ -32,7 +33,7 @@ flow. The user picking option N triggers `slash-commands` on the
32
33
  On a user turn that matches **all** of the following:
33
34
 
34
35
  1. The message does **not** start with an explicit `/command` (those
35
- bypass suggestion entirely — see `slash-commands`).
36
+ bypass suggestion entirely — see `slash-command-routing-policy`).
36
37
  2. `commands.suggestion.enabled` is `true` (default).
37
38
  3. The user has not issued `/command-suggestion-off` in this conversation.
38
39
  4. No clarification is owed for the same turn (per
@@ -109,7 +110,7 @@ prompt runs exactly as it would without this rule.
109
110
 
110
111
  ## What this rule does NOT do
111
112
 
112
- - Invoke any command. Picking option N is what triggers `slash-commands`.
113
+ - Invoke any command. Picking option N is what triggers `slash-command-routing-policy`.
113
114
  - Stack with other questions. One numbered-options block per turn.
114
115
  - Re-trigger on its own output. Command names emitted in the
115
116
  suggestion block are excluded from the next-turn matcher input.
@@ -125,7 +126,7 @@ available — degrade silently, never crash the turn.
125
126
 
126
127
  ## Interactions
127
128
 
128
- - [`slash-commands`](slash-commands.md) — explicit `/command` skips suggestion entirely.
129
+ - [`slash-command-routing-policy`](slash-command-routing-policy.md) — explicit `/command` skips suggestion entirely.
129
130
  - [`user-interaction`](user-interaction.md) — numbered-options Iron Law and single-source recommendation.
130
131
  - [`ask-when-uncertain`](ask-when-uncertain.md) — clarification wins on conflict.
131
132
  - [`scope-control`](scope-control.md) — git-op gates outrank suggestion.