Loading repository data…
Loading repository data…
Algovate / repository
A Python implementation of the Claude Agent Skills system — a sophisticated prompt-based meta-tool architecture that extends LLM capabilities through specialized instruction injection.
A Python implementation of the Claude Agent Skills system — a sophisticated prompt-based meta-tool architecture that extends LLM capabilities through specialized instruction injection.
ClaudeSkills Engine is a complete Python implementation of the Claude Agent Skills system, enabling LLMs to discover, load, and execute specialized skills through a meta-tool architecture. Skills are self-contained instruction sets that extend agent capabilities with domain-specific knowledge and workflows.
{baseDir} placeholders for skill portabilityUsing uv (recommended):
uv pip install -e .
Or using pip:
pip install -e .
For development with testing and linting tools:
uv pip install -e ".[dev]"
from engine import ClaudeSkillsEngine
# Initialize engine
engine = ClaudeSkillsEngine(builtin_skills_dir="skills")
# List available skills
skills = engine.list_skills()
for skill in skills:
print(f"{skill.name}: {skill.description}")
# Execute a skill
result = engine.execute_skill("script-automation", args="analyze /path/to/directory")
if result.success:
for message in result.messages:
print(message.content)
# List all available skills
python examples/demo.py list
# Show detailed information about a skill
python examples/demo.py show script-automation
# Execute a skill
python examples/demo.py execute script-automation --args "analyze /path/to/directory"
# View the Skill tool's dynamic prompt
python examples/demo.py prompt
# Validate a skill's structure
python examples/demo.py validate script-automation
Skills are self-contained instruction sets that extend an LLM's capabilities. Each skill consists of:
Skills use a meta-tool pattern: the Skill tool dynamically generates prompts listing available skills, and when invoked, injects the full skill instructions into the conversation context.
engine/
├── engine.py # Main engine orchestrator
├── skill.py # Skill class and YAML frontmatter parser
├── skill_loader.py # Multi-directory skill discovery
├── skill_tool.py # Meta-tool implementation
├── context.py # Execution context management
├── tools/ # Core tool implementations
│ ├── read.py # File reading
│ ├── write.py # File writing
│ ├── bash.py # Shell command execution
│ ├── grep.py # Pattern searching
│ ├── glob.py # File pattern matching
│ ├── git.py # Git operations
│ └── browser.py # Browser automation
└── patterns/ # Reusable skill patterns
├── script_automation.py
├── read_process_write.py
├── search_analyze_report.py
└── command_chain.py
Skills are loaded from three directories (in priority order):
~/.config/claude/skills/ (highest priority).claude/skills/ (project-specific)skills/ (default examples)Skills can restrict tool usage through the allowed-tools frontmatter field:
allowed-tools: "Read, Write, Bash(python {baseDir}/scripts/*:*)"
This enables:
The repository includes several example skills demonstrating different patterns:
Location: skills/script-automation/
Executes Python/Bash scripts for complex operations that require deterministic logic or multi-step processing.
Pattern: Script Automation
Use Case: Data processing, file transformations, complex calculations
Location: skills/read-process-write/
Demonstrates file transformation workflows: read input, process content, write output.
Pattern: Read-Process-Write
Use Case: Format conversions, data transformations, batch processing
Location: skills/search-analyze-report/
Performs codebase analysis, pattern detection, and generates reports.
Pattern: Search-Analyze-Report
Use Case: Code reviews, architecture analysis, documentation generation
Location: skills/command-chain/
Executes multi-step command sequences with dependencies and error handling.
Pattern: Command Chain Execution
Use Case: Build pipelines, deployment workflows, sequential operations
Location: skills/pdf-processor/
Complete working example using the Script Automation pattern to extract and process PDF content.
Use Case: Document processing, content extraction, batch operations
Location: skills/api-scaffolder/
Generates API scaffolding code based on specifications.
Use Case: Rapid prototyping, code generation, boilerplate creation
Location: skills/code-reviewer/
Analyzes code for issues, suggests improvements, and generates review reports.
Use Case: Code quality checks, best practices enforcement, automated reviews
Create a directory for your skill and add a SKILL.md file:
---
name: my-skill
description: A brief description of what this skill does
when-to-use: When you need to do X, Y, or Z
allowed-tools: "Read, Write"
version: 1.0.0
license: MIT
---
# My Skill
## Overview
Detailed explanation of the skill's purpose and capabilities.
## Instructions
Step-by-step instructions for the agent to follow when using this skill.
### Step 1: Identify Requirements
Analyze the user's request to determine...
### Step 2: Execute Actions
Use the available tools to...
## Examples
Example use cases and expected outcomes.
name (required): Unique skill identifierdescription (required): Brief description for skill discoverywhen-to-use (optional): Guidance on when to use this skillallowed-tools (optional): Comma-separated list of allowed tools with optional path restrictionsversion (optional): Skill version numberlicense (optional): License informationmodel (optional): Specific model requirementdisable-model-invocation (optional): Disable direct model callsmode (optional): Enable mode command supportUse {baseDir} in paths to make skills portable:
allowed-tools: "Bash(python {baseDir}/scripts/*:*)"
The {baseDir} placeholder is automatically replaced with the skill's directory path at runtime.
Place your skill in one of:
skills/your-skill/ (for repository skills).claude/skills/your-skill/ (project-specific)~/.config/claude/skills/your-skill/ (personal skills)The engine includes implementations of common skill patterns:
Offload complex operations to Python/Bash scripts stored in the skill directory.
Implementation: engine/patterns/script_automation.py
Transform files through a read → process → write pipeline.
Implementation: engine/patterns/read_process_write.py
Search codebase, analyze patterns, generate reports.
Implementation: engine/patterns/search_analyze_report.py
Execute sequential commands with dependencies and error handling.
Implementation: engine/patterns/command_chain.py
Core tools available to skills:
| Tool | Description | Permission Syntax |
|---|---|---|
| Read | Read file contents | Read |
| Write | Write content to files | Write |
| Bash | Execute shell commands | Bash or Bash(path:pattern) |
| Grep | Search patterns in files | Grep |
| Glob | File pattern matching | Glob |
| Git | Git operations | Git |
| Browser | Browser automation | Browser |
# Allow all tools
allowed-tools: "Read, Write, Bash, Grep, Glob"
# Restrict Bash to specific scripts
allowed-tools: "Read, Write, Bash(python {baseDir}/scripts/*:*)"
# Multiple path restrictions
allowed-tools: "Bash(python {baseDir}/scripts/*:*), Bash(bash {baseDir}/tools/*:*)"
Run the test suite:
pytest
Or with uv:
uv run pytest
Run specific test files:
pytest tests/test_skill.py
pytest tests/test_patterns.py
Contributions are welcome! When adding new skills:
skills/SKILL.md file with proper frontmatterpython examples/demo.py validate <skill-name>See individual skill licenses in their respective directories. The engine codebase follows the project's main license.
Note: This is a Python reference implementation of the Claude Skills system. For production use with Claude, refer to Anthropic's official documentation and tooling.