Agent Builder logo

Agent Builder

Community
Mathews-Tom
agent-builder

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".

Overview

PublisherMathews-Tom
Repositoryarmory
Skill nameagent-builder
Stars
318
Forks
47
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Mathews-Tom on GitHub. Read the source before you install it.

Installation

Install the Agent Builder AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Mathews-Tom/armory.git /tmp/armory
mkdir -p .claude/skills
cp -r /tmp/armory/skills/agent-builder .claude/skills/agent-builder
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Builder in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Builder on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Builder is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agent Builder AI skill do?

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".

Why use Agent Builder on TypingMind?

Because you install it once and use it with any model. Agent Builder is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Builder in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Mathews-Tom/armory/tree/main/skills/agent-builder. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agent Builder?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Builder?

As many as you like. As long as a model supports skills, you can use Agent Builder with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Builder AI skill free?

Yes. It is published on GitHub by Mathews-Tom under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇