Contributing¶
Porting to New Platforms¶
Want Spellbook on your coding assistant? Spellbook requires agent skills support, which means prompt files that automatically activate based on trigger descriptions (e.g., "Use when implementing features"). This is different from MCP tools or programmatic hooks.
See the Porting Guide for requirements and instructions.
Prerequisites¶
Install uv:
Development Setup¶
# Clone the repository
git clone https://github.com/axiomantic/spellbook.git
cd spellbook
# Install pre-commit hooks
uvx pre-commit install
Running Tests¶
# Run fast tests (heavy markers auto-skipped)
uv run pytest tests/
# Run specific test file
uv run pytest tests/unit/test_installer.py
Documentation¶
Building Docs Locally¶
Then open http://127.0.0.1:8000
Generating Skill Docs¶
After modifying skills, regenerate documentation:
MCP Server Development¶
# Run the MCP server directly
cd spellbook
uv run server.py
# Or install as editable package
uv pip install -e .
Creating a New Skill¶
- Create a directory:
skills/<skill-name>/ - Add
SKILL.mdwith frontmatter:
---
name: skill-name
description: Use when [trigger] - [what it does]
---
# Skill Name
## When to Use
[Describe when this skill applies]
## Process
[Step-by-step workflow]
- Run
uv run scripts/generate_docs.pyto update docs - Test the skill in Claude Code
Creating a New Command¶
- Add
commands/<command-name>.md - Include clear usage instructions
- Regenerate docs:
uv run scripts/generate_docs.py
Pre-commit Hooks¶
The repository uses pre-commit hooks for:
- generate-docs - Auto-regenerate skill/command/agent documentation
- check-docs-completeness - Ensure all items are documented
Run hooks manually:
Pull Request Guidelines¶
- Create a feature branch
- Make changes with clear commits
- Ensure tests pass:
uv run pytest - Update documentation if needed
- Submit PR with description of changes
Code Style¶
- Markdown: Follow existing formatting
- Python: Follow PEP 8, use type hints
- JavaScript: Use ES modules, async/await
Attribution¶
When adding content from other sources:
- Update
THIRD-PARTY-NOTICESwith attribution - Note the origin in documentation
- Ensure license compatibility (MIT preferred)