create-atomic-schema
ما الذي تفعله
تشرح المهارة كيفية كتابة بنية المدخلات والمخرجات التي تستخدمها الوكلاء والأدوات في إطار Atomic Agents. وهي موجهة للمطوّرين الذين يحددون البيانات التي يتوقعها كل جزء من تطبيق الذكاء الاصطناعي ويعيدها.
متى تستخدمها
- ✓عندما يحتاج المطوّر إلى بنية مخرجات يملؤها نموذج اللغة لصالح وكيل.
- ✓عندما يريد المطوّر إضافة حقل إلى مدخلات وكيل أو أداة موجودة.
- ✓عندما يريد المطوّر بنيتي مخرجات منفصلتين للنجاح والفشل لأداة.
رابط المهارة
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-schema/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“صمم مخطط المخرجات لوكيل تخطيط يعيد قائمة خطوات مع المسؤولين وتواريخ الاستحقاق.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تسأل المهارة من يستخدم المخطط وأي الحقول وحالات الفشل مطلوبة، ثم تكتب صنف مخطط مع وصف توثيقي وأوصاف للحقول، لأن هذه الأوصاف توجّه النموذج أيضًا.
المحتوى التقني (ملف 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
الأسئلة الشائعة
لماذا يحتاج المخطط إلى توثيق؟
يطلبه الإطار، والأوصاف تساعد نموذج اللغة على ملء كل حقل بشكل صحيح.
هل يمكن أن يكون للمخطط نسخ للفشل؟
نعم. تغطي المهارة نسخ النجاح والخطأ للمخرجات التي قد تفشل.
لمن هذه المهارة؟
للمطوّرين الذين يبنون تطبيقات 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
التعليقات
- …
المزيد من المهارات من هذا المستودع
create-atomic-agent
6.3kيساعد وكيلك على بناء وكيل جديد في Atomic Agents بمدخلات ومخرجات مُحددة الأنواع، وموجّه نظام، ومزوّد ذكاء اصطناعي مختار.
create-atomic-context-provider
6.3kيساعد وكيلك على إضافة مزوّد سياق إلى وكيل Atomic Agents، حتى تظهر تفاصيل حديثة مثل الوقت أو المستندات المسترجعة في موجّهه.
create-atomic-tool
6.3kيساعد وكيلك على بناء أداة مُحددة الأنواع لتطبيق Atomic Agents، مثل غلاف لواجهة برمجية أو آلة حاسبة يستطيع الوكيل استدعاءها.
framework
6.3kيساعد وكيلك على العمل بشكل صحيح مع إطار Atomic Agents لبايثون، ويغطي المخططات والوكلاء والأدوات والموجهات وإعداد المزوّد.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.