मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग6.3k · #14239

create-atomic-schema

यह क्या करती है

यह बताती है कि Atomic Agents फ़्रेमवर्क में एजेंट और टूल जो इनपुट और आउटपुट आकार इस्तेमाल करते हैं, वे कैसे लिखें। यह उन डेवलपर्स के लिए है जो AI ऐप के हर हिस्से से अपेक्षित और लौटाए जाने वाले डेटा को परिभाषित करते हैं।

कब इस्तेमाल करें

  • ✓जब डेवलपर को एजेंट के लिए ऐसा आउटपुट आकार चाहिए जिसे भाषा मॉडल भरे।
  • ✓जब डेवलपर मौजूदा एजेंट या टूल के इनपुट में नया फ़ील्ड जोड़ना चाहे।
  • ✓जब डेवलपर किसी टूल के लिए सफलता और विफलता के अलग आउटपुट आकार चाहे।

Skill का लिंक

https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-schema/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-schema/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“एक planner एजेंट के लिए आउटपुट schema डिज़ाइन कीजिए, जो ज़िम्मेदार व्यक्ति और अंतिम तारीख वाले चरणों की सूची लौटाए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह स्किल पूछती है कि schema का इस्तेमाल कौन करेगा और कौन से फ़ील्ड और विफलता के मामले चाहिए, फिर docstring और फ़ील्ड विवरण वाली schema क्लास लिखती है, क्योंकि वे विवरण मॉडल का मार्गदर्शन भी करते हैं।

तकनीकी सामग्री (मूल 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
अक्सर पूछे जाने वाले सवाल

schema को docstrings की ज़रूरत क्यों है?

फ़्रेमवर्क इन्हें माँगता है, और विवरण भाषा मॉडल को हर फ़ील्ड सही भरने में मदद करते हैं।

क्या schema के विफलता वाले रूप हो सकते हैं?

हाँ। स्किल उन आउटपुट के लिए सफलता और त्रुटि वेरिएंट कवर करती है जो विफल हो सकते हैं।

यह किसके लिए है?

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
अपडेट की गई
29/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

create-atomic-agent

6.3k

आपके एजेंट को टाइप्ड इनपुट और आउटपुट, सिस्टम प्रॉम्प्ट और चुने गए AI प्रदाता के साथ नया Atomic Agents एजेंट बनाने में मदद करती है।

AI और एजेंटएजेंट

create-atomic-context-provider

6.3k

आपके एजेंट को Atomic Agents एजेंट में context provider जोड़ने में मदद करती है, ताकि समय या मिली हुई दस्तावेज़ों जैसी ताज़ा जानकारी उसके प्रॉम्प्ट में दिखे।

AI और एजेंटएजेंट

create-atomic-tool

6.3k

आपके एजेंट को Atomic Agents ऐप के लिए टाइप्ड टूल बनाने में मदद करती है, जैसे API रैपर या कैलकुलेटर जिसे एजेंट बुला सके।

कोडिंगAPI और सर्वर (backend)

framework

6.3k

आपके एजेंट को Atomic Agents Python फ़्रेमवर्क के साथ सही तरीके से काम करने में मदद करती है, जिसमें schemas, एजेंट, टूल, प्रॉम्प्ट और प्रदाता सेटअप शामिल हैं।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills