用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Abilityai/abilities --skill add-memory命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-memory |
| description | Add a memory system to an agent — file awareness, knowledge graph, structured state, or multi-session tracking |
| argument-hint | [memory-type] |
| disable-model-invocation | false |
| user-invocable | true |
| allowed-tools | Read, Write, Bash, Glob, Grep, AskUserQuestion |
| metadata | {"version":"1.1","created":"2026-04-16T00:00:00.000Z","updated":"2026-05-16T00:00:00.000Z","author":"Ability.ai","changelog":["1.1: Add portability note — memory skills are copied into the agent so it stays self-contained with no plugin dependency","1.0: Initial version — adds a memory system (file-index, brain, json-state, or workspace) to an existing agent"]} |
ℹ️ First, set expectations: before anything else, print one short line with this skill's version and its most recent change — the top entry of
metadata.changelogabove — e.g.add-memory vX.Y — recent: <summary>. Then proceed.
Add a memory system to an existing agent. Memory skills are COPIED into the agent's .claude/skills/ directory — the agent becomes self-contained with no plugin dependency.
| Type | Description | Skills Installed |
|---|---|---|
| file-index | File system awareness — creates and maintains a searchable file index | setup-index, refresh-index, search-files |
| brain | Zettelkasten-style knowledge graph — atomic notes with connections | setup-brain, create-note, search-brain, find-connections |
| json-state | Structured JSON state with jq-based updates and action logging | setup-memory, load-memory, update-memory, memory-jq |
| workspace | Multi-session project tracking — organized folders, sessions, archives | setup-projects, create-project, create-session, archive-project |
Check if we're in an agent directory (has CLAUDE.md) or if user specified a path.
# Check current directory
if [ -f "CLAUDE.md" ]; then
AGENT_DIR="$(pwd)"
else
# Ask user for agent path
fi
If no CLAUDE.md found, ask:
If user provided an argument (e.g., /agent-dev:add-memory brain), use that.
Otherwise, use AskUserQuestion:
Question: "What kind of memory does this agent need?"
Header: "Add Memory"
Options:
File awareness (file-index) — "I need the agent aware of workspace files"
Knowledge graph (brain) — "I need connected notes, evolving knowledge"
Structured state (json-state) — "I need counters, config, structured data"
Multi-session workspace (workspace) — "I need organized projects and sessions"
Memory templates are stored in this plugin at:
agent-dev/memory-templates/
file-index/ # setup-index/, refresh-index/, search-files/
brain/ # setup-brain/, create-note/, search-brain/, find-connections/
json-state/ # setup-memory/, load-memory/, update-memory/, memory-jq/
workspace/ # setup-projects/, create-project/, create-session/, archive-project/
Copy the selected memory type's skills into the agent:
# Get the plugin directory (where this skill lives)
PLUGIN_DIR="$(dirname "$(dirname "$(dirname "$0")")")"
TEMPLATES_DIR="$PLUGIN_DIR/memory-templates"
# Copy skills to agent
cp -r "$TEMPLATES_DIR/[selected-type]/"* "$AGENT_DIR/.claude/skills/"
Add a section documenting the new memory capabilities:
## Memory: [Type Name]
This agent has [type] memory installed. Available skills:
- `/[skill-1]` — description
- `/[skill-2]` — description
...
Run `/[setup-skill]` to initialize.
Output:
## Memory Added
Installed **[type]** memory to `[agent-name]`.
### New Skills
- `/[skill-1]` — description
- `/[skill-2]` — description
### Next Step
Run `/[setup-skill]` to initialize the memory system.
~/. If using the native Claude Code memory: frontmatter field on custom subagent definitions, use memory: project (stores in .claude/agent-memory/, stays in repo) — never memory: user (stores in ~/.claude/, breaks portability)