From madi
Scaffold a new Claude Code subagent (the kind invoked via the Agent tool). Use when the user asks to "create an agent", "make a subagent", "add an expert for X", or "/agent-creator" — OR when, mid-task, you notice a recurring specialised job (e.g. dense log triage, security review, migration planning) where having a dedicated agent would help on this and future runs. Writes the agent file to `~/.claude/agents/` (global) or `<repo>/.claude/agents/` (project).
How this skill is triggered — by the user, by Claude, or both
Slash command
/madi:agent-creatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Turn a need for specialised expertise into a working subagent file. Subagents are spawned via the `Agent` tool with `subagent_type: <name>` and run in their own context.
Turn a need for specialised expertise into a working subagent file. Subagents are spawned via the Agent tool with subagent_type: <name> and run in their own context.
You may invoke this skill on your own — without being asked — when all of these hold:
Available agent types already covers it.Examples that warrant a new agent: "review SQL migrations for lock safety", "triage flaky test logs", "write ADRs from a design discussion", "audit a PR for secrets". Examples that do not: one-off questions, generic coding, anything the Explore / general-purpose / Plan agents already handle.
When self-invoking, skip the user-facing questions in step 1 below and infer answers from context. Save the agent, then mention what you created and why in one sentence.
Gather requirements. If the user explicitly asked, use AskUserQuestion for anything unclear:
~/.claude/agents/) or project-level (<repo>/.claude/agents/)?* (all tools). Restrict only if there's a clear safety reason (e.g. read-only research agent → no Edit/Write/Bash).opus for hard reasoning, sonnet for balanced, haiku for cheap/fast.Pick a kebab-case name. Short, descriptive. Examples: migration-reviewer, log-triager, adr-writer. Avoid generic names like helper, expert, assistant.
Write the description carefully. The dispatcher reads this to decide whether to route to the agent. Make it:
Write the agent file at <dir>/<name>.md with this frontmatter:
---
name: <kebab-name>
description: <what + when, 1-3 sentences>
tools: <comma-separated list, or omit for all>
model: <opus|sonnet|haiku, or omit to inherit>
---
# <Title>
<One-paragraph overview: what the agent does, what it produces.>
## Instructions
<Numbered, imperative steps. Be concrete: which tools, what to ask, what to return. Remember the agent starts with no conversation context — anything it needs must be in the spawn prompt or discoverable at runtime.>
## Output format
<What the agent should return to the caller — a report, a diff, a checklist, etc. Keep it tight; the caller relays a summary to the user.>
Save.
~/.claude/agents/<name>.md<repo>/.claude/agents/<name>.mdmkdir -p the directory first.Confirm. Tell the user the path and that it'll appear in the Available agent types list on the next prompt — invokable via the Agent tool with subagent_type: <name>.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub madiabio/madi-skills-marketplace --plugin madi