skills/agent-memory/SKILL.md
Sets up agent memory project structure and manages the four agent memory files (adr.md, config.md, bug.md, issue.md). Handles scaffolding (creating docs/memory, docs/plans directories, memory files, and .claude/CLAUDE.md) and memory operations (adding ADRs, logging bug fixes, tracking issues, updating config, resolving issues). Use when the user asks to "set up agent memory", "scaffold agent project structure", "initialize agent cookiecutter", "run agent-cookiecutter", "set up agent project", "add an ADR", "record an architectural decision", "log a bug fix", "add a bug", "add an issue", "update config memory", "resolve an issue", "move issue to bug", or "update memory files", "plant the plan", "save plan to repo". Depends on plant-plan for copying plan files into docs/plans/. Do NOT use for committing or pushing changes.
npx skillsauth add armandli/get-skilled agent-memoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Determine which path to follow based on the user's request:
Run pwd and git rev-parse --show-toplevel 2>/dev/null.
pwd, warn the user and stop. All paths must be relative to the repo root.Run:
mkdir -p docs/memory docs/plans
Both are created with -p (no error if already present).
After creating directories, note to the user:
docs/plans/is ready. Use/plant-planafter planning sessions to copy plan files here from~/.claude/plans/.
Use Glob to check which files already exist: docs/memory/*.md.
For each file not already present, use the Write tool to create it:
docs/memory/adr.md — content: # Architectural Decision Recordsdocs/memory/config.md — content: # Project Configurationdocs/memory/bug.md — content: # Bug Fix Historydocs/memory/issue.md — content: # Open IssuesSkip any file that already exists.
.claude/CLAUDE.mdUse Glob to check whether .claude/CLAUDE.md already exists.
Only if it does not exist:
mkdir -p .claude to ensure the directory is present..claude/CLAUDE.md with this exact content:# Agent Memory
This project uses structured memory files to maintain context across sessions.
## Architecture Decisions
When making changes to project architecture or significant design decisions, read and update `docs/memory/adr.md` to record the decision, rationale, and consequences.
## Configuration and Settings
When changing project configurations or settings, read and update `docs/memory/config.md` to reflect the current configuration state.
## Bug Tracking
When fixing bugs:
- Check `docs/memory/bug.md` for historical bug fixes that may be relevant.
- After fixing a bug, record the fix and its root cause in `docs/memory/bug.md`.
- Check `docs/memory/issue.md` for currently open issues.
- When resolving an open issue, move it from `docs/memory/issue.md` to `docs/memory/bug.md`.
If .claude/CLAUDE.md already exists, skip creation.
Print a summary listing:
.claude/CLAUDE.md: created or skipped (already exists)Determine which operation is requested from the table below, then read all target files before making any edits.
| Intent | Target file(s) |
|---|---|
| Add architectural decision | docs/memory/adr.md |
| Add/update config entry | docs/memory/config.md |
| Add bug fix record | docs/memory/bug.md |
| Add open issue | docs/memory/issue.md |
| Resolve issue (move to bug) | docs/memory/issue.md + docs/memory/bug.md |
adr.md — Architectural Decision RecordsMaintain as a Markdown table with exactly these 5 columns in order:
| ID/Name | Context | Decision | Alternative | Consequence | |---|---|---|---|---|
ADR-001) and/or a descriptive name.Append new rows; never delete existing rows.
config.md — Project ConfigurationFree-form Markdown organized by service or category. Each entry should document one of:
staging, prod)NEVER record in this file:
If the user attempts to write forbidden content, stop, warn them, and omit the secret.
bug.md — Bug Fix HistoryMaintain as a Markdown table with exactly these 5 columns in order:
| Date | Issue | Cause | Solution | Prevention | |---|---|---|---|---|
YYYY-MM-DD).— if not applicable).Append new rows; never delete existing rows.
issue.md — Open IssuesMaintain as a Markdown table with exactly these 2 columns in order:
| Date | Issue | |---|---|
YYYY-MM-DD).Append new rows for new issues.
When an issue is resolved (user says the bug is fixed, issue is closed, etc.):
docs/memory/issue.md and identify the matching row.docs/memory/bug.md.issue.md.bug.md using:
issue.md (date found), not today's date.issue.md.— if not given.If cause or solution is unknown, ask the user before writing.
Use the Edit tool (not Write) to make targeted updates so existing content is preserved.
adr.md, bug.md, issue.md): append new rows at the bottom of the table.config.md: append under the relevant section heading, or create a new section.After every operation, confirm:
adr.md or bug.md (append-only)issue.md except when promoting to bug.mdAfter the skill's primary task completes, run:
python3 ${PWD}/.claude/skills/skill-stat/scripts/record-stat.py "agent-memory"
tools
--- name: update-readme description: Updates a project README.md with build instructions, unit test instructions, and a mermaid architecture diagram. Use when a project README needs to be created or refreshed. Trigger phrases: "update readme", "generate readme", "create readme", "refresh readme docs". Emphasizes project interfaces, extension points, and customization hooks in the diagram — not concrete implementations. Do NOT use for documentation sites, wikis, or non-project READMEs. argument-h
business
--- name: skill-stat description: Records skill usage statistics and issue reports into .claude/skill-stats.md. Increments the Uses count for a skill name, and optionally logs an issue report that increments the Issues count and appends a row to the Issue Reports table. Use when tracking how often a skill is invoked, when a user reports a problem with a skill, or when another skill needs to log its own usage. Trigger phrases: "record skill stat", "log skill usage", "report skill issue". Do NOT u
testing
--- name: revert description: Reverts ALL git changes in the working directory: staged changes, unstaged modifications, and new untracked files. Use when user asks to "revert all changes", "undo all changes", "discard all changes", "reset all git changes", or "clean working directory". Do NOT use for reverting a specific file or a specific commit — those need targeted git commands. disable-model-invocation: true --- Revert all git changes in the working directory. This is destructive and cannot
tools
Scans a Python codebase for duplicate or near-duplicate logic patterns across functions, classes, and files, then extracts those patterns into typed utility classes in a shared module. Use when the user asks to "refactor this Python code", "find duplicate logic", "extract shared utilities", "apply DRY to Python", "deduplicate Python code", or "find repeated patterns in Python". Groups extracted helpers by the object type they operate on (strings, numbers, dates, collections, etc.). Do NOT use for performance optimization (use optimize-python), for debugging logic errors, or for explaining code. Do NOT extract code that appears only once. Run this skill before optimize-python.