Contributing¶
Development Setup¶
Code Quality¶
Lint & Format¶
Type Check¶
Test¶
Code Style¶
- ruff for linting and formatting (line-length 100, py311 target)
- mypy --strict for type checking
- All public functions require type hints
- No docstrings unless absolutely necessary
- Prefer self-documenting code over comments
Anti-Patterns¶
Avoid these:
# type: ignoreorcast(Any, ...)without justification- Empty exception handlers (
except: pass) - Hardcoded provider keys
- Docstrings for simple, obvious functions
Project Conventions¶
Config Priority¶
Adding a New Agent¶
- Create
src/theoria/agents/your_agent.py - Define
YourState(TypedDict)with phase tracking - Implement
StateGraphwith nodes and routing - Add streaming support via
stream_*method
Adding a CLI Command¶
# In cli.py
@app.command()
def your_command(
option: Annotated[str, typer.Option("--option", "-o", help="Description")] = "default",
) -> None:
"""Command description."""
...
Pull Requests¶
- Fork and create a feature branch
- Ensure all checks pass (
ruff,mypy,pytest) - Write clear commit messages
- Submit PR with description of changes
License¶
By contributing, you agree that your contributions will be released under the WTFPL license.