@event4u/agent-config 1.9.1 → 1.13.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 +15 -0
- package/.agent-src/commands/chat-history-clear.md +98 -0
- package/.agent-src/commands/chat-history-resume.md +178 -0
- package/.agent-src/commands/chat-history.md +102 -0
- package/.agent-src/commands/compress.md +9 -9
- package/.agent-src/commands/copilot-agents-init.md +1 -1
- package/.agent-src/commands/fix-portability.md +2 -2
- package/.agent-src/commands/fix-pr-bot-comments.md +1 -1
- package/.agent-src/commands/fix-pr-developer-comments.md +1 -1
- package/.agent-src/commands/fix-references.md +2 -2
- package/.agent-src/commands/mode.md +5 -5
- package/.agent-src/commands/onboard.md +171 -0
- package/.agent-src/commands/roadmap-create.md +7 -2
- package/.agent-src/commands/roadmap-execute.md +2 -2
- package/.agent-src/commands/set-cost-profile.md +101 -0
- package/.agent-src/commands/sync-agent-settings.md +122 -0
- package/.agent-src/commands/sync-gitignore.md +104 -0
- package/.agent-src/commands/tests-execute.md +6 -6
- package/.agent-src/commands/upstream-contribute.md +5 -4
- package/.agent-src/contexts/augment-infrastructure.md +2 -2
- package/.agent-src/contexts/override-system.md +1 -1
- package/.agent-src/contexts/subagent-configuration.md +3 -3
- package/.agent-src/guidelines/agent-infra/layered-settings.md +48 -5
- package/.agent-src/rules/ask-when-uncertain.md +56 -3
- package/.agent-src/rules/augment-portability.md +52 -1
- package/.agent-src/rules/augment-source-of-truth.md +10 -10
- package/.agent-src/rules/chat-history.md +171 -0
- package/.agent-src/rules/docker-commands.md +5 -7
- package/.agent-src/rules/docs-sync.md +13 -9
- package/.agent-src/rules/improve-before-implement.md +2 -0
- package/.agent-src/rules/onboarding-gate.md +94 -0
- package/.agent-src/rules/package-ci-checks.md +6 -5
- package/.agent-src/rules/roadmap-progress-sync.md +24 -13
- package/.agent-src/rules/size-enforcement.md +1 -1
- package/.agent-src/rules/skill-quality.md +1 -1
- package/.agent-src/rules/think-before-action.md +1 -0
- package/.agent-src/rules/user-interaction.md +53 -7
- package/.agent-src/scripts/update_roadmap_progress.py +57 -10
- package/.agent-src/skills/check-refs/SKILL.md +1 -1
- package/.agent-src/skills/command-routing/SKILL.md +1 -1
- package/.agent-src/skills/command-writing/SKILL.md +4 -3
- package/.agent-src/skills/file-editor/SKILL.md +2 -2
- package/.agent-src/skills/guideline-writing/SKILL.md +4 -3
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +2 -2
- package/.agent-src/skills/lint-skills/SKILL.md +1 -1
- package/.agent-src/skills/roadmap-management/SKILL.md +13 -10
- package/.agent-src/skills/rtk-output-filtering/SKILL.md +20 -30
- package/.agent-src/skills/rule-writing/SKILL.md +5 -5
- package/.agent-src/skills/terragrunt/SKILL.md +0 -8
- package/.agent-src/skills/upstream-contribute/SKILL.md +5 -4
- package/.agent-src/templates/agent-settings.md +86 -34
- 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/scripts/memory_lookup.py +382 -21
- package/.agent-src/templates/scripts/memory_status.py +110 -9
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +320 -0
- package/CONTRIBUTING.md +89 -40
- package/README.md +24 -3
- package/composer.json +5 -1
- package/config/agent-settings.template.yml +45 -6
- package/config/gitignore-block.txt +24 -0
- package/config/profiles/balanced.ini +5 -0
- package/config/profiles/full.ini +5 -0
- package/config/profiles/minimal.ini +5 -0
- package/docs/customization.md +30 -4
- package/docs/getting-started.md +53 -3
- package/docs/mcp.md +15 -4
- package/package.json +21 -2
- package/scripts/agent-config +230 -0
- package/scripts/chat_history.py +519 -0
- package/scripts/check_portability.py +151 -1
- package/scripts/install.py +55 -3
- package/scripts/install.sh +50 -21
- package/scripts/mcp_render.py +30 -16
- package/scripts/memory_lookup.py +143 -7
- package/scripts/memory_status.py +76 -14
- package/scripts/postinstall.sh +16 -0
- package/scripts/release.py +588 -0
- package/scripts/sync_agent_settings.py +211 -0
- package/scripts/sync_gitignore.py +226 -0
- package/templates/agent-config-wrapper.sh +47 -0
- package/.agent-src/commands/config-agent-settings.md +0 -126
- package/.agent-src/skills/eloquent/evals/last-run.json +0 -99
|
@@ -62,3 +62,18 @@ Show the handoff prompt in a fenced code block and say:
|
|
|
62
62
|
- **Open tasks are critical** — the new chat needs to know what's left.
|
|
63
63
|
- **Decisions are important** — prevents the new chat from re-asking settled questions.
|
|
64
64
|
- **File list is optional** — only include if the new chat will need to edit specific files.
|
|
65
|
+
|
|
66
|
+
## When to use this vs. `/chat-history-resume`
|
|
67
|
+
|
|
68
|
+
- `/agent-handoff` is **push-based**: you copy a short summary into the
|
|
69
|
+
new chat. Works across tools (Augment → Claude Code), across machines,
|
|
70
|
+
and without any persistent file.
|
|
71
|
+
- [`/chat-history-resume`](chat-history-resume.md) is **pull-based**: the
|
|
72
|
+
new chat reads `.agent-chat-history` from disk (written by the
|
|
73
|
+
[`chat-history`](../rules/chat-history.md) rule). Works only on the
|
|
74
|
+
same machine and same repo, but captures more detail (every phase /
|
|
75
|
+
tool call / decision the prior session logged).
|
|
76
|
+
|
|
77
|
+
Prefer `/agent-handoff` for planned context switches; prefer
|
|
78
|
+
`/chat-history-resume` after a crash or after switching tools within the
|
|
79
|
+
same workspace.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chat-history-clear
|
|
3
|
+
description: Manually delete the persistent chat-history log — asks for confirmation, optionally archives to a timestamped backup before wiping
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /chat-history-clear
|
|
8
|
+
|
|
9
|
+
Wipes `.agent-chat-history`. Use when the log is stale (wrong session),
|
|
10
|
+
bloated beyond usefulness, or contains information you do not want
|
|
11
|
+
persisted on disk.
|
|
12
|
+
|
|
13
|
+
This command is **destructive** — always asks for confirmation before
|
|
14
|
+
touching the file, unless the file does not exist in the first place.
|
|
15
|
+
|
|
16
|
+
## When NOT to use
|
|
17
|
+
|
|
18
|
+
- Inspect before deleting → [`/chat-history`](chat-history.md).
|
|
19
|
+
- Keep the entries but re-point the header → [`/chat-history-resume`](chat-history-resume.md).
|
|
20
|
+
- Disable logging entirely → set `chat_history.enabled: false` in
|
|
21
|
+
`.agent-settings.yml`; see
|
|
22
|
+
[`layered-settings`](../guidelines/agent-infra/layered-settings.md#section-aware-merge-rules).
|
|
23
|
+
Disabling does not delete the existing file; run this command
|
|
24
|
+
afterwards if you also want it gone.
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
### 1. Check current state
|
|
29
|
+
|
|
30
|
+
Run `scripts/chat_history.py status`. If `exists: false`, tell the user
|
|
31
|
+
and stop:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
> 📒 No .agent-chat-history to clear.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Show what is about to be deleted
|
|
38
|
+
|
|
39
|
+
Render a short preview so the user sees what they are wiping:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
> 📒 About to clear .agent-chat-history
|
|
43
|
+
>
|
|
44
|
+
> Size: {size_kb} KB
|
|
45
|
+
> Entries: {entries}
|
|
46
|
+
> Session: {short_fp} (started {created_at_relative})
|
|
47
|
+
>
|
|
48
|
+
> 1. Archive — rename to .agent-chat-history.{YYYYMMDD-HHMMSS}.bak, then start fresh
|
|
49
|
+
> 2. Delete — permanent, no backup
|
|
50
|
+
> 3. Cancel — keep the file as-is
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. Act on the choice
|
|
54
|
+
|
|
55
|
+
- `1` (Archive) → `mv .agent-chat-history
|
|
56
|
+
.agent-chat-history.{timestamp}.bak`. The rule will create a fresh
|
|
57
|
+
file on the next append.
|
|
58
|
+
- `2` (Delete) → run `scripts/chat_history.py clear`. Permanent.
|
|
59
|
+
- `3` (Cancel) → stop. Make no changes.
|
|
60
|
+
|
|
61
|
+
Free-text replies ("abbrechen", "keep it", "nevermind") count as `3`.
|
|
62
|
+
An unrecognized reply also counts as `3` — never delete on ambiguous
|
|
63
|
+
input.
|
|
64
|
+
|
|
65
|
+
### 4. Confirm
|
|
66
|
+
|
|
67
|
+
After a successful archive or delete, print a one-line confirmation:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
> 📒 Archived to .agent-chat-history.{timestamp}.bak
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
or
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
> 📒 .agent-chat-history deleted.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Do **not** re-enable logging or change `.agent-settings.yml` as a side
|
|
80
|
+
effect — this command is scoped to the file on disk only.
|
|
81
|
+
|
|
82
|
+
## Gotchas
|
|
83
|
+
|
|
84
|
+
- `.agent-chat-history.*.bak` files are also git-ignored by the
|
|
85
|
+
installer's `.gitignore` block. They accumulate if archived often —
|
|
86
|
+
users can delete them manually.
|
|
87
|
+
- If `chat_history.enabled: false`, the file will **not** be recreated
|
|
88
|
+
after clearing. That is usually fine, but mention it so the user
|
|
89
|
+
knows the log is now silent.
|
|
90
|
+
- Deletion cannot be undone. When in doubt, prefer option `1` (Archive).
|
|
91
|
+
|
|
92
|
+
## See also
|
|
93
|
+
|
|
94
|
+
- [`chat-history`](../rules/chat-history.md) — the rule that writes the file
|
|
95
|
+
- [`/chat-history`](chat-history.md) — status inspection
|
|
96
|
+
- [`/chat-history-resume`](chat-history-resume.md) — load + adopt instead of wipe
|
|
97
|
+
- [`agent-settings` template](../templates/agent-settings.md) — `chat_history.*` reference
|
|
98
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — helper API
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chat-history-resume
|
|
3
|
+
description: Load the persistent chat-history log into the current conversation — picks match/returning/foreign flow and supports resume, merge, replace, or continue
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /chat-history-resume
|
|
8
|
+
|
|
9
|
+
Reconnects the current conversation with an existing `.agent-chat-history`
|
|
10
|
+
file. Depending on the 4-state ownership check, it routes to the right
|
|
11
|
+
flow: silent summarize, adopt, merge, or replace.
|
|
12
|
+
|
|
13
|
+
Use after a crashed chat, after switching tools (Augment → Claude Code),
|
|
14
|
+
or when the agent showed the foreign- or returning-session prompt from
|
|
15
|
+
the [`chat-history`](../rules/chat-history.md) rule and the user picked
|
|
16
|
+
"resume".
|
|
17
|
+
|
|
18
|
+
## When NOT to use
|
|
19
|
+
|
|
20
|
+
- Just inspect metadata → [`/chat-history`](chat-history.md).
|
|
21
|
+
- Start fresh instead of resuming → [`/chat-history-clear`](chat-history-clear.md)
|
|
22
|
+
or pick "New start" in the foreign prompt.
|
|
23
|
+
- Logging is disabled (`chat_history.enabled: false`) → enable it in
|
|
24
|
+
`.agent-settings.yml` first; this command refuses to run otherwise.
|
|
25
|
+
|
|
26
|
+
## Preconditions
|
|
27
|
+
|
|
28
|
+
- `.agent-settings.yml` exists and `chat_history.enabled: true`.
|
|
29
|
+
- `.agent-chat-history` exists at the project root.
|
|
30
|
+
|
|
31
|
+
If either is missing, tell the user and stop — do not create files here.
|
|
32
|
+
|
|
33
|
+
## Steps
|
|
34
|
+
|
|
35
|
+
### 1. Load status
|
|
36
|
+
|
|
37
|
+
Run `scripts/chat_history.py status`. If `exists: false` or
|
|
38
|
+
`entries: 0`, tell the user there is nothing to resume and stop.
|
|
39
|
+
|
|
40
|
+
### 2. Determine ownership state
|
|
41
|
+
|
|
42
|
+
Run `scripts/chat_history.py state --first-user-msg "<current first user
|
|
43
|
+
message>"`. Branch on the result:
|
|
44
|
+
|
|
45
|
+
- `match` → step 3a (already owner)
|
|
46
|
+
- `returning` → step 3b (pick Merge / Replace / Continue)
|
|
47
|
+
- `foreign` → step 3c (pick Resume / New start / Ignore)
|
|
48
|
+
- `missing` → header corrupt; tell the user and suggest
|
|
49
|
+
`/chat-history-clear` to start fresh. Stop.
|
|
50
|
+
|
|
51
|
+
### 3a. `match` — already owner
|
|
52
|
+
|
|
53
|
+
Nothing to adopt. Skip to step 4 (summarize) for the user's benefit.
|
|
54
|
+
|
|
55
|
+
### 3b. `returning` — this chat once owned the file
|
|
56
|
+
|
|
57
|
+
Another session took over. Present the Returning-Prompt from the rule
|
|
58
|
+
and wait for a number:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
> 📒 Welcome back. This chat once owned the history file; another
|
|
62
|
+
> session has written to it since.
|
|
63
|
+
>
|
|
64
|
+
> On-file entries: {N} Size: {X} KB
|
|
65
|
+
>
|
|
66
|
+
> 1. Merge — my in-memory history first, the foreign entries after
|
|
67
|
+
> 2. Replace — wipe the foreign entries, keep only my history
|
|
68
|
+
> 3. Continue — leave the file as-is; only new entries from now on
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- **1 (Merge)** — build the in-memory entries list (see below), then:
|
|
72
|
+
```bash
|
|
73
|
+
scripts/chat_history.py prepend --entries-json '<list>'
|
|
74
|
+
scripts/chat_history.py adopt --first-user-msg "<msg>"
|
|
75
|
+
```
|
|
76
|
+
- **2 (Replace)** — build the in-memory entries list, then:
|
|
77
|
+
```bash
|
|
78
|
+
scripts/chat_history.py reset --first-user-msg "<msg>" \
|
|
79
|
+
--freq <frequency> --entries-json '<list>'
|
|
80
|
+
```
|
|
81
|
+
- **3 (Continue)** —
|
|
82
|
+
```bash
|
|
83
|
+
scripts/chat_history.py adopt --first-user-msg "<msg>"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 3c. `foreign` — new chat finds an unknown session's file
|
|
87
|
+
|
|
88
|
+
Present the Foreign-Prompt from the rule and wait for a number:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
> 📒 Found chat history from an unknown session.
|
|
92
|
+
>
|
|
93
|
+
> Entries on file: {N} Size: {X} KB
|
|
94
|
+
>
|
|
95
|
+
> 1. Resume — adopt this file, load entries as context, keep appending
|
|
96
|
+
> 2. New start — archive to .agent-chat-history.bak, init fresh
|
|
97
|
+
> 3. Ignore — leave the file untouched, disable logging for this session
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- **1 (Resume)** — `adopt --first-user-msg "<msg>"`.
|
|
101
|
+
- **2 (New start)** — rename file to `.agent-chat-history.bak`, run
|
|
102
|
+
`init --first-user-msg "<msg>" --freq <frequency>`. Skip summary.
|
|
103
|
+
- **3 (Ignore)** — do nothing. Report that logging is off for this
|
|
104
|
+
conversation. Stop.
|
|
105
|
+
|
|
106
|
+
### 3d. Building the in-memory entries list (Merge / Replace)
|
|
107
|
+
|
|
108
|
+
Reconstruct the agent's prior turns as a JSON array:
|
|
109
|
+
|
|
110
|
+
- one `{"t":"user","text":"<preview>","ts":"<iso>"}` per user message
|
|
111
|
+
- one `{"t":"agent","text":"<preview>","ts":"<iso>"}` per agent reply
|
|
112
|
+
- `text` previews capped at ~200 chars (whitespace flattened)
|
|
113
|
+
- timestamps in ISO-8601 UTC (current time is acceptable if exact times
|
|
114
|
+
are unknown; order is what matters)
|
|
115
|
+
- no tool-call payloads, no file contents, no secrets
|
|
116
|
+
|
|
117
|
+
If the list is large (>30 KB), stream it via stdin:
|
|
118
|
+
`prepend --entries-stdin` or `reset --entries-stdin`.
|
|
119
|
+
|
|
120
|
+
### 4. Overflow check
|
|
121
|
+
|
|
122
|
+
After any Merge or Replace, run
|
|
123
|
+
`scripts/chat_history.py rotate --max-kb <max_size_kb>
|
|
124
|
+
--mode <on_overflow>` so the combined body stays within the user's
|
|
125
|
+
budget.
|
|
126
|
+
|
|
127
|
+
### 5. Summarize into conversation context
|
|
128
|
+
|
|
129
|
+
Read the entries via the helper (`read --all` or `read --last N` for
|
|
130
|
+
bounded). Produce a short, structured summary — **not** a verbatim dump:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
> 📒 Resumed chat-history ({entries} entries, {age})
|
|
134
|
+
>
|
|
135
|
+
> ## What was done
|
|
136
|
+
> - {1–3 bullets from agent/decision entries}
|
|
137
|
+
>
|
|
138
|
+
> ## Open threads
|
|
139
|
+
> - {1–3 bullets from the most recent entries and any pending questions}
|
|
140
|
+
>
|
|
141
|
+
> ## Key decisions
|
|
142
|
+
> - {decisions captured during the prior session}
|
|
143
|
+
>
|
|
144
|
+
> Ready to continue. What would you like to do?
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Keep the summary under ~25 lines. Rationale: this is input into the new
|
|
148
|
+
turn, not a display artifact (see
|
|
149
|
+
[`token-efficiency`](../rules/token-efficiency.md)).
|
|
150
|
+
|
|
151
|
+
### 6. Hand control back to the user
|
|
152
|
+
|
|
153
|
+
After presenting the summary, stop and wait. Do not auto-resume work —
|
|
154
|
+
the user decides what to do next.
|
|
155
|
+
|
|
156
|
+
## Gotchas
|
|
157
|
+
|
|
158
|
+
- **Iron law — one question at a time.** Even if the log contains
|
|
159
|
+
several open threads, ask about one at a time after the summary
|
|
160
|
+
(see [`ask-when-uncertain`](../rules/ask-when-uncertain.md)).
|
|
161
|
+
- `adopt` rewrites the header in place and pushes the previous fp into
|
|
162
|
+
`former_fps` (capped at 10). No backup is created — use
|
|
163
|
+
`/chat-history-clear` first if you want a clean slate.
|
|
164
|
+
- `reset` discards whatever was on disk. Only use it when the user
|
|
165
|
+
explicitly picks "Replace".
|
|
166
|
+
- The summary is derived from the agent's reading of the JSONL. Old
|
|
167
|
+
entries may be incomplete (especially under `per_turn` with
|
|
168
|
+
previews only). Flag gaps explicitly.
|
|
169
|
+
|
|
170
|
+
## See also
|
|
171
|
+
|
|
172
|
+
- [`chat-history`](../rules/chat-history.md) — the rule that triggers
|
|
173
|
+
this command via the foreign- and returning-session prompts
|
|
174
|
+
- [`/chat-history`](chat-history.md) — status inspection without adopting
|
|
175
|
+
- [`/chat-history-clear`](chat-history-clear.md) — wipe instead of adopt
|
|
176
|
+
- [`/agent-handoff`](agent-handoff.md) — complementary: generates a
|
|
177
|
+
paste-into-new-chat prompt (no disk file)
|
|
178
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — helper API
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chat-history
|
|
3
|
+
description: Show the status of the persistent chat-history log — file size, entry count, header fingerprint, age, and the last few entries
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /chat-history
|
|
8
|
+
|
|
9
|
+
Inspect `.agent-chat-history` — the JSONL log maintained by the
|
|
10
|
+
[`chat-history`](../rules/chat-history.md) rule for crash recovery.
|
|
11
|
+
|
|
12
|
+
Shows:
|
|
13
|
+
|
|
14
|
+
- Whether the file exists and whether logging is currently enabled
|
|
15
|
+
- File size vs `max_size_kb`
|
|
16
|
+
- Header metadata: fingerprint preview, created-at, `frequency`
|
|
17
|
+
- Entry count and age of the oldest/newest entry
|
|
18
|
+
- A peek at the last 3–5 entries so the user can see what was captured
|
|
19
|
+
|
|
20
|
+
Read-only — this command never writes to the file.
|
|
21
|
+
|
|
22
|
+
## When NOT to use
|
|
23
|
+
|
|
24
|
+
- Load the log back into the conversation for context →
|
|
25
|
+
[`/chat-history-resume`](chat-history-resume.md).
|
|
26
|
+
- Wipe the file → [`/chat-history-clear`](chat-history-clear.md).
|
|
27
|
+
- Configure logging behavior → edit `.agent-settings.yml` directly
|
|
28
|
+
(`chat_history.*`); see
|
|
29
|
+
[`layered-settings`](../guidelines/agent-infra/layered-settings.md#section-aware-merge-rules).
|
|
30
|
+
|
|
31
|
+
## Steps
|
|
32
|
+
|
|
33
|
+
### 1. Check if enabled
|
|
34
|
+
|
|
35
|
+
Read `chat_history.enabled` from `.agent-settings.yml`. If `false` or
|
|
36
|
+
the section is missing, say so and stop:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
> 📒 chat-history is disabled (chat_history.enabled = false).
|
|
40
|
+
> Set it to true in .agent-settings.yml to start logging.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Read status via helper
|
|
44
|
+
|
|
45
|
+
Run `scripts/chat_history.py status`. The helper returns a JSON object
|
|
46
|
+
with `exists`, `size_bytes`, `size_kb`, `entries`, `header`, and `path`.
|
|
47
|
+
|
|
48
|
+
If `exists: false`, tell the user the file has not been created yet —
|
|
49
|
+
it will be created on the next agent turn that writes an entry.
|
|
50
|
+
|
|
51
|
+
### 3. Read last N entries
|
|
52
|
+
|
|
53
|
+
Run `scripts/chat_history.py read --last 5` (or equivalent — see the
|
|
54
|
+
helper's CLI). Capture timestamps and entry types without loading the
|
|
55
|
+
full file.
|
|
56
|
+
|
|
57
|
+
### 4. Present the summary
|
|
58
|
+
|
|
59
|
+
Render a concise report:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
> 📒 chat-history status
|
|
63
|
+
>
|
|
64
|
+
> File: .agent-chat-history ({size_kb} KB / {max_size_kb} KB)
|
|
65
|
+
> Entries: {entries}
|
|
66
|
+
> Fingerprint:{short_fp} (session started {created_at_relative})
|
|
67
|
+
> Frequency: {frequency}
|
|
68
|
+
> Overflow: {on_overflow}
|
|
69
|
+
>
|
|
70
|
+
> Last entries:
|
|
71
|
+
> {ts_1} {type_1} {preview_1}
|
|
72
|
+
> {ts_2} {type_2} {preview_2}
|
|
73
|
+
> ...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Keep previews short (≤ 60 chars). Do not render the full entry text
|
|
77
|
+
unless the user asks (avoids flooding the conversation with old log
|
|
78
|
+
data, see [`token-efficiency`](../rules/token-efficiency.md)).
|
|
79
|
+
|
|
80
|
+
### 5. Offer follow-ups (optional)
|
|
81
|
+
|
|
82
|
+
If the file exists and the fingerprint does **not** match the current
|
|
83
|
+
session, suggest `/chat-history-resume` to adopt it.
|
|
84
|
+
|
|
85
|
+
If the file is close to `max_size_kb` (> 80 %), mention it — the next
|
|
86
|
+
append may trigger overflow handling.
|
|
87
|
+
|
|
88
|
+
## Gotchas
|
|
89
|
+
|
|
90
|
+
- `.agent-chat-history` is git-ignored. This command never commits.
|
|
91
|
+
- The helper is the only way to read the file — do not cat or parse
|
|
92
|
+
the JSONL directly; entry shape is owned by `scripts/chat_history.py`.
|
|
93
|
+
- If `exists: false` but the rule says logging is enabled, the file is
|
|
94
|
+
created lazily on the first append. That is expected — not an error.
|
|
95
|
+
|
|
96
|
+
## See also
|
|
97
|
+
|
|
98
|
+
- [`chat-history`](../rules/chat-history.md) — the rule that writes the file
|
|
99
|
+
- [`/chat-history-resume`](chat-history-resume.md) — adopt + load
|
|
100
|
+
- [`/chat-history-clear`](chat-history-clear.md) — wipe
|
|
101
|
+
- [`agent-settings` template](../templates/agent-settings.md) — `chat_history.*` reference
|
|
102
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — helper API
|
|
@@ -16,7 +16,7 @@ Only changed files need recompression — saving tokens and time.
|
|
|
16
16
|
## Step 1: Sync non-.md files
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
|
|
19
|
+
bash scripts/compress.sh --sync
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
This copies non-`.md` files (`.php`, etc.), deletes stale files, and shows the count of
|
|
@@ -25,13 +25,13 @@ changed `.md` files that need compression.
|
|
|
25
25
|
## Step 2: Get changed files
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
|
|
28
|
+
bash scripts/compress.sh --changed
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This lists only `.md` files whose source has changed since the last compression (based on
|
|
32
32
|
stored SHA-256 hashes). If no files changed → you're done.
|
|
33
33
|
|
|
34
|
-
If you need to see ALL files regardless of change status: `
|
|
34
|
+
If you need to see ALL files regardless of change status: `bash scripts/compress.sh --list`.
|
|
35
35
|
|
|
36
36
|
## Step 3: Compress each changed .md file
|
|
37
37
|
|
|
@@ -97,7 +97,7 @@ Common errors and how to fix them:
|
|
|
97
97
|
**Do NOT call `mark-done` until this file has zero 🔴 errors.**
|
|
98
98
|
|
|
99
99
|
8. Show word count: `{original} → {compressed} words ({saved}% saved)`
|
|
100
|
-
9. **Mark as done:** `
|
|
100
|
+
9. **Mark as done:** `bash scripts/compress.sh --mark-done {path}`
|
|
101
101
|
|
|
102
102
|
### Batch processing
|
|
103
103
|
|
|
@@ -113,7 +113,7 @@ Batch 1/5 complete: 10 files, avg 42% saved
|
|
|
113
113
|
Run BOTH checks. Both must pass before finishing.
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
|
|
116
|
+
bash scripts/compress.sh --check
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Must show ✅ (hashes in sync).
|
|
@@ -132,9 +132,9 @@ Show a summary table with per-category stats (files compressed, avg savings).
|
|
|
132
132
|
## Hash management
|
|
133
133
|
|
|
134
134
|
- Hashes are stored in `.augment/.compression-hashes.json` (committed to Git).
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
initial full compression or when bootstrapping the hash file).
|
|
135
|
+
- `bash scripts/compress.sh --sync` automatically cleans up hashes for deleted source files.
|
|
136
|
+
- `bash scripts/compress.sh --mark-all-done` marks ALL current `.md` files as compressed
|
|
137
|
+
(useful after an initial full compression or when bootstrapping the hash file).
|
|
138
138
|
- A file with no stored hash is always treated as "changed".
|
|
139
139
|
|
|
140
140
|
## Compression quality checklist
|
|
@@ -174,4 +174,4 @@ Unsafe (DO NOT do this):
|
|
|
174
174
|
- **Only write to `.augment/`** — the compressed output directory.
|
|
175
175
|
- **Preserve ALL technical content** — only compress natural language prose.
|
|
176
176
|
- **YAML frontmatter** in command/skill files must be preserved exactly.
|
|
177
|
-
- **Always run `
|
|
177
|
+
- **Always run `bash scripts/compress.sh --mark-done {path}`** after writing each compressed file.
|
|
@@ -134,7 +134,7 @@ Next steps:
|
|
|
134
134
|
### 7. Follow-ups
|
|
135
135
|
|
|
136
136
|
If `agents/` directory does not exist, suggest running `/agents-prepare`.
|
|
137
|
-
If `.agent-settings.yml` does not exist, suggest running `/
|
|
137
|
+
If `.agent-settings.yml` does not exist, suggest running `scripts/install` (then `/onboard` for first-run setup).
|
|
138
138
|
|
|
139
139
|
## Rules
|
|
140
140
|
|
|
@@ -71,7 +71,7 @@ Present a summary:
|
|
|
71
71
|
|
|
72
72
|
### 5. Apply fixes
|
|
73
73
|
|
|
74
|
-
Edit files in `.agent-src.uncompressed/`, then run `
|
|
74
|
+
Edit files in `.agent-src.uncompressed/`, then run `bash scripts/compress.sh --sync` to regenerate `.agent-src/` and `.augment/`.
|
|
75
75
|
|
|
76
76
|
After all fixes, re-run:
|
|
77
77
|
|
|
@@ -90,7 +90,7 @@ python3 scripts/compress.py --mark-done "{relative_path}"
|
|
|
90
90
|
## Rules
|
|
91
91
|
|
|
92
92
|
- **Always fix in `.agent-src.uncompressed/`** — never edit `.agent-src/` or `.augment/` directly.
|
|
93
|
-
- **Run `
|
|
93
|
+
- **Run `bash scripts/compress.sh --sync`** after fixing to regenerate `.agent-src/` and `.augment/`.
|
|
94
94
|
- **Do NOT commit or push.**
|
|
95
95
|
- **`agents/` directory is allowed** to have project-specific references — skip it.
|
|
96
96
|
- **Do NOT fix references in code blocks** unless the code block is clearly a template.
|
|
@@ -127,7 +127,7 @@ Process all comments without asking. For each comment:
|
|
|
127
127
|
|
|
128
128
|
### Bot icon prefix
|
|
129
129
|
|
|
130
|
-
Read `
|
|
130
|
+
Read `personal.pr_comment_bot_icon` from `.agent-settings.yml`. If `true` (default),
|
|
131
131
|
prefix every reply with `🤖 ` so reviewers can see at a glance that the reply was
|
|
132
132
|
bot-authored.
|
|
133
133
|
|
|
@@ -133,7 +133,7 @@ Process all comments without asking. For each comment:
|
|
|
133
133
|
|
|
134
134
|
### Bot icon prefix
|
|
135
135
|
|
|
136
|
-
Read `
|
|
136
|
+
Read `personal.pr_comment_bot_icon` from `.agent-settings.yml`. If `true` (default),
|
|
137
137
|
prefix every reply with `🤖 ` so reviewers can see at a glance that the reply was
|
|
138
138
|
bot-authored.
|
|
139
139
|
|
|
@@ -66,7 +66,7 @@ Present a summary before applying:
|
|
|
66
66
|
|
|
67
67
|
### 5. Apply fixes
|
|
68
68
|
|
|
69
|
-
Edit files in `.agent-src.uncompressed/` (source of truth). Regenerate `.agent-src/` and `.augment/` via `
|
|
69
|
+
Edit files in `.agent-src.uncompressed/` (source of truth). Regenerate `.agent-src/` and `.augment/` via `bash scripts/compress.sh --sync`.
|
|
70
70
|
|
|
71
71
|
After all fixes:
|
|
72
72
|
|
|
@@ -87,7 +87,7 @@ python3 scripts/compress.py --mark-done "{relative_path}"
|
|
|
87
87
|
## Rules
|
|
88
88
|
|
|
89
89
|
- **Always fix in `.agent-src.uncompressed/`** — never edit `.agent-src/` or `.augment/` directly.
|
|
90
|
-
- **Run `
|
|
90
|
+
- **Run `bash scripts/compress.sh --sync`** after fixing to regenerate `.agent-src/` and `.augment/`.
|
|
91
91
|
- **Do NOT commit or push** — the user decides.
|
|
92
92
|
- **Do NOT fix references in code blocks** — they are examples, not live refs.
|
|
93
93
|
- **Do NOT auto-fix without showing the summary first.**
|
|
@@ -41,7 +41,7 @@ If `<name>` is not in that set, refuse and print the valid list.
|
|
|
41
41
|
### 3. Read settings
|
|
42
42
|
|
|
43
43
|
Read `.agent-settings.yml`. If missing, tell the user to run
|
|
44
|
-
|
|
44
|
+
`scripts/install` first and stop — do not create the file here.
|
|
45
45
|
|
|
46
46
|
Extract `roles.default_role` and `roles.active_role`.
|
|
47
47
|
|
|
@@ -58,9 +58,9 @@ exactly what the contract demands.
|
|
|
58
58
|
|
|
59
59
|
### 5. Write the active role
|
|
60
60
|
|
|
61
|
-
Update `roles.active_role` in `.agent-settings.yml` using the
|
|
62
|
-
section-aware merge rules
|
|
63
|
-
preserve key order, touch only the changed field).
|
|
61
|
+
Update `roles.active_role` in `.agent-settings.yml` using the
|
|
62
|
+
[section-aware merge rules](../guidelines/agent-infra/layered-settings.md#section-aware-merge-rules)
|
|
63
|
+
(preserve comments, preserve key order, touch only the changed field).
|
|
64
64
|
|
|
65
65
|
For `/mode none`: set `active_role: ""`.
|
|
66
66
|
|
|
@@ -117,5 +117,5 @@ For `/mode` (status only):
|
|
|
117
117
|
|
|
118
118
|
- [`role-contracts`](../guidelines/agent-infra/role-contracts.md) — the six modes
|
|
119
119
|
- [`role-mode-adherence`](../rules/role-mode-adherence.md) — closing-output gate
|
|
120
|
-
- [`
|
|
120
|
+
- [`layered-settings`](../guidelines/agent-infra/layered-settings.md) — merge rules for settings edits
|
|
121
121
|
- [`ask-when-uncertain`](../rules/ask-when-uncertain.md) — never invent modes
|