Rustic AI Skills
Agent Skills support for the Rustic AI framework. This module provides tools for discovering, installing, parsing, and executing Agent Skills from various sources including GitHub repositories and local directories.
Overview
Agent Skills are a standardized format for packaging reusable capabilities that AI agents can invoke. This module implements:
- SKILL.md Parser: Parse skill definitions in the Agent Skills format
- Skill Marketplace: Discover and install skills from GitHub repositories, Git URLs, or local directories
- Script Executor: Securely execute skill scripts (Python, Shell, JavaScript, etc.)
- SkillToolset: Integrate skills with the ReActAgent as executable tools
Installation
cd skills
poetry install --with dev
Quick Start
Discover and Install Skills
from rustic_ai.skills import SkillMarketplace
# Initialize marketplace
marketplace = SkillMarketplace()
# Add Anthropic's official skills (pre-configured)
# marketplace.add_source("anthropic", "github", "anthropics/skills")
# Add a custom source
marketplace.add_source(
name="my-skills",
source_type="github",
location="myorg/agent-skills",
)
# Discover available skills
skills = marketplace.discover()
for skill in skills:
print(f"{skill.name}: {skill.description}")
# Install a skill
marketplace.install("pdf")
# List installed skills
installed = marketplace.list_installed()
Use Skills with ReActAgent
from pathlib import Path
from rustic_ai.skills import SkillToolset
from rustic_ai.llm_agent.react import ReActAgent, ReActAgentConfig
# Create toolset from installed skill
toolset = SkillToolset.from_path(Path("/tmp/rustic-skills/pdf"))
# Configure ReActAgent with the skill
config = ReActAgentConfig(
model="gpt-4",
toolset=toolset,
system_prompt=toolset.get_system_prompt_addition(),
)
Use Multiple Skills
from rustic_ai.skills import SkillToolset
# Load multiple skills at once
toolset = SkillToolset.from_paths([
Path("/tmp/rustic-skills/pdf"),
Path("/tmp/rustic-skills/csv"),
Path("/tmp/rustic-skills/web-search"),
])
# Get combined system prompt
system_prompt = toolset.get_combined_system_prompt()
Parse Skills Directly
from pathlib import Path
from rustic_ai.skills import SkillParser, parse_skill
# Parse a skill folder
skill = parse_skill(Path("./my-skill"))
print(f"Name: {skill.name}")
print(f"Description: {skill.description}")
print(f"Scripts: {[s.name for s in skill.scripts]}")
print(f"Instructions:\n{skill.instructions}")
# Lazy load metadata only (for efficient discovery)
metadata = SkillParser.parse_metadata_only(Path("./my-skill"))
Execute Scripts Directly
from rustic_ai.skills import ScriptExecutor, ExecutionConfig
# Configure executor
config = ExecutionConfig(
timeout_seconds=60,
env_vars={"API_KEY": "secret"},
)
executor = ScriptExecutor(config)
# Execute inline code
result = executor.execute_inline(
code='print("Hello from skill")',
language="python",
args={"input": "test"},
)
if result.success:
print(result.output)
else:
print(f"Error: {result.error}")
Skill Format
Skills follow the Agent Skills specification:
my-skill/
├── SKILL.md # Required: Skill definition
├── scripts/ # Optional: Executable scripts
│ ├── process.py
│ └── setup.sh
├── references/ # Optional: Reference documents
│ └── api-docs.md
└── assets/ # Optional: Template files, configs
└── template.json
SKILL.md Format
---
name: my-skill
description: What this skill does and when to use it
allowed-tools: Read, Write, Bash
model: gpt-4
---
# My Skill
Instructions for how to use this skill...
## Usage
1. Step one
2. Step two
Components
Models
SkillMetadata: Lightweight metadata from SKILL.md frontmatterSkillDefinition: Full skill definition with scripts, references, assetsSkillScript: Executable script with interpreter infoSkillReference: Reference document with lazy loadingSkillSource: Configuration for a skill source (GitHub, local, Git)SkillRegistry: Registry of discovered skills
Parser
SkillParser: Parse SKILL.md files and discover resourcesparse_skill(): Convenience function for full parsingparse_skill_metadata(): Convenience function for metadata-only parsing
Marketplace
SkillMarketplace: Discover and install skills from various sources- Supports GitHub repositories (via GitPython)
- Supports local directories
- Supports arbitrary Git URLs
Executor
ScriptExecutor: Execute scripts with timeout and sandboxingExecutionConfig: Configuration for script executionExecutionResult: Result of script execution- Supports Python, Shell, JavaScript, TypeScript, Ruby
Toolset
SkillToolset: Convert skills to ReActToolset for use with ReActAgent (supports single or multiple skills)MarketplaceSkillToolset: Auto-install skills from marketplaceScriptToolParams: Parameters for script-based tools
Testing
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=rustic_ai.skills
# Run specific test file
poetry run pytest tests/test_parser.py
Development
# Format code
poetry run tox -e format
# Lint code
poetry run tox -e lint
# Run all checks
poetry run tox
License
Apache-2.0
Metadata
Release files for rusticai-skills 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rusticai_skills-0.4.1.tar.gz | 18.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rusticai_skills-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / rusticai_skills-0.4.1.tar.gz
| Download URL | rusticai_skills-0.4.1.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
272f7a476f9912d1904ea1b7f77d7ea65de42163f3cddaee25ed5bbea8ec3d7c
|
|
BLAKE2b-256 checksum How to use checksums |
a4b28a22fa46edb39493153a4fb101a0c33741ae4e4dd20cad32388cb6387af0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.13.12 Linux/6.17.0-1022-azure
|
Release files / rusticai_skills-0.4.1-py3-none-any.whl
| Download URL | rusticai_skills-0.4.1-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
619c744daf7104c42eb600088245eae4b6949209feca2eac003a87de6253dc68
|
|
BLAKE2b-256 checksum How to use checksums |
b023e56a31ed3547e41199dc0a9ddd4536a70bd1a18eebcf81e345500cbe6df6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.13.12 Linux/6.17.0-1022-azure
|
Security for rusticai-skills 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.