Agent skill

A2ui Generate Pydantic Models

by a2ui-project in a2ui-project/a2ui

Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.).

Apache-2.0Auto-check passedDevelopment

Install A2ui Generate Pydantic Models

skills CLI
$ npx skills add a2ui-project/a2ui --skill a2ui-generate-pydantic-models -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install a2ui-project/a2ui a2ui-generate-pydantic-models --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/a2ui-project/a2ui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/a2ui-generate-pydantic-models .claude/skills/a2ui-generate-pydantic-models && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
a2ui-generate-pydantic-models
GitHub stars
17k
Token cost
~2.3k tokens
SKILL.md length
1,033 words
Files
7 (incl. scripts)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.).

  • Works in 5 steps: Extract the target version parameter… → Execute the generator script exactly… → Format generated Python code → …
  • Development work in your project
  • SKILL.md covers Agent Execution Steps and Generated Output Files per…
  • Runs Python scripts from its folder; calls uv

What it does

A2ui Generate Pydantic Models is an agent skill from a2ui-project/a2ui. Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.).

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts (for example `scripts/__init__.py`, `scripts/catalog_generators.py` and `scripts/codegen_pydantic.py`).

It sits in Development. It works with Pydantic and Python. The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “/a2ui-generate-pydantic-models”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Extract the target version parameter from the prompt (e.g. v1.0 -> v1.0).
  2. Execute the generator script exactly once for that target version
  3. Format generated Python code
  4. Verify the generated files by running pytest
  5. Stop and report completion to the user.

What it can do on your machine

Read from SKILL.md and the folder at commit 03b77ae. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

A2ui Generate Pydantic Models loads about 2.3k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 1,033 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from a2ui-project/a2ui at commit 03b77ae, republished under its Apache-2.0 licence (© a2ui-project). 1,033 words, ~2,293 tokens.

Download SKILL.mdSave it as .claude/skills/a2ui-generate-pydantic-models/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
a2ui-generate-pydantic-models
description
Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.).

A2UI Pydantic Model Generation Skill

This skill provides an automated code generation tool that produces strongly typed Pydantic v2 data models and basic catalog definitions for python/a2ui_core directly from the schemas and catalogs in specification/<version>/.


Agent Execution Steps

When given a prompt like "Generate Pydantic model classes for A2UI spec v1.0":

  1. Extract the target version parameter from the prompt (e.g. v1.0 -> v1.0).

  2. Execute the generator script exactly once for that target version:

    bash
    uv run python .agents/skills/a2ui-generate-pydantic-models/scripts/codegen_pydantic.py --version <TARGET_VERSION>

    (Replace <TARGET_VERSION> with the single requested version, e.g. --version v1.0).

  3. Format generated Python code:

    bash
    cd python/a2ui_core
    uv run pyink .
  4. Verify the generated files by running pytest:

    bash
    cd python/a2ui_core
    uv run pytest tests/test_codegen_pydantic.py
  5. Stop and report completion to the user.


Generated Output Files per Version

When executed for a target version <version> (e.g. v1.0 -> v1_0), the script generates:

  1. python/a2ui_core/src/a2ui/core/schema/<version>/:

    • constants.py
    • common_types.py: strongly typed shared models and the COMMON_TYPES_DEFS manifest, which maps each spec $defs name to its symbol in spec order. No spec schema is copied verbatim; the published common types schema is rebuilt from these symbols.
      • Type aliases such as ComponentId, Child, ChildList and the Dynamic* unions are registered as Annotated[..., Field(description=...)] with the spec descriptions, so the runtime JSON schema generator needs no per-def special cases. Dynamic unions list their members in spec order.
      • When a Dynamic* def constrains its function-call branch with a returnType const, the branch is Annotated[FunctionCall, ReturnType("<type>")], which validates the return type and emits the spec's allOf in both modes. Any other branch shape fails generation.
      • Every model extends SpecBaseModel (hand-written in schema/common_types.py) and has no generated methods. Keywords that fields cannot produce are declared in the model config as json_schema_extra=SchemaKeywords(...): it drops additionalProperties where the spec leaves it out and adds returnType, unevaluatedProperties, title, allowedParents and oneOf required-alternatives (see _SPEC_KEYWORDS). The keywords apply only to the declaring model, not to subclasses. SpecBaseModel validates a declared oneOf whose branches only list required fields (for example FunctionResponse's value/error), requiring exactly one branch.
      • Only composition that references the catalog's function union is limited to spec_schema() (SchemaKeywords(..., spec_only=True)), which the published common types schema uses: v0.9's FunctionCall oneOf, v1.0's FunctionCall allOf over FunctionCommon and anyFunction (replace=True, since the spec def is pure composition), and v0.9's precise args shape (a schema-only JsonSchemaAs annotation requested through the x-python-type property override). Catalogs keep the flat model shape there. References inside declared keywords are the markers def_ref("<Def>") and catalog_functions() from the internal a2ui.core.schema._json_schema module, which the schema builder resolves to $refs. FunctionCall itself is a flat model that validates any call without the catalog.
      • Nested object properties with their own properties become helper models named <Parent><Property> (for example ComponentCommonMetadata, IndexSystemFunctionArgs, FunctionResponseError), which schemas inline. Wrapper unions such as Action are TypeAliasTypes, so fields reference them by def name. Each branch gets a <Def><Property>Wrapper model, and a branch property that is an object becomes <Def><Property> (ActionEvent, ActionEventWrapper, ActionFunctionCallWrapper). A generated name that collides with a def, a base symbol or another helper fails generation.
      • A def that the spec leaves open (no additionalProperties and no unevaluatedProperties: false) allows extra keys. ComponentCommon is the exception (_SUBCLASSED_DEFS): generated catalog components subclass it and must stay closed.
      • Optional fields are typed X | None so they can be absent. SpecBaseModel rejects an explicit null for such a field unless X accepts null itself (Any), under both the spec name and the Python field name; it does not change the JSON schema. Catalog components inherit this rule through ComponentCommon. v0.9's FunctionCall.args also rejects null values.
      • Primitive defs such as CallId are TypeAliasTypes, so local references keep their $ref. References from other documents to a primitive def map to its Python type through _CROSS_DOCUMENT_REF_TYPES in engine.py.
      • patternProperties objects (Extensions) are TypeAliasTypes over a key-checking validator, and their pattern is published in the spec schema and in catalogs. Python's re cannot compile \p{...}, so the SDK validates JSON schemas with a2ui.core.validation.SchemaValidator (powered by regex). The DynamicValue literal-object branch carries the spec's propertyNames and not clauses through a SchemaKeywords annotation in both modes.
      • Common types keep component properties (Surface) and emit required consts without defaults (skip_component_property and required_const_default on the engine). Spec defaults are emitted as JSON schema default values (schema_defaults), not as description notes.
      • Common types are generated in strict mode: a schema shape the models would not enforce (an unknown or non-local $ref, siblings next to $ref/const/composition, an unsupported keyword next to properties, a required property that is not declared, an empty union) raises instead of loosening validation. Output is deterministic and does not depend on string hashing.
    • agent_to_renderer.py / server_to_client.py: strongly typed outbound message models and the AGENT_TO_RENDERER_DEFS manifest, which maps each spec $defs (or v0.8 properties) name to its symbol in spec order so get_agent_to_renderer_schema_map / get_agent_to_renderer_schema_json can rebuild server_to_client.json / agent_to_renderer.json from the models. Nested payload objects and array item objects become helper models marked with INLINE_DEF_MARKER (for example CreateSurfaceMetadata, SurfaceUpdateComponentsItem), and non-message $defs (Component, ComponentsList) are emitted as TypeAliasTypes with SchemaKeywords.
    • renderer_to_agent.py / client_to_server.py
    • renderer_capabilities.py / client_capabilities.py
    • agent_capabilities.py / server_capabilities.py (when present in spec)
    • catalog_definition.py (when present in spec)
    • __init__.py
  2. python/a2ui_core/src/a2ui/core/basic_catalog/<version>/:

    • components.py (strongly typed components & ModelComponentApi registrations)
    • function_apis.py (strongly typed function schemas & FunctionApi classes)
    • styles.py (theme schema, generated when theme is defined in catalog)
    • __init__.py
    • For versions with a common types schema (v0.9+), the models carry everything Catalog.catalog_schema needs to rebuild the specification's catalog.json from them, with no spec JSON copied into Python:
      • A component's allOf references to common types defs (for example Checkable) become base classes, and catalog defs (CatalogComponentCommon) become base models. A component with more than one base sets extra="forbid", because Pydantic would otherwise inherit an open base's config. A component description becomes the class docstring and fails generation if it cannot be one.
      • A function's description becomes the FunctionApi.description attribute. Keywords on the args object that fields cannot produce (unevaluatedProperties, additionalProperties, required-alternative anyOf) are declared with SchemaKeywords as the model's json_schema_extra, and an unknown keyword fails generation.
      • Field constraints (minItems, minimum, ...) are emitted as Field arguments, so they are validated and published; format and default are published through json_schema_extra. An allOf member that only adds keywords becomes a SpecAllOf annotation.
      • Top-level instructions in catalog.json are passed to the Catalog in __init__.py.
      • The conformance cases test_v09_basic_catalog_schema and test_v10_basic_catalog_schema compare the result with the specification files, so any drift fails the tests.
  3. python/a2ui_core/src/a2ui/core/schema/__init__.py:

    • Registers the version in A2uiProtocolVersion enum and updates envelope unions.

© a2ui-project, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts) in .agents/skills/a2ui-generate-pydantic-models of a2ui-project/a2ui.

  • SKILL.md
  • scripts/__init__.py
  • scripts/catalog_generators.py
  • scripts/codegen_pydantic.py
  • scripts/engine.py
  • scripts/schema_generators.py
  • scripts/utils.py

Open the folder on GitHubat commit 03b77ae

Compare with similar skills

A2ui Generate Pydantic Models next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

A2ui Generate Pydantic Models compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
A2ui Generate Pydantic Models this skilla2ui-project/a2ui17k—~2.3kAutomated safety check: PassApache-2.0
Releasezmievsa/cadwyn309—~522Automated safety check: PassMIT
Ag2 Add Custom Toolag2ai/build-with-ag2252—~1.9kAutomated safety check: PassApache-2.0
Adk Stylegoogle/adk-python22k—~769Automated safety check: PassApache-2.0
Mastering Python SkillSpillwaveSolutions/agent-brain119—~1.4kAutomated safety check: NotesMIT
Agentic Workflows API Documentation Lungoagntcy/coffeeAgntcy112—~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Release

    zmievsa/cadwyn

    Prepare and publish Cadwyn releases. An agent skill from zmievsa/cadwyn.

    309 GitHub stars~522 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Ag2 Add Custom Tool

    ag2ai/build-with-ag2

    Add a custom Python tool to an AG2 beta Agent using the @tool decorator.

    252 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Adk Style

    google/adk-python

    Official

    Python style and codebase conventions for ADK (Agent Development Kit): private-by-default file visibility, imports, type hints, Pydantic v2 models, formatting, docstrings, logging, async I/O, file…

    22k GitHub stars~769 tokensUpdated today
    DevelopmentAuto-check passed
  • Mastering Python Skill

    SpillwaveSolutions/agent-brain

    Modern Python coaching covering language foundations through advanced production patterns.

    119 GitHub stars~1.4k tokensUpdated 19 days ago
    DevelopmentAuto-check: notes
  • Authors and maintains the human-facing Agentic Workflows API documentation for the lungo subproject at coffeeAGNTCY/coffeeagents/lungo/docs/workflow-instanceapi.md.

    112 GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review

    vectorize-io/hindsight

    Review changed code against project standards. An agent skill from vectorize-io/hindsight.

    47k GitHub stars~12k tokensUpdated today
    DevelopmentAuto-check passed

More from a2ui-project/a2ui

All 20 skills in this repo
  • A2ui Remediate Problem

    a2ui-project/a2ui

    Remediates a specific recommendation from an A2UI compliance report issue, or resolves any general GitHub issue, by inspecting context, implementing minimal targeted fixes, verifying tests, creating…

    17k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • A2ui Issue Triage

    a2ui-project/a2ui

    Automates the triage of GitHub issues in the A2UI repository.

    17k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • A2ui Audit

    a2ui-project/a2ui

    Main coordination skill to run the blueprint compliance, documentation synchronization, and test quality audits, posting the combined results as a labeled GitHub issue.

    17k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Iterative benchmarking, evaluation, and algorithmic optimization of alternative A2UI inference formats (such as Express, Atom, and Elemental).

    17k GitHub stars~985 tokensUpdated today
    Auto-check passed
  • A2ui Python Development

    a2ui-project/a2ui

    Grounding, architectural standards, Python best practices, package facade conventions, testing, and verification workflows for developing any Python code across the entire A2UI repository (core…

    17k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • A2ui Release Python

    a2ui-project/a2ui

    Releases the Python SDKs (a2ui-core, a2ui-agent-sdk) to PyPI by running preflight checks, dispatching the release workflow as a dry run, confirming with the maintainer, publishing, and following the…

    17k GitHub stars~4.8k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about A2ui Generate Pydantic Models

What does A2ui Generate Pydantic Models do?

Automated generator for strongly typed Pydantic v2 data models and basic catalogs across any A2UI protocol version (v0.8, v0.9, v0.9.1, v1.0, etc.). A2ui Generate Pydantic Models is an agent skill from a2ui-project/a2ui.).

When should I use A2ui Generate Pydantic Models?

A2ui Generate Pydantic Models fits situations like: development work in your project.

How do I install A2ui Generate Pydantic Models in Claude Code?

Run `npx skills add a2ui-project/a2ui --skill a2ui-generate-pydantic-models -a claude-code`. Or copy the skill folder (.agents/skills/a2ui-generate-pydantic-models in a2ui-project/a2ui) into .claude/skills/a2ui-generate-pydantic-models in your project. Claude Code loads it when a task matches its description.

How do I install A2ui Generate Pydantic Models in Codex?

Run `npx skills add a2ui-project/a2ui --skill a2ui-generate-pydantic-models -a codex`. Or copy the skill folder (.agents/skills/a2ui-generate-pydantic-models in a2ui-project/a2ui) into .agents/skills/a2ui-generate-pydantic-models in your project. Codex loads it when a task matches its description.

Can I use A2ui Generate Pydantic Models in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add a2ui-project/a2ui --skill a2ui-generate-pydantic-models -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/a2ui-generate-pydantic-models, .gemini/skills/a2ui-generate-pydantic-models, .github/skills/a2ui-generate-pydantic-models and .opencode/skills/a2ui-generate-pydantic-models in your project.

What does A2ui Generate Pydantic Models need to run?

Going by SKILL.md and its folder, A2ui Generate Pydantic Models needs Python for the scripts in its folder and the command-line tools its instructions call (uv). Our summary lists: Python 3.

Does A2ui Generate Pydantic Models access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is A2ui Generate Pydantic Models safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does A2ui Generate Pydantic Models use?

A2ui Generate Pydantic Models is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does A2ui Generate Pydantic Models use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to A2ui Generate Pydantic Models?

Skills that share tags, products or a category with A2ui Generate Pydantic Models: Release (zmievsa/cadwyn, 309 stars), Ag2 Add Custom Tool (ag2ai/build-with-ag2, 252 stars), Adk Style (google/adk-python, 22k stars) and Mastering Python Skill (SpillwaveSolutions/agent-brain, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains A2ui Generate Pydantic Models?

a2ui-project (a GitHub organization) maintains it in a2ui-project/a2ui, which has 16,638 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 9, 2026.

Source: a2ui-project/a2ui on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.