agentleFS
maeseokmaeseok/agent-operating-discipline/skills/agent-memory/SKILL.md

agent-memory

Skill0 starsChanged 4 months agoMITView on GitHub

Use when setting up or maintaining persistent memory for a long-running agent — the one-fact-per-file structure, what deserves to be written, and the verification habit that keeps failed writes from being reported as successes

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use observability, data-analysis and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 4 projects that use this

  • shanggqmSkill

    data-analysis

    数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。

    Also in 3 projects that use this

  • Microsoft AzureSkill

    skill-authoring

    Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.

    Also in 3 projects that use this

  • VercelSkill

    technical-writing

    Write, edit, review, or audit user-facing documentation for the eve repository. Use for changes under docs/, documentation tied to eve APIs or CLI behavior, docs work based on Slack or support feedback, and requests to make eve docs clearer, more natural, or less AI-patterned while verifying claims against current source, tests, CLI help, public releases, and repository conventions.

    Also in 3 projects that use this

  • JetBrainsSkill

    webapp-testing

    Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

    Also in 4 projects that use this

  • AnthropicSkill

    pdf

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never put content in the index.

    line 48
  2. Distinctive:

    Write at that moment. A lesson you didn't record does not exist in the next session — and the next session is confident, because it has no …

    line 78
  3. Distinctive:

    Put principles at the top and current status at the bottom.

    line 88
  4. Distinctive:

    Delete memories that turn out to be wrong.

    line 116

“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent memory that survives compaction

Long sessions get summarized. Anything not written to a file is gone, and you will not notice it's gone — you'll just quietly stop applying it.

Structure

One directory. One fact per file. An index that loads every session.

memory/
  MEMORY.md                      ← index, loaded into context each session
  falsifier-must-be-able-to-fire.md
  deploy-slot-semantics.md
  ...

Each file:

---
name: <kebab-case-slug>
description: <one line — this is what's scanned to decide relevance>
metadata:
  type: user | feedback | project | reference
---

<the fact>

**Why:** <the reasoning — this is what makes it reusable>
**How to apply:** <the trigger and the action>

Links: [[related-slug]]

MEMORY.md holds one line per memory and nothing else:

- [Falsifiers must be able to fire](falsifier-must-be-able-to-fire.md) — a metric
  that can't move isn't a safety net

Never put content in the index. It's a router.

What earns a file

Write:

  • A correction — you were wrong, and why the reasoning went wrong
  • A standing instruction, verbatim, with the reason behind it
  • A constraint that isn't derivable from the code
  • A rejected approach and the evidence that rejected it

Don't write:

  • Anything the repository already records (structure, history, past fixes)
  • Anything that only matters in this conversation
  • Numbers you'll re-read later — they rot. Write the method for getting the number, not the number.

That last one has teeth. Metrics quoted from memory are stale by definition. I published two public corrections because I re-cited a number instead of pulling it fresh. If you must record a value, stamp it with the time it was read and mark it as historical.

Write on the event, not on request

Learning arrives at specific moments:

  • You were wrong
  • You were corrected
  • A hypothesis was falsified
  • A discipline paid off

Write at that moment. A lesson you didn't record does not exist in the next session — and the next session is confident, because it has no record of having been wrong.

Record the reasoning, not just the conclusion. "Check the definition SQL" is forgettable. "I read a field named oldest_age_h, assumed queue wait, and reported a 41-day backlog that didn't exist" is not.

Order the index by durability

Put principles at the top and current status at the bottom. When context gets compacted, what survives is what's near the top. Status is re-derivable from the live system; principles are not.

Mark the source of truth explicitly. If deployment state can be read from a live endpoint, say so in the index — "the live system is authoritative; if memory disagrees, believe the system and fix the memory."

Verify writes with a marker you wrote

I ran a script that appended a section to a file, then grepped for a distinctive phrase to confirm. Got a match. Reported success.

The write had no-opped. An idempotency guard saw the phrase already present — in a different, older section — and skipped. My grep matched that older line.

I verified the existence of someone else's sentence and called it my write.

Two rules:

  1. Verify with a unique marker created by that specific write — an HTML comment like <!-- SLUG-YYYYMMDD --> works well. Never verify with meaningful prose; meaningful prose is exactly what's likely to already be in the file.
  2. Make idempotency guards announce themselves. A silent no-op must never be indistinguishable from a successful write.

Prune

Delete memories that turn out to be wrong. Update rather than duplicate. A memory file that contradicts the live system is worse than no file — it will be trusted.

Related

  • standing-instructions — where recurring obligations live
  • verify-before-judging — why recorded numbers can't be re-cited

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.