agentleFS
Jeff-TianJeff-Tian/agent-skills/repo-memory/SKILL.md

repo-memory

Skill1 starsChanged 7 months agoMITView on GitHub

Capture and maintain durable repository memory when working in a codebase. Use when starting implementation, debugging, review, or exploration work and you want the agent to first load and then update persistent notes about the tech stack, architecture decisions, build and test commands, domain context, user preferences, and recurring constraints. Trigger on requests like "remember this repo", "keep notes while you work", "record architecture decisions", "track user preferences", "maintain project memory", or when repeated work in the same repository would benefit from durable context.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

33 rules. About 0 are common, 28 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈28

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to keep a small, durable memory inside the repository so future work starts from the current technical and human context …

    line 16
  2. Distinctive:

    If the user explicitly invokes this skill, treat that as permission to bootstrap the repository memory system in the current workspace.

    line 20
  3. Distinctive:

    Keep user-specific preferences separate from repo facts

    line 32
  4. Distinctive:

    Use this skill when:

    line 38
  5. Distinctive:

    Do not use this skill to dump raw terminal output, secrets, or transient noise.

    line 45
  6. Distinctive:

    If the repository already has an established memory area, prefer reusing it instead of creating a second system.

    line 51
  7. Distinctive:

    If an existing convention is found, keep using that location.

    line 58
  8. Very specific:

    Use only one project-wide agent instruction file.

    line 61
  9. Distinctive:

    Create only the files that are justified by the current work.

    line 66
  10. Distinctive:

    If the user explicitly triggers this skill, do all of the following unless the repository already has an equivalent setup:

    line 81
  11. Distinctive:

    Create or update the project-wide instruction file so every future task loads repository memory before substantive work.

    line 83
  12. Distinctive:

    Create the memory root and minimal starter files.

    line 85
  13. Distinctive:

    Use copilot-instructions.md as the base template and memory templates for the starter files.

    line 88
  14. Distinctive:

    Before broad exploration or code changes:

    line 94
  15. Distinctive:

    Check whether the memory root already exists.

    line 95
  16. Distinctive:

    If it exists, read the smallest set of relevant memory files first.

    line 96
  17. Distinctive:

    If it does not exist, do a small amount of repo discovery, then bootstrap the minimal files needed for the current task.

    line 97
  18. Distinctive:

    If the project-wide instruction file does not yet direct the agent to load repository memory first, add or update it.

    line 99
  19. Distinctive:

    Write notes when the information is likely to matter again.

    line 122
  20. Distinctive:

    When memory already exists:

    line 140
  21. Distinctive:

    prefer editing the existing note over appending near-duplicates

    line 141
  22. Distinctive:

    add a short source hint such as a file path, command, or date when useful

    line 143
  23. Distinctive:

    If two notes conflict and the correct version is still unclear, record the uncertainty explicitly instead of pretending the conflict is …

    line 146
  24. Distinctive:

    Before finishing substantial work:

    line 151
  25. Distinctive:

    Update any memory files affected by new durable knowledge.

    line 152
  26. Distinctive:

    Remove or rewrite notes invalidated by the change.

    line 153
  27. Very specific:

    Make sure current-focus.md reflects the real next state, or clear it if done.

    line 154
  28. Distinctive:

    If bootstrapping happened during this task, confirm the project-wide instruction points at the chosen memory root.

    line 155
  29. Distinctive:

    Keep the spirit, not the branding.

    line 168
  30. Distinctive:

    If the user says not to remember something, do not persist it.

    line 184
  31. Very specific:

    If a preference appears task-local rather than durable, keep it out of user-preferences.md unless the user confirms it is stable.

    line 185
  32. Very specific:

    If the repo is tiny or the task is one-off, bootstrap only repo-overview.md and skip the rest until needed.

    line 187
  33. Very specific:

    If a note is useful across many tasks but specific to this repository, keep it in .ai/memory/, not a global memory store.

    line 189

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Repository Memory

Use this skill to keep a small, durable memory inside the repository so future work starts from the current technical and human context instead of rebuilding it from scratch.

If the user explicitly invokes this skill, treat that as permission to bootstrap the repository memory system in the current workspace.

Outcome

This skill creates and maintains a repository-local memory root at .ai/memory/. The memory is meant to be read before work starts and updated as durable facts become clear.

Primary goals:

  • Load high-value context before doing substantive work
  • Persist stable repo knowledge discovered during the task
  • Keep user-specific preferences separate from repo facts
  • Revise or replace stale notes instead of stacking contradictions
  • Install an always-on repository instruction so future sessions preload memory

When to Use

Use this skill when:

  • You are starting or resuming work in an unfamiliar repository
  • The user expects the agent to remember architecture, conventions, or commands
  • The same repository is visited repeatedly across tasks
  • The user has stable preferences worth carrying forward in this codebase
  • You are making decisions that future work should inherit

Do not use this skill to dump raw terminal output, secrets, or transient noise.

Memory Root

Default location: .ai/memory/

If the repository already has an established memory area, prefer reusing it instead of creating a second system. Check for one of these before bootstrapping:

  • .ai/memory/
  • .openclaw/memory/
  • .claw/memory/
  • another clearly named repository memory directory already used by the team

If an existing convention is found, keep using that location.

The preferred paired instruction file is .github/copilot-instructions.md. Use only one project-wide agent instruction file. If the repository already uses AGENTS.md, update that instead of creating copilot-instructions.md.

File Layout

Create only the files that are justified by the current work. Start minimal.

Recommended files:

  • .ai/memory/repo-overview.md for stack, layout, entry points, build/test commands
  • .ai/memory/architecture-decisions.md for ADR-style decisions and tradeoffs
  • .ai/memory/user-preferences.md for stable user-specific preferences in this repo
  • .ai/memory/domain-notes.md for glossary, business rules, invariants
  • .ai/memory/current-focus.md for active task state that should survive handoffs

See memory-files.md for suggested contents.

Workflow

0. Explicit Invocation Bootstrap

If the user explicitly triggers this skill, do all of the following unless the repository already has an equivalent setup:

  1. Create or update the project-wide instruction file so every future task loads repository memory before substantive work.
  2. Create the memory root and minimal starter files.
  3. Seed repo-overview.md with whatever has already been verified.

Use copilot-instructions.md as the base template and memory templates for the starter files.

1. Load Before Work

Before broad exploration or code changes:

  1. Check whether the memory root already exists.
  2. If it exists, read the smallest set of relevant memory files first.
  3. If it does not exist, do a small amount of repo discovery, then bootstrap the minimal files needed for the current task.
  4. If the project-wide instruction file does not yet direct the agent to load repository memory first, add or update it.

Prioritize loading in this order:

  1. repo-overview.md
  2. architecture-decisions.md
  3. user-preferences.md
  4. current-focus.md
  5. any task-specific or area-specific note directly relevant to the request

2. Separate Fact Types

Classify information before writing it down:

  • Repo fact: tech stack, module ownership, test command, API boundaries
  • Architecture decision: why one approach was chosen over another
  • User preference: style, review expectations, collaboration patterns
  • Task state: what is in progress, blocked, or validated
  • Domain note: business vocabulary, invariants, workflow rules

Store each fact in the narrowest file that fits.

3. Record Only Durable Signals

Write notes when the information is likely to matter again.

Good examples:

  • confirmed build or test commands
  • canonical entry points and owning modules
  • architectural boundaries and dependency direction
  • naming conventions and repository-specific patterns
  • user preferences repeated or stated explicitly
  • decisions made during the task and the reason they were made

Avoid recording:

  • raw logs or stack traces with no lasting value
  • tentative guesses not yet checked
  • secrets, tokens, credentials, or private data
  • one-off scratch thoughts better kept in ephemeral chat context

4. Update In Place

When memory already exists:

  • prefer editing the existing note over appending near-duplicates
  • replace outdated facts when the new evidence is stronger
  • add a short source hint such as a file path, command, or date when useful
  • consolidate repeated bullets into one clearer statement

If two notes conflict and the correct version is still unclear, record the uncertainty explicitly instead of pretending the conflict is resolved.

5. Close the Loop

Before finishing substantial work:

  1. Update any memory files affected by new durable knowledge.
  2. Remove or rewrite notes invalidated by the change.
  3. Make sure current-focus.md reflects the real next state, or clear it if done.
  4. If bootstrapping happened during this task, confirm the project-wide instruction points at the chosen memory root.

OpenClaw-Inspired Defaults

This skill intentionally borrows a few durable-memory ideas common in OpenClaw-style workflows:

  • a repository-local memory root committed with the project
  • a small number of typed note files instead of one giant journal
  • explicit separation between stable repo facts and volatile task state
  • updates in place rather than append-only logging
  • a lightweight always-on instruction that tells the agent to read memory first

Keep the spirit, not the branding. Reuse the project's existing convention if it already has one.

Quality Bar

Memory is good only if it is cheap to reload and safe to trust.

Each note should be:

  • specific rather than generic
  • short enough to scan quickly
  • separated by category
  • written as a stable fact, decision, or clearly marked open question
  • easy to revise later

Decision Rules

  • If the user says not to remember something, do not persist it.
  • If a preference appears task-local rather than durable, keep it out of user-preferences.md unless the user confirms it is stable.
  • If the repo is tiny or the task is one-off, bootstrap only repo-overview.md and skip the rest until needed.
  • If a note is useful across many tasks but specific to this repository, keep it in .ai/memory/, not a global memory store.

Completion Checks

This skill has been applied well when:

  • the agent read repository memory before substantive work
  • new durable facts discovered during the task were persisted
  • repo facts, user traits, and active task state were kept separate
  • stale notes were corrected rather than accumulated

Related Customization

This skill should normally pair with a project-wide instruction file so the memory system stays active after the first bootstrap. Prefer .github/copilot-instructions.md unless the repository already standardizes on AGENTS.md.

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.