본문으로 건너뛰기
Skillpedia
일반 코딩6.3k · #14239

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-schema/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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".
  • framework skill: 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.

  1. Caller — is this for an AtomicAgent, a BaseTool, both (an agent that emits a tool-input schema), or a nested sub-schema?
  2. Direction — input only, output only, or a paired Input/Output?
  3. Fields — what fields does the caller need, with which types? (Required vs optional, defaults, constraints.)
  4. 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 (not BaseModel).
  • 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 a description= written for the LLM.
  • Use Literal[...] for closed sets before reaching for Enum — 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬