Skip to main content
Thank you for your interest in contributing to Skill Lab! This guide will help you get started with development and understand our contribution process.

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

This installs:
  • 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=html

Code Quality

Before submitting a PR, ensure your code passes all quality checks:
All CI checks must pass before your PR can be merged. Run these commands locally to catch issues early.

Code Style Guidelines

  • Type hints: Use type hints for all function parameters and return values
  • Union syntax: Use Python 3.10+ union syntax (T | None instead of Optional[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 organization
  • schema.py - Frontmatter field validation
  • naming.py - Naming conventions
  • content.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 a FieldRule 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

Use descriptive branch names:
  • feature/ - New features
  • fix/ - Bug fixes
  • docs/ - Documentation updates
  • refactor/ - 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

Write clear commit messages:
  • Use present tense (“Add feature” not “Added feature”)
  • Be concise but descriptive
  • Reference issues when applicable
5

Push and create PR

Then create a Pull Request on GitHub with:
  • 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 in tests/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 tests
  • test_parsers.py - Parser tests
  • test_evaluator.py - Evaluator tests
  • test_cli.py - CLI command tests
  • test_triggers.py - Trigger testing
  • test_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

License

By contributing to Skill Lab, you agree that your contributions will be licensed under the MIT License.