agentleFS
vintavinta/hal-9000/skills/refactor-memory/SKILL.md

refactor-memory

Skill142 starsChanged 22 days agoMITView on GitHub

Use when refactoring Claude Code or Codex memories to remove stale or derivable entries, resolve contradictions, promote standing instructions, or reorganize recall. Not for standalone CLAUDE.md, AGENTS.md, or rules cleanup

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Pick the target: Use the scope or directory the user names, otherwise the platform default below.

    line 13
  2. Distinctive:

    Read the evidence: Follow the reference's reading procedure and fetch its official memory guide.

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Overview

Refactor memories so each entry carries what no lookup returns: a decision, a correction, a measured gotcha. Audit entries within the requested scope; their storage and update mechanism depend on the environment.

Instructions

  1. Pick the target. Use the scope or directory the user names, otherwise the platform default below. Load the reference for the active environment before reading memories:

    • Claude Code: references/claude-code.md for project memory files, index rules, promotion destinations, and direct edits.
    • Codex: references/codex.md for shared storage, project filtering, promotion destinations, and session-authorized updates.

    State the storage location and audit scope. A shared directory does not make every entry global.

  2. Read the evidence. Follow the reference's reading procedure and fetch its official memory guide. Compare entries against applicable loaded instructions, repository files, and current vendor documentation. Inventory the entries in scope before assigning verdicts.
  3. Audit entries. Give every entry exactly one verdict, with its location and evidence beside it. Done when no entry in scope lacks one.
    • contradiction: conflicts with another memory, or with the current instruction or code it describes. Record both sides.
    • delete: no future action depends on it. Covers completed work, settled questions, and facts recoverable from code, git history, loaded instructions, or vendor docs. Check each claim by looking: search the repo, read the instruction, fetch the docs page. Delete outright, never rewrite into a done or synced record.
    • rewrite: right fact, wrong form: a recall hook disagrees with the body, a reference is broken, a date is relative, or two entries carry one fact and should merge.
    • promote: a memory that is really a standing instruction. Name the destination using the platform reference. Promote only instructions that change future behavior and are not already covered there; use a skill for a multi-step workflow. Tool behavior alone is not a standing instruction.
    • keep: earns its index line and recall cost as written.
  4. Audit recall. Apply the platform's index or summary checks. Check discoverability, duplicate claims, scope, and evidence references. Propose the layout changes needed for the entries in scope.
  5. Get decisions. Reuse verdicts the user already selected within the requested scope. Present remaining contradictions with both sides as choices and unselected delete, rewrite, and promote verdicts as numbered lists with evidence and the proposed layout. Use the platform's question tool only for unresolved choices. Apply only the outcomes the user selected.
  6. Apply and verify. Apply the selected verdicts through the platform's update mechanism without asking again. Remove a promoted memory only after its destination carries the instruction. Verify the result using the platform reference and report any pending consolidation separately from completed changes. Anything else noticed while editing is a follow-up.

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.