agentleFS
t4sht4sh/skills4sh/skills/agent-memory/SKILL.md

agent-memory

Skill5 starsChanged 46 days agoMITView on GitHub

Persist project decisions in reviewable `.agent-memory/` markdown. Use when asked to \"remember a project decision\", \"save session learnings\", \"initialize .agent-memory\", \"manage project memory\", \"migrate memory\", \"build memory from docs\", \"sync memory\", \"run memory maintenance\", \"check memory status\", or \"onboard a new developer\"; when `.agent-memory/` or `AGENTS.md` memory pointers are in play; when sharing project context, conventions, or session handoffs with another developer or reviewing project memory in a pull request; or when context \"forgets between sessions\". Sync reconciles files already in the checkout. Not for vendor auto-memory consolidation, personal agent rulebooks, memory leaks, RAM usage, or human memory.

  • Reads credentials

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

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these prompts to choose the operation, then proceed without collecting unnecessary information:

    line 50
  2. Very specific:

    For each piece: update existing memory file or create new one in appropriate {type}/ directory.

    line 121
  3. Distinctive:

    Phase 2 — Save: Run the full Save operation (review, update/create, session log, index).

    line 134
  4. Very specific:

    Fallback (no expires): Use updated date (or created if never updated) + type-based thresholds: context/ >30 days, sessions/ >60 days.

    line 149
  5. Very specific:

    supersedes chain: If file A has supersedes: B, and B still exists with status: active, flag B for archival.

    line 151
  6. Distinctive:

    Update in place: When facts change, edit the file.

    line 168
  7. Distinctive:

    Keep index in sync: Every file in index, every index entry points to a file.

    line 169
  8. Distinctive:

    No secrets: No credentials, PII, or sensitive data in memory files.

    line 172

“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 Skill

Manage persistent project memory as reviewable markdown in the repository. Any file-reading agent can read and update the same .agent-memory/ files across sessions.

Design Principles

PrinciplePractice
Open filesStore memory as YAML-frontmatter markdown that can be read and edited with any editor or file-reading agent.
Shared entry pointKeep AGENTS.md as the canonical instructions file; keep client-specific files thin pointers.
Native-memory coexistenceTreat vendor auto-memory as machine-local scratch and .agent-memory/ as the deliberate cross-agent, reviewable source; do not overwrite or duplicate native stores.
Managed lifecycleUse typed directories, expires metadata, maintain, and sync so memory stays current instead of accumulating noise.
No secretsStore project knowledge and decisions, never credentials, private keys, tokens, or sensitive personal data.

Commands

KeywordOperationDescription
initInitializeScaffold .agent-memory/, README, index, and AGENTS.md, plus pointer files only for agents already in use
migrateMigrateDetect and migrate older structures (CURSOR.md, flat files, INDEX.yaml) to memory format v2.1
buildBuildScan project and auto-generate initial memory files from existing docs
saveSaveCapture learnings from the current session into memory
maintainMaintainCompact, trim stale, fix index, clean old session logs
syncSyncReconcile memory files already in the checkout + save current session
statusStatusRead-only health check — file counts, staleness, sync

Infer the operation from a clear request; a literal command keyword is not required. For example, “remember why we chose SQLite” routes to Save, and “reconcile these memory files and capture our decision” routes to Sync. Ask one focused question only when the intended operation or a required input remains ambiguous. Preserve read-only requests: onboarding or reviewing existing memory does not authorize rebuilding or saving it.

For a developer handoff, read the index and relevant entries, summarize the current decisions and open questions, and cite their files. Preserve proposals as proposals. A newer timestamp alone does not resolve conflicting decisions; inspect their evidence and review status, then ask when the accepted direction is unknown. Record supersedes only when replacement is established.

For cross-repository work, use accessible references to the owning project's decisions with a revision when relevant. Summarize only the context needed locally; identify unavailable sources rather than inventing their contents. A request concerning one repository does not authorize edits to another.

Show memory files inline rather than in an external editor: markdown bodies without YAML frontmatter; YAML, JSON, and plain text in fenced code blocks.

Assessment Checklist

Use these prompts to choose the operation, then proceed without collecting unnecessary information:

  1. Does .agent-memory/ already exist, and what structure/version does it use?
  2. Which operation fits the request: init, migrate, build, save, sync, maintain, or status?
  3. Which instruction or pointer files already exist, do they point at AGENTS.md, and which vendor-native memory stores must be left untouched? See references/agent-pointers.md.
  4. Which project docs can seed memory without copying them verbatim?
  5. Is the memory local/private, or intended to be shared through git?

Operation: Init

Scaffold the .agent-memory/ system from scratch.

Overwrite guard: Before creating or changing AGENTS.md, .agent-memory/index.yaml, .agent-memory/README.md, or any pointer file listed in references/agent-pointers.md, inspect any existing file and preserve its content. If a target file already exists and is not a thin compatible pointer, stage the proposed replacement and ask before overwriting. Report every file kept, created, or changed.

Memory format v2.1 — Entry Points

project/
├── AGENTS.md          # Canonical shared instructions
└── .agent-memory/     # Reviewable project memory

Key: AGENTS.md is the shared source of truth. Add thin pointer files only for agents the project already uses; recipes live in references/agent-pointers.md. Never put shared instructions inside a vendor-only directory. Detect native memory/rule locations read-only and report them; do not migrate or overwrite them implicitly.

Steps

  1. Create directories: user/, feedback/, project/, decisions/, context/, conventions/, references/, sessions/ under .agent-memory/.
  2. Create files: .agent-memory/README.md (system spec), .agent-memory/index.yaml (empty [] registry in the index format), and AGENTS.md (canonical shared instructions). Create pointer files only for agents already in use, following references/agent-pointers.md. Keep an existing compatible index format and its entries; do not reset it to [].
  3. Complete AGENTS.md: replace every placeholder with the project's actual structure and rules. Include the session-start loading instruction so the next agent reads the index and relevant entries. Preserve substantive existing instructions under the overwrite guard; propose the addition rather than replacing them without approval. Done when no TODO or placeholder tokens remain and the loading instruction is present or its pending approval is reported.
  4. Check the registry and report what was created or kept. An empty [] index is correct until entries are saved or the separate Build operation is requested; do not invent project memories during Init. Done when a new registry parses as an empty list, or an existing registry retains its entries, and next-session discovery is configured or explicitly pending approval.

Operation: Migrate

Detect and migrate older structures to memory format v2.1.

Old StructureNew StructureAction
CURSOR.md at rootAGENTS.md + thin .cursor/rules/index.mdc pointerShared content merged into AGENTS.md; pointer per agent-pointers.md; old file kept as CURSOR.md.migrated
INDEX.yaml (uppercase)index.yaml (lowercase)Renamed
Flat {type}--{topic}.md{type}/{topic}.mdMoved to directory
summary: frontmatterdescription: frontmatterField renamed
CLAUDE.md with full instructions (no AGENTS.md)AGENTS.md + a thin pointer filePromoted; pointer recipe in agent-pointers.md

Steps: Scan for each old structure listed above → preserve existing content → perform only confirmed migrations → move shared instructions into AGENTS.md, then rewrite leftover client files as thin pointers per references/agent-pointers.md → reconcile index.yaml with filesystem → report what changed. Done when every confirmed migration has a backup or .migrated file, shared instructions live only in AGENTS.md, and index ↔ filesystem differences are empty.

Migration guard: Renames, moves, and pointer rewrites are destructive. Before renaming CURSOR.md, INDEX.yaml, or replacing instruction files, show the planned source and destination paths and ask for confirmation unless the file is empty or already an exact generated pointer. Keep a backup or .migrated file whenever content is moved.


Operation: Build

Scan project and auto-generate initial memory files from existing docs.

  1. Scan for docs: *.md, package.json, pyproject.toml, Cargo.toml, CLAUDE.md, AGENTS.md, *.yaml configs, .env.example
  2. Distill each source: overview → project/overview.md, architecture → project/architecture.md, decisions → decisions/{topic}.md, conventions → conventions/{topic}.md, user preferences/collaboration style → user/preferences.md only when explicitly confirmed by the user
  3. Rules: Summarize don't copy. One topic per file. Reference source docs. Use standard frontmatter.
  4. Migrate old formats if found (flat files, old frontmatter fields)
  5. Update index.yaml — add entries for each new file, reconcile with filesystem
  6. Report with summary table. Done when every new file has standard frontmatter and an index entry, index ↔ filesystem differences are empty, and the report lists each created path with its source doc.

Operation: Save

Capture learnings from the current conversation into memory.

  1. Review conversation for: decisions, feedback, conventions, status changes, important context
  2. For each piece: update existing memory file or create new one in appropriate {type}/ directory. Create session log in sessions/ for significant sessions.
  3. Source identifier: record the writing runtime as a slug (codex, claude-code, cursor, grok, openclaw, vscode, craft-agent, or other)
  4. Write files using standard frontmatter format (see references/templates.md)
  5. Update index.yaml and report what was saved/updated. Done when the report lists each created or updated path with its id, and each path has an index entry.

Operation: Sync

Reconcile memory files already present in the current checkout, then save the session. Sync does not fetch, pull, merge, commit, push, or synchronize another repository or a vendor-native memory store. Git operations require their own task authorization and repository workflow.

Phase 1 — Ingest: Scan for unindexed files in .agent-memory/ (add to index) → scan for orphan index entries (remove) → read updated files for awareness.

Phase 2 — Save: Run the full Save operation (review, update/create, session log, index).

Phase 3 — Report: Single combined report (see references/templates.md for format).

Done when the index ↔ filesystem difference is empty and every fact saved this session maps to an indexed file with standard frontmatter.


Operation: Maintain

Full maintenance: compact, trim stale, fix index, clean old session logs.

  1. Health check: Count files by type, check index sync, identify stale/expired entries.
  2. Staleness check — frontmatter-driven:
    • Primary signal: expires field. If expires < today → flag as expired, ask update/archive/remove.
    • Fallback (no expires): Use updated date (or created if never updated) + type-based thresholds: context/ >30 days, sessions/ >60 days.
    • Archived entries: status: archived with updated >90 days ago → suggest deletion.
    • supersedes chain: If file A has supersedes: B, and B still exists with status: active, flag B for archival.
  3. Compaction: Identify content overlap, suggest merges, promote session log patterns to conventions/ or decisions/.
  4. Session cleanup: type: session with updated >60 days → extract valuable info elsewhere if needed, list deletion candidates, and ask for confirmation before deleting.
  5. Report with health summary (see references/templates.md for format). Done when every flagged item has a user decision or is listed as pending, and nothing was deleted or archived without confirmation.

Operation: Status

Quick read-only health check. Count files by type, check index ↔ filesystem sync, report stale/expired entries. If .agent-memory/ doesn't exist, suggest init. If issues found, suggest maintain.


File Format Rules

  1. Distill, don't transcribe. Summaries and decisions, not conversation dumps.
  2. One idea per file. Split if a memory covers unrelated topics.
  3. Update in place. When facts change, edit the file. Don't append forever.
  4. Keep index in sync. Every file in index, every index entry points to a file.
  5. Use expires on context. Context goes stale. Set a review date.
  6. Reference, don't copy. Point to source docs instead of duplicating content.
  7. No secrets. No credentials, PII, or sensitive data in memory files.
  8. Absolute dates. Resolve relative dates from the date and timezone supplied by the task; otherwise use the current date and timezone. Compute and verify the calendar date, then save it as YYYY-MM-DD. Never copy a date from a template. Ask only when the intended reference date or relative phrase is ambiguous.

For frontmatter schema, memory types, and templates, see references/templates.md.


Reference Files

FileContents
references/templates.mdSession log template, sync/health report templates, frontmatter schema, memory types table
references/agent-pointers.mdInstaller skill roots, thin pointer files, and native-memory scope and preservation boundaries
references/troubleshooting.mdCommon issues by project type (solo, multi-agent, team, monorepo), troubleshooting Q&A

Adjacent Patterns

PatternWhen it is enoughWhen agent-memory is the better fit
Single client instruction fileOne tool and a small projectMultiple tools need a shared, indexed memory base
Vendor auto-memoryLocal scratch and automatic recall inside one clientKnowledge must be portable, reviewable, shareable through git, or consistent across checkouts
Session handoff noteOne-time transfer between chatsDurable decisions, conventions, and project context need lifecycle management
Memory MCP/serverSearchable centralized service is already approvedPlain files, git review, and zero runtime dependencies are preferred

Behavioral evals

Authors/reviewers only: use the scenario catalog when explicitly evaluating this skill. Skip it during normal task execution. Materialize each case in a fresh temporary directory, withhold assertions from the executing agent, and grade the resulting artifacts and actions. The catalog defines expected behavior; it is not evidence of a passing run. Synthetic browser and service inputs test decisions only, not live integrations.

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.