@event4u/agent-config 1.12.0 → 1.14.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.
- package/.agent-src/commands/agent-handoff.md +3 -0
- package/.agent-src/commands/agent-status.md +3 -0
- package/.agent-src/commands/agents-audit.md +4 -0
- package/.agent-src/commands/agents-cleanup.md +6 -1
- package/.agent-src/commands/agents-prepare.md +3 -0
- package/.agent-src/commands/analyze-reference-repo.md +4 -0
- package/.agent-src/commands/bug-fix.md +5 -1
- package/.agent-src/commands/bug-investigate.md +4 -0
- package/.agent-src/commands/chat-history-checkpoint.md +126 -0
- package/.agent-src/commands/chat-history-clear.md +5 -0
- package/.agent-src/commands/chat-history-resume.md +5 -0
- package/.agent-src/commands/chat-history.md +5 -0
- package/.agent-src/commands/check-current-md.md +126 -0
- package/.agent-src/commands/commit-in-chunks.md +98 -0
- package/.agent-src/commands/commit.md +4 -0
- package/.agent-src/commands/compress.md +3 -0
- package/.agent-src/commands/context-create.md +4 -0
- package/.agent-src/commands/context-refactor.md +4 -0
- package/.agent-src/commands/copilot-agents-init.md +3 -0
- package/.agent-src/commands/copilot-agents-optimize.md +3 -0
- package/.agent-src/commands/create-pr-description.md +4 -0
- package/.agent-src/commands/create-pr.md +4 -0
- package/.agent-src/commands/do-and-judge.md +4 -1
- package/.agent-src/commands/do-in-steps.md +3 -0
- package/.agent-src/commands/e2e-heal.md +4 -0
- package/.agent-src/commands/e2e-plan.md +4 -0
- package/.agent-src/commands/estimate-ticket.md +4 -1
- package/.agent-src/commands/feature-dev.md +4 -0
- package/.agent-src/commands/feature-explore.md +4 -0
- package/.agent-src/commands/feature-plan.md +4 -0
- package/.agent-src/commands/feature-refactor.md +4 -0
- package/.agent-src/commands/feature-roadmap.md +6 -0
- package/.agent-src/commands/fix-ci.md +4 -0
- package/.agent-src/commands/fix-portability.md +3 -0
- package/.agent-src/commands/fix-pr-bot-comments.md +4 -0
- package/.agent-src/commands/fix-pr-comments.md +4 -0
- package/.agent-src/commands/fix-pr-developer-comments.md +4 -0
- package/.agent-src/commands/fix-references.md +3 -0
- package/.agent-src/commands/fix-seeder.md +4 -0
- package/.agent-src/commands/implement-ticket.md +39 -13
- package/.agent-src/commands/jira-ticket.md +4 -0
- package/.agent-src/commands/judge.md +3 -0
- package/.agent-src/commands/memory-add.md +5 -3
- package/.agent-src/commands/memory-full.md +5 -2
- package/.agent-src/commands/memory-promote.md +7 -6
- package/.agent-src/commands/mode.md +3 -0
- package/.agent-src/commands/module-create.md +4 -0
- package/.agent-src/commands/module-explore.md +4 -0
- package/.agent-src/commands/onboard.md +24 -0
- package/.agent-src/commands/optimize-agents.md +4 -0
- package/.agent-src/commands/optimize-augmentignore.md +3 -0
- package/.agent-src/commands/optimize-rtk-filters.md +3 -0
- package/.agent-src/commands/optimize-skills.md +4 -0
- package/.agent-src/commands/override-create.md +4 -0
- package/.agent-src/commands/override-manage.md +4 -0
- package/.agent-src/commands/package-reset.md +3 -0
- package/.agent-src/commands/package-test.md +3 -0
- package/.agent-src/commands/prepare-for-review.md +4 -0
- package/.agent-src/commands/project-analyze.md +4 -0
- package/.agent-src/commands/project-health.md +4 -0
- package/.agent-src/commands/propose-memory.md +6 -8
- package/.agent-src/commands/quality-fix.md +4 -0
- package/.agent-src/commands/refine-ticket.md +4 -1
- package/.agent-src/commands/review-changes.md +4 -0
- package/.agent-src/commands/review-routing.md +4 -0
- package/.agent-src/commands/roadmap-create.md +7 -0
- package/.agent-src/commands/roadmap-execute.md +12 -1
- package/.agent-src/commands/rule-compliance-audit.md +4 -0
- package/.agent-src/commands/set-cost-profile.md +3 -0
- package/.agent-src/commands/sync-agent-settings.md +3 -0
- package/.agent-src/commands/sync-gitignore.md +3 -0
- package/.agent-src/commands/tests-create.md +4 -0
- package/.agent-src/commands/tests-execute.md +4 -0
- package/.agent-src/commands/threat-model.md +4 -0
- package/.agent-src/commands/update-form-request-messages.md +4 -0
- package/.agent-src/commands/upstream-contribute.md +4 -0
- package/.agent-src/commands/work.md +161 -0
- package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +2 -6
- package/.agent-src/guidelines/agent-infra/layered-settings.md +0 -1
- package/.agent-src/guidelines/agent-infra/memory-access.md +0 -7
- package/.agent-src/guidelines/agent-infra/role-contracts.md +2 -4
- package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +0 -1
- package/.agent-src/guidelines/php/patterns/strategy.md +180 -2
- package/.agent-src/personas/README.md +0 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +7 -2
- package/.agent-src/rules/artifact-engagement-recording.md +133 -0
- package/.agent-src/rules/ask-when-uncertain.md +18 -13
- package/.agent-src/rules/augment-portability.md +8 -0
- package/.agent-src/rules/autonomous-execution.md +158 -0
- package/.agent-src/rules/chat-history.md +147 -118
- package/.agent-src/rules/cli-output-handling.md +26 -3
- package/.agent-src/rules/command-suggestion.md +133 -0
- package/.agent-src/rules/commit-policy.md +99 -0
- package/.agent-src/rules/direct-answers.md +114 -0
- package/.agent-src/rules/docs-sync.md +36 -0
- package/.agent-src/rules/downstream-changes.md +10 -9
- package/.agent-src/rules/improve-before-implement.md +9 -6
- package/.agent-src/rules/language-and-tone.md +81 -6
- package/.agent-src/rules/non-destructive-by-default.md +117 -0
- package/.agent-src/rules/package-ci-checks.md +4 -0
- package/.agent-src/rules/preservation-guard.md +20 -0
- package/.agent-src/rules/roadmap-progress-sync.md +103 -30
- package/.agent-src/rules/scope-control.md +42 -1
- package/.agent-src/rules/size-enforcement.md +1 -3
- package/.agent-src/rules/skill-quality.md +3 -8
- package/.agent-src/rules/ui-audit-before-build.md +106 -0
- package/.agent-src/rules/user-interaction.md +81 -3
- package/.agent-src/scripts/update_roadmap_progress.py +48 -6
- package/.agent-src/skills/blade-ui/SKILL.md +30 -5
- package/.agent-src/skills/command-routing/SKILL.md +32 -0
- package/.agent-src/skills/command-writing/SKILL.md +41 -2
- package/.agent-src/skills/description-assist/SKILL.md +21 -0
- package/.agent-src/skills/estimate-ticket/SKILL.md +0 -1
- package/.agent-src/skills/existing-ui-audit/SKILL.md +187 -0
- package/.agent-src/skills/fe-design/SKILL.md +72 -60
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +4 -0
- package/.agent-src/skills/flux/SKILL.md +31 -4
- package/.agent-src/skills/guideline-writing/SKILL.md +24 -2
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +51 -9
- package/.agent-src/skills/livewire/SKILL.md +30 -4
- package/.agent-src/skills/md-language-check/SKILL.md +103 -0
- package/.agent-src/skills/php-coder/SKILL.md +24 -0
- package/.agent-src/skills/react-shadcn-ui/SKILL.md +121 -0
- package/.agent-src/skills/refine-prompt/SKILL.md +220 -0
- package/.agent-src/skills/refine-ticket/SKILL.md +2 -4
- package/.agent-src/skills/roadmap-management/SKILL.md +10 -3
- package/.agent-src/skills/rule-writing/SKILL.md +23 -1
- package/.agent-src/skills/skill-writing/SKILL.md +1 -3
- package/.agent-src/skills/upstream-contribute/SKILL.md +1 -1
- package/.agent-src/skills/using-git-worktrees/SKILL.md +3 -1
- package/.agent-src/templates/AGENTS.md +24 -6
- package/.agent-src/templates/agent-settings.md +149 -0
- package/.agent-src/templates/github-workflows/roadmap-progress-check.yml +63 -0
- package/.agent-src/templates/hooks/pre-commit-roadmap-progress +60 -0
- package/.agent-src/templates/roadmaps.md +8 -2
- package/.agent-src/templates/scripts/implement_ticket/__init__.py +63 -26
- package/.agent-src/templates/scripts/implement_ticket/__main__.py +8 -2
- package/.agent-src/templates/scripts/memory_lookup.py +382 -21
- package/.agent-src/templates/scripts/memory_status.py +110 -9
- package/.agent-src/templates/scripts/telemetry/__init__.py +42 -0
- package/.agent-src/templates/scripts/telemetry/aggregator.py +154 -0
- package/.agent-src/templates/scripts/telemetry/boundary.py +171 -0
- package/.agent-src/templates/scripts/telemetry/engagement.py +238 -0
- package/.agent-src/templates/scripts/telemetry/report_renderer.py +170 -0
- package/.agent-src/templates/scripts/telemetry/settings.py +112 -0
- package/.agent-src/templates/scripts/telemetry_record.py +166 -0
- package/.agent-src/templates/scripts/telemetry_report.py +161 -0
- package/.agent-src/templates/scripts/telemetry_status.py +142 -0
- package/.agent-src/templates/scripts/work_engine/__init__.py +58 -0
- package/.agent-src/templates/scripts/work_engine/__main__.py +9 -0
- package/.agent-src/templates/scripts/work_engine/cli.py +592 -0
- package/.agent-src/templates/scripts/{implement_ticket → work_engine}/delivery_state.py +7 -0
- package/.agent-src/templates/scripts/work_engine/directives/__init__.py +33 -0
- package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +98 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/analyze.py +1 -1
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/implement.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/memory.py +1 -1
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/plan.py +1 -1
- package/.agent-src/templates/scripts/work_engine/directives/backend/refine.py +396 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/report.py +36 -4
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/test.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/verify.py +2 -2
- package/.agent-src/templates/scripts/work_engine/directives/mixed/__init__.py +116 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/contract.py +254 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/stitch.py +229 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/ui.py +231 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/__init__.py +113 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/_passthrough.py +44 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/apply.py +241 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/audit.py +414 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/design.py +335 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/polish.py +510 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/review.py +468 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/__init__.py +119 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/_skipped.py +37 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/apply.py +165 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/refine.py +66 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/report.py +62 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/test.py +115 -0
- package/.agent-src/templates/scripts/work_engine/dispatcher.py +331 -0
- package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +54 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +32 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +103 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +42 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +49 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/directive_set_guard.py +53 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/halt_surface_audit.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/state_shape_validation.py +52 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/trace.py +84 -0
- package/.agent-src/templates/scripts/work_engine/hooks/context.py +66 -0
- package/.agent-src/templates/scripts/work_engine/hooks/events.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/exceptions.py +79 -0
- package/.agent-src/templates/scripts/work_engine/hooks/registry.py +60 -0
- package/.agent-src/templates/scripts/work_engine/hooks/runner.py +73 -0
- package/.agent-src/templates/scripts/work_engine/hooks/settings.py +141 -0
- package/.agent-src/templates/scripts/work_engine/intent/__init__.py +47 -0
- package/.agent-src/templates/scripts/work_engine/intent/classify.py +280 -0
- package/.agent-src/templates/scripts/work_engine/migration/__init__.py +8 -0
- package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +199 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/__init__.py +22 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/diff.py +106 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/file.py +113 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +90 -0
- package/.agent-src/templates/scripts/work_engine/scoring/__init__.py +14 -0
- package/.agent-src/templates/scripts/work_engine/scoring/confidence.py +300 -0
- package/.agent-src/templates/scripts/work_engine/stack/__init__.py +31 -0
- package/.agent-src/templates/scripts/work_engine/stack/detect.py +187 -0
- package/.agent-src/templates/scripts/work_engine/state.py +641 -0
- package/.claude-plugin/marketplace.json +105 -2
- package/AGENTS.md +36 -8
- package/CHANGELOG.md +558 -0
- package/README.md +146 -4
- package/composer.json +3 -0
- package/config/agent-settings.template.yml +45 -0
- package/config/gitignore-block.txt +4 -0
- package/docs/architecture.md +28 -1
- package/docs/development.md +1 -1
- package/docs/getting-started.md +3 -2
- package/docs/installation.md +86 -0
- package/docs/showcase.md +204 -0
- package/package.json +9 -1
- package/scripts/agent-config +274 -0
- package/scripts/audit_cloud_compatibility.py +288 -0
- package/scripts/build_cloud_bundle.py +458 -0
- package/scripts/build_linear_digest.py +263 -0
- package/scripts/chat_history.py +796 -7
- package/scripts/check_compression.py +139 -0
- package/scripts/check_iron_law_prominence.py +143 -0
- package/scripts/check_md_language.py +159 -0
- package/scripts/check_portability.py +36 -0
- package/scripts/check_reply_consistency.py +140 -0
- package/scripts/command_suggester/__init__.py +51 -0
- package/scripts/command_suggester/cooldown.py +132 -0
- package/scripts/command_suggester/loader.py +70 -0
- package/scripts/command_suggester/match.py +180 -0
- package/scripts/command_suggester/rank.py +120 -0
- package/scripts/command_suggester/render.py +86 -0
- package/scripts/command_suggester/sanitize.py +113 -0
- package/scripts/command_suggester/settings.py +125 -0
- package/scripts/command_suggester/types.py +78 -0
- package/scripts/hooks/augment-chat-history.sh +56 -0
- package/scripts/install-hooks.sh +67 -0
- package/scripts/install.py +150 -33
- package/scripts/lint_marketplace.py +27 -0
- package/scripts/memory_lookup.py +143 -7
- package/scripts/memory_status.py +76 -14
- package/scripts/migrate_command_suggestions.py +151 -0
- package/scripts/postinstall.sh +16 -0
- package/scripts/schemas/command.schema.json +41 -0
- package/scripts/skill_linter.py +67 -0
- package/scripts/sync_agent_settings.py +42 -12
- package/templates/consumer-settings/augment-cli-hooks.json +54 -0
- package/templates/consumer-settings/claude-settings.json +55 -1
- package/.agent-src/templates/scripts/implement_ticket/cli.py +0 -171
- package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +0 -134
- package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +0 -49
- package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +0 -140
- /package/.agent-src/templates/scripts/{implement_ticket → work_engine}/persona_policy.py +0 -0
|
@@ -5,6 +5,8 @@ alwaysApply: true
|
|
|
5
5
|
source: package
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- cloud_safe: noop -->
|
|
9
|
+
|
|
8
10
|
# Chat History
|
|
9
11
|
|
|
10
12
|
Persists the conversation to `.agent-chat-history` (JSONL, project root,
|
|
@@ -12,160 +14,187 @@ git-ignored) so a crashed or switched agent session can be resumed. File
|
|
|
12
14
|
I/O is owned by [`scripts/chat_history.py`](../../../scripts/chat_history.py)
|
|
13
15
|
— this rule says **when** to call it, not how the file is structured.
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## Two paths — platform decides which Iron Law applies
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
Population of `.agent-chat-history` is **structural** (platform-driven)
|
|
20
|
+
on platforms with native lifecycle hooks, and **cooperative**
|
|
21
|
+
(agent-driven) on platforms without. Both paths converge on the same
|
|
22
|
+
JSONL schema; only the trigger differs. Per-platform classification
|
|
23
|
+
lives in
|
|
24
|
+
[`agents/contexts/chat-history-platform-hooks.md`](../../../agents/contexts/chat-history-platform-hooks.md).
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
| Path | Platforms / Surfaces | Trigger | Agent's role |
|
|
27
|
+
|---|---|---|---|
|
|
28
|
+
| **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 |
|
|
29
|
+
| **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) |
|
|
30
|
+
| **CHECKPOINT** | Augment IDE plugin, Cursor < 1.7, Cline on Windows | Agent invokes `/chat-history-checkpoint` at phase boundaries | Cooperative — the three gates below are mandatory |
|
|
31
|
+
| **MANUAL** | Cloud surfaces (Claude.ai Web, Skills API) | Rule is inert — see Cloud Behavior | None |
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
Detect the path on first turn: read `chat_history.platform` from
|
|
34
|
+
`.agent-settings.yml` if set, else fall back to `chat_history.path`
|
|
35
|
+
(`hook` / `checkpoint` / `manual`). Missing both → assume CHECKPOINT
|
|
36
|
+
(safest cooperative default; HOOK platforms install the platform
|
|
37
|
+
config explicitly via `scripts/install.py`).
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
## Iron Law (CHECKPOINT path) — three gates, skipping any one is a rule violation
|
|
28
40
|
|
|
29
|
-
```
|
|
30
|
-
|
|
41
|
+
```
|
|
42
|
+
1. turn-check — first tool call of every session
|
|
43
|
+
2. append — at every cadence boundary, with --first-user-msg
|
|
44
|
+
3. heartbeat — last line of every reply, from current subprocess
|
|
45
|
+
stdout (NEVER from memory)
|
|
31
46
|
```
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
48
|
+
**Overrides** token-efficiency, conversation momentum, "the turn was
|
|
49
|
+
trivial". Three enforcement layers: **turn-check** non-zero on
|
|
50
|
+
`missing`/`foreign`/`returning`, **append refusal** (exit `3` on
|
|
51
|
+
ownership mismatch), **script-generated heartbeat** (silent skip
|
|
52
|
+
becomes immediately visible).
|
|
35
53
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
54
|
+
On the HOOK and ENGINE paths the platform / engine performs gates 1 + 2
|
|
55
|
+
structurally; the agent **must not** also call `turn-check` or `append`
|
|
56
|
+
(double-write risk). Engine-driven turns inherit the structural guarantee
|
|
57
|
+
for the duration of the dispatch cycle — once the engine returns control,
|
|
58
|
+
free-form prose around the engine output falls back to whatever path the
|
|
59
|
+
platform supplies. Heartbeat (gate 3) stays useful for visibility on
|
|
60
|
+
every path — see below.
|
|
42
61
|
|
|
43
|
-
|
|
44
|
-
into the agent's working context before any write** — the user chose to
|
|
45
|
-
log history for a reason; losing it silently is never acceptable.
|
|
62
|
+
### Turn-start gate — MANDATORY first tool call
|
|
46
63
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Trigger: `state == foreign` **and** `status.entries >= 1`.
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
> 📒 Found chat history from an unknown session.
|
|
53
|
-
>
|
|
54
|
-
> Header fingerprint: <short-hash-A>
|
|
55
|
-
> Current session: <short-hash-B>
|
|
56
|
-
> Entries on file: <N> Age: <age>
|
|
57
|
-
>
|
|
58
|
-
> 1. Resume — adopt this file, load entries as context, keep appending here
|
|
59
|
-
> 2. New start — archive to .agent-chat-history.bak, init fresh
|
|
60
|
-
> 3. Ignore — leave the file untouched, disable logging for this session
|
|
64
|
+
```bash
|
|
65
|
+
scripts/chat_history.py turn-check --first-user-msg "<first-user-msg>"
|
|
61
66
|
```
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
- `3` → logging disabled for this conversation; do not touch the file,
|
|
69
|
-
do not edit settings.
|
|
68
|
+
Exit codes: `0` = `ok`/`disabled` (proceed), `10` = `missing`
|
|
69
|
+
(run `init --first-user-msg "..." --freq <freq>`), `11` = `foreign`
|
|
70
|
+
(render Foreign-Prompt + stop), `12` = `returning` (render
|
|
71
|
+
Returning-Prompt + stop). The script also writes a one-line
|
|
72
|
+
`ACTION REQUIRED:` hint to stderr on non-zero exits.
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
### Append cadence — MANDATORY at boundaries
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
Cadence comes from `chat_history.frequency`:
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
- `per_turn` → one entry at the end of every agent turn.
|
|
79
|
+
- `per_phase` → at phase boundaries (user question answered, decision
|
|
80
|
+
taken, task-list item completed, significant tool sequence finished).
|
|
81
|
+
Pure clarification turns may skip.
|
|
82
|
+
- `per_tool` → after each tool-call sequence.
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
>
|
|
84
|
-
|
|
85
|
-
>
|
|
86
|
-
> (All three options read the on-disk entries into context first.)
|
|
87
|
-
>
|
|
88
|
-
> 1. Merge — my in-memory history first, the foreign entries after,
|
|
89
|
-
> overwrite the file with the combined body
|
|
90
|
-
> 2. Replace — wipe the foreign entries, rewrite the file with my
|
|
91
|
-
> in-memory history only
|
|
92
|
-
> 3. Continue — leave the file as-is; only new entries from now on
|
|
84
|
+
Every append goes through
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
scripts/chat_history.py append --first-user-msg "<msg>" \
|
|
88
|
+
--type <user|agent|tool|decision|phase> --json '<obj>'
|
|
93
89
|
```
|
|
94
90
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- `3` (Continue) → `adopt --first-user-msg "<msg>"`, then append normally.
|
|
91
|
+
Never write the file directly. Prefer `phase` over `agent` for boundaries.
|
|
92
|
+
Exit `3` (`OWNERSHIP_REFUSED`) means turn-start was skipped or the file
|
|
93
|
+
was hijacked — surface it, do not swallow it. Cadence is the trigger, not
|
|
94
|
+
reply length; do not batch missed turns (crashes happen between turns).
|
|
100
95
|
|
|
101
|
-
|
|
96
|
+
### Heartbeat marker — visibility gated by `chat_history.heartbeat`
|
|
102
97
|
|
|
103
|
-
|
|
98
|
+
Run silently before emitting the final reply:
|
|
104
99
|
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
```bash
|
|
101
|
+
scripts/chat_history.py heartbeat --first-user-msg "<first-user-msg>"
|
|
102
|
+
```
|
|
107
103
|
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- Timestamps in ISO-8601 UTC. If the agent does not have exact times,
|
|
113
|
-
use the current time for all entries; order is what matters.
|
|
114
|
-
- Do **not** include tool-call payloads, file contents, or secrets.
|
|
104
|
+
Stdout is **at most** one line, e.g.
|
|
105
|
+
`📒 chat-history: ok · 9 entries · per_phase · last 30s ago`. Non-empty →
|
|
106
|
+
paste **verbatim** as the last line of the reply. Empty → emit nothing.
|
|
107
|
+
Always exits 0 — observability, not a gate.
|
|
115
108
|
|
|
116
|
-
|
|
117
|
-
`reset ... --entries-stdin <<< '<list>'`.
|
|
109
|
+
**Visibility modes** — `chat_history.heartbeat`:
|
|
118
110
|
|
|
119
|
-
|
|
111
|
+
| Mode | When marker prints | Token cost |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| `on` | every reply (legacy) | ~20 tokens / reply |
|
|
114
|
+
| `off` | never — full silence | 0 |
|
|
115
|
+
| `hybrid` *(default)* | drift states only (`missing`/`foreign`/`returning`) | 0 in normal flow, ~20 on drift |
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
`hybrid` ships zero tokens when healthy, loud on ownership drift. YAML 1.1
|
|
118
|
+
booleanizes bare `on`/`off`; the reader coerces both back, so
|
|
119
|
+
`heartbeat: on` works unquoted.
|
|
123
120
|
|
|
124
|
-
-
|
|
125
|
-
- `per_phase` — at phase boundaries (user question, agent answer,
|
|
126
|
-
decision, completion of a task-list item).
|
|
127
|
-
- `per_tool` — after each tool-call sequence.
|
|
121
|
+
### Memory-typing the marker — rule violation, not a slip
|
|
128
122
|
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
Format is memorizable; counts and timestamps are not. A typed-from-
|
|
124
|
+
memory line shows stale entries and a healthy-looking `ok` while the
|
|
125
|
+
file is silently behind — observability collapses, invisible until
|
|
126
|
+
`status` is checked. Heartbeat is the script output of the **current
|
|
127
|
+
turn**, verbatim, or nothing.
|
|
131
128
|
|
|
132
|
-
|
|
129
|
+
**Self-check before send — MANDATORY.** (1) Did `heartbeat` run on
|
|
130
|
+
this turn? (2) Is the line byte-identical to that subprocess stdout?
|
|
131
|
+
(3) Empty stdout → no marker line. Any "no" → drop it.
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
**Slip handling.** Stale marker called out → acknowledge once in the
|
|
134
|
+
user's language; run `status`; on CHECKPOINT `append` missed phase-
|
|
135
|
+
boundaries; run a real `heartbeat`; paste stdout verbatim or nothing.
|
|
136
|
+
Don't promise "from now on" — only behaviour proves compliance
|
|
137
|
+
(mirrors `language-and-tone` § slip handling).
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
silent and cheap.
|
|
138
|
-
- `compress` → `rotate --mode compress --max-kb <n>`. Marks the file for
|
|
139
|
-
summarization; the **next** turn writes the summary for the dropped
|
|
140
|
-
range. Do not block the current turn on this.
|
|
139
|
+
## Activation & handshake
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
Read `chat_history.*` from `.agent-settings.yml` **once per conversation**
|
|
142
|
+
(first turn) and cache. `enabled: false` or section missing → rule is a
|
|
143
|
+
**no-op** (do not read, write, or mention the file). Otherwise cache
|
|
144
|
+
`frequency`, `max_size_kb`, `on_overflow`, and the **path** (HOOK /
|
|
145
|
+
CHECKPOINT / MANUAL — see the table above).
|
|
146
|
+
|
|
147
|
+
**HOOK path** — skip `turn-check` entirely. The platform's
|
|
148
|
+
`SessionStart` hook already initialized the file; the agent's job is to
|
|
149
|
+
read `status` once for context awareness (header preview, entry count)
|
|
150
|
+
and otherwise leave I/O to the hook dispatcher. Foreign / Returning
|
|
151
|
+
prompts still apply because hooks call into the same ownership state
|
|
152
|
+
machine — when the dispatcher reports `foreign` or `returning` via
|
|
153
|
+
exit code or stderr, render the corresponding prompt.
|
|
154
|
+
|
|
155
|
+
**CHECKPOINT path** — run `turn-check` as the first tool call. State
|
|
156
|
+
token branches to one of: `missing` → `init`, `ok` → continue,
|
|
157
|
+
`foreign` → Foreign-Prompt, `returning` → Returning-Prompt. Cooperative
|
|
158
|
+
gates 1 + 2 + 3 are mandatory; `/chat-history-checkpoint` is the
|
|
159
|
+
recommended way to satisfy gate 2 at phase boundaries.
|
|
144
160
|
|
|
145
|
-
|
|
161
|
+
In `foreign` and `returning`, **always read the file's current contents
|
|
162
|
+
into the agent's working context before any write** — the user chose to
|
|
163
|
+
log history for a reason; losing it silently is never acceptable. The
|
|
164
|
+
legacy `state` subcommand still works for shell scripts; agents prefer
|
|
165
|
+
`turn-check` (folds in `enabled` + distinct exit codes).
|
|
166
|
+
|
|
167
|
+
## Foreign / Returning prompts — full mechanics
|
|
168
|
+
|
|
169
|
+
When `turn-check` exits `11` (foreign) or `12` (returning), render the
|
|
170
|
+
matching numbered-options block from
|
|
171
|
+
[`agents/contexts/chat-history-handshake.md`](../../../agents/contexts/chat-history-handshake.md).
|
|
172
|
+
That doc holds the prompt bodies, the option → script-call mapping
|
|
173
|
+
(`adopt` / `init` / `prepend` / `reset`), the in-memory entries-list
|
|
174
|
+
shape, free-text fallbacks, and the overflow handling per
|
|
175
|
+
`on_overflow` (`rotate` / `compress`). Read it once on first foreign
|
|
176
|
+
or returning event; cache the chosen option for the rest of the
|
|
177
|
+
conversation.
|
|
146
178
|
|
|
147
179
|
## What this rule does NOT do
|
|
148
180
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
|
|
181
|
+
Display/reload/clear (`/chat-history*` commands). Auto-flip `enabled` or
|
|
182
|
+
`on_overflow`. Run when `enabled: false` (no silent logging, no
|
|
183
|
+
telemetry). Decide ownership heuristically — only `state` does that.
|
|
184
|
+
Double-write on HOOK platforms — when hooks fire structurally, the
|
|
185
|
+
agent does **not** also call `append`.
|
|
154
186
|
|
|
155
|
-
##
|
|
187
|
+
## Cloud Behavior
|
|
156
188
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- `token-efficiency` — never load the full log into context from this
|
|
162
|
-
rule; use `status` for metadata, `read --last N` for a tail.
|
|
189
|
+
On cloud surfaces (Claude.ai Web, Skills API) the rule is **fully inert** —
|
|
190
|
+
no `.agent-chat-history`, no `scripts/`, no Iron Law gates, no heartbeat,
|
|
191
|
+
no foreign/returning prompts, no overflow warning. Treat
|
|
192
|
+
`chat_history.enabled` as `false`; persistence is a local-agent concern.
|
|
163
193
|
|
|
164
|
-
##
|
|
194
|
+
## Interactions & references
|
|
165
195
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
- [`agent-settings`
|
|
171
|
-
- [`rule-type-governance`](rule-type-governance.md) — why this is `always`
|
|
196
|
+
- `ask-when-uncertain` + `user-interaction` — foreign/returning prompts use numbered options, one question per turn.
|
|
197
|
+
- `language-and-tone` — prompt translated at runtime; `.md` stays English.
|
|
198
|
+
- `onboarding-gate` — runs first; this rule activates only after it clears.
|
|
199
|
+
- `token-efficiency` — never load the full log; use `status` / `read --last N`.
|
|
200
|
+
- 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).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
alwaysApply: false
|
|
4
|
-
description: "Running CLI commands that produce verbose output — git, tests, linters, docker, build tools, artisan, npm, composer"
|
|
4
|
+
description: "Running CLI commands that produce verbose output — git, tests, linters, docker, build tools, artisan, npm, composer. Wrap with rtk when installed; tail/grep is fallback."
|
|
5
5
|
source: package
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -10,6 +10,28 @@ source: package
|
|
|
10
10
|
Loaded when actively working with code, tests, quality tools, CLI, or analysis.
|
|
11
11
|
For communication and response style rules → see the always-loaded `token-efficiency` rule.
|
|
12
12
|
|
|
13
|
+
## Iron Law — rtk first, tail/grep fallback
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
IF `rtk` IS INSTALLED, WRAP VERBOSE COMMANDS WITH rtk.
|
|
17
|
+
USE tail / grep / cat ONLY AS FALLBACK WHEN rtk HAS NO MATCHING SUBCOMMAND.
|
|
18
|
+
NEVER PIPE A STILL-RUNNING LONG COMMAND THROUGH tail — IT BUFFERS TO EOF.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Detection: `rtk_installed: true` in `.agent-settings.yml`, or `which rtk`
|
|
22
|
+
exits 0. Caching the result for the session is fine.
|
|
23
|
+
|
|
24
|
+
| Verbose command | Use | Fallback (no rtk) |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| CI-style suites, full test runs | `rtk err <cmd>` — only errors/warnings | redirect → tail → grep |
|
|
27
|
+
| Unit tests | `rtk test <cmd>` — only failures | redirect → tail → grep |
|
|
28
|
+
| `git status`/`log`/`diff` | `rtk git <subcmd>` | plain |
|
|
29
|
+
| `gh pr list`, `gh run view` | `rtk gh <subcmd>` | plain |
|
|
30
|
+
| Generic noisy command | `rtk summary <cmd>` or `rtk err <cmd>` | redirect → tail |
|
|
31
|
+
|
|
32
|
+
For the full rtk subcommand catalog and project-local filter setup → see
|
|
33
|
+
the `rtk-output-filtering` skill.
|
|
34
|
+
|
|
13
35
|
## Codebase Navigation
|
|
14
36
|
|
|
15
37
|
### Use what you already have
|
|
@@ -38,9 +60,10 @@ For communication and response style rules → see the always-loaded `token-effi
|
|
|
38
60
|
- **`view_range`** when you know the exact lines.
|
|
39
61
|
- **One `codebase-retrieval` call** with all symbols — batch, not 5 separate calls.
|
|
40
62
|
|
|
41
|
-
## Pattern: Redirect, Summarize, Target
|
|
63
|
+
## Fallback Pattern: Redirect, Summarize, Target
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
When `rtk` has no matching subcommand for the tool at hand, fall back to
|
|
66
|
+
this pattern. Every command that MAY produce more than ~30 lines of output:
|
|
44
67
|
|
|
45
68
|
### Step 1: Redirect to file
|
|
46
69
|
```bash
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
|
5
|
+
source: package
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Command Suggestion
|
|
9
|
+
|
|
10
|
+
When the user's prompt matches an eligible slash command, surface it
|
|
11
|
+
as a **numbered option** alongside an "as-is" escape hatch. The user
|
|
12
|
+
always picks. **Nothing auto-executes.** The suggestion layer is a
|
|
13
|
+
read-only shortcut *finder*, not an invocation path.
|
|
14
|
+
|
|
15
|
+
Engine: `scripts/command_suggester/`. Eligibility table:
|
|
16
|
+
[`agents/contexts/command-suggestion-eligibility.md`](../../agents/contexts/command-suggestion-eligibility.md).
|
|
17
|
+
Design:
|
|
18
|
+
[`road-to-context-aware-command-suggestion`](../../agents/roadmaps/road-to-context-aware-command-suggestion.md).
|
|
19
|
+
|
|
20
|
+
## Iron Law — never auto-execute
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
SUGGEST. NEVER INVOKE. THE USER PICKS, ALWAYS.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
A suggestion block emits options. It does **not** start a command
|
|
27
|
+
flow. The user picking option N triggers `slash-commands` on the
|
|
28
|
+
**next** turn — with all the command's own halts intact.
|
|
29
|
+
|
|
30
|
+
## When to fire
|
|
31
|
+
|
|
32
|
+
On a user turn that matches **all** of the following:
|
|
33
|
+
|
|
34
|
+
1. The message does **not** start with an explicit `/command` (those
|
|
35
|
+
bypass suggestion entirely — see `slash-commands`).
|
|
36
|
+
2. `commands.suggestion.enabled` is `true` (default).
|
|
37
|
+
3. The user has not issued `/command-suggestion-off` in this conversation.
|
|
38
|
+
4. No clarification is owed for the same turn (per
|
|
39
|
+
`ask-when-uncertain` — clarification wins; suggestion can fire next turn).
|
|
40
|
+
5. No active engine flow is mid-halt (e.g. an `/implement-ticket`
|
|
41
|
+
step waiting on the user — the active flow has the floor).
|
|
42
|
+
6. The matcher returns at least one match above the effective
|
|
43
|
+
`confidence_floor` after rank + cooldown + anti-noise.
|
|
44
|
+
|
|
45
|
+
When all six hold, the suggestion block is the **first and only**
|
|
46
|
+
thing the agent emits that turn. No tools, no edits, no other prose.
|
|
47
|
+
|
|
48
|
+
## What to emit
|
|
49
|
+
|
|
50
|
+
Render exactly one numbered-options block conforming to
|
|
51
|
+
`user-interaction`:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
> 💡 Your request matches a command. Pick one or run the prompt as-is:
|
|
55
|
+
>
|
|
56
|
+
> 1. /implement-ticket — drive ticket end-to-end through refine → plan → implement → test
|
|
57
|
+
> 2. /refine-ticket — tighten the AC and risks on a ticket before planning
|
|
58
|
+
> 3. Just run the prompt as-is, no command
|
|
59
|
+
|
|
60
|
+
**Recommendation: 1 — /implement-ticket** — the request matches its trigger description (`setze ticket abc-123 um`). Pick the last option to skip the command and run the prompt as written.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Rules — non-negotiable:
|
|
64
|
+
|
|
65
|
+
- The "run as-is" option is **always present**, **always last**, never removed.
|
|
66
|
+
- At most `commands.suggestion.max_options` command suggestions
|
|
67
|
+
precede the as-is option (default 4 → 5 total).
|
|
68
|
+
- Exactly **one** `Recommendation:` line follows the block, naming
|
|
69
|
+
the highest-scoring command — or no recommendation when the top
|
|
70
|
+
two scores are within 0.05 of each other (single-source-of-truth
|
|
71
|
+
Iron Law from `user-interaction`).
|
|
72
|
+
- Free-text replies count as the as-is option unless they
|
|
73
|
+
unambiguously name one of the listed commands.
|
|
74
|
+
|
|
75
|
+
## Subordination — when to stay silent
|
|
76
|
+
|
|
77
|
+
The suggestion rule is **junior** to:
|
|
78
|
+
|
|
79
|
+
- `scope-control` — never surfaces a git-op command behind a
|
|
80
|
+
permission gate the user already declined this turn.
|
|
81
|
+
- `ask-when-uncertain` — if a clarification is owed, the
|
|
82
|
+
clarification is the only question; suggestion suppresses for
|
|
83
|
+
that turn.
|
|
84
|
+
- `verify-before-complete` — suggestion does not interrupt an
|
|
85
|
+
evidence-gate verification that's already running.
|
|
86
|
+
- Any active role-mode contract (`role-mode-adherence`).
|
|
87
|
+
- Any active engine halt (`/implement-ticket`, `/work`, etc.).
|
|
88
|
+
|
|
89
|
+
On any conflict → suggestion stays silent. Zero output. The user's
|
|
90
|
+
prompt is processed as it would be without this rule.
|
|
91
|
+
|
|
92
|
+
## Anti-noise — silent when uncertain
|
|
93
|
+
|
|
94
|
+
The engine's `rank.py` already drops:
|
|
95
|
+
|
|
96
|
+
- Matches below the `confidence_floor` (default 0.6, per-command
|
|
97
|
+
override in frontmatter).
|
|
98
|
+
- Single matches scoring `< floor + 0.1` with no structural bonus
|
|
99
|
+
(high uncertainty isn't worth interrupting for).
|
|
100
|
+
- Short prompts (< 6 words) hitting > 2 commands with no structural
|
|
101
|
+
bonus (ticket key, file path) — too vague to disambiguate.
|
|
102
|
+
- Pure-continuation messages (`ok`, `weiter`, `mach weiter`, `go on`,
|
|
103
|
+
…) — no new intent signal, no structural bonus → silent.
|
|
104
|
+
- Suggestions that fired for the same `(command, evidence)` pair
|
|
105
|
+
within the cooldown window (default 10m, per-command override).
|
|
106
|
+
|
|
107
|
+
If the engine returns an empty list → emit nothing. The user's
|
|
108
|
+
prompt runs exactly as it would without this rule.
|
|
109
|
+
|
|
110
|
+
## What this rule does NOT do
|
|
111
|
+
|
|
112
|
+
- Invoke any command. Picking option N is what triggers `slash-commands`.
|
|
113
|
+
- Stack with other questions. One numbered-options block per turn.
|
|
114
|
+
- Re-trigger on its own output. Command names emitted in the
|
|
115
|
+
suggestion block are excluded from the next-turn matcher input.
|
|
116
|
+
- Override `enabled: false`, blocklist entries, or per-conversation opt-out.
|
|
117
|
+
- Suggest commands that are not in the locked eligibility table.
|
|
118
|
+
|
|
119
|
+
## Cloud Behavior
|
|
120
|
+
|
|
121
|
+
On cloud surfaces (Claude.ai Web, Skills API) the rule is **inert**
|
|
122
|
+
unless the suggester package is shipped in the bundle. Treat
|
|
123
|
+
`commands.suggestion.enabled` as `false` when the engine is not
|
|
124
|
+
available — degrade silently, never crash the turn.
|
|
125
|
+
|
|
126
|
+
## Interactions
|
|
127
|
+
|
|
128
|
+
- [`slash-commands`](slash-commands.md) — explicit `/command` skips suggestion entirely.
|
|
129
|
+
- [`user-interaction`](user-interaction.md) — numbered-options Iron Law and single-source recommendation.
|
|
130
|
+
- [`ask-when-uncertain`](ask-when-uncertain.md) — clarification wins on conflict.
|
|
131
|
+
- [`scope-control`](scope-control.md) — git-op gates outrank suggestion.
|
|
132
|
+
- [`role-mode-adherence`](role-mode-adherence.md) — active mode contract outranks suggestion.
|
|
133
|
+
- [`agents/contexts/command-suggestion-eligibility.md`](../../agents/contexts/command-suggestion-eligibility.md) — locked eligibility table.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: "always"
|
|
3
|
+
description: "Commit policy — never commit and never ask about committing unless the user said so this turn, the roadmap authorizes it, or a commit command is invoked"
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
source: package
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Commit Policy
|
|
9
|
+
|
|
10
|
+
Local commits don't change remote state, but committing prematurely
|
|
11
|
+
makes review harder. **Canonical** rule, referenced by
|
|
12
|
+
[`autonomous-execution`](autonomous-execution.md),
|
|
13
|
+
[`scope-control`](scope-control.md), and roadmap commands.
|
|
14
|
+
|
|
15
|
+
## The Iron Law
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
NEVER COMMIT. NEVER ASK ABOUT COMMITTING.
|
|
19
|
+
EXCEPTIONS ARE EXPLICIT, NOT INFERRED.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Applies regardless of `personal.autonomy`, conversation momentum, or
|
|
23
|
+
"clean stopping point". Default is **no commit, no question**.
|
|
24
|
+
|
|
25
|
+
## Exceptions — when committing IS allowed
|
|
26
|
+
|
|
27
|
+
Four ways only:
|
|
28
|
+
|
|
29
|
+
1. **User says so this turn** — explicit phrase like "commit this now",
|
|
30
|
+
"go ahead and commit". This commit only, not standing.
|
|
31
|
+
2. **Standing instruction not yet revoked** — earlier "commit after
|
|
32
|
+
every phase" or similar, not yet revoked. Cache and honor.
|
|
33
|
+
3. **Commit command invoked** — `/commit` (with confirmation) or
|
|
34
|
+
`/commit-in-chunks` (auto-split, no confirmation).
|
|
35
|
+
4. **Roadmap authorization** — roadmap lists explicit commit steps
|
|
36
|
+
and user invoked execution. See [Roadmap-authorized commits](#roadmap-authorized-commits).
|
|
37
|
+
|
|
38
|
+
Anything else → no commit.
|
|
39
|
+
|
|
40
|
+
## Hard Floor still applies — bulk deletions and infra changes
|
|
41
|
+
|
|
42
|
+
Even when one of the four exceptions above authorizes a commit, the
|
|
43
|
+
[`non-destructive-by-default`](non-destructive-by-default.md) Hard
|
|
44
|
+
Floor still fires when the diff:
|
|
45
|
+
|
|
46
|
+
- Removes a directory
|
|
47
|
+
- Deletes ≥5 unrelated files
|
|
48
|
+
- Touches Terraform / Pulumi / k8s manifests / Ansible / cloud-config
|
|
49
|
+
|
|
50
|
+
In those cases, **surface the diff** (paths + counts) and confirm
|
|
51
|
+
this turn before committing — even under `/commit-in-chunks`,
|
|
52
|
+
roadmap pre-scan authorization, or an explicit "commit this now". The
|
|
53
|
+
four exceptions cover *whether* commits happen; the Hard Floor covers
|
|
54
|
+
*which diffs* still need a separate confirmation.
|
|
55
|
+
|
|
56
|
+
## NEVER ask about committing
|
|
57
|
+
|
|
58
|
+
Asking "should I commit this?", "do we want to commit?", or any
|
|
59
|
+
variant is **forbidden**. User invokes a command or says so
|
|
60
|
+
explicitly. Don't surface a commit option in numbered-options unless
|
|
61
|
+
the rest of the message would be incomplete without it.
|
|
62
|
+
|
|
63
|
+
Speech-act check from [`autonomous-execution`](autonomous-execution.md#speech-act-check--the-phrase-must-be-a-meta-instruction-to-the-agent)
|
|
64
|
+
applies in reverse: an explicit commit phrase inside a quote, code
|
|
65
|
+
block, or content (e.g. a copy-paste of a chat log) is **not** a
|
|
66
|
+
permission grant.
|
|
67
|
+
|
|
68
|
+
## NEVER write commit steps into roadmaps unsolicited
|
|
69
|
+
|
|
70
|
+
When **creating** a roadmap (`/roadmap-create`, `/feature-roadmap`,
|
|
71
|
+
or any roadmap-producing flow), do **not** include commit steps
|
|
72
|
+
unless the user explicitly requested them. Commits are a delivery
|
|
73
|
+
decision; roadmaps plan **work**.
|
|
74
|
+
|
|
75
|
+
If the user explicitly wants commit steps, write them clearly
|
|
76
|
+
(e.g. "Commit phase X: chore: …").
|
|
77
|
+
|
|
78
|
+
## Roadmap-authorized commits
|
|
79
|
+
|
|
80
|
+
When **executing** a roadmap that contains commit steps:
|
|
81
|
+
|
|
82
|
+
- **Non-autonomous** (`autonomy: off`, or `auto` before opt-in) —
|
|
83
|
+
agent may ask before each commit step. User retains step-level
|
|
84
|
+
control.
|
|
85
|
+
- **Autonomous** (`autonomy: on`, or `auto` after opt-in) — agent
|
|
86
|
+
pre-scans the roadmap **before starting execution**. Commit steps
|
|
87
|
+
found → ask **once** upfront: "Roadmap contains N commit steps —
|
|
88
|
+
should they be executed?". Cache the answer; honor or skip for
|
|
89
|
+
the rest of the run. No re-asking per step.
|
|
90
|
+
|
|
91
|
+
The pre-scan ask is the **only** permitted commit-related question
|
|
92
|
+
in autonomous mode.
|
|
93
|
+
|
|
94
|
+
## See also
|
|
95
|
+
|
|
96
|
+
- [`autonomous-execution`](autonomous-execution.md) — trivial-question suppression survives this rule.
|
|
97
|
+
- [`scope-control`](scope-control.md) — push/merge/branch/PR/tag stay permission-gated.
|
|
98
|
+
- [`/commit`](../commands/commit.md) — split + commit with confirmation.
|
|
99
|
+
- [`/commit-in-chunks`](../commands/commit-in-chunks.md) — auto-split + commit without confirmation.
|