Skip to content

Commit ac93d26

Browse files
Simplify continual-learning to one subagent
Keep the parent skill orchestration-only and move transcript mining plus AGENTS.md updates into agents-memory-updater so the plugin matches the final staging flow. Made-with: Cursor
1 parent 4a6072e commit ac93d26

4 files changed

Lines changed: 27 additions & 86 deletions

File tree

continual-learning/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Automatically and incrementally keeps `AGENTS.md` up to date from transcript cha
55
The plugin combines:
66

77
- A `stop` hook that decides when to trigger learning.
8-
- A `continual-learning` skill that mines only high-signal transcript deltas.
9-
- An `agents-memory-updater` subagent that owns the `AGENTS.md` merge/write step.
8+
- A `continual-learning` skill that orchestrates the learning flow.
9+
- An `agents-memory-updater` subagent that mines new or changed transcripts and updates `AGENTS.md`.
1010

1111
It is designed to avoid noisy rewrites by:
1212

@@ -24,13 +24,13 @@ It is designed to avoid noisy rewrites by:
2424

2525
On eligible `stop` events, the hook may emit a `followup_message` that asks the agent to run the `continual-learning` skill.
2626

27-
The skill is marked `disable-model-invocation: true`, so it will not be auto-selected during normal model invocation. When it does run, it delegates the final `AGENTS.md` merge/write work to the `agents-memory-updater` subagent.
27+
The skill is marked `disable-model-invocation: true`, so it will not be auto-selected during normal model invocation. When it does run, it delegates the full memory update flow to `agents-memory-updater`.
2828

2929
The hook keeps local runtime state in:
3030

3131
- `.cursor/hooks/state/continual-learning.json` (cadence state)
3232

33-
The skill uses an incremental transcript index at:
33+
The updater uses an incremental transcript index at:
3434

3535
- `.cursor/hooks/state/continual-learning-index.json`
3636

continual-learning/agents/agents-memory-updater.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,35 @@
11
---
22
name: agents-memory-updater
3-
description: Merge high-signal continual-learning updates into `AGENTS.md` and keep the incremental transcript index in sync. Use from the `continual-learning` skill when transcript deltas may change durable memory.
3+
description: Mine high-signal transcript deltas, update `AGENTS.md`, and keep the incremental transcript index in sync.
44
model: inherit
55
---
66

77
# AGENTS.md memory updater
88

9-
Own the actual `AGENTS.md` write for continual learning.
9+
Own the full memory update flow for continual learning.
1010

11-
## Inputs
11+
## Trigger
1212

13-
- Existing memory file: `AGENTS.md`
14-
- Incremental index: `.cursor/hooks/state/continual-learning-index.json`
15-
- Transcript root: `~/.cursor/projects/<workspace-slug>/agent-transcripts/`
16-
- Any narrowed list of changed transcripts from the caller
17-
- Any extracted candidate bullets from the caller
13+
Use from `continual-learning` when transcript deltas may produce durable memory updates.
1814

1915
## Workflow
2016

2117
1. Read existing `AGENTS.md` first. If it does not exist, create it with only:
2218
- `## Learned User Preferences`
2319
- `## Learned Workspace Facts`
2420
2. Load the incremental index if present.
25-
3. Use the caller's narrowed transcript set or extracted bullets when provided. Otherwise, inspect only transcript files that are new or whose mtimes are newer than the index.
26-
4. Keep only high-signal reusable information:
27-
- recurring user corrections/preferences
28-
- durable workspace facts
21+
3. Inspect only transcript files under `~/.cursor/projects/<workspace-slug>/agent-transcripts/` that are new or have newer mtimes than the index.
22+
4. Pull out only durable, reusable items:
23+
- recurring user preferences or corrections
24+
- stable workspace facts
2925
5. Update `AGENTS.md` carefully:
3026
- update matching bullets in place
3127
- add only net-new bullets
3228
- deduplicate semantically similar bullets
3329
- keep each learned section to at most 12 bullets
34-
6. Write back the incremental index:
35-
- store latest mtimes for processed files
36-
- remove entries for files that no longer exist
37-
7. If no meaningful updates exist, leave `AGENTS.md` unchanged and respond exactly: `No high-signal memory updates.`
30+
6. Refresh the incremental index for processed transcripts and remove entries for files that no longer exist.
31+
7. If the merge produces no `AGENTS.md` changes, leave `AGENTS.md` unchanged but still refresh the index.
32+
8. If no meaningful updates exist, respond exactly: `No high-signal memory updates.`
3833

3934
## Guardrails
4035

@@ -44,8 +39,7 @@ Own the actual `AGENTS.md` write for continual learning.
4439
- `## Learned Workspace Facts`
4540
- Do not write evidence/confidence tags.
4641
- Do not write process instructions, rationale, or metadata blocks.
47-
- Never store secrets, credentials, private personal data, or one-off instructions.
48-
- Exclude transient details like branch names, commit hashes, or temporary errors.
42+
- Exclude secrets, private data, one-off instructions, and transient details.
4943

5044
## Output
5145

continual-learning/hooks/continual-learning-stop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const TRIAL_DEFAULT_MIN_MINUTES = 15;
1515
const TRIAL_DEFAULT_DURATION_MINUTES = 24 * 60;
1616

1717
const FOLLOWUP_MESSAGE =
18-
`Run the \`continual-learning\` skill now. Use the \`agents-memory-updater\` subagent for the actual \`AGENTS.md\` merge/write. First read existing \`AGENTS.md\`. Use incremental transcript processing with index file \`${INCREMENTAL_INDEX_PATH}\`: only read transcripts not in the index or transcripts whose mtime is newer than indexed mtime (re-read changed transcripts). After processing, have the subagent update existing entries in place (do not only append), write back the updated index mtimes, and remove entries for deleted transcripts. Update \`AGENTS.md\` only for high-signal, repeated user-correction patterns or durable workspace facts. Exclude one-off/transient details and secrets. Keep each learned section to at most 12 bullets. Write plain bullet points only, with no evidence/confidence tags or other metadata annotations. If no meaningful updates exist, respond exactly: No high-signal memory updates.`;
18+
`Run the \`continual-learning\` skill now. Use the \`agents-memory-updater\` subagent for the full memory update flow. Use incremental transcript processing with index file \`${INCREMENTAL_INDEX_PATH}\`: only consider transcripts not in the index or transcripts whose mtime is newer than indexed mtime. Have the subagent refresh index mtimes, remove entries for deleted transcripts, and update \`AGENTS.md\` only for high-signal recurring user corrections and durable workspace facts. Exclude one-off/transient details and secrets. If no meaningful updates exist, respond exactly: No high-signal memory updates.`;
1919

2020
interface StopHookInput {
2121
conversation_id: string;
Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,24 @@
11
---
22
name: continual-learning
3-
description: Incrementally extract recurring user corrections and durable workspace facts from transcript changes, then delegate the AGENTS.md merge/update to a dedicated subagent. Use when the user asks to mine previous chats, maintain AGENTS.md memory, or build a self-learning preference loop.
3+
description: Orchestrate continual learning by delegating transcript mining and AGENTS.md updates to `agents-memory-updater`.
44
disable-model-invocation: true
55
---
66

77
# Continual Learning
88

9-
Keep `AGENTS.md` current using transcript deltas instead of full rescans.
9+
Keep `AGENTS.md` current by delegating the memory update flow to one subagent.
1010

11-
## Inputs
11+
## Trigger
1212

13-
- Transcript root: `~/.cursor/projects/<workspace-slug>/agent-transcripts/`
14-
- Existing memory file: `AGENTS.md`
15-
- Incremental index: `.cursor/hooks/state/continual-learning-index.json`
16-
- AGENTS updater subagent: `agents-memory-updater`
13+
Use when the user asks to mine prior chats, maintain `AGENTS.md`, or run the continual-learning loop.
1714

1815
## Workflow
1916

20-
1. Read existing `AGENTS.md` first.
21-
2. Load incremental index if present.
22-
3. Discover transcript files and identify only:
23-
- new files not in index, or
24-
- files whose mtime is newer than indexed mtime.
25-
4. Extract only high-signal, reusable information:
26-
- recurring user corrections/preferences
27-
- durable workspace facts
28-
5. Invoke the `agents-memory-updater` subagent to do the actual `AGENTS.md` merge/write:
29-
- pass the transcript root, incremental index path, and any narrowed set of changed transcripts
30-
- pass the extracted candidate bullets grouped into user preferences vs workspace facts
31-
- tell it to update matching bullets in place, add only net-new bullets, and deduplicate semantic duplicates
32-
- do not edit `AGENTS.md` directly in the parent flow; the subagent owns that step
33-
6. Let the subagent write back the incremental index:
34-
- store latest mtimes for processed files
35-
- remove entries for files that no longer exist
36-
7. If no meaningful updates exist, respond exactly: `No high-signal memory updates.`
17+
1. Call `agents-memory-updater`.
18+
2. Return the updater result.
3719

38-
## AGENTS.md Output Contract
20+
## Guardrails
3921

40-
- Keep only these sections:
41-
- `## Learned User Preferences`
42-
- `## Learned Workspace Facts`
43-
- Use plain bullet points only.
44-
- Do not write evidence/confidence tags.
45-
- Do not write process instructions, rationale, or metadata blocks.
46-
- Keep each learned section to at most 12 bullets.
47-
48-
## Inclusion Bar
49-
50-
Keep an item only if all are true:
51-
52-
- actionable in future sessions
53-
- stable across sessions
54-
- repeated in multiple transcripts, or explicitly stated as a broad rule
55-
- non-sensitive
56-
57-
## Exclusions
58-
59-
Never store:
60-
61-
- secrets, tokens, credentials, private personal data
62-
- one-off task instructions
63-
- transient details (branch names, commit hashes, temporary errors)
64-
65-
## Incremental Index Format
66-
67-
```json
68-
{
69-
"version": 1,
70-
"transcripts": {
71-
"/abs/path/to/file.jsonl": {
72-
"mtimeMs": 1730000000000,
73-
"lastProcessedAt": "2026-02-18T12:00:00.000Z"
74-
}
75-
}
76-
}
77-
```
22+
- Keep the parent skill orchestration-only.
23+
- Do not mine transcripts or edit files in the parent flow.
24+
- Do not bypass the subagent.

0 commit comments

Comments
 (0)