draft-agent

A command that turns a short description into either a reusable coding subagent or a project sub-goal file. A subagent is a separate helper with a defined role; by default, a generated subagent is installed for a later session.

In plain words
What is it for?
Use it to create a new specialist agent or document one unit of work for a larger project. It can also stage drafts without installing them.
Why use it?
It avoids writing the required agent structure and setup by hand. Draft mode lets a person review the result before anything is installed.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/dwarvesf/dwarves-kit/draft-agent
Clone the repo
git clone --depth 1 https://github.com/dwarvesf/dwarves-kit
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,368 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00053 $0.01368
Opus 5 $0.00026 $0.00684
Sonnet 5 $0.00011 $0.00274
Haiku 4.5 $0.00005 $0.00137

Measured 2d ago against content hash a5ced9ae3f53, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

draft-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/draft-agent.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dispatch the meta-agent to generate a new subagent definition (or a mega-goal sub-goal file) from a description, then INSTALL it by default so it is runnable at runtime. Installing is local: the agent goes live in your ~/.claude/agents/ on the next session and lands in the repo working tree; it only reaches teammates if you commit + merge it (that stays PR-gated). --draft keeps the old behavior: stop at a staged draft, install nothing.

A sub-goal file (Mode B) is NOT installable (it is project content, not an agent); for Mode B this command always behaves as --draft and just writes the file to the goals staging path.

Usage

$ARGUMENTS is the description, optionally prefixed with --draft and/or a mode:

  • /kit:draft-agent agent: <one-line role> , generate + INSTALL a subagent (default).
  • /kit:draft-agent --draft agent: <one-line role> , generate a staged draft only, no install.
  • /kit:draft-agent subgoal: <one-line unit of work> , draft a mega-goal sub-goal file (never installed).
  • /kit:draft-agent <description> , no mode prefix: the meta-agent infers the mode and says which it picked.

Steps

  1. Parse --draft (if present), the mode (or let the agent infer it), and the description from $ARGUMENTS.

  2. Dispatch ONE meta-agent subagent. Give it the mode, the description, and a staging write-path (default drafts/ at the repo root; create it if missing). It writes the artifact there with the DRAFT marker on line 1 and returns a bounded summary (mode, path, name/tools/model or the sub-goal Done =).

  3. If --draft, or the mode is subgoal: show the summary, open the staged file for review, and STOP. Nothing is installed.

  4. Otherwise (default, mode agent): INSTALL it so it is dispatchable. Do this as the main agent (you have the tools the subagent does not):

    1. Read the staged draft. Strip the first-line DRAFT marker.
    2. Write it to agents/<name>.md (the repo source of truth), where <name> is the frontmatter name:. Stamp provenance (SPEC-108): add a generated-by: draft-agent <YYYY-MM-DD> <one-line context> line to the frontmatter (after model:) so a generated agent is distinguishable from a hand-written one forever, and metric 11 (SPEC-073) can count its runtime catches. Keep <context> COLON-FREE (an unquoted YAML scalar breaks on : ); use commas. Only draft-agent-generated agents carry this key; never add it to a hand-written agent.
    3. Roster sync (REQUIRED , test-meta.sh fails closed otherwise): add a | \` | ... |row todocs/MANUAL.md's agent table (the bulk; root MANUAL.mdis a thin stub, SPEC-185), a row to thedocs/architecture.md"Command and agent V-phase inventory" table, and (only if you also added a command) theREADME.md` command rows. Match the existing row formats.
    4. Run bash tests/test-meta.sh. It MUST pass (it lints the new agent's frontmatter + the cross-refs). If it fails, fix the roster rows until green; do not leave a half-installed agent.
    5. Activate it for runtime: cp agents/<name>.md ~/.claude/agents/<name>.md (the dir Claude Code scans at session start). It is dispatchable on your next session / reload, not mid-conversation (CC discovers agents at startup).
    6. Print, loudly: the agent name, its granted tools and model, "live next session", and "undo: rm ~/.claude/agents/<name>.md (+ revert the repo rows)". The granted tools are the one thing to eyeball, since default-install skips the read-before-live gate.
    7. Effectiveness-validate the new/changed agent (SPEC-088, diff-keyed). Dispatch the agent-effectiveness validator on the agent def you just wrote (agents/<name>.md) -- and ONLY it, this is the diff-keyed trigger: the agent-author phase is the one point a new/changed agent def enters the repo, so validating here keys on the change, not every agent every run. It judges four lenses (tools minimal-yet-sufficient, description fires right, instructions unambiguous, tier fits) and returns VERDICT: PASS | FLAGGED | UNVALIDATED. Advisory + ship-visible, never a mid-flight block (ADR-0024): surface the verdict; a FLAGGED or UNVALIDATED result is a signal to revise the draft, not an auto-uninstall. This mirrors how /kit:docs dispatches doc-verifier at its Step 4.5.

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 45 lines · 53 tokens per session scan A a5ced9ae3f53

Subscribe to this mod's changes

draft-agent is a command published in the GitHub repository dwarvesf/dwarves-kit (11 stars, last pushed 2d ago), licensed MIT. It adds 53 tokens to every session and 1,368 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.