agent:create
Scaffold a Claude Code subagent that has durable memory — not just a system
prompt, but a small filesystem the agent reads at boot and writes back to at
the end of each session.
The skill creates three things in one shot:
| Tier |
What |
Where |
Read by |
| 1 |
Definition (system prompt + YAML frontmatter) |
.claude/agents/<name>.md |
The Claude Code harness, at spawn |
| 2 |
Memory index (boot sequence, ≤80 lines) |
.claude/agent-memory/<name>/MEMORY.md |
The subagent itself, auto-injected on every spawn |
| 3 |
Deep memory store (PRIVACY, profiles, sessions, tasks, cache) |
.agents/<name>/ |
The subagent, on demand per the boot sequence |
Files are templates. They include placeholders, hints, and a few sensible
defaults (e.g. PRIVACY.md as the first boot step, a self-curation block in the
definition, a tasks/open-tasks.md skeleton). The user customizes after the
scaffold runs.
When this earns its place
Use it when the user is about to create — or wishes they had created — an
agent that should:
- Have a persistent identity across sessions, not a one-shot prompt
- Remember decisions, preferences, and "what works" without being told each time
- Carry per-topic state (per-person profiles, per-project notes, etc.)
- Curate its own memory after each session (append to what-works.md, log a session, mark a task done)
Skip it for:
- One-off slash commands (those go in
commands/, not agents/)
- Skills that wrap a tool — those don't need their own memory store
- "Just give me a system prompt" — that's a one-file edit, not three-tier scaffolding
The flow
1. Collect the minimum input
Before running the scaffolder, confirm with the user:
- Name — kebab-case, used in all three tiers (e.g.
code-reviewer, release-notes-writer, data-scout).
The agent file will be <name>.md; the deep store will live at .agents/<name>/.
- Role / one-line purpose — a single sentence the user would say if asked
"what does this agent do for me?" Used in the description-trigger and in the
identity blocks of all three tiers.
- Target directory — where the three tiers should be created. Default is
the current working directory. For a vault-style setup, pass the vault root
(the scaffolder will create
.claude/agents/, .claude/agent-memory/, and
.agents/ under it).
Optional fields (the scaffolder accepts but leaves blank if not provided):
--anchor — a short anchor phrase the agent returns to ("Boring is the feature.", "Signal, not noise.")
--voice — one line of voice notes ("calm, dry, no exclamations, no emojis")
--triggers — comma-separated keywords for the description ("X, Y, Z")
--anti-triggers — comma-separated "do NOT trigger for" topics
--force — overwrite existing files (default: refuse if any of the three tiers already exists)
2. Run the scaffolder
# $CLAUDE_PLUGIN_ROOT is set by Claude Code when the plugin is installed
python3 "$CLAUDE_PLUGIN_ROOT/skills/agent:create/scripts/create_agent.py" \
--name <agent-name> \
--role "<one-line purpose>" \
--target <vault-or-project-root> \
[--anchor "<phrase>"] \
[--voice "<one line>"] \
[--triggers "kw1, kw2, kw3"] \
[--anti-triggers "topic1, topic2"]
The script prints the absolute paths of every file it created and exits 0 on
success, non-zero with a clear message if a tier already exists (use --force
to overwrite, or pick a different name).
3. Review and customize
After the scaffold lands, walk the user through the three files that matter
most:
**.claude/agents/<name>.md** — fill in persona, boundaries, output formats.
The template ships with section headings and <!-- TODO --> markers so it's
obvious what's missing.
**.claude/agent-memory/<name>/MEMORY.md** — sanity-check the boot sequence.
Add or remove file pointers based on what memory/ actually contains.
**.agents/<name>/memory/PRIVACY.md** — set the privacy posture before the
agent is ever invoked. The template has prompts for what to redact, what to
keep in buckets, and what to point-to-vault rather than duplicate.
4. Run a first audit
After customization, the user can run mh:agent:audit (the sister skill in
this plugin) against the new agent to check that:
- All boot-sequence files referenced in MEMORY.md actually exist
- The description has both positive triggers and "do NOT trigger" rules
- PRIVACY.md, tasks/, and sessions/ are present
- Cross-tier consistency holds (name, identity one-liner)
This closes the loop: scaffold → customize → audit → iterate.
What the scaffolder creates
<target>/
├── .claude/
│ ├── agents/
│ │ └── <name>.md ← Tier 1 — definition + system prompt
│ └── agent-memory/
│ └── <name>/
│ └── MEMORY.md ← Tier 2 — auto-injected boot index
└── .agents/
└── <name>/
├── memory/
│ ├── PRIVACY.md ← always read first by the agent
│ ├── INDEX.md ← pointers into the deep store
│ └── _shared/.gitkeep ← framework / pattern files (load on demand)
├── tasks/
│ └── open-tasks.md ← agent's own backlog (Markdown checkboxes)
├── sessions/
│ └── .gitkeep ← session logs land here per ritual
├── cache/
│ └── .gitkeep ← ephemeral cache (rates, RSS poll state, …)
└── output/
└── .gitkeep ← draft outputs before publish
Templates live at templates/ inside this skill. They are deliberately short:
they give shape, not content.
Conventions baked into the templates
- PRIVACY.md is step 1 of every boot sequence. Always.
- MEMORY.md kept ≤80 lines. It pays its cost on every spawn — keep it lean.
Detail goes to
memory/INDEX.md and topic files.
- Boot sequence is a numbered list. No "read these files" prose — the order
matters and should be explicit.
- Self-curation block in the definition. Every agent writes back at session
end: what-works, decisions, tasks closed, MEMORY.md trim check.
Subagents do NOT inherit the CLAUDE.md cascade is called out in the
template — boot sequence should explicitly list any CLAUDE.md the agent
depends on.
What the skill does NOT do
By design, this skill stays out of the user's domain decisions:
- No cadence integration — no daily/weekly/monthly assumptions, no embedding
the agent in any periodic-routine flow. If the user wants that, they wire it after.
- No external-system handoffs — no MCP wiring, no queue conventions, no
cron/scheduling. The scaffolded agent is fully self-contained.
- No persona invention — anchor phrase, voice, triggers, and tool boundaries
are user input. Templates have placeholders, not opinions.
- No vault opinions — the scaffolder writes the three tiers wherever you
point it. It does not touch existing CLAUDE.md, README, or git config.
Inputs / outputs
Inputs: name, role, target dir, optional anchor / voice / triggers / anti-triggers.
Outputs: three tiers of files described above, absolute-path-listed on stdout.
Exit codes: 0 on success; non-zero with a clear message on collision or
invalid input.
See also
mh:agent:audit — sister skill, checks the structure for completeness and
cross-tier consistency.
- The plugin README at
plugins/mh/README.md.
Source: mhlavac/claude-marketplace — distributed by TomeVault.
1---2name: mhlavac-claude-marketplace-agent-create3description: agent:create4---56# agent:create78Scaffold a Claude Code subagent that has **durable memory** — not just a system9prompt, but a small filesystem the agent reads at boot and writes back to at10the end of each session.1112The skill creates three things in one shot:1314| Tier | What | Where | Read by |15|---|---|---|---|16| 1 | **Definition** (system prompt + YAML frontmatter) | `.claude/agents/<name>.md` | The Claude Code harness, at spawn |17| 2 | **Memory index** (boot sequence, ≤80 lines) | `.claude/agent-memory/<name>/MEMORY.md` | The subagent itself, auto-injected on every spawn |18| 3 | **Deep memory store** (PRIVACY, profiles, sessions, tasks, cache) | `.agents/<name>/` | The subagent, on demand per the boot sequence |1920Files are templates. They include placeholders, hints, and a few sensible21defaults (e.g. PRIVACY.md as the first boot step, a self-curation block in the22definition, a `tasks/open-tasks.md` skeleton). The user customizes after the23scaffold runs.2425## When this earns its place2627Use it when the user is about to create — or wishes they had created — an28agent that should:2930- Have a **persistent identity** across sessions, not a one-shot prompt31- Remember decisions, preferences, and "what works" without being told each time32- Carry **per-topic state** (per-person profiles, per-project notes, etc.)33- Curate its own memory after each session (append to what-works.md, log a session, mark a task done)3435Skip it for:3637- One-off slash commands (those go in `commands/`, not `agents/`)38- Skills that wrap a tool — those don't need their own memory store39- "Just give me a system prompt" — that's a one-file edit, not three-tier scaffolding4041## The flow4243### 1. Collect the minimum input4445Before running the scaffolder, confirm with the user:46471. **Name** — kebab-case, used in all three tiers (e.g. `code-reviewer`, `release-notes-writer`, `data-scout`).48 The agent file will be `<name>.md`; the deep store will live at `.agents/<name>/`.492. **Role / one-line purpose** — a single sentence the user would say if asked50 "what does this agent do for me?" Used in the description-trigger and in the51 identity blocks of all three tiers.523. **Target directory** — where the three tiers should be created. Default is53 the current working directory. For a vault-style setup, pass the vault root54 (the scaffolder will create `.claude/agents/`, `.claude/agent-memory/`, and55 `.agents/` under it).5657Optional fields (the scaffolder accepts but leaves blank if not provided):5859- `--anchor` — a short anchor phrase the agent returns to (`"Boring is the feature."`, `"Signal, not noise."`)60- `--voice` — one line of voice notes (`"calm, dry, no exclamations, no emojis"`)61- `--triggers` — comma-separated keywords for the description (`"X, Y, Z"`)62- `--anti-triggers` — comma-separated "do NOT trigger for" topics63- `--force` — overwrite existing files (default: refuse if any of the three tiers already exists)6465### 2. Run the scaffolder6667```bash68# $CLAUDE_PLUGIN_ROOT is set by Claude Code when the plugin is installed69python3 "$CLAUDE_PLUGIN_ROOT/skills/agent:create/scripts/create_agent.py" \70 --name <agent-name> \71 --role "<one-line purpose>" \72 --target <vault-or-project-root> \73 [--anchor "<phrase>"] \74 [--voice "<one line>"] \75 [--triggers "kw1, kw2, kw3"] \76 [--anti-triggers "topic1, topic2"]77```7879The script prints the absolute paths of every file it created and exits 0 on80success, non-zero with a clear message if a tier already exists (use `--force`81to overwrite, or pick a different name).8283### 3. Review and customize8485After the scaffold lands, walk the user through the three files that matter86most:87881. `**.claude/agents/<name>.md**` — fill in persona, boundaries, output formats.89 The template ships with section headings and `<!-- TODO -->` markers so it's90 obvious what's missing.912. `**.claude/agent-memory/<name>/MEMORY.md**` — sanity-check the boot sequence.92 Add or remove file pointers based on what `memory/` actually contains.933. `**.agents/<name>/memory/PRIVACY.md**` — set the privacy posture before the94 agent is ever invoked. The template has prompts for what to redact, what to95 keep in buckets, and what to point-to-vault rather than duplicate.9697### 4. Run a first audit9899After customization, the user can run `mh:agent:audit` (the sister skill in100this plugin) against the new agent to check that:101102- All boot-sequence files referenced in MEMORY.md actually exist103- The description has both positive triggers and "do NOT trigger" rules104- PRIVACY.md, tasks/, and sessions/ are present105- Cross-tier consistency holds (name, identity one-liner)106107This closes the loop: scaffold → customize → audit → iterate.108109## What the scaffolder creates110111```112<target>/113├── .claude/114│ ├── agents/115│ │ └── <name>.md ← Tier 1 — definition + system prompt116│ └── agent-memory/117│ └── <name>/118│ └── MEMORY.md ← Tier 2 — auto-injected boot index119└── .agents/120 └── <name>/121 ├── memory/122 │ ├── PRIVACY.md ← always read first by the agent123 │ ├── INDEX.md ← pointers into the deep store124 │ └── _shared/.gitkeep ← framework / pattern files (load on demand)125 ├── tasks/126 │ └── open-tasks.md ← agent's own backlog (Markdown checkboxes)127 ├── sessions/128 │ └── .gitkeep ← session logs land here per ritual129 ├── cache/130 │ └── .gitkeep ← ephemeral cache (rates, RSS poll state, …)131 └── output/132 └── .gitkeep ← draft outputs before publish133```134135Templates live at `templates/` inside this skill. They are deliberately short:136they give shape, not content.137138## Conventions baked into the templates139140- **PRIVACY.md is step 1 of every boot sequence.** Always.141- **MEMORY.md kept ≤80 lines.** It pays its cost on every spawn — keep it lean.142 Detail goes to `memory/INDEX.md` and topic files.143- **Boot sequence is a numbered list.** No "read these files" prose — the order144 matters and should be explicit.145- **Self-curation block in the definition.** Every agent writes back at session146 end: what-works, decisions, tasks closed, MEMORY.md trim check.147- **`Subagents do NOT inherit the CLAUDE.md cascade`** is called out in the148 template — boot sequence should explicitly list any CLAUDE.md the agent149 depends on.150151## What the skill does NOT do152153By design, this skill stays out of the user's domain decisions:154155- **No cadence integration** — no daily/weekly/monthly assumptions, no embedding156 the agent in any periodic-routine flow. If the user wants that, they wire it after.157- **No external-system handoffs** — no MCP wiring, no queue conventions, no158 cron/scheduling. The scaffolded agent is fully self-contained.159- **No persona invention** — anchor phrase, voice, triggers, and tool boundaries160 are user input. Templates have placeholders, not opinions.161- **No vault opinions** — the scaffolder writes the three tiers wherever you162 point it. It does not touch existing CLAUDE.md, README, or git config.163164## Inputs / outputs165166**Inputs:** name, role, target dir, optional anchor / voice / triggers / anti-triggers.167**Outputs:** three tiers of files described above, absolute-path-listed on stdout.168**Exit codes:** 0 on success; non-zero with a clear message on collision or169invalid input.170171## See also172173- `mh:agent:audit` — sister skill, checks the structure for completeness and174 cross-tier consistency.175- The plugin README at `plugins/mh/README.md`.176177---178> Source: [mhlavac/claude-marketplace](https://github.com/mhlavac/claude-marketplace) — distributed by [TomeVault](https://tomevault.io).179<!-- tomevault:4.0:skill_md:2026-05-23 -->