Assistant Skills Library
Shared Python utilities for building Claude Code Assistant Skills plugins.
Installation
pip install assistant-skills-lib
# With HTTP support (for requests-based error handling)
pip install assistant-skills-lib[http]
Quick Start
from assistant_skills_lib import (
format_table,
validate_url,
Cache,
handle_errors,
APIError,
)
# Format data as a table
data = [
{"name": "Alice", "role": "Admin"},
{"name": "Bob", "role": "User"},
]
print(format_table(data, headers=["name", "role"]))
# Validate input
url = validate_url("https://api.example.com")
# Cache API responses
cache = Cache(app_name="my-skill")
cache.set("user:123", {"name": "Alice"}, ttl=300)
user = cache.get("user:123")
# Handle errors with decorator
@handle_errors
def main():
# Your code here - errors are caught and formatted
pass
Modules
Formatters
Output formatting utilities for tables, trees, and colored text.
from assistant_skills_lib import (
format_table,
format_tree,
format_list,
format_json,
print_success,
print_error_formatted,
print_warning,
Colors,
)
# Table formatting
data = [{"id": 1, "name": "Item 1"}, {"id": 2, "name": "Item 2"}]
print(format_table(data, headers=["id", "name"]))
# Tree formatting
tree = {"root": {"child1": {}, "child2": {"grandchild": {}}}}
print(format_tree(tree))
# Colored output
print_success("Operation completed!")
print_warning("Check your configuration")
Validators
Input validation utilities with clear error messages.
from assistant_skills_lib import (
validate_url,
validate_required,
validate_name,
validate_path,
validate_choice,
InputValidationError,
)
# URL validation
url = validate_url("https://api.example.com")
# Required field validation
name = validate_required(user_input, "username")
# Name validation (alphanumeric, hyphens, underscores)
skill_name = validate_name("my-skill", field_name="skill name")
# Choice validation
status = validate_choice(value, choices=["active", "inactive"], field_name="status")
Cache
File-based response caching with TTL support.
from assistant_skills_lib import Cache, cached, get_cache, invalidate
# Direct cache usage
cache = Cache(app_name="my-skill", default_ttl=300)
cache.set("key", {"data": "value"})
value = cache.get("key")
# Decorator usage
@cached(ttl=600, app_name="my-skill")
def fetch_user(user_id):
return api.get_user(user_id)
# Global cache access
cache = get_cache("my-skill")
cache.clear()
# Invalidate by pattern
invalidate("user:", app_name="my-skill")
Error Handler
Exception hierarchy and error handling utilities.
from assistant_skills_lib import (
handle_errors,
handle_api_error,
APIError,
AuthenticationError,
NotFoundError,
RateLimitError,
print_error,
ErrorContext,
)
# Decorator for main functions
@handle_errors
def main():
# Exceptions are caught, formatted, and exit with appropriate code
pass
# Handle API response errors
def make_request():
response = requests.get(url)
if not response.ok:
handle_api_error(response, operation="fetch user")
# Context manager for detailed error context
with ErrorContext("creating resource", resource_id=123):
client.post("/api/resources", data=data)
# Raise specific errors
raise NotFoundError("User not found", status_code=404)
raise RateLimitError("Too many requests", retry_after=60)
Template Engine
Template loading and rendering with placeholder support.
from assistant_skills_lib import (
load_template,
render_template,
list_placeholders,
list_template_files,
)
# Load and render templates
template = load_template("templates/skill.md")
content = render_template(template, {
"SKILL_NAME": "my-skill",
"DESCRIPTION": "A helpful skill",
})
# List placeholders in a template
placeholders = list_placeholders(template)
# Returns: ["SKILL_NAME", "DESCRIPTION", ...]
Project Detector
Detect and analyze Assistant Skills project structure.
from assistant_skills_lib import (
detect_project,
list_skills,
validate_structure,
get_project_stats,
)
# Detect project type
project = detect_project("/path/to/project")
# Returns: {"name": "Jira-Assistant-Skills", "type": "assistant-skills", ...}
# List skills in a project
skills = list_skills("/path/to/project")
# Returns: [{"name": "search", "path": "...", "has_scripts": True}, ...]
# Validate project structure
result = validate_structure("/path/to/project")
# Returns: {"valid": True, "errors": [], "warnings": [...]}
# Get project statistics
stats = get_project_stats("/path/to/project")
# Returns: {"skills": 5, "scripts": 12, "templates": 8, ...}
Development
# Clone the repository
git clone https://github.com/grandcamel/assistant-skills-lib.git
cd assistant-skills-lib
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check src/
# Type checking
mypy src/
License
MIT License - see LICENSE for details.
Metadata
Release files for assistant-skills-lib 1.0.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 | |
|---|---|---|---|---|
| assistant_skills_lib-1.0.1.tar.gz | 38.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| assistant_skills_lib-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.7 kB
Release files / assistant_skills_lib-1.0.1.tar.gz
| Download URL | assistant_skills_lib-1.0.1.tar.gz |
|---|---|
| Size | 38.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58c31e54c73e8b097b746829d493430801ff368f3cfd79891d6577dc1945bd5f
|
|
BLAKE2b-256 checksum How to use checksums |
5c8e53982be094cd7883b22b3ea5ed2c819b113cd235d70807c503754cf9969f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 21, 2026.
Transparency logRelease files / assistant_skills_lib-1.0.1-py3-none-any.whl
| Download URL | assistant_skills_lib-1.0.1-py3-none-any.whl |
|---|---|
| Size | 44.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a6ca72e02ec4ddf7711de3924df018e06aa86a82782055cf7e1544a6ea5d0b1
|
|
BLAKE2b-256 checksum How to use checksums |
bb96e79f4582576cfbc4cbd1c9494a843a66de89cd72f5f33a0976ca733caad7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 21, 2026.
Transparency logSecurity for assistant-skills-lib 1.0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for assistant_skills_lib-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 21, 2026.
Transparency logA 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.