mirror of
https://github.com/cursor/plugins.git
synced 2026-09-14 20:00:00 +08:00
Add AGENTS updater subagent to continual-learning
Delegate AGENTS.md merges to a dedicated subagent and disable model invocation for the parent skill so the workflow only runs when explicitly triggered. Made-with: Cursor
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"memory",
|
||||
"transcripts"
|
||||
],
|
||||
"agents": "./agents/",
|
||||
"skills": "./skills/",
|
||||
"hooks": "./hooks/hooks.json"
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ The plugin combines:
|
||||
|
||||
- A `stop` hook that decides when to trigger learning.
|
||||
- A `continual-learning` skill that mines only high-signal transcript deltas.
|
||||
- An `agents-memory-updater` subagent that owns the `AGENTS.md` merge/write step.
|
||||
|
||||
It is designed to avoid noisy rewrites by:
|
||||
|
||||
@@ -23,6 +24,8 @@ It is designed to avoid noisy rewrites by:
|
||||
|
||||
On eligible `stop` events, the hook may emit a `followup_message` that asks the agent to run the `continual-learning` skill.
|
||||
|
||||
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.
|
||||
|
||||
The hook keeps local runtime state in:
|
||||
|
||||
- `.cursor/hooks/state/continual-learning.json` (cadence state)
|
||||
@@ -56,7 +59,7 @@ Trial mode defaults (enabled in this plugin hook config):
|
||||
|
||||
## Output format in AGENTS.md
|
||||
|
||||
The skill writes only:
|
||||
The memory updater writes only:
|
||||
|
||||
- `## Learned User Preferences`
|
||||
- `## Learned Workspace Facts`
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
name: agents-memory-updater
|
||||
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.
|
||||
model: inherit
|
||||
---
|
||||
|
||||
# AGENTS.md memory updater
|
||||
|
||||
Own the actual `AGENTS.md` write for continual learning.
|
||||
|
||||
## Inputs
|
||||
|
||||
- Existing memory file: `AGENTS.md`
|
||||
- Incremental index: `.cursor/hooks/state/continual-learning-index.json`
|
||||
- Transcript root: `~/.cursor/projects/<workspace-slug>/agent-transcripts/`
|
||||
- Any narrowed list of changed transcripts from the caller
|
||||
- Any extracted candidate bullets from the caller
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Read existing `AGENTS.md` first. If it does not exist, create it with only:
|
||||
- `## Learned User Preferences`
|
||||
- `## Learned Workspace Facts`
|
||||
2. Load the incremental index if present.
|
||||
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.
|
||||
4. Keep only high-signal reusable information:
|
||||
- recurring user corrections/preferences
|
||||
- durable workspace facts
|
||||
5. Update `AGENTS.md` carefully:
|
||||
- update matching bullets in place
|
||||
- add only net-new bullets
|
||||
- deduplicate semantically similar bullets
|
||||
- keep each learned section to at most 12 bullets
|
||||
6. Write back the incremental index:
|
||||
- store latest mtimes for processed files
|
||||
- remove entries for files that no longer exist
|
||||
7. If no meaningful updates exist, leave `AGENTS.md` unchanged and respond exactly: `No high-signal memory updates.`
|
||||
|
||||
## Guardrails
|
||||
|
||||
- Use plain bullet points only.
|
||||
- Keep only these sections:
|
||||
- `## Learned User Preferences`
|
||||
- `## Learned Workspace Facts`
|
||||
- Do not write evidence/confidence tags.
|
||||
- Do not write process instructions, rationale, or metadata blocks.
|
||||
- Never store secrets, credentials, private personal data, or one-off instructions.
|
||||
- Exclude transient details like branch names, commit hashes, or temporary errors.
|
||||
|
||||
## Output
|
||||
|
||||
- Updated `AGENTS.md` and `.cursor/hooks/state/continual-learning-index.json` when needed
|
||||
- Otherwise exactly `No high-signal memory updates.`
|
||||
@@ -15,7 +15,7 @@ const TRIAL_DEFAULT_MIN_MINUTES = 15;
|
||||
const TRIAL_DEFAULT_DURATION_MINUTES = 24 * 60;
|
||||
|
||||
const FOLLOWUP_MESSAGE =
|
||||
`Run the \`continual-learning\` skill now. First read existing \`AGENTS.md\` and update existing entries in place (do not only append). 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, 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.`;
|
||||
`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.`;
|
||||
|
||||
interface StopHookInput {
|
||||
conversation_id: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: continual-learning
|
||||
description: Incrementally extract recurring user corrections and durable workspace facts from transcript changes, then update AGENTS.md with plain bullet points only. Use when the user asks to mine previous chats, maintain AGENTS.md memory, or build a self-learning preference loop.
|
||||
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.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
# Continual Learning
|
||||
@@ -12,24 +13,27 @@ Keep `AGENTS.md` current using transcript deltas instead of full rescans.
|
||||
- Transcript root: `~/.cursor/projects/<workspace-slug>/agent-transcripts/`
|
||||
- Existing memory file: `AGENTS.md`
|
||||
- Incremental index: `.cursor/hooks/state/continual-learning-index.json`
|
||||
- AGENTS updater subagent: `agents-memory-updater`
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Read existing `AGENTS.md` first.
|
||||
2. Load incremental index if present.
|
||||
3. Discover transcript files and process only:
|
||||
3. Discover transcript files and identify only:
|
||||
- new files not in index, or
|
||||
- files whose mtime is newer than indexed mtime.
|
||||
4. Extract only high-signal, reusable information:
|
||||
- recurring user corrections/preferences
|
||||
- durable workspace facts
|
||||
5. Merge with existing bullets in `AGENTS.md`:
|
||||
- update matching bullets in place
|
||||
- add only net-new bullets
|
||||
- deduplicate semantically similar bullets
|
||||
6. Write back the incremental index:
|
||||
5. Invoke the `agents-memory-updater` subagent to do the actual `AGENTS.md` merge/write:
|
||||
- pass the transcript root, incremental index path, and any narrowed set of changed transcripts
|
||||
- pass the extracted candidate bullets grouped into user preferences vs workspace facts
|
||||
- tell it to update matching bullets in place, add only net-new bullets, and deduplicate semantic duplicates
|
||||
- do not edit `AGENTS.md` directly in the parent flow; the subagent owns that step
|
||||
6. Let the subagent write back the incremental index:
|
||||
- store latest mtimes for processed files
|
||||
- remove entries for files that no longer exist
|
||||
7. If no meaningful updates exist, respond exactly: `No high-signal memory updates.`
|
||||
|
||||
## AGENTS.md Output Contract
|
||||
|
||||
@@ -39,6 +43,7 @@ Keep `AGENTS.md` current using transcript deltas instead of full rescans.
|
||||
- Use plain bullet points only.
|
||||
- Do not write evidence/confidence tags.
|
||||
- Do not write process instructions, rationale, or metadata blocks.
|
||||
- Keep each learned section to at most 12 bullets.
|
||||
|
||||
## Inclusion Bar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user