Development Setup
Prerequisites
Before you begin, ensure you have:- Python 3.10 or higher
- Git
- A text editor or IDE
Installation
1
Clone the repository
2
Create a virtual environment
3
Install in editable mode with dev dependencies
- Core dependencies (typer, rich, pyyaml)
- Dev tools (pytest, pytest-cov, mypy, ruff)
- Optional dependencies (anthropic for LLM-based test generation)
4
Verify installation
Development Workflow
Running Tests
Coverage reports are generated in
htmlcov/index.html when using --cov-report=htmlCode Quality
Before submitting a PR, ensure your code passes all quality checks:Code Style Guidelines
- Type hints: Use type hints for all function parameters and return values
- Union syntax: Use Python 3.10+ union syntax (
T | Noneinstead ofOptional[T]) - Naming: Follow PEP 8 naming conventions
- Function size: Keep functions focused and small
- Docstrings: Add docstrings for public functions and classes
- Line length: Maximum 100 characters
- Immutability: Use
@dataclass(frozen=True)for data models
Adding New Features
Adding a New Static Check
Skill Lab supports two types of static checks:1. Behavioral Checks (Hand-written Classes)
For complex validation logic, create a new check class:1
Create your check class
Add your check to the appropriate file in
src/skill_lab/checks/static/:structure.py- File structure and organizationschema.py- Frontmatter field validationnaming.py- Naming conventionscontent.py- Content quality and requirements
2
Add tests
Add test cases to
tests/test_checks.py:3
Update documentation
Document your new check in the appropriate documentation files.
2. Schema-Based Checks (Declarative)
For simple field validation, add aFieldRule to FRONTMATTER_SCHEMA in src/skill_lab/checks/static/schema.py:
Schema-based checks are automatically registered. No need to write a class or use
@register_check.Adding a New Trace Check Handler
For trace analysis checks:Pull Request Process
1
Create a branch
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoring
2
Make your changes
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
3
Run checks locally
4
Commit your changes
- Use present tense (“Add feature” not “Added feature”)
- Be concise but descriptive
- Reference issues when applicable
5
Push and create PR
- Clear title describing the change
- Description of what changed and why
- Any relevant issue numbers
- Screenshots or examples if applicable
Testing Conventions
Fixture Structure
Test fixtures are located intests/fixtures/skills/. Each subdirectory represents a mock skill with a SKILL.md file.
Testing Different Check Types
Test Organization
Test files mirror the source structure:test_checks.py- Static check teststest_parsers.py- Parser teststest_evaluator.py- Evaluator teststest_cli.py- CLI command teststest_triggers.py- Trigger testingtest_trace_evaluator.py- Trace analysis tests
Reporting Issues
When reporting issues, please include:- Environment details: OS, Python version, sklab version
- Reproduction steps: Clear steps to reproduce the issue
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Error messages: Full error messages and stack traces
- Sample files: Minimal SKILL.md that demonstrates the issue (if applicable)
Questions and Support
Feel free to:- Open an issue for questions or discussions
- Check existing issues and pull requests
- Review the Architecture documentation for technical details