manage-memory
Manages persistent file-based memory for all agents in .claude/agent-memory/<agent-name>/. Supports load, save, refresh, prune, and audit. All agents call this directly for load/save; prune/audit/refresh are routed through skill-manager.
- License 许可
- GPL-3.0
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- manage-memory
- model
- claude-haiku-4-5-20251001
- tools
- Read, Write, Edit, Glob, Grep
- description
- Manages persistent file-based memory for all agents in .claude/agent-memory/<agent-name>/. Supports load, save, refresh, prune, and audit. All agents call this directly for load/save; prune/audit/refresh are routed through skill-manager.
03 SKILL.md 正文
You manage all persistent memory for agents in the HypermediaEngine project. Memory is stored in .claude/agent-memory/<agent-name>/. Parse the args to determine the operation.
Load — args: <agent-name>
Retrieve all memories for the named agent.
- Check for
.claude/agent-memory/<agent-name>/MEMORY.md - If it exists, read the index to get all memory file pointers
- Read each referenced memory file
- Run the Staleness Check (see below) on all entries
- Return all memory content as structured context for the calling agent
If no MEMORY.md exists: respond "No prior memories for <agent-name>."
Save — args: multi-line block
save <agent-name>
type: <user|feedback|project|reference>
name: <memory-name>
description: <one-line description for the index>
<memory content body>
- Parse agent name, type, name, description, and content from args
- Derive filename:
<type>_<kebab-case-name>.md(e.g.,feedback_response-style.md) - Write
.claude/agent-memory/<agent-name>/<filename>.mdusing the Memory File Format below - Read
.claude/agent-memory/<agent-name>/MEMORY.md(or initialize an empty index) - Check for an existing entry matching this memory name — update rather than duplicate
- Write the updated MEMORY.md
- Confirm: "Saved '<name>' to <agent-name>'s memory."
Refresh — args: refresh <agent-name>
Force-reload the memory index and all files, then re-run staleness checks.
- Re-read
.claude/agent-memory/<agent-name>/MEMORY.md - Re-read every referenced memory file
- Run the Staleness Check on all entries
- Flag any stale entries to the caller
- Return the refreshed memory context
Prune — args: prune <agent-name>
Remove stale or duplicate memory entries with confirmation.
- Load all memory files for the agent
- Identify stale entries: those referencing non-existent file paths (Glob), functions, or flags (Grep)
- Identify duplicates: same topic covered by multiple files
- Present a list of candidates with reasons; ask for confirmation before any deletion
- On confirmation: delete approved files and remove their entries from MEMORY.md
- Confirm: "Pruned N entries from <agent-name>'s memory."
Audit — args: audit
Survey memory health across all agents.
- Glob
.claude/agent-memory/*/MEMORY.md - For each agent, count entries and note the index file size
- Return a summary table: agent → entry count → index line count → staleness risk
- Flag any agent whose MEMORY.md exceeds 150 lines (approaching the 200-line truncation limit)
Memory File Format
---
name: <memory name>
description: <one-line description — specific enough to judge relevance in future conversations>
type: <user|feedback|project|reference>
---
<content body>
feedback and project entries must include:
- The rule or fact on the lead line
- Why: the reason (past incident, constraint, user preference)
- How to apply: when/where this guidance kicks in
MEMORY.md Format (index only — no frontmatter)
# Memory Index
- [Title](filename.md) — one-line hook under 150 characters
One line per entry. Never write memory content directly in MEMORY.md. Lines after 200 are truncated — keep the index concise.
Memory Types
| Type | Stores | Save when |
|---|---|---|
| user | Role, goals, expertise, preferences | You learn who the user is |
| feedback | Corrections AND validated approaches | User corrects ("don't X") or confirms ("yes, exactly") |
| project | Work, decisions, constraints, deadlines | You learn project context (convert relative dates to absolute YYYY-MM-DD) |
| reference | Pointers to external systems | You learn about tools, dashboards, trackers, channels |
What NOT to Save
- Code patterns, conventions, architecture — derivable from the codebase
- Git history —
git logis authoritative - Bug fixes or debugging recipes — the fix is in the code
- Anything documented in CLAUDE.md files
- Ephemeral task state or current conversation context
If asked to save any of the above, ask what was surprising or non-obvious about it — save that instead.
Staleness Check (on load and refresh)
For every memory entry that names a specific file, function, flag, or external resource:
- File paths: Glob to verify existence
- Function or flag names: Grep to verify
- Flag stale entries to the calling agent before returning memory context
Current codebase state always overrides memory.
04 同仓库更多 Skills
write-tests
Test implementation skill for HypermediaEngine. Takes a confirmed test plan from design-test-cases and produces compilable, runnable xUnit tests following project conventions. Validates coverage quality through mutation testing. Invoked by the sqa-engineer agent after the test plan is approved.
write-documentation
Structured documentation writing workflow for HypermediaEngine. Writes or updates README.md files at the repo root and in each project directory (src/, tests/, samples/, etc.) based on current implementation, ADRs, and architecture decisions.
write-adr
Writes a numbered Architecture Decision Record (ADR) for a significant architectural choice in the HypermediaEngine project. Invoked by the software-architect agent whenever a consequential design decision is made or ratified. Saves the ADR to docs/architecture/decisions/.
tunit-playwright-ui-testing
Comprehensive guidance for writing coded end-to-end UI tests in C# using TUnit.Playwright. Tests inherit from PageTest — the base class manages all browser lifecycle. Covers NuGet setup, PageTest inheritance, Page Object Model, browser configuration, parallelism limiting, and CI integration. Based on the official TUnit docs at https://tunit.dev/docs/examples/playwright.
triage
Task classification, decomposition, dependency mapping, and routing skill. Invoked by the triage-agent to break any user request into discrete, independently-routable work items with assigned priorities and agent chains.
system-design
Expert system design skill. Use PROACTIVELY to design systems, review architectures, and assist software engineers in learning design principles and implementing them in the code with design patterns.