Pydantic AI Harness
pydantic/pydantic-ai
Adds optional capabilities to Pydantic AI agents from pydantic-ai-harness, led by Code Mode, which runs many tool calls as one sandboxed Python script.
Gives patterns, a tool design checklist and an architecture decision tree for building agent harnesses, tools and multi-agent setups around a model.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builder --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-builder .claude/skills/agent-builder && rm -rf skills-srcUse ~/.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/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .claude/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builderType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builder --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/agent-builder .agents/skills/agent-builder && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .agents/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builder --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/agent-builder .cursor/skills/agent-builder && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .cursor/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/FareedKhan-dev/claude-code-from-scratch.git --path skills/agent-builder--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builder --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/agent-builder .gemini/skills/agent-builder && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .gemini/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builderInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/agent-builder .github/skills/agent-builder && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .github/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install FareedKhan-dev/claude-code-from-scratch agent-builder --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FareedKhan-dev/claude-code-from-scratch.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/agent-builder .opencode/skills/agent-builder && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "agent-builder" agent skill from https://github.com/FareedKhan-dev/claude-code-from-scratch/tree/main/skills/agent-builder into .opencode/skills/agent-builder/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agent-builder", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
agent-builderGives patterns, a tool design checklist and an architecture decision tree for building agent harnesses, tools and multi-agent setups around a model.
The central idea is that the model is the agent and your code is the harness: tools, knowledge, observation, action and permissions. The skill says to leave judgment to the model rather than the harness, and to start from a minimal loop that calls the Anthropic client in Python, adding mechanisms only when a real need appears.
A checklist covers tool design: verb-style names, descriptions that say when to use the tool, minimal input schemas, plain-text results, a hard timeout and output truncated to a safe length of 50,000 characters. A description formula and an example show how to word them. A decision tree helps choose among agent architectures, from a single loop with a shell tool up to multi-agent systems.
Common mistakes are listed with fixes: logic hard-coded into the harness, oversized system prompts, loops blocked by slow operations, and shared mutable state between subagents. A subagent template shows how to give each one an isolated context.
Read from SKILL.md and the folder at commit fb9709e. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Agent Harness Builder loads about 1.1k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 266 words of instructions outside code blocks.
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.
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.
The full file from FareedKhan-dev/claude-code-from-scratch at commit fb9709e, republished under its MIT licence (© FareedKhan-dev). 266 words, ~1,148 tokens.
.claude/skills/agent-builder/SKILL.md (or your agent's skills folder).Load this skill when the user wants to:
The agent is always the model. Your job is the harness.
Harness = Tools + Knowledge + Observation + Action + PermissionsNever try to encode intelligence in your harness code. Give the model clean tools, clear context, and get out of the way.
from anthropic import Anthropic
client = Anthropic()
def agent_loop(messages, tools, dispatch, system):
while True:
response = client.messages.create(
model="claude-sonnet-4-20250514",
system=system, messages=messages,
tools=tools, max_tokens=8000,
)
messages.append({"role": "assistant", "content": response.content})
if response.stop_reason != "tool_use":
return
results = []
for block in response.content:
if block.type == "tool_use":
output = dispatch[block.name](block.input)
results.append({"type": "tool_result",
"tool_use_id": block.id, "content": output})
messages.append({"role": "user", "content": results})Do not add anything until you need it. Every mechanism should earn its place.
Before writing a tool, ask:
"[Action verb] [what it does]. Use when [specific situation].
[What it returns]. [Any important limits]."Example:
"Read a file and return numbered lines. Use when you need to inspect
file content or reference specific line numbers. Returns up to 50,000
characters. Use start_line/end_line for large files."One task, one user, no persistence needed?
→ s01: minimal loop + bash
Need file read/write/search?
→ s02: extended tool dispatch
Need the agent to plan before acting?
→ s03: add todo_write tool
Task too big for one context window?
→ s04: subagent isolation
Need domain-specific knowledge?
→ s05: skill loading
Long-running session, context will overflow?
→ s06: compression + memory file
Complex multi-step project spanning sessions?
→ s07: task graph with dependencies
Slow operations (builds, tests)?
→ s08: background tasks
Work that parallelises across specialties?
→ s09+: agent teams with mailboxes
Need isolation between parallel tasks?
→ s12/s23: git worktreesPutting logic in the harness instead of trusting the model
Bad: if "error" in output: retry_with_different_approach()
Good: return the error to the model and let it decide
Giant system prompts Bad: 5,000-word system prompt covering every scenario Good: load domain knowledge on-demand via skills (s05)
Blocking the loop on slow operations
Bad: output = subprocess.run("npm test", timeout=300)
Good: run in background thread, notify when done (s08)
Shared mutable state between subagents Bad: subagents writing to the same dict/file without locks Good: each subagent has its own isolated context (s04, s12)
def spawn_subagent(prompt: str, tools=EXTENDED_TOOLS, dispatch=EXTENDED_DISPATCH) -> str:
messages = [{"role": "user", "content": prompt}]
while True:
response = client.messages.create(
model=MODEL, system=SUBAGENT_SYSTEM,
messages=messages, tools=tools, max_tokens=8000,
)
messages.append({"role": "assistant", "content": response.content})
if response.stop_reason != "tool_use":
break
results = dispatch_tools(response.content, dispatch)
messages.append({"role": "user", "content": results})
return "".join(b.text for b in messages[-1]["content"] if hasattr(b, "text"))© FareedKhan-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/agent-builder of FareedKhan-dev/claude-code-from-scratch.
Open the folder on GitHubat commit fb9709e
Agent Harness 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Agent Harness Builder this skillFareedKhan-dev/claude-code-from-scratch | 298 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Pydantic AI Harnesspydantic/pydantic-ai | 20k | — | ~4.9k | Automated safety check: Pass | MIT | |
| Agent BuildershareAI-lab/lab-skills | 314 | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Deep Agents Corelangchain-ai/langchain-skills | 1.3k | 1 repos | ~3.1k | Automated safety check: Pass | MIT | |
| Openhands SDKOpenHands/extensions | 157 | — | ~6.9k | Automated safety check: Pass | MIT | |
| Swarms Multi-Agent Frameworkkyegomez/swarms | 7.2k | — | ~5.5k | Automated safety check: Pass | Apache-2.0 |
pydantic/pydantic-ai
Adds optional capabilities to Pydantic AI agents from pydantic-ai-harness, led by Code Mode, which runs many tool calls as one sandboxed Python script.
shareAI-lab/lab-skills
Helps design and build AI agents for any domain around a minimal loop of capabilities, knowledge and context, adding planning or subagents only when needed.
langchain-ai/langchain-skills
Explains how to build agents with the Deep Agents framework: create_deep_agent, the built-in middleware, the harness, SKILL.md format and configuration options.
OpenHands/extensions
Reference skill for the OpenHands Software Agent SDK - the Python framework for building AI agents that write software.
kyegomez/swarms
Teaches the Swarms Python framework: the Agent class, tools, loops, memory and multi-agent structures such as sequential, concurrent and graph workflows.
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.
FareedKhan-dev/claude-code-from-scratch
Gives the agent a five-step review routine that reads the full file first, labels each finding as bug, security, performance, style or suggestion, and ends with a summary.
FareedKhan-dev/claude-code-from-scratch
Picks the right Python library for PDF jobs, with examples for text and table extraction, merging, splitting and page extraction, plus OCR and memory fixes.
Works with
Categories
Gives patterns, a tool design checklist and an architecture decision tree for building agent harnesses, tools and multi-agent setups around a model. The central idea is that the model is the agent and your code is the harness: tools, knowledge, observation, action and permissions. The skill says to leave judgment to the model rather than the harness, and to start from a minimal loop that calls the Anthropic client in Python, adding mechanisms only when a real need appears.
Agent Harness Builder fits situations like: building a new agent loop from scratch; designing a tool and writing its description for an agent; structuring a multi-agent workflow with subagents; debugging an agent loop that is not behaving.
Run `npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a claude-code`. Or copy the skill folder (skills/agent-builder in FareedKhan-dev/claude-code-from-scratch) into .claude/skills/agent-builder in your project. Claude Code loads it when a task matches its description.
Run `npx skills add FareedKhan-dev/claude-code-from-scratch --skill agent-builder -a codex`. Or copy the skill folder (skills/agent-builder in FareedKhan-dev/claude-code-from-scratch) into .agents/skills/agent-builder in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FareedKhan-dev/claude-code-from-scratch --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.
SKILL.md names no scripts, command-line tools or credentials: Agent Harness Builder is instructions for the agent only. Our summary lists: Python with the anthropic package for the sample loop.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Agent Harness Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.1k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Agent Harness Builder: Pydantic AI Harness (pydantic/pydantic-ai, 20k stars), Agent Builder (shareAI-lab/lab-skills, 314 stars), Deep Agents Core (langchain-ai/langchain-skills, 1.3k stars) and Openhands SDK (OpenHands/extensions, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
FareedKhan-dev (a GitHub user) maintains it in FareedKhan-dev/claude-code-from-scratch, which has 298 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on April 5, 2026.
Source: FareedKhan-dev/claude-code-from-scratch on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.