Thank you for your interest in contributing to PISA! We welcome contributions from the community and are excited to work with you.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Testing
- Documentation
- Pull Request Process
This project follows a standard Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@prismer.ai.
- Python 3.11 or higher
- Git
- uv (recommended) or pip
- Fork and Clone
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/pisa.git
cd pisa
# Add upstream remote
git remote add upstream https://github.com/prismer/pisa.git- Create a Virtual Environment
# Using uv (recommended)
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Or using venv
python -m venv .venv
source .venv/bin/activate- Install Dependencies
# Install in development mode with dev dependencies
uv pip install -e ".[dev]"
# Or using pip
pip install -e ".[dev]"- Set Up Pre-commit Hooks
pre-commit install- Verify Installation
# Run tests
uv run pytest tests/ -v
# Check code quality
uv run ruff check src/We welcome various types of contributions:
- Use the GitHub issue tracker
- Include a clear description, reproduction steps, and expected behavior
- Add logs, screenshots, or error messages if applicable
- Open an issue with the "enhancement" label
- Describe the problem you're trying to solve
- Explain your proposed solution
- Consider backward compatibility
- Fix typos, clarify explanations, or add examples
- Update outdated documentation
- Write tutorials or guides
- Bug fixes
- New features
- Performance improvements
- New capabilities or loop templates
We follow PEP 8 with some modifications:
- Line length: 100 characters (not 79)
- Use type hints for all function signatures
- Use docstrings (Google style) for all public APIs
We use the following tools:
# Format code
uv run black src/ tests/
# Sort imports
uv run isort src/ tests/
# Lint
uv run ruff check src/ tests/
# Type checking
uv run mypy src/- Classes:
PascalCase(e.g.,PlanningModule,AgentLoop) - Functions/Methods:
snake_case(e.g.,create_agent,execute_task) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_RETRIES,DEFAULT_MODEL) - Private members: prefix with
_(e.g.,_internal_method)
src/pisa/
βββ capability/ # Capability system
β βββ local/ # Built-in capabilities
β βββ registry.py # Capability registration
βββ core/ # Core framework
β βββ loop/ # Agent loop implementations
β βββ planning/ # Planning system
β βββ context/ # Context management
β βββ definition/ # Agent definition parsing
βββ cli/ # CLI commands
βββ utils/ # Utilities
# Run all tests
uv run pytest tests/ -v
# Run specific test file
uv run pytest tests/test_planning.py -v
# Run with coverage
uv run pytest tests/ --cov=src/pisa --cov-report=html
# Run only unit tests
uv run pytest tests/unit/ -v
# Run only integration tests
uv run pytest tests/integration/ -v- Place unit tests in
tests/unit/ - Place integration tests in
tests/integration/ - Use pytest fixtures for common setup
- Aim for >80% code coverage
- Test both success and failure cases
Example test:
import pytest
from pisa.core.planning import Planner
@pytest.fixture
def planner():
return Planner(model="gpt-4o-mini")
def test_planner_creates_valid_plan(planner):
"""Test that planner creates a valid task plan."""
goal = "Calculate 2 + 2"
plan = await planner.create_plan(goal)
assert plan is not None
assert len(plan.tasks) > 0
assert plan.root_goal == goalWe use Google-style docstrings:
def my_function(param1: str, param2: int) -> bool:
"""
Brief description of the function.
Longer description if needed, explaining what the function does
and any important details.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ValueError: When param2 is negative
Example:
>>> my_function("test", 42)
True
"""
passWhen adding new features:
- Update relevant markdown docs in
docs/ - Add docstrings to all public APIs
- Include usage examples
- Update the README if needed
- Create a Branch
git checkout -b feature/my-new-feature
# or
git checkout -b fix/bug-description- Make Your Changes
- Write clean, readable code
- Follow the coding standards
- Add tests for new functionality
- Update documentation
- Test Locally
# Run tests
uv run pytest tests/ -v
# Check code quality
uv run ruff check src/
uv run black --check src/
uv run mypy src/- Commit Your Changes
# Use conventional commit messages
git commit -m "feat: add new planning strategy"
git commit -m "fix: resolve context compression bug"
git commit -m "docs: update capability guide"Commit message types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Maintenance tasks
- Push to Your Fork
git push origin feature/my-new-feature- Create Pull Request
- Go to the PISA repository
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
## Description
Brief description of what this PR does
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests pass locally
- [ ] Added new tests
- [ ] Updated existing tests
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No new warnings- Maintainers will review your PR
- Address any feedback or requested changes
- Once approved, a maintainer will merge your PR
# Enable debug mode
export PISA_DEBUG=true
# Run with verbose logging
pisa run .prismer/agent.md -i "test" --verbose
# Use IPython for interactive debugging
ipdb.set_trace() # Add to your code# Add a new capability
pisa init my-agent
cd my-agent/.prismer/capability/function
# Create your capability file
# Test a capability
cd example/PISA5
pisa list-capabilities
pisa run .prismer/agent.md -i "test capability"
# Create a new loop template
# Edit src/pisa/core/loop/templates/my_loop.py
# Register with @agent decorator- Discord: Join our Discord server
- GitHub Discussions: Ask questions in Discussions
- Email: Contact maintainers at dev@prismer.ai
Contributors will be:
- Listed in the README
- Credited in release notes
- Added to our Contributors page
Thank you for contributing to PISA! π