skills/agent-memory-v2/SKILL.md
--- name: agent-memory-v2 description: Sets up and manages diagram-driven project memory in docs/memory/. Scaffolds directories (docs/memory, docs/plans), creates memory files (kanban.md, architecture.md, adr.md, config.md, bug.md), and writes CLAUDE.md to guide future sessions. Diagrams in docs/memory drive source code changes. Use when the user asks to "set up agent memory v2", "scaffold project structure", "initialize memory", "add an ADR", "log a bug fix", "update config memory", "update kan
npx skillsauth add armandli/get-skilled skills/agent-memory-v2Install 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.
If $ARGUMENTS is present, parse it as a kanban command and go directly to Path B-Kanban:
| Invocation | Action |
|-----------|--------|
| create-item <name> "details" | Create new item in the open column with the given name and details |
| progress <name> | Move item matching <name> from open → inprogress |
| complete <name> | Move item matching <name> from any column → complete |
Item name matching is case-insensitive and partial — match the closest item if exact match not found. If ambiguous (multiple partial matches), list them and ask the user to clarify.
If no $ARGUMENTS, determine the path from the user's message:
docs/memory/ and wants source code updated to reflect it, or asks to sync code from a diagram. → Path CRun pwd and git rev-parse --show-toplevel 2>/dev/null.
If the git root differs from pwd, warn the user and stop. All paths must be relative to the repo root.
mkdir -p docs/memory docs/plans
Both 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 under docs/memory/*.md.
For each file not already present, create it using the Write tool with the initial content specified in references/initial-content.md. Files to create:
docs/memory/kanban.mddocs/memory/architecture.mddocs/memory/adr.mddocs/memory/config.mddocs/memory/bug.mdSkip any file that already exists — never overwrite existing memory.
.claude/CLAUDE.mdUse Glob to check whether .claude/CLAUDE.md exists at the repo root.
.claude/ does not exist, create it first with mkdir -p .claude..claude/CLAUDE.md does not exist: use the Write tool to create it with the content in references/claude-md-content.md..claude/CLAUDE.md already exists: read it first, then use the Edit tool to append the agent-memory-v2 section if it is not already present. Never remove existing content.Print a summary:
.claude/CLAUDE.md: created, updated, or skippedThis path handles both command-style ($ARGUMENTS) and natural-language kanban requests.
Read docs/memory/kanban.md. Parse the mermaid kanban block to extract the current items and their columns.
create-item <name> "details" (or natural language equivalent: "add kanban item", "create task"):
fix-auth-bug-2, -3, etc.)open column:
open[Open]
fix-auth-bug[Fix auth bug — details here]
name — details (em dash separator). If no details provided, use just the name.progress <name> (or "move to in progress", "start working on"):
open column whose label best matches <name>open, add under inprogresscomplete <name> (or "complete item", "mark done", "finish"):
<name>completeUse the Edit tool to update the mermaid kanban block in docs/memory/kanban.md. Replace only the fenced code block — preserve the heading and any surrounding text.
State: which item was affected, what operation was performed, and which column it now lives in.
Read all target files before editing.
| Intent | Target file(s) |
|--------|---------------|
| Add/move kanban item | docs/memory/kanban.md |
| Add architectural decision | docs/memory/adr.md |
| Add/update config entry | docs/memory/config.md |
| Add bug fix record | docs/memory/bug.md |
See references/memory-schemas.md for the exact schema and rules for each file.
Use the Edit tool (not Write) to make targeted updates — preserve all existing content.
kanban.md: edit the mermaid diagram block — move items between columns or add new items. Keep the fenced code block intact.adr.md and bug.md: append new rows at the bottom of the table.config.md: append under the relevant section heading, or add a new section.Confirm which file(s) were updated and what changed. If any forbidden config content was omitted, state what and why.
This path is triggered when the user has edited a diagram in docs/memory/ and wants the source code updated to match it, or explicitly asks to "sync code from diagram" / "update source from architecture".
See references/diagram-driven-dev.md for the full workflow.
Ask the user which diagram changed (if not already stated). Supported diagrams:
| File | Diagram type | Drives |
|------|-------------|--------|
| docs/memory/architecture.md | Class diagram | Class/struct/interface definitions, relationships, method signatures |
| docs/memory/*.md (sequence) | Sequence diagram | Function/method call flows, API contracts, inter-service protocols |
| docs/memory/*.md (state) | State diagram | State machine implementations, lifecycle enums, transition handlers |
Read the target file. Parse the mermaid diagram to understand the intended structure or behavior. Refer to the mermaid-diagram-guide skill for syntax — load the relevant reference file from that skill if needed.
Explore the source code to find the corresponding implementation:
Identify what is missing, renamed, or structurally different.
Make the minimum set of source changes needed to bring the code in line with the diagram:
Do not add features, docstrings, or refactors beyond what the diagram specifies.
List each source change made (file, what changed, which diagram element drove it).
adr.md or bug.md (append-only)complete column insteadCLAUDE.md contentarchitecture.md insteadAfter the skill's primary task completes, run:
python3 ${PWD}/.claude/skills/skill-stat/scripts/record-stat.py "agent-memory-v2"
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.