create-atomic-schema
하는 일
Atomic Agents 프레임워크에서 에이전트와 도구가 사용하는 입력과 출력 구조를 작성하는 방법을 설명합니다. AI 앱의 각 부분이 기대하고 반환하는 데이터를 정의하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓개발자가 에이전트를 위해 언어 모델이 채워야 할 출력 구조가 필요할 때.
- ✓개발자가 기존 에이전트나 도구의 입력에 필드를 추가하려 할 때.
- ✓개발자가 도구에 성공과 실패 출력 구조를 따로 원할 때.
스킬 링크
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-schema/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“담당자와 기한이 포함된 단계 목록을 반환하는 계획 에이전트의 출력 스키마를 설계해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 누가 스키마를 쓰는지, 어떤 필드와 실패 상황이 필요한지 묻고, 필드 설명과 docstring이 있는 스키마 클래스를 작성합니다. 이 설명들은 모델이 각 필드를 채우는 데에도 도움이 됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Create an Atomic Agents Schema
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.
When this fires vs the umbrella framework skill
- This skill: the user is creating or modifying a specific schema — e.g. "design the output schema for the planner agent", "add a field to
WeatherInput", "split the result into success and failure variants". frameworkskill: the user is asking about Atomic Agents in general or doing something other than authoring schemas.
Phase 1 — Clarify
Ask only what is not already obvious from context. Bundle into one message; do not interrogate one-at-a-time.
- Caller — is this for an
AtomicAgent, aBaseTool, both (an agent that emits a tool-input schema), or a nested sub-schema? - Direction — input only, output only, or a paired Input/Output?
- Fields — what fields does the caller need, with which types? (Required vs optional, defaults, constraints.)
- Failure modes — can this legitimately fail? If yes, plan a typed error variant rather than raising. See
../framework/references/schemas.md→ "Error-schema pattern".
If the user is mid-conversation about an existing schema, skip questions answered in context.
Phase 2 — Write
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 components
Required ingredients on every schema
- Subclass
BaseIOSchema(notBaseModel). - A non-empty class docstring — the framework raises at import otherwise. Write it for the LLM, because Instructor uses it as the schema's
description. - Every
Field(...)carries adescription=written for the LLM. - Use
Literal[...]for closed sets before reaching forEnum— flatter JSON Schema, easier for Instructor.
Minimal template
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'."
)
When to add validators
- Field-level for normalization (lowercase, strip, enum coercion) and single-field validation.
- Model-level (
@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.
When to use discriminated unions
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 | Se
자주 묻는 질문
스키마에 docstring이 왜 필요한가요?
프레임워크가 요구하며, 설명은 언어 모델이 각 필드를 올바르게 채우도록 돕기 때문입니다.
스키마에 실패 버전을 둘 수 있나요?
네. 실패할 수 있는 출력을 위해 성공과 오류 변형을 다룬다고 스킬은 말합니다.
누구를 위한 스킬인가요?
타입이 있는 데이터 계약이 필요한 Atomic Agents 앱을 만드는 개발자를 위한 스킬입니다.
상세 정보
작성자의 원본 설명
Design and write a `BaseIOSchema` input/output pair for an Atomic Agents agent or tool — docstrings, field descriptions, validators, error variants. Use when the user asks to "create a schema", "design the input/output schema", "define an `IOSchema`", "write a `BaseIOSchema`", "model the agent's output", or runs `/atomic-agents:create-atomic-schema`.
repo: Eigenwise/atomic-agents
인기도
- GitHub 스타
- 6.3k
- 순위
- #14239
- 라이선스
- MIT
- 업데이트
- 2026. 10. 29.
댓글
- …
이 저장소의 다른 스킬
create-atomic-agent
6.3k에이전트가 타입이 지정된 입력과 출력, 시스템 프롬프트, 선택한 AI 제공자로 새 Atomic Agents 에이전트를 만드는 데 도움을 줍니다.
create-atomic-context-provider
6.3k에이전트에 컨텍스트 제공자를 추가해, 현재 시간이나 검색된 문서 같은 최신 정보가 프롬프트에 나타나도록 돕습니다.
create-atomic-tool
6.3k에이전트가 호출할 수 있는 API 래퍼나 계산기 같은, 타입이 있는 Atomic Agents 도구를 만들도록 돕습니다.
framework
6.3k에이전트가 스키마, 에이전트, 도구, 프롬프트, 제공자 설정을 포함해 Atomic Agents Python 프레임워크를 올바르게 사용하도록 돕습니다.