agentleFS
fengsihao23-engfengsihao23-eng/shen-hua/skills/persistent-memory/SKILL.md

persistent-memory

Skill1 starsChanged 6 months agoMITView on GitHub

Shen-Hua project memory manager. Use whenever Codex needs to initialize, read, repair, update, or summarize the project's `.agent/` working memory files, including PROJECT_BRIEF.md, PLAN.md, TASKS.md, LOG.md, DECISIONS.md, HANDOFF.md, and REVIEW_CHECKLIST.md for long-running tasks.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 12
  2. Distinctive:

    Do not use this skill when:

    line 19
  3. Very specific:

    When Shen-Hua V2 runtime is enabled, also maintain:

    line 35
  4. Distinctive:

    Read existing memory before changing it.

    line 45
  5. Distinctive:

    Use timestamps for log entries.

    line 47
  6. Distinctive:

    Prefer concise append/update blocks over wholesale rewrites.

    line 48
  7. Very specific:

    Keep .agent/HANDOFF.md current enough that another agent can resume immediately.

    line 50
  8. Distinctive:

    When invoked, update at least one relevant memory file.

    line 54
  9. Very specific:

    Use $runtime-operator when the task needs queue operations, memory indexing/search, resume prompt generation, automation prompts, sync …

    line 65
  10. Very specific:

    Do not launch subagents for routine memory updates.

    line 69
  11. Distinctive:

    No build/test command is required for memory-only edits.

    line 73

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

Persistent Memory

Persistent Memory keeps long-running project context in .agent/ so future Codex sessions can resume with less drift.

Trigger Conditions

Use this skill when:

  • .agent/ files are missing, stale, inconsistent, or need initialization.
  • Starting, continuing, pausing, or handing off long-running work.
  • A plan, decision, task status, verification result, or blocker must persist across turns.

Do Not Trigger

Do not use this skill when:

  • The user explicitly forbids writing project memory.
  • The task is truly one-shot and no project state changes.
  • A different project memory system is mandated by the user and conflicts with .agent/.

Memory Files

Maintain these files:

  • .agent/PROJECT_BRIEF.md: stable project goal, constraints, source priority, commands, conventions.
  • .agent/PLAN.md: current plan, phases, milestones, verification gates.
  • .agent/TASKS.md: task list with status, owner/role, and next action.
  • .agent/LOG.md: append-only chronological work log.
  • .agent/DECISIONS.md: durable decisions with rationale and alternatives.
  • .agent/HANDOFF.md: resume instructions for the next agent/session.
  • .agent/REVIEW_CHECKLIST.md: self-review and quality checklist.

When Shen-Hua V2 runtime is enabled, also maintain:

  • .agent/state/tasks.jsonl: machine-readable task queue.
  • .agent/state/events.jsonl: append-only runtime event log.
  • .agent/state/memory-index.json: local memory retrieval index.
  • .agent/state/sync-outbox.jsonl: external sync outbox.
  • .agent/resume-prompt.md: future-session resume prompt.
  • .agent/automation-prompt.md: Codex automation prompt.

Update Rules

  1. Read existing memory before changing it.
  2. Preserve useful prior context; do not rewrite history into fiction.
  3. Use timestamps for log entries.
  4. Prefer concise append/update blocks over wholesale rewrites.
  5. Mark uncertainty explicitly.
  6. Keep .agent/HANDOFF.md current enough that another agent can resume immediately.

Required .agent/ Updates

When invoked, update at least one relevant memory file. For ordinary long-task rounds, update:

  • .agent/LOG.md
  • .agent/TASKS.md
  • .agent/HANDOFF.md

For first-time setup, create all seven files with usable starter content.

Other Skills

Persistent Memory supports all Shen-Hua skills. It does not need to call other skills unless memory repair reveals that planning, verification, review, or handoff is missing.

Use $runtime-operator when the task needs queue operations, memory indexing/search, resume prompt generation, automation prompts, sync export, or the runtime gate.

Subagents

Do not launch subagents for routine memory updates. If multiple subagents are already running, record their assignments and statuses in .agent/TASKS.md and .agent/HANDOFF.md.

Verification Commands

No build/test command is required for memory-only edits. Validate by confirming the files exist and contain no placeholder-only sections.

Output Format

MEMORY UPDATE
Files read:
Files updated:
New facts:
Open uncertainties:
Next resume point:

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.