Skip to main content

A lightweight agent skill implementation for Pydantic AI

Project description

pydantic-ai-skills

Python 3.10+ License: MIT Quality Gate Status

Agent Skills for Pydantic AI.

Agent Skills are modular packages of instructions, resources, and scripts that teach an agent to handle a specialized task. On disk, a skill is just a folder: a SKILL.md file holding a name, a description, and Markdown instructions, plus any reference documents and executable scripts the task needs.

Your agent starts out seeing only the name and description of each skill. When a task calls for one, it loads that skill's full instructions, and reads a reference document or runs a script only if it actually needs to. This is progressive disclosure: your skill library can grow without every skill paying for space in the prompt.

📖 Full documentation — including video tutorials.

Why This and Not pydantic-ai-harness

The harness's own Skills capability is a minimal reader: it injects SKILL.md instructions but does not enumerate, read, or execute bundled files. pydantic-ai-skills implements the full package — bundled resources, script execution, remote registries, programmatic skills, and reload at runtime — so skills that ship a reference document or a script (including those in Anthropic's skills repository) run as written. Feature-by-feature comparison: Why pydantic-ai-skills.

Installation

uv add pydantic-ai-skills

Millennials may continue to use pip install pydantic-ai-skills. It still works, like your Spotify playlist from 2013.

Quick Start

Point a SkillsCapability at one or more skill directories and add it to your agent:

from pydantic_ai import Agent
from pydantic_ai_skills import SkillsCapability

agent = Agent(
    model='gateway/openai:gpt-5.2',
    instructions='You are a helpful research assistant.',
    capabilities=[SkillsCapability(directories=['./skills'])],
)

result = await agent.run('What are the last 3 papers on arXiv about machine learning?')
print(result.output)

SkillsToolset is the same thing as a toolset, for agents built around toolsets=[...]:

from pydantic_ai_skills import SkillsToolset

agent = Agent(model='gateway/openai:gpt-5.2', toolsets=[SkillsToolset(directories=['./skills'])])

Both inject the skill catalog into the agent's instructions automatically and expose four tools:

Tool Purpose
list_skills() List available skills (optional — the catalog is already in the prompt)
load_skill(name) Read a skill's full instructions
read_skill_resource(skill_name, resource_name) Read a bundled file such as REFERENCE.md
run_skill_script(skill_name, script_name, args) Run a bundled script with named arguments

See Quick Start.

Anatomy of a Skill

my-skill/
├── SKILL.md      # Required: YAML frontmatter + Markdown instructions
├── REFERENCE.md  # Optional: extra docs, read on demand
├── scripts/      # Optional: executable scripts
└── resources/    # Optional: templates, data files
---
name: my-skill
description: Brief description of what this skill does and when to use it
---

# My Skill

## When to Use This Skill

Use this skill when you need to...

## Instructions

1. Step 1
2. Step 2

name (max 64 chars, lowercase letters, numbers and hyphens) and description (max 1024 chars) are required; other frontmatter fields are yours to use. See Creating Skills.

Beyond the Filesystem

  • Programmatic skills — define skills in Python with decorators or dataclasses.
  • Registries — load skills from Git repositories, S3, or custom sources, and compose them (combine, filter, prefix, rename).
  • Skill selection — give each agent a subset of a shared library with include / exclude.
  • Advanced featuresreload() / auto_reload, exclude_tools, deferred loading, recursive discovery.

Security

Only use skills from sources you trust. Skills give agents new capabilities through instructions and code, so a malicious skill can direct an agent to invoke tools or execute code in ways that don't match its stated purpose — with risks including data exfiltration and unauthorized system access. Audit any skill from an unknown source before use. See Security & Deployment.

Related Resources

Contributing

Contributions are welcome — see Contributing.

Acknowledgments

Thanks to Anthropic for the Agent Skills open format, the Pydantic AI team for the framework, and the community for feedback and contributions.

This project was highly inspired by pydantic-deepagents, which provided foundational ideas and patterns for agent skills and progressive disclosure in Pydantic AI.

License

MIT License — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_ai_skills-1.3.0.tar.gz (9.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_ai_skills-1.3.0-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_ai_skills-1.3.0.tar.gz.

File metadata

  • Download URL: pydantic_ai_skills-1.3.0.tar.gz
  • Upload date:
  • Size: 9.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pydantic_ai_skills-1.3.0.tar.gz
Algorithm Hash digest
SHA256 9940240170fa315640b76ec94be430bea1df55ac6d625a285725b4994f07f86d
MD5 c791f7d6f059e0211db1982ad22e2bb9
BLAKE2b-256 9c36d5746c3d5f7dbcdd9b30e5dd2dc4babc397b1fb21de300e3dc15c34aee3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_ai_skills-1.3.0.tar.gz:

Publisher: pypi-publish.yml on DougTrajano/pydantic-ai-skills

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydantic_ai_skills-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_ai_skills-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a8e001054b8c458d9b9b1d7688f0a30602246473ed8dfbe235dc4557b458dff
MD5 257262ac5d82cfd640c1fa4f9fb2fec8
BLAKE2b-256 ab5da93d33b5eb69f03b95c7de4f10ed04cd2135c0fc14fa73293c0610699df2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_ai_skills-1.3.0-py3-none-any.whl:

Publisher: pypi-publish.yml on DougTrajano/pydantic-ai-skills

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page