create-atomic-agent
Build and wire an `AtomicAgent[InSchema, OutSchema]` — schemas, `AgentConfig`, `SystemPromptGenerator`, provider client, history, hooks, optional context providers. Use when the user asks to "create an agent", "add another agent", "build an `AtomicAgent`", "wire up an agent", "make a planner/router/extractor agent", or runs `/atomic-agents:create-atomic-agent`.
What this skill does
# Create an Atomic Agent
An agent is an LLM-backed transformer from one `BaseIOSchema` to another. Building one means: design the schemas, write the system prompt, wire the provider client, build the `AgentConfig`, instantiate `AtomicAgent[In, Out]`.
For deep material (streaming, token counting, hooks, multi-agent memory), the authority is `../framework/references/agents.md` plus `providers.md`, `prompts.md`, and `memory.md`. This skill is the action-oriented path: clarify → write → run.
## When this fires vs the umbrella `framework` skill
- **This skill**: the user is creating or wiring a specific agent — "add a planner agent", "build a Q&A agent", "make a router that classifies tickets".
- **`framework` skill**: questions about Atomic Agents in general, or the user is doing something other than authoring an agent.
## Phase 1 — Clarify
Bundle into one message:
1. **What should the agent do?** One sentence. Becomes the persona / `background` line.
2. **Inputs and outputs.** Use `BasicChatInputSchema` / `BasicChatOutputSchema` for free-form chat. Use a custom pair for anything structured (extraction, classification, planning, routing). When custom, branch to the `create-atomic-schema` skill for the schema authoring.
3. **Provider.** OpenAI / Anthropic / Groq / Ollama / Gemini / OpenRouter / MiniMax. Default: whatever the project already uses; otherwise OpenAI.
4. **Conversational?** Yes → wire a `ChatHistory`. No (single-shot transformer) → omit it for stateless behavior.
5. **Context providers.** Anything to inject into the prompt at runtime (current time, user identity, retrieved docs)? If yes, plan to also use the `create-atomic-context-provider` skill afterwards.
Skip anything already settled in context.
## Phase 2 — Plan
State the plan in one short block:
- File: `<project>/agents/<agent_name>.py` (or directly in `main.py` for a tiny project — see `../framework/references/project-structure.md`).
- Schemas: which pair, where they live.
- Provider + model + Instructor mode. Default models: OpenAI `gpt-5-mini`, Anthropic `claude-haiku-4-5`, Groq `llama-3.3-70b-versatile`, Ollama `llama3.1`, Gemini `gemini-2.5-flash`.
- `SystemPromptGenerator` content — three sections: `background`, `steps`, `output_instructions`.
- History? Hooks? Context providers?
## Phase 3 — Implement
### Canonical imports (do not deviate)
```python
from atomic_agents import (
AtomicAgent, AgentConfig,
BasicChatInputSchema, BasicChatOutputSchema,
)
from atomic_agents.context import ChatHistory, SystemPromptGenerator
from instructor import Mode
```
### Wire the provider client (always Instructor-wrapped)
The full per-provider matrix lives in `../framework/references/providers.md`. Quick recap:
```python
# OpenAI — default mode is Mode.TOOLS
import os, instructor, openai
client = instructor.from_openai(openai.OpenAI(api_key=os.environ["OPENAI_API_KEY"]))
model = "gpt-5-mini"
api_params: dict = {}
# Anthropic — Mode.TOOLS, max_tokens REQUIRED in model_api_parameters
import anthropic
client = instructor.from_anthropic(anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"]))
model = "claude-haiku-4-5"
api_params = {"max_tokens": 4096}
# Gemini — Mode.GENAI_TOOLS, assistant_role="model"
from google import genai
client = instructor.from_genai(genai.Client(api_key=os.environ["GEMINI_API_KEY"]), mode=Mode.GENAI_TOOLS)
model = "gemini-2.5-flash"
api_params = {}
# Groq / Ollama / MiniMax — Mode.JSON in both factory and AgentConfig
```
### Build the agent
```python
from atomic_agents import AtomicAgent, AgentConfig
from atomic_agents.context import ChatHistory, SystemPromptGenerator
agent = AtomicAgent[MyInput, MyOutput](
config=AgentConfig(
client=client,
model=model,
history=ChatHistory(), # omit for stateless
system_prompt_generator=SystemPromptGenerator(
background=["You are a concise research assistant."],
steps=[
"Read the question carefully.",
"Decide what minimum information answers it.",
"Produce the answer in the required schema.",
],
output_instructions=[
"Reply under 100 words.",
"If unsure, set status='error' and explain why.",
],
),
# Provider-specific knobs — match the Instructor factory
# mode=Mode.TOOLS, # OpenAI / Anthropic / OpenRouter
# mode=Mode.JSON, # Groq / Ollama / MiniMax
# mode=Mode.GENAI_TOOLS, assistant_role="model", # Gemini
model_api_parameters=api_params or {"temperature": 0.2},
)
)
```
### Generics carry the truth
`AtomicAgent[MyInput, MyOutput]` — write the type parameters explicitly. The framework reads them at class-definition time. Do **not** rely on subclass-level `input_schema` / `output_schema` class attributes.
### Provider-specific knobs (most common gotchas)
- **Anthropic** without `max_tokens` in `model_api_parameters` → API rejects every call.
- **Gemini** without `assistant_role="model"` → role mismatch on every turn.
- **Groq / Ollama / MiniMax** with `Mode.TOOLS` → tools formatted in a way the provider does not accept; flip to `Mode.JSON`.
- Reasoning models (o-series, GPT-5 reasoning variants) → often want `system_role=None` and `reasoning_effort` in `model_api_parameters`.
## Phase 4 — Run and verify
```python
out = agent.run(MyInput(...))
print(out)
```
Quick smoke test without paying for a real call:
```bash
uv run python -c "from <project>.agents.<agent_name> import agent; print(type(agent).__name__, '->', agent.input_schema.__name__, '/', agent.output_schema.__name__)"
```
If output validation fails repeatedly, the `parse:error` hook has the details — see `../framework/references/hooks.md` for registration.
## Phase 5 — Hand off
Tell the user:
- How to call `agent.run(...)` (and `run_async`, `run_stream`, `run_async_stream` when appropriate).
- Which env var to set for the provider key.
- Optional next steps:
- Tools the agent should be able to invoke → `create-atomic-tool` skill.
- Dynamic data injected into the prompt → `create-atomic-context-provider` skill.
- Custom schemas → `create-atomic-schema` skill.
- Multiple agents working together → `../framework/references/orchestration.md`.
- Telemetry / retries / logging → `../framework/references/hooks.md`.
- Conversation persistence, summarization, multi-agent memory → `../framework/references/memory.md`.
## Anti-patterns
- Forgetting to wrap the client with `instructor.from_*` — structured outputs silently stop working.
- `BaseModel` instead of `BaseIOSchema` for the agent's input or output type.
- `AgentConfig.mode` out of sync with the Instructor factory mode.
- `assistant_role="assistant"` on Gemini — must be `"model"`.
- Missing `max_tokens` on Anthropic — every call fails.
- Hardcoded API keys in the source — read from env.
- Unbounded `ChatHistory` in a long-running service — monitor `agent.get_context_token_count().utilization` or set `max_messages`.
For deep material — streaming, async, token counting, hooks, multi-agent history — load `../framework/references/agents.md`.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.