Skip to main content

Python library implementing Anthropic's Agent Skills functionality for LLM-powered agents

Project description

skillkit

Enables Anthropic's Agent Skills functionality to any python agent, unleashing LLM-powered agents to autonomously discover and utilize packaged expertise, regardless of their framework. skillkit is compatible with existings skills (SKILL.md), so you can browse and use any skill available on the web

Features

  • Framework-free: can be used without any framework, or with other frameworks (currently only compatible with LangChain - more coming in the future!)
  • Multi-source skill discovery from local directories
  • YAML frontmatter parsing with comprehensive validation
  • Progressive disclosure pattern (metadata-first loading, 80% memory reduction)
  • Security features: Input validation, size limits, suspicious pattern detection
  • Model-agnostic design: Works with any LLM

Why Skills Matter?

What Skills Are

Agent Skills are modular capability packages that work like "onboarding guides" for AI. Each skill is a folder containing a SKILL.md file (with YAML metadata + Markdown instructions) plus optional supporting files like scripts, templates, and documentation. The Agent autonomously discovers and loads skills based on task relevance using a progressive disclosure model—first reading just the name/description metadata, then the full SKILL.md if needed, and finally any referenced files only when required.

Why Skills Matter

- Transform AI from assistant to operational team member — Skills let you encode your organization's procedural knowledge, workflows, and domain expertise into reusable capabilities that Claude can invoke autonomously. Instead of repeatedly prompting Claude with the same context, you create persistent "muscle memory" that integrates AI into real business processes, making it a specialized professional rather than a generic chatbot.

- Achieve scalable efficiency through progressive disclosure — Unlike traditional prompting where everything loads into context, skills use a three-tier discovery system (metadata → full instructions → supplementary files) that keeps Claude's context window lean. This architecture allows unlimited expertise to be available without token bloat, dramatically reducing running costs while supporting dozens of skills simultaneously.

- Combine AI reasoning with deterministic code execution — Skills can bundle Python scripts and executables alongside natural language instructions, letting Claude use traditional programming for tasks where LLMs are wasteful or unreliable (like sorting lists, filling PDF forms, or data transformations). This hybrid approach delivers the reliability of code with the flexibility of AI reasoning, ensuring consistent, auditable results for mission-critical operations. ⚠️ Warning Code execution feature is not currently active and will be released in future versions of skillkit

Where can i find ready-to-use skills?

The web is full of great skills! here are some repositories you can check out:


Installation

Core library

pip install skillkit

With LangChain integration

pip install skillkit[langchain]

Development dependencies

pip install skillkit[dev]

Quick Start

1. Create a skill

Create a directory structure:

.claude/skills/code-reviewer/SKILL.md

SKILL.md format:

---
name: code-reviewer
description: Review code for best practices and potential issues
allowed-tools: Read, Grep
---

# Code Reviewer Skill

You are a code reviewer. Analyze the provided code for:
- Best practices violations
- Potential bugs
- Security vulnerabilities

## Instructions

$ARGUMENTS

2. Use standalone (without frameworks)

from skillkit import SkillManager

# Create manager (defaults to ~/.claude/skills/)
manager = SkillManager()

# Discover skills
manager.discover()

# List available skills
for skill in manager.list_skills():
    print(f"{skill.name}: {skill.description}")

# Invoke a skill
result = manager.invoke_skill("code-reviewer", "Review function calculate_total()")
print(result)

3. Use with LangChain

from skillkit import SkillManager
from skillkit.integrations.langchain import create_langchain_tools
from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI

# Discover skills
manager = SkillManager()
manager.discover()

# Convert to LangChain tools
tools = create_langchain_tools(manager)

# Create agent
llm = ChatOpenAI(model="gpt-4")
agent = create_react_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools)

# Use agent
result = agent_executor.invoke({"input": "Review my code for security issues"})

SKILL.md Format

Required Fields

  • name (string): Unique skill identifier
  • description (string): Human-readable skill description

Optional Fields

  • allowed-tools (list): Tool names allowed for this skill (not enforced in v0.1)

Example

---
name: git-helper
description: Generate git commit messages and workflow guidance
allowed-tools: Bash, Read
---

# Git Helper Skill

Content with $ARGUMENTS placeholder...

Argument Substitution

  • $ARGUMENTS → replaced with user-provided arguments
  • $$ARGUMENTS → literal $ARGUMENTS (escaped)
  • No placeholder + arguments → arguments appended to end
  • No placeholder + no arguments → content unchanged

Common Usage Patterns

Custom skills directory

from pathlib import Path
manager = SkillManager(Path("/custom/skills"))

Error handling

from skillkit import SkillNotFoundError, ContentLoadError

try:
    result = manager.invoke_skill("my-skill", args)
except SkillNotFoundError:
    print("Skill not found")
except ContentLoadError:
    print("Skill file was deleted or is unreadable")

Accessing metadata

metadata = manager.get_skill("code-reviewer")
print(f"Path: {metadata.skill_path}")
print(f"Tools: {metadata.allowed_tools}")

Multiple arguments

# Arguments are passed as a single string
result = manager.invoke_skill("code-reviewer", "Review file.py for security issues")

No placeholder behavior

If SKILL.md has no $ARGUMENTS placeholder:

  • With arguments: appended to end of content
  • Without arguments: content returned unchanged

Debugging Tips

Enable logging

import logging
logging.basicConfig(level=logging.DEBUG)

Module-specific logging

logging.getLogger('skillkit.core.discovery').setLevel(logging.DEBUG)

Common issues

Skill not found after discovery:

  • Check skill directory path
  • Verify SKILL.md file exists (case-insensitive)
  • Check logs for parsing errors

YAML parsing errors:

  • Validate YAML syntax (use yamllint)
  • Check for proper --- delimiters
  • Ensure required fields present

Arguments not substituted:

  • Check for $ARGUMENTS placeholder (case-sensitive)
  • Check for typos: $arguments, $ARGUMENT, $ ARGUMENTS
  • See logs for typo detection warnings

Memory usage concerns:

  • Content is loaded lazily (only when .content accessed or invoke() called)
  • Python 3.10+ recommended for optimal memory efficiency (60% reduction via slots)

Performance Tips

  1. Discover once: Call discover() once at startup, reuse manager
  2. Reuse manager: Don't create new SkillManager for each invocation
  3. Keep skills focused: Large skills (>200KB) may slow down invocation
  4. Use Python 3.10+: Better memory efficiency with dataclass slots

Requirements

  • Python: 3.10+
  • Core dependencies: PyYAML 6.0+
  • Optional: langchain-core 0.1.0+, pydantic 2.0+ (for LangChain integration)

Development

Setup

git clone https://github.com/maxvaega/skillkit.git
cd skillkit
python3.10 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Run tests

The project includes a comprehensive pytest-based test suite with 70%+ coverage validating core functionality, integrations, and edge cases. For detailed testing instructions, test organization, markers, and debugging tips, see tests/README.md.

pytest
pytest --cov=src/skillkit --cov-report=html

Type checking

mypy src/skillkit --strict

Linting

ruff check src/skillkit
ruff format src/skillkit

Examples

See examples/ directory:

  • basic_usage.py - Standalone usage without frameworks
  • langchain_agent.py - LangChain agent integration
  • skills/ - Example skills (code-reviewer, markdown-formatter, git-helper)

Run examples:

python examples/basic_usage.py
python examples/langchain_agent.py  # Requires langchain extras

Roadmap

v0.1 (Current)

  • ✅ Core skill discovery and metadata management
  • ✅ YAML frontmatter parsing with validation
  • ✅ Progressive disclosure pattern (lazy loading)
  • ✅ Skill invocation with argument substitution
  • ✅ LangChain integration (sync only)
  • ✅ 70% test coverage

v0.2 (Planned) 👈 we are here

  • Async support (adiscover(), ainvoke_skill())
  • Advanced Discovery (multiple search paths, plugin directory support, nested skill structure, skill name conflict resolution)
  • File reference resolution (supporting file access from scripts/, templates/ and docs/)

v0.3 (Planned)

  • Script Execution (script detection, execution with variables, stdout/stderr capture, sandboxing)
  • Tool restriction enforcement (allowed-tools enforcement, tool filtering, violation error handling)

v0.4 (Planned)

  • Plugin integration
  • Enhanced error handling and recovery
  • Performance optimizations

v0.5 (Planned)

  • Additional Frameworks integration

v1.0 (Planned)

  • Plugin integration for dynamic skill loading
  • Nested directory support
  • Advanced arguments schemas
  • Skill versioning and compatibility checks
  • Comprehensive documentation
  • 90% test coverage

License

MIT License - see LICENSE file for details.

Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or creating new example skills, your help is appreciated.

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and add tests
  4. Ensure all tests pass (pytest)
  5. Ensure code quality checks pass (ruff check, mypy --strict)
  6. Submit a pull request

Detailed Guidelines

For comprehensive contribution guidelines, including:

  • Development environment setup
  • Code style and testing requirements
  • PR submission process
  • Bug reporting and feature requests

Please see CONTRIBUTING.md for detailed information.

Support

Acknowledgments

  • Inspired by Anthropic's Agent Skills functionality
  • Built with Python, PyYAML, LangChain, and Pydantic

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

skillkit-0.1.0.tar.gz (339.1 kB view details)

Uploaded Source

Built Distribution

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

skillkit-0.1.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file skillkit-0.1.0.tar.gz.

File metadata

  • Download URL: skillkit-0.1.0.tar.gz
  • Upload date:
  • Size: 339.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for skillkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c86bd8d9789e1185673a34249806a7e84ef65bf1b37698fc800222e456728c0
MD5 6f5aa207e70daefb0905d665be5b3f87
BLAKE2b-256 0e68c8ce6ed38f60525fb4ab52e0cdb61c8c7e9dc8d8babd8cc8b7eae876927f

See more details on using hashes here.

File details

Details for the file skillkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skillkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for skillkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b49c4ba23746e8c2eeb03d8f0108808af0ba01ea777468e7ee0b51e2e6ed4720
MD5 3edfe81c8eefea864277e35e78f65dc6
BLAKE2b-256 c4fccabdce0e03342b1e7cfe0a693b34f419165c9e74d9b5c875a5e1b21fbf5a

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