Skip to main content

Storage-agnostic abstractions for discovering, validating, and accessing Agent Skills (https://agentskills.io)

Project description

agentskills-core

PyPI Python 3.12+ License: MIT

Core abstractions for the Agent Skills SDK — provider interface, registry, validation, and skill model.

This package provides the foundational building blocks for working with the Agent Skills format. It is storage-agnostic — concrete providers (filesystem, HTTP, database, etc.) live in separate packages.

Installation

pip install agentskills-core

Requires Python 3.12+.

What's Included

Export Description
SkillProvider Abstract base class that every skill backend must implement
Skill Lightweight runtime handle to a single registered skill
SkillRegistry Unified index with explicit registration and catalog builder
validate_skill Validates a skill against the Agent Skills specification
split_frontmatter Parses YAML frontmatter from SKILL.md content
AgentSkillsError Base exception for all library errors
SkillNotFoundError Raised when a skill does not exist
ResourceNotFoundError Raised when a resource within a skill does not exist

Usage

Registering Skills

from agentskills_core import SkillRegistry

registry = SkillRegistry()
await registry.register("incident-response", provider)  # validates on registration

Or register multiple skills at once:

await registry.register([
    ("incident-response", fs_provider),
    ("api-style-guide", http_provider),
])

Batch registration is atomic — if any skill fails validation, none are registered.

Accessing Skills

skill = registry.get_skill("incident-response")
meta = await skill.get_metadata()       # YAML frontmatter as dict
body = await skill.get_body()           # Markdown instructions
script = await skill.get_script("run.sh")

Building a Catalog

Generate a catalog string for system-prompt injection:

xml_catalog = await registry.get_skills_catalog(format="xml")       # <available_skills> XML
md_catalog = await registry.get_skills_catalog(format="markdown")   # Markdown list

Implementing a Custom Provider

from agentskills_core import SkillProvider

class DatabaseSkillProvider(SkillProvider):
    async def get_metadata(self, skill_id: str) -> dict: ...
    async def get_body(self, skill_id: str) -> str: ...
    async def get_script(self, skill_id: str, name: str) -> bytes: ...
    async def get_asset(self, skill_id: str, name: str) -> bytes: ...
    async def get_reference(self, skill_id: str, name: str) -> bytes: ...

All methods are async so implementations backed by network I/O can be non-blocking.

License

MIT

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

agentskills_core-0.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

agentskills_core-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file agentskills_core-0.2.0.tar.gz.

File metadata

  • Download URL: agentskills_core-0.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.9 Windows/11

File hashes

Hashes for agentskills_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 443bcb3a5a93143f68b4172c04fcb2625d87769021d6492b7143a994e61b7d94
MD5 38a330e5f1ed85af6df8bc13e8bd0f3e
BLAKE2b-256 e72652b630f56bdff91d67e197bfcc7085bd4fb658b4efe2b84068fda9e07953

See more details on using hashes here.

File details

Details for the file agentskills_core-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agentskills_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.9 Windows/11

File hashes

Hashes for agentskills_core-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf4a7b49845a9f60a038e9bf5d9c3806ebedc211db95205b56e6af57fb583132
MD5 002f4b5df901d6190d9c861e6c9b628a
BLAKE2b-256 079099861f5ccc41efffae16395feba89dced04b5ffef1be607fe9220ae56dcb

See more details on using hashes here.

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