Agent skill

Agent Builder

by Mathews-Tom in Mathews-Tom/armory

Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode.

MITAuto-check passedAI & LLM Engineering

Install Agent Builder

skills CLI
$ npx skills add Mathews-Tom/armory --skill agent-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mathews-Tom/armory agent-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-builder .claude/skills/agent-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-builder
GitHub stars
327
Token cost
~1.7k tokens
SKILL.md length
722 words
Files
10 (incl. references)
Skills in repo
80
Repo updated
First seen
Licence
MIT

At a glance

Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode.

  • Works in 3 steps: Claude Agent SDK Python - Programmatic… → Headless/Print Mode - Run Claude Code… → CLI Reference - All commands, flags, and…
  • : build an agent
  • SKILL.md covers Prefer Claude Code Headless Mode, Core Capabilities, Documentation Sources and Workflow, plus 7 more sections
  • Calls claude and uv; needs ANTHROPIC_API_KEY

What it does

Agent Builder is an agent skill from Mathews-Tom/armory. Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK, claude -p, SDK MCP servers, hooks, sessions. Triggers on: "build an agent", "agent SDK", "headless mode", "automate Claude", "programmatic agent".

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `evals/cases.yaml`, `references/api-vs-sdk.md` and `references/best-practices.md`).

It sits in AI & LLM Engineering, covering Building AI agents. It works with Model Context Protocol, Claude Agent SDK, Python and Anthropic API. The repository describes itself as: Curated, production-grade skills for AI coding agents. Battle-tested workflows for developers who use AI seriously. The licence is MIT.

When your agent uses it

  • : build an agent
  • Automate Claude
  • Programmatic agent

Example prompts

  • “build an agent”
  • “agent SDK”
  • “headless mode”
  • “/agent-builder”

Requirements

  • Python 3
  • A credential in ANTHROPIC_API_KEY

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Claude Agent SDK Python - Programmatic agent creation with custom tools and hooks (wraps Claude Code CLI)
  2. Headless/Print Mode - Run Claude Code from CLI, scripts, CI/CD (claude -p)
  3. CLI Reference - All commands, flags, and configuration options

What it can do on your machine

Read from SKILL.md and the folder at commit 4594fb7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • claude
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • code.claude.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Builder loads about 1.7k tokens when it runs, and up to ~5.6k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 722 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Mathews-Tom/armory at commit 4594fb7, republished under its MIT licence (© Mathews-Tom). 722 words, ~1,663 tokens.

Download SKILL.mdSave it as .claude/skills/agent-builder/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
agent-builder
description
Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK, claude -p, SDK MCP servers, hooks, sessions. Triggers on: "build an agent", "agent SDK", "headless mode", "automate Claude", "programmatic agent".
metadata.version
1.1.1
metadata.category
development
metadata.tags
agent-sdk, headless, automation, mcp
metadata.difficulty
intermediate
metadata.phase
build

Agent Builder - Claude SDK & CLI Expert

Triggers:

  • "build agent", "create agent", "agent sdk", "claude sdk"
  • "headless mode", "programmatic", "cli command"
  • "claude -p", "query programmatically"
  • "custom tools", "mcp server", "sdk mcp"
  • "claude code api", "agent options"

Prefer Claude Code Headless Mode

This skill covers Claude Code's headless mode and the Agent SDK — not the raw Anthropic API.

text
Preferred: Claude Code CLI headless mode (claude -p)
Preferred: Claude Agent SDK (wraps Claude Code CLI)
Avoid:     Raw Anthropic API (anthropic.Anthropic())
Avoid:     Direct API calls with API keys

Why this matters:

  • The Agent SDK wraps the Claude Code CLI — it does not use the raw Anthropic API
  • Authentication comes from existing ~/.claude/ config — no API keys needed
  • All settings, MCP servers, and configuration inherit from your Claude Code setup
  • You get Claude Code's full agent loop, tools, and context management

Rule: If code uses anthropic.Anthropic(), anthropic.messages.create(), or requires ANTHROPIC_API_KEY, that is the wrong approach. Use claude -p or claude_agent_sdk instead.


Core Capabilities

  1. Claude Agent SDK Python - Programmatic agent creation with custom tools and hooks (wraps Claude Code CLI)
  2. Headless/Print Mode - Run Claude Code from CLI, scripts, CI/CD (claude -p)
  3. CLI Reference - All commands, flags, and configuration options

All use Claude Code's existing authentication from ~/.claude/ — no API keys required.


Documentation Sources


Workflow

  1. Understand the requirement - What type of agent/automation is needed?
  2. Check dependencies - Verify Python version, packages, Claude Code installation
  3. Reference live docs - Fetch relevant documentation if details are unclear
  4. Build confidently - Write production-ready code with proper error handling
  5. Test immediately - Run and validate the implementation

Reference Files

Load only the reference file relevant to the current task.

TaskLoad
Distinguishing raw Anthropic API from Claude Code SDK patternsreferences/api-vs-sdk.md
Writing a Python agent with the Agent SDK (install, query, client, tools, hooks, errors)references/sdk-python.md
Using headless claude -p mode (basic, JSON schema, streaming, tool approval, sessions, system prompts)references/headless-cli.md
CLI commands, flags table, dynamic subagents, permission rule syntaxreferences/cli-reference.md
Use-case templates: CI/CD pipeline, code review, custom analysis tool, database query agentreferences/use-cases.md
Agent SDK and CLI/Headless best practicesreferences/best-practices.md
Complete end-to-end agent example (tools + hooks + client)references/example-agent.md
Output format conventions for produced artifactsreferences/output-format.md

Security

  • Do not use --dangerously-skip-permissions in production
  • Validate inputs in custom tools
  • Use permission rules to block destructive commands
  • Set budget limits with --max-budget-usd
  • Implement hooks for sensitive operations
  • Review allowed tools before automation

Quick Decision Tree

Need to...

  • Run one-off query → claude -p "query"
  • Build custom agent → Agent SDK with ClaudeSDKClient
  • Add custom tools → SDK MCP server with @tool decorator
  • Control execution → Hooks with HookMatcher
  • Stream responses → --output-format stream-json
  • Get structured data → --json-schema
  • Continue conversation → --continue or --resume
  • Run in CI/CD → claude -p with --allowedTools
  • Integrate with app → Python SDK with query() or ClaudeSDKClient

Show full SKILL.md (287 more words)Show less

When to Fetch Docs

Fetch live documentation when:

  • API signatures or parameters are unclear
  • New features or flags are mentioned
  • Error messages reference unknown configuration
  • Implementing complex hooks or MCP servers
  • User asks about specific capabilities

Use WebFetch tool to pull latest documentation from source URLs.


Implementation Checklist

Before writing code:

  • Verify: Using Claude Code headless mode (claude -p or claude_agent_sdk) — not raw Anthropic API
  • Verify: No API keys in code — authentication comes from ~/.claude/ config
  • Confirm Python version (3.10+)
  • Verify Claude Code CLI installation (which claude)
  • Check required packages with uv pip list
  • Understand the specific use case
  • Determine if SDK or CLI approach is needed

After writing code:

  • Verify: Code uses claude_agent_sdk or claude -p — not anthropic.Anthropic()
  • Verify: No ANTHROPIC_API_KEY or api_key= parameters in code
  • Add error handling for all SDK exceptions
  • Test with actual Claude Code installation
  • Validate tool permissions and security
  • Set appropriate limits (turns, budget)
  • Document custom tools and their purposes

Skill Invocation

This skill provides:

  • Complete Agent SDK implementation guidance
  • Headless/CLI command construction
  • Custom tool creation with MCP servers
  • Hook implementation for control flow
  • Security best practices
  • Live documentation fetching when needed

Ask specific questions about building agents, running headless commands, or CLI usage.


Limitations

  • The Agent SDK is Python-only (Python 3.10+); no JavaScript or other language bindings are covered here.
  • Requires Claude Code CLI installed and authenticated via ~/.claude/ before any SDK or headless usage works.
  • This skill does not cover raw Anthropic API usage (anthropic.Anthropic()); see the Anthropic API docs for that.
  • Agent processes launched via the SDK are ephemeral by default; session persistence requires explicit --resume or session ID capture.
  • MCP server patterns in this skill use stdio transport; HTTP-based MCP transports require separate configuration not covered here.

© Mathews-Tom, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in skills/agent-builder of Mathews-Tom/armory.

  • SKILL.md
  • evals/cases.yaml
  • references/api-vs-sdk.md
  • references/best-practices.md
  • references/cli-reference.md
  • references/example-agent.md
  • references/headless-cli.md
  • references/output-format.md
  • references/sdk-python.md
  • references/use-cases.md

Open the folder on GitHubat commit 4594fb7

Compare with similar skills

Agent Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Builder this skillMathews-Tom/armory327—~1.7kAutomated safety check: PassMIT
Agent Squad Python Guide2FastLabs/agent-squad7.8k—~4.7kAutomated safety check: PassApache-2.0
Compact Memory Implementationsimbajigege/book2skills184—~2.5kAutomated safety check: PassMIT
Strandsstrands-agents/harness-sdk8.7k—~1kAutomated safety check: PassApache-2.0
Cc GuidemikeOnBreeze/cc-crossbeam293—~668Automated safety check: PassMIT
Claude Agent SDKsammcj/agentic-coding162—~3.8kAutomated safety check: PassApache-2.0

Similar skills

  • Agent Squad Python Guide

    2FastLabs/agent-squad

    Map of the agent-squad Python framework for async multi-agent orchestration: which agent, classifier, storage and tool provider to pick, and the pitfalls to avoid.

    7.8k GitHub stars~4.7k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Compact Memory Implementation

    simbajigege/book2skills

    A developer guide to adding compact memory to an agent: when to trigger compaction, how to fork a compactor sub-agent, what the summary holds, and how to restore it.

    184 GitHub stars~2.5k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Strands

    strands-agents/harness-sdk

    Build, extend, evaluate, or migrate applications with Strands Agents in Python or TypeScript.

    8.7k GitHub stars~1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Cc Guide

    mikeOnBreeze/cc-crossbeam

    Claude Code documentation expert. An agent skill from mikeOnBreeze/cc-crossbeam.

    293 GitHub stars~668 tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed
  • Claude Agent SDK

    sammcj/agentic-coding

    A skill your agent uses when working with Anthropic Claude Agent SDK.

    162 GitHub stars~3.8k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Ydc Openai Agent SDK Integration

    LeoYeAI/openclaw-master-skills

    Integrate OpenAI Agents SDK with You.com MCP server - Hosted and Streamable HTTP support for Python and TypeScript.

    2.2k GitHub stars~4.4k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check: notes

More from Mathews-Tom/armory

All 80 skills in this repo
  • Architecture Reviewer

    Mathews-Tom/armory

    Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports.

    327 GitHub stars~4.6k tokensUpdated yesterday
    Auto-check passed
  • Concept To Image

    Mathews-Tom/armory

    Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG.

    327 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Watch

    Mathews-Tom/armory

    A skill your agent uses when analyzing an existing video URL or local recording: "watch this video", "analyze youtube video", "summarize this video", "youtube transcript", "find this moment", "what…

    327 GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Code Refiner

    Mathews-Tom/armory

    Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.

    327 GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Concept To Video

    Mathews-Tom/armory

    Turn concepts into animated explainer videos using Manim (Python) with MP4/GIF output, audio overlay, multi-scene composition.

    327 GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Decision Map

    Mathews-Tom/armory

    Maps the unresolved architecture, policy, and scope decisions that must be answered before planning can start: one durable decision ticket per question on the issue tracker, typed and blocker-linked…

    327 GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed

Questions about Agent Builder

What does Agent Builder do?

Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Agent Builder is an agent skill from Mathews-Tom/armory. Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode.

When should I use Agent Builder?

Agent Builder fits situations like: : build an agent; automate Claude; programmatic agent.

How do I install Agent Builder in Claude Code?

Run `npx skills add Mathews-Tom/armory --skill agent-builder -a claude-code`. Or copy the skill folder (skills/agent-builder in Mathews-Tom/armory) into .claude/skills/agent-builder in your project. Claude Code loads it when a task matches its description.

How do I install Agent Builder in Codex?

Run `npx skills add Mathews-Tom/armory --skill agent-builder -a codex`. Or copy the skill folder (skills/agent-builder in Mathews-Tom/armory) into .agents/skills/agent-builder in your project. Codex loads it when a task matches its description.

Can I use Agent Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mathews-Tom/armory --skill agent-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-builder, .gemini/skills/agent-builder, .github/skills/agent-builder and .opencode/skills/agent-builder in your project.

What does Agent Builder need to run?

Going by SKILL.md and its folder, Agent Builder needs the command-line tools its instructions call (claude and uv) and credentials named ANTHROPIC_API_KEY. Our summary lists: Python 3; A credential in ANTHROPIC_API_KEY.

Does Agent Builder access the network?

SKILL.md names 2 domains. As links in the text: code.claude.com and github.com. This is read from the text; nothing was executed.

Is Agent Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Builder use?

Agent Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agent Builder use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.9k tokens, read only when the agent opens those files.

What are the alternatives to Agent Builder?

Skills that share tags, products or a category with Agent Builder: Agent Squad Python Guide (2FastLabs/agent-squad, 7.8k stars), Compact Memory Implementation (simbajigege/book2skills, 184 stars), Strands (strands-agents/harness-sdk, 8.7k stars) and Cc Guide (mikeOnBreeze/cc-crossbeam, 293 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Builder?

Mathews-Tom (a GitHub user) maintains it in Mathews-Tom/armory, which has 327 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on October 6, 2026.

Source: Mathews-Tom/armory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.