memory-discipline
When and how to persist durable memory — save genuine user preferences, facts, and corrections; NEVER persist transient environment failures (a failed command, a flaky network call, a one-off tool error) as lessons; recall before re-asking.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-05
- Stars
- ★ 212
- Forks
- 33
01 前言 Front Matter
- name
- memory-discipline
- always
- false
- triggers
- remember, memory, lesson, preference, note this, persist, save this for later, recall, forget, learned, you should know
- description
- When and how to persist durable memory — save genuine user preferences, facts, and corrections; NEVER persist transient environment failures (a failed command, a flaky network call, a one-off tool error) as lessons; recall before re-asking.
03 SKILL.md 正文
Memory Discipline
Gideon is persistent and self-learning — across sessions it remembers what the user prefers, durable facts about them and their work, and corrections they've made. That value collapses if memory fills with noise. The discipline is simple: persist what's durable, recall before re-asking, and never store transient failures as lessons.
Tools: memory_remember (save), memory_recall / memory_list (retrieve),
memory_forget (remove).
What IS worth remembering
Persist something only when it will still be true and useful next week, in a different session. Three durable kinds:
- Preference — a standing choice about how the user wants things done. "Prefers pytest over unittest." "Wants concise answers, no preamble." "Uses tabs, not spaces, in this repo."
- Fact — durable truth about the user, their environment, or their projects.
"The prod database is
orders-prodin us-east-1." "Their team's CI is GitHub Actions." "Deploys go out Tuesdays." - Correction — the user fixed something you got wrong; capture the corrected rule so you don't repeat the mistake. "Don't call it 'the API' — it's specifically the Billing API." "I said X was fine; the user corrected that X is forbidden here."
What is NOT a lesson (the key guardrail)
Never persist environment or transient failures as memory. A failure that belongs to this moment — not to the user's durable preferences or world — is not a lesson:
- A bash command that failed (wrong flag, missing file, exit 1) — fix it and move on; don't remember "the command failed".
- A flaky or timed-out network call, a transient API 500, a rate-limit — retry or route around; it's not a fact about the user.
- A one-off tool error (bad argument, malformed path, a file that didn't exist yet) — correct the call; the error is not knowledge.
- A momentary state ("the server was down", "the test was red just now") — state changes; don't freeze a snapshot of it into permanent memory.
Litmus test before memory_remember: "Will this still be true and actionable
in a fresh session next week?" If it's about something that just broke or a
passing condition of the current run, the answer is no — don't save it. (If a
failure reveals a durable rule — e.g. "this build always needs Node ≥20" — save
the rule, not the incident.)
Recall before re-asking
Before asking the user something they may have already told you — a preference, a
default, a name, an environment detail — check memory first with
memory_recall (semantic lookup) or memory_list (browse). If it's there, act
on it (or confirm — "Last time you preferred X; still the case?") instead of
re-asking. Re-asking something already on record is exactly the friction
persistent memory exists to remove.
How to write a good memory
- One durable rule per entry, phrased as a standing instruction or fact, not a narration of an event. ✅ "Prefers TypeScript strict mode." ❌ "Today we turned on strict mode."
- Categorize by kind (preference / fact / correction) and scope it appropriately — workspace/project-specific facts scoped to that project, global preferences scoped broadly — so recall surfaces the right thing in context.
- Supersede, don't duplicate. If a new preference contradicts an old one, update/forget the stale entry rather than leaving both — contradictory memory is worse than none.
Don't
- Don't save secrets or credential contents, ever.
- Don't save throwaway working state (current branch, today's failing test, a transient error) — see the guardrail above.
- Don't save something the user didn't actually express as durable just because it came up once; ephemeral context stays in the conversation, not in memory.
04 同仓库更多 Skills
web-verify
Verify a built web page or app actually renders and works — drive it in a real browser, check the console and network, confirm the thing you changed is the thing being served, and capture evidence. Use before claiming a frontend change works.
visual-output
Emit rich visual output in chat via <widget> tags — styled HTML cards, charts, tables, interactive tools, and drawn SVG/canvas diagrams, illustrations, and animations — theme-aware, centered, and responsive instead of clashing or cramped.
task-and-project
Track work as Tasks (the /api/tasks CRUD + native task provider), and decompose larger projects into independent, verifiable units — fanning parallel investigation out to subagents while keeping one coherent plan; hand open-ended goal-driven work to a goal loop.
research-campaign
Run a multi-cycle research campaign — grill the question, decompose it into answerable sub-questions, investigate each against sources, then synthesize with confidence and gaps stated. Use for open questions that need real investigation rather than one lookup.
loop-worker
Per-cycle protocol for an autonomous goal loop worker — the unified autonomous goal engine that runs one self-directed cycle per turn until its goal is met, then self-retires. Drives one cycle against a loop's file interface (status.json gate, brief.md goal, guidance.txt nudges, findings/cycle_NNN.json, FINDINGS.md, the type-appropriate deliverable, STOP sentinel). The worker produces work and reports evidence; a deterministic check or a separate judge — never the worker — decides done-ness.
knowledge-grounding
Search the knowledge pool before answering, ground claims in retrieved sources and cite them, recognize ingest-worthy content and capture it with knowledge_create — don't fabricate when the answer is on record.