create-atomic-schema

Designs BaseIOSchema input/output pairs with docstrings, field descriptions, validators, and error variants for Atomic Agents.

6.2k|536|Updated Jun 3, 2024
One-click install
npx skills add https://github.com/BrainBlend-AI/atomic-agents --skill create-atomic-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-atomic-schema
Source: https://github.com/BrainBlend-AI/atomic-agents/tree/main/claude-plugin/atomic-agents/skills/create-atomic-schema
Command: npx skills add https://github.com/BrainBlend-AI/atomic-agents --skill create-atomic-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Pydantic schemas for Atomic Agents agents and tools requires more than typing: the framework enforces docstrings on every BaseIOSchema subclass, and Instructor feeds field descriptions directly into the LLM prompt. This Skill guides you through clarifying requirements, writing compliant schemas, and verifying them so the schema works as both a contract and part of the prompt.

Core Features & Use Cases

  • Guided schema authoring: A clarify → write → verify workflow that produces paired input/output BaseIOSchema classes with mandatory docstrings and Field descriptions.
  • Validation and error modeling: Covers field-level and model-level validators, discriminated unions, and typed error variants so agents return structured failures instead of raising.
  • Use Case: You are building a weather agent and need an output schema that distinguishes success from failure. The Skill produces a WeatherOutput with a status discriminator, optional result fields, and an error variant, then verifies it round-trips through model_json_schema().

Quick Start

Ask the AI to design the input and output BaseIOSchema pair for your Atomic Agents agent, including field descriptions and a typed error variant.

Frequently Asked Questions about create-atomic-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a BaseIOSchema for an Atomic Agents agent?

Subclass BaseIOSchema instead of BaseModel, add a non-empty class docstring, and give every Field a description written for the LLM. Place the schema in your agent's schemas.py module and verify it imports and round-trips through model_json_schema().

Why does Atomic Agents raise an error about missing docstrings?

The framework enforces a non-empty docstring on every BaseIOSchema subclass at import time because Instructor uses it as the schema's description in the LLM prompt. Add a docstring describing the schema's purpose to resolve the ValueError.

Should I use Enum or Literal for fixed value sets in Pydantic schemas?

Prefer Literal over Enum for closed sets in Atomic Agents schemas. Literal produces flatter JSON Schema, which is easier for Instructor to pass to the model and for Pydantic to validate.

How do I model agent failures without raising exceptions?

Use a typed error variant: define success and failure schemas with a Literal kind discriminator, then wrap them in a union field on the output schema. Pydantic resolves the union via the discriminator so callers can exhaustively handle each outcome.

When should I add validators to an Atomic Agents schema?

Add field-level validators for normalization like lowercasing or stripping, and model-level validators for cross-field rules such as start before end. Validation errors trigger Instructor retries, so treat them as a feature rather than catching them.