# Persistent Memory

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-fengsihao23-eng-shen-hua-persistent-memory`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [fengsihao23-eng](https://agentstack.voostack.com/s/fengsihao23-eng)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [fengsihao23-eng](https://github.com/fengsihao23-eng)
- **Source:** https://github.com/fengsihao23-eng/shen-hua/tree/main/skills/persistent-memory

## Install

```sh
agentstack add skill-fengsihao23-eng-shen-hua-persistent-memory
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [fengsihao23-eng](https://github.com/fengsihao23-eng)
- **Source:** [fengsihao23-eng/shen-hua](https://github.com/fengsihao23-eng/shen-hua)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-fengsihao23-eng-shen-hua-persistent-memory
- Seller: https://agentstack.voostack.com/s/fengsihao23-eng
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
