agentleFS
soden46soden46/syarif-laravel-ai-skills/skills/memory-management/SKILL.md

memory-management

Skill4 starsChanged 5 months agoMITView on GitHub

Recall, checkpoint, and audit durable Laravel project knowledge across sessions when prior context materially affects the current task.

  • Reads credentials

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-agent, agent-analyze-code-quality 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.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill as conditional context infrastructure when a Laravel task depends on prior context, project history, or known conventions.

    line 11
  2. Distinctive:

    Prefer continuity without context overload.

    line 21
  3. Distinctive:

    Run memory preflight only when at least one is true:

    line 27
  4. Distinctive:

    Prefer the active MCP server when the host exposes it:

    line 35
  5. Distinctive:

    If MCP is unavailable and Node/file access exists, fall back to the local CLI:

    line 44
  6. Distinctive:

    Stop retrieving when marginal relevance is lower than token cost.

    line 67
  7. Very specific:

    When memory-graph.json exists, query the graph before opening Markdown evidence:

    line 71
  8. Distinctive:

    Use graph edges with confidence tags:

    line 79
  9. Very specific:

    When the codebase or architecture changes, mark older project memories as STALE or SUPERSEDED rather than deleting them.

    line 93
  10. Distinctive:

    When memory and current evidence conflict, trust this order:

    line 97
  11. Distinctive:

    When memory conflicts with current evidence, mark the memory mentally as stale or superseded until verified.

    line 108
  12. Distinctive:

    Do not checkpoint everything.

    line 112
  13. Distinctive:

    Prefer storing the decision, not just the fact.

    line 128
  14. Distinctive:

    Search filter uses session.

    line 134
  15. Distinctive:

    Run checkpoint after meaningful work only when durable reusable project knowledge changed:

    line 140
  16. Distinctive:

    Before writing memory, pass data through:

    line 150
  17. Distinctive:

    Never store secrets, raw emails, phone numbers, .env contents, or customer personal data.

    line 156

“Common” is measured: kept by at least 6 in 10 of the 16 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

Memory Management

Use this skill as conditional context infrastructure when a Laravel task depends on prior context, project history, or known conventions. For self-contained local tasks, skip memory entirely.

Core Principles

  • Remember only what remains useful.
  • Retrieve only what is relevant.
  • Verify before trusting.
  • Anonymize before sharing across projects.
  • Never persist secrets.
  • Preserve provenance for every durable entry.
  • Prefer continuity without context overload.

Conditional Preflight

The using-laravel-standards entrypoint decides this automatically before broad code exploration. Do not wait for explicit phrases like "remember" or "use memory-management".

Run memory preflight only when at least one is true:

  • the user references previous work or prior decisions
  • the task depends on project history
  • a known project convention is needed
  • durable prior context materially affects the implementation

For self-contained local tasks, skip memory entirely.

Prefer the active MCP server when the host exposes it:

MCP server: syarif-memory-management
Tool: memory_auto
Root: %USERPROFILE%\.ai-memory on Windows unless AI_MEMORY_ROOT overrides it
Installed skill path: %USERPROFILE%\.agents\skills\memory-management

If MCP is unavailable and Node/file access exists, fall back to the local CLI:

node <skill-dir>/scripts/memory.mjs auto --cwd <project-root> --query "<task intent>" --limit 5

This returns an explicit decision: RUN or decision: SKIP. On SKIP, continue normal work without memory. On RUN, use only compact relevant memory. Do not load every memory file by default. Do not fail the task merely because memory infrastructure is unavailable.

Memory is outside specialist routing. It does not consume the primary specialist slot, the supporting specialist slot, or the 0-2 specialist cap.

Preflight is retrieval-only. It must not create durable memory entries; writes happen through remember or checkpoint after safety checks.

Recall Budget

Default recall budget:

  • User memory: ~200 tokens
  • Conversation memory: ~500 tokens
  • Project memory: ~800 tokens
  • Workflow memory: ~400 tokens
  • Codebase context: remaining budget up to ~2200 tokens
  • Reserve: ~400 tokens

Stop retrieving when marginal relevance is lower than token cost.

Graph Memory

When memory-graph.json exists, query the graph before opening Markdown evidence:

node <skill-dir>/scripts/memory.mjs graph query "<task intent>" --limit 5
node <skill-dir>/scripts/memory.mjs graph path <from-id> <to-id>
node <skill-dir>/scripts/memory.mjs graph explain <memory-id>

Use graph edges with confidence tags:

  • EXTRACTED = explicit in source
  • INFERRED = derived by reasoning
  • AMBIGUOUS = weak or conflicting evidence

Memory Staleness

Memory is not forever. Every memory entry should carry a lifecycle:

  • CURRENT - actively valid and aligned with current codebase.
  • STALE - likely outdated; verify before trusting.
  • SUPERSEDED - replaced by newer memory or current code.
  • TEMPORARY - valid only for the current session or short horizon.

When the codebase or architecture changes, mark older project memories as STALE or SUPERSEDED rather than deleting them. Prefer current code over old memory.

Source Precedence

When memory and current evidence conflict, trust this order:

  1. Current code
  2. Current config
  3. Project docs
  4. Explicit project memory
  5. Conversation memory
  6. Inferred memory

This prevents memory poisoning during implementation.

When memory conflicts with current evidence, mark the memory mentally as stale or superseded until verified. Do not silently implement old memory over current code/config.

Selective Checkpointing

Do not checkpoint everything. Store only reusable durable knowledge:

  • architectural decision
  • non-obvious constraint
  • bug root cause that is reusable
  • project convention
  • environment quirk

Do not store:

  • line-number changes
  • temporary debug notes
  • short-lived branches
  • one-time grep results

Decision Memory

Prefer storing the decision, not just the fact.

Good:

  • Chose session-persisted filters instead of query-string persistence because existing project convention uses session state.

Bad:

  • Search filter uses session.

Decision memory helps the next agent understand why, not just what.

Checkpoint At Handoff

Run checkpoint after meaningful work only when durable reusable project knowledge changed:

node <skill-dir>/scripts/memory.mjs checkpoint --project <alias> --summary "<handoff summary>" --pending "<open questions>" --files "app/Actions/Foo.php,tests/Feature/FooTest.php"

Memory checkpoint is never a requirement for task completion. It occurs only when durable reusable knowledge was produced. Temporary debugging, transient terminal failures, trivial line edits, one-time grep results, and raw logs should not be checkpointed.

Security Pipeline

Before writing memory, pass data through:

raw input -> secret detection -> personal-data classification -> scope classification -> anonymization -> retention policy -> encryption at rest -> memory storage

Never store secrets, raw emails, phone numbers, .env contents, or customer personal data.

References

  • Graph memory commands and formats: references/graph-memory.md
  • Hermes-style orchestrator profile: references/hermes-orchestrator-profile.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.