AGENT SKILL

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.

  1. Check for .claude/agent-memory/<agent-name>/MEMORY.md
  2. If it exists, read the index to get all memory file pointers
  3. Read each referenced memory file
  4. Run the Staleness Check (see below) on all entries
  5. 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>
  1. Parse agent name, type, name, description, and content from args
  2. Derive filename: <type>_<kebab-case-name>.md (e.g., feedback_response-style.md)
  3. Write .claude/agent-memory/<agent-name>/<filename>.md using the Memory File Format below
  4. Read .claude/agent-memory/<agent-name>/MEMORY.md (or initialize an empty index)
  5. Check for an existing entry matching this memory name — update rather than duplicate
  6. Write the updated MEMORY.md
  7. 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.

  1. Re-read .claude/agent-memory/<agent-name>/MEMORY.md
  2. Re-read every referenced memory file
  3. Run the Staleness Check on all entries
  4. Flag any stale entries to the caller
  5. Return the refreshed memory context

Prune — args: prune <agent-name>

Remove stale or duplicate memory entries with confirmation.

  1. Load all memory files for the agent
  2. Identify stale entries: those referencing non-existent file paths (Glob), functions, or flags (Grep)
  3. Identify duplicates: same topic covered by multiple files
  4. Present a list of candidates with reasons; ask for confirmation before any deletion
  5. On confirmation: delete approved files and remove their entries from MEMORY.md
  6. Confirm: "Pruned N entries from <agent-name>'s memory."

Audit — args: audit

Survey memory health across all agents.

  1. Glob .claude/agent-memory/*/MEMORY.md
  2. For each agent, count entries and note the index file size
  3. Return a summary table: agent → entry count → index line count → staleness risk
  4. 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 log is 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

rafsanulhasan
rafsanulhasan/HypermediaEngine

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.

★ 0
rafsanulhasan
rafsanulhasan/HypermediaEngine

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.

★ 0
rafsanulhasan
rafsanulhasan/HypermediaEngine

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

★ 0
rafsanulhasan
rafsanulhasan/HypermediaEngine

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.

★ 0
rafsanulhasan
rafsanulhasan/HypermediaEngine

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.

★ 0
rafsanulhasan
rafsanulhasan/HypermediaEngine

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.

★ 0