ai-agent-builder

ai-agent-builder is a skill for Claude Code from mahmoud20138/Tradecraft. It costs 112 tokens per session (4,184 once invoked), scanned A, original, MIT.

A design guide for building AI agents that use tools, repeat tasks, and check their own results. An AI agent is a program that can plan work, take actions, observe the results and retry when needed.

In plain words
What is it for?
Use it to plan coding agents, tool-using assistants, automation pipelines, data-analysis systems and other software where the model must act and validate its output.
Why use it?
It helps avoid building a chatbot that only replies once and may produce unchecked or incomplete work.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the tradecraft plugin — 58 skills shipped together

Good fit Use it to plan coding agents, tool-using assistants, automation pipelines, data-analysis systems and other software where the model must act and validate its output.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mahmoud20138/tradecraft/ai-agent-builder
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.

Any agent
npx skills add mahmoud20138/Tradecraft --skill ai-agent-builder
Clone the repo
git clone --depth 1 https://github.com/mahmoud20138/Tradecraft

Made for: Claude Code.

Or install tradecraft, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-agent-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/mahmoud20138/tradecraft/ai-agent-builder/github.svg)](https://agentmods.dev/skills/mahmoud20138/tradecraft/ai-agent-builder)
Your own site
<a href="https://agentmods.dev/skills/mahmoud20138/tradecraft/ai-agent-builder"><img src="https://agentmods.dev/badge/skills/mahmoud20138/tradecraft/ai-agent-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-agent-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/mahmoud20138/tradecraft/ai-agent-builder"><img src="https://agentmods.dev/badge/skills/mahmoud20138/tradecraft/ai-agent-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,184 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00112 $0.04184
Opus 5 $0.00056 $0.02092
Sonnet 5 $0.00022 $0.00837
Haiku 4.5 $0.00011 $0.00418

Measured 11d ago against content hash 29a0fba6154a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ai-agent-builder scanned grade A with 1 finding 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 11d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
plugins/tradecraft/skills/ai-agent-builder/SKILL.md · 531 lines

How it starts

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

AI Agent Builder Skill — Agentic System Design

Identity

You architect AI agents that reliably produce professional-quality outputs. You understand that the gap between a "chatbot wrapper" and a real agent is: structured tool use, skill-based prompting, iterative execution, and quality gates.


CORE PRINCIPLE

An agent is a loop, not a call. Single LLM call = chatbot. LLM + tools + iteration + validation = agent.

┌─────────────────────────────────────────┐
│           AGENT EXECUTION LOOP          │
│                                         │
│  Plan → Execute → Observe → Validate    │
│    ↑                           │        │
│    └───── Fix if invalid ──────┘        │
│                                         │
│  Stop when: success OR max_retries      │
└─────────────────────────────────────────┘

ARCHITECTURE PATTERNS

Pattern 1: Tool-Using Agent (Most Common)

User Request
    ↓
System Prompt + Skill Context
    ↓
LLM generates plan
    ↓
LLM calls tools (file_write, shell_exec, web_search, etc.)
    ↓
Tool results fed back to LLM
    ↓
LLM validates output
    ↓
Deliver or retry

Best for: Code generation, file manipulation, data analysis, research

Pattern 2: Skill-Loaded Agent

User Request → Classify task type → Load relevant skill(s)
    ↓
Inject skill into system prompt
    ↓
Execute with tool use
    ↓
Quality gate from skill checklist

Best for: Multi-domain agents (code + UI + docs + data)

Pattern 3: Multi-Agent Pipeline

Agent 1: Planner    → Decomposes task into subtasks
Agent 2: Implementer → Executes each subtask with tools
Agent 3: Reviewer    → Reviews output, requests fixes
Agent 4: Integrator  → Combines outputs into final deliverable

Best for: Complex multi-file projects, but higher cost and latency. Warning: Start with single-agent + tools. Only add agents when single-agent fails.

Pattern 4: ReAct (Reason + Act)

Thought: I need to find the user's API key location
Action: search_files("*.env", "API_KEY")
Observation: Found in .env line 3: CLAUDE_API_KEY=sk-...
Thought: Now I need to read the config to see how it's loaded
Action: read_file("config.py")
Observation: Uses os.environ.get("CLAUDE_API_KEY")
Thought: The key is loaded correctly. Now I can...

Read the full file on GitHub · 531 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. 11d ago First seen · 531 lines · 112 tokens per session scan A 29a0fba6154a

Subscribe to this mod's changes

ai-agent-builder is a skill published in the GitHub repository mahmoud20138/Tradecraft (15 stars, last pushed 4mo ago), licensed MIT. It adds 112 tokens to every session and 4,184 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-memory-mcp

A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

lingxling/awesome-skills-cn · 26 tokens

design-feature

Turn a raw idea or existing feature into a designed product SPEC by completing entity, integration, role, and expectation closure. Upserts never destroy recorded decisions. Triggers: "design-feature", "design this feature", "define product scope".

gtrabanco/agentic-workflow · 51 tokens

audit-pr

Audit a whole PR against the delivery contract and return MERGE-READY or evidenced blockers with the full URL. Consumes the current review-change REVIEW-PASS receipt instead of re-running review axes; posts a SHA-bound ready comment; never edits or merges. Triggers: "audit-pr", "is this PR ready", "merge gate".

gtrabanco/agentic-workflow · 71 tokens

plan-feature

Route designed features or issues into engineering planning and roadmap registration; undesigned work stops at design-feature. Supports --next, --from-issue, and --scaffold. Triggers: "plan-feature", "plan a feature", "plan the next roadmap feature", "create SPEC and TASKS".

gtrabanco/agentic-workflow · 66 tokens

audit-docs

Audit cross-document coherence: docs ↔ roadmap ↔ code ↔ fix index ↔ issues. Finds drift — features in docs/ not in the roadmap (or vice versa), fix-index entries already merged/closed, broken documentation-map links, dependency cycles, artifacts in the wrong language, naming-convention violations — and reports them…

gtrabanco/agentic-workflow · 188 tokens

init-workspace

Adapt the workflow scaffold to a new repository or add only missing substrate blocks to an existing install. Every install, hook, and overwrite needs explicit consent. Triggers: "init-workspace", "set up agentic workflow", "upgrade workflow scaffold".

gtrabanco/agentic-workflow · 54 tokens