agentleFS
chadixearthchadixearth/graphyloop/skills/swarm-memory/SKILL.md

swarm-memory

Skill3 starsChanged 10 days agoMITView on GitHub

Use this skill at the start and end of every non-trivial task to recall and record durable project knowledge through graphyloop memory - what to search before planning, what is worth storing, what must never be stored, and how to correct a wrong memory.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    START of any non-trivial task, in the same parallel block as the first reads and before the context pack and contract.

    line 14
  2. Distinctive:

    When a past decision is being revisited ("why is it done this way?").

    line 16
  3. Distinctive:

    Write the entry yourself at the end.

    line 58

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

Swarm memory

Memory is only useful if it is read before deciding and written after learning. A store that is written but never searched is a diary; one that is searched but never corrected repeats its mistakes forever.

When to activate

  • START of any non-trivial task, in the same parallel block as the first reads and before the context pack and contract. A trivial single-file edit skips memory.
  • END of any task that produced a decision, a gotcha, or a reusable approach.
  • When a past decision is being revisited ("why is it done this way?").

Procedure

  1. Recall first. memory_search with 2-4 concrete keywords from the task (component names, error text, feature nouns). Optional type filter: decision, pattern, lesson, event, task.
    • Results exist → use them, and say which memory informed the plan.
    • Nothing → say nothing and proceed. Never invent a recalled memory.
  2. Store at the end, one entry. memory_store with the right type:
    • decision — a choice made and why (the alternative rejected matters more than the choice).
    • lesson — a gotcha hit and how it was resolved. This is the highest-value type.
    • pattern — a reusable approach with the file that demonstrates it.
    • event — something that happened (a deploy, a migration, an incident).
  3. Correct, do not accumulate. A wrong or outdated memory gets memory_forget with its id, then a corrected entry. Leaving both means the next session gets contradictory advice with no way to pick.

What makes an entry worth keeping

Good: one dense line, searchable nouns, an anchor.

decision: state lives in <project>/.graphyloop/state.json (was .opencode/graphyloop) — three of four harnesses are not opencode; migration in lib/engine.mjs
lesson: node --test hangs when a failing assert skips stdin.end() on a spawned server — the child holds the stdio pipes; close it in a finally
pattern: file-to-file credential sync (env_sync) keeps values out of the model context — see lib/secrets.mjs

Bad, and why:

  • "fixed the bug" — unsearchable, no anchor, no cause.
  • A pasted 200-line diff — the repo already has it; memory is for the why.
  • "user prefers dark mode" when it was said once about one screen — over-generalized preferences become wrong rules.

Never store

  • Credentials, tokens, connection strings, or anything from a .env file — not even partially. Store the key NAME if it matters.
  • Personal data about the user or third parties beyond what the work needs.
  • Speculation stated as fact. If it was not verified, either verify it or label it.

Rules

  • One entry per task, not one per file touched. A flooded store ranks badly.
  • Write the entry yourself at the end; do not delegate it to a subagent whose context is narrower than the task.
  • Memory survives shutdown and restarts. State does not — re-read swarm_state after a restart instead of trusting recall for live task status.
  • Blocked roots (home directory, harness config dirs, system dirs) refuse memory writes by design. Accept the skip; do not retry in another directory.
  • A build leaves two frozen files next to each other: ctx-<slug>.md (context pack) and contract-<slug>.md. Store the lesson or decision, not their content.

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.