/atomic-agents:create-atomic-schemafrom atomic-agents
Designs and writes BaseIOSchema input/output pairs for Atomic Agents agents and tools, including docstrings, field descriptions, validators, and error variants.
Ships in atomic-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Author a BaseIOSchema pair (input and/or output) that becomes the contract between an agent or tool and its caller. The framework enforces docstrings on every subclass, and Instructor flows field descriptions into the LLM prompt — so the schema is part of the prompt, not just typing.
For deep material (validators, discriminated unions, error envelopes), the authority is ../framework/references/schemas.md. This skill is the action-oriented path: clarify → write → validate.
framework skillWeatherInput", "split the result into success and failure variants".framework skill: the user is asking about Atomic Agents in general or doing something other than authoring schemas.Ask only what is not already obvious from context. Bundle into one message; do not interrogate one-at-a-time.
AtomicAgent, a BaseTool, both (an agent that emits a tool-input schema), or a nested sub-schema?../framework/references/schemas.md → "Error-schema pattern".If the user is mid-conversation about an existing schema, skip questions answered in context.
Place schema(s) where they will be imported from. Conventional locations:
<project>/agents/<agent_name>/schemas.py — agent-owned schemas<project>/tools/<tool_name>_tool.py — tool I/O lives next to the tool<project>/schemas/<topic>.py — schemas shared across multiple componentsBaseIOSchema (not BaseModel).description.Field(...) carries a description= written for the LLM.Literal[...] for closed sets before reaching for Enum — flatter JSON Schema, easier for Instructor.from typing import Optional, Literal
from pydantic import Field
from atomic_agents import BaseIOSchema
class WeatherInput(BaseIOSchema):
"""A request for current weather conditions."""
city: str = Field(..., description="City name, e.g. 'Brussels' or 'New York'.")
units: Literal["metric", "imperial"] = Field(
default="metric",
description="Unit system for the temperature.",
)
class WeatherOutput(BaseIOSchema):
"""Current weather conditions for a city."""
status: Literal["ok", "error"] = Field(..., description="Outcome code.")
temperature_c: Optional[float] = Field(
default=None, description="Temperature in Celsius when status='ok'."
)
summary: Optional[str] = Field(
default=None, description="Human-readable summary when status='ok'."
)
error: Optional[str] = Field(
default=None, description="Failure message when status='error'."
)
@model_validator(mode="after")) for cross-field rules (start ≤ end, mutually exclusive flags).Validation errors trigger Instructor retries and fire the parse:error hook — they're a feature, not a failure path. Do not swallow them.
If the caller must exhaustively handle multiple result shapes, prefer a union over an inflated single schema:
class SearchSuccess(BaseIOSchema):
"""Successful search result."""
kind: Literal["ok"] = "ok"
results: list[str] = Field(..., description="Matching items.")
class SearchFailure(BaseIOSchema):
"""Search could not complete."""
kind: Literal["error"] = "error"
code: Literal["rate_limited", "no_results", "upstream_error"] = Field(
..., description="Machine-readable failure code."
)
message: str = Field(..., description="Human-readable failure reason.")
class SearchOutput(BaseIOSchema):
"""Search outcome — success or typed failure."""
result: SearchSuccess | SearchFailure = Field(..., description="Outcome.")
The kind discriminator on each variant lets Pydantic resolve the union without ambiguity.
Smoke-check the schema imports cleanly and round-trips through model_json_schema():
uv run python -c "from <project>.<module> import WeatherInput, WeatherOutput; print(WeatherInput.model_json_schema()['title'])"
If the import raises ValueError("… must have a non-empty docstring …"), add the docstring. If a field's JSON schema is missing a description, add description= to its Field(...).
Tell the user:
create-atomic-agent skill.create-atomic-tool skill.create-atomic-context-provider skill.BaseModel instead of BaseIOSchema — loses docstring enforcement and the JSON-schema overrides Instructor depends on.Field(...) without description= — Instructor has nothing to tell the model about the field.Optional[str] with no default — required-but-nullable, which is rarely the intent.dict, Any, or object as a field type — the LLM produces anything and Pydantic cannot validate.ValidationError to "make the agent more robust" — fix the field constraints or descriptions instead.For deeper material — composition, nested schemas, discriminated unions in production, validator gotchas — load ../framework/references/schemas.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
atomic-agents, schema-design, pydantic, baseioschema, agent-tools
npx claudepluginhub eigenwise/atomic-agents --plugin atomic-agents7 skills in this plugin
/create-atomic-agentBuild 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`./create-atomic-context-providerBuild a `BaseDynamicContextProvider` that injects a named, titled block into an agent's system prompt at every `run()` — current time, user identity, retrieved RAG docs, session state, cached DB schema. Use when the user asks to "add a context provider", "inject X into the prompt", "give the agent dynamic context", "wire up RAG", "make a `BaseDynamicContextProvider`", or runs `/atomic-agents:create-atomic-context-provider`./create-atomic-toolBuild a `BaseTool[InSchema, OutSchema]` subclass — input/output schemas, `BaseToolConfig`, `run()` (and optional `run_async()`), env-driven secrets, typed failure outputs. Use when the user asks to "add a tool", "create a tool", "wrap an API as a tool", "build a `BaseTool`", "make a calculator/search/weather tool", or runs `/atomic-agents:create-atomic-tool`.Other plugins' skills for the same job