pydantic-ai-skills  by DougTrajano

Build and manage AI agent skills with a composable framework

Created 4 months ago
263 stars

Top 96.7% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This package provides a standardized, composable framework for integrating Agent Skills into the Pydantic AI ecosystem. It enables AI agents to progressively discover, load, and execute specialized capabilities, enhancing modularity and reducing token usage. Targeting Pydantic AI developers, it offers support for both filesystem-based and programmatic skills, adapting the Agent Skills specification for Pydantic AI's tool-calling architecture.

How It Works

The framework implements the Agent Skills open format using Pydantic AI's tool-calling capabilities, replacing traditional bash interactions with a Pythonic approach. Core to its design is progressive disclosure, ensuring skill metadata is loaded first for discovery, with full instructions and resources fetched only when needed, thereby minimizing token overhead. It supports two primary skill definition methods: filesystem skills, organized as directories with Markdown instructions and executable scripts, and programmatic skills, defined dynamically within Python code using decorators or dataclasses. This approach ensures type-safe skill management and automatic validation of metadata and structure.

Quick Start & Requirements

  • Installation: pip install pydantic-ai-skills
  • Development: pip install pydantic-ai-skills[test]
  • Prerequisites: Pydantic AI (version >= 1.71 recommended for SkillsCapability). Some individual skills may require specific Python packages (e.g., arxiv for the arxiv-search skill).
  • Documentation: Full documentation is available at https://dougtrajano.github.io/pydantic-ai-skills.

Highlighted Details

  • Progressive Disclosure: Optimizes token usage by loading skill details on demand.
  • Agent Skills Specification: Fully compatible with the open format maintained by Anthropic.
  • Dual Skill Support: Enables skills defined via filesystem directories or dynamic Python code.
  • Type-Safe & Validated: Leverages Pydantic for robust metadata and structure validation.
  • Security: Incorporates path traversal prevention and safe script execution mechanisms.

Maintenance & Community

The project acknowledges contributions and maintenance efforts from Anthropic (for the Agent Skills format) and the Pydantic AI Team. Inspiration is drawn from pydantic-deepagents. Community contribution guidelines are available. Specific community channels (e.g., Discord, Slack) or a public roadmap are not detailed in the provided README excerpt.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The permissive MIT license generally allows for commercial use and integration within closed-source projects without significant restrictions.

Limitations & Caveats

A critical security caveat advises using skills exclusively from trusted sources, as malicious skills could potentially lead to data exfiltration or unauthorized system access. Additionally, individual skills may necessitate separate installation of specific Python dependencies.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
1
Star History
65 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.