Thank you for your interest in contributing to Trinity! This document provides guidelines for contributing to the project.
Trinity is licensed under the Apache License 2.0. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Trinity by you shall be licensed under the Apache License 2.0, without any additional terms or conditions (per Section 5 of the license).
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
Where things are tracked. Trinity is open-core. The public issue tracker (abilityai/trinity) is for bugs and core maintenance. Feature ideas and roadmap discussion happen in Discussions — maintainers triage accepted proposals into the product roadmap.
- Check if the issue already exists in GitHub Issues
- If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Docker version, etc.)
- Relevant logs or screenshots
Feature ideas go in Discussions, not Issues — the public tracker stays focused on bugs, and maintainers curate the roadmap from accepted proposals.
- Open a Discussion describing the use case and the problem you're solving
- Propose a solution (optional) and be open to alternatives
- Accepted ideas are picked up by maintainers and tracked on the roadmap
The project follows a 4-stage SDLC: Todo → In Progress → In Dev → Done, tracked via GitHub Issues labels (status-in-progress, status-in-dev).
All PRs target the dev branch. main only receives release cuts (dev → main) performed by maintainers — a PR opened against main will be asked to retarget. Direct pushes to both dev and main are blocked by branch protection; everything lands via PR and is squash-merged.
- Fork and clone the repository
- Find or create an issue — every PR must link to an issue. Bugs go in GitHub Issues; feature ideas start in Discussions (see above) and get an issue once accepted
- Create a feature branch from
dev:Usegit checkout dev && git pull origin dev git checkout -b feature/<issue-number>-your-feature-name
fix/<issue-number>-<slug>for bug fixes. - Make your changes following our coding standards, keeping the diff minimal (see PR Validation below)
- Test your changes locally — new behavior needs tests (see Test Expectations)
- Update documentation as required by the change type (see Documentation Requirements)
- Commit with clear messages:
git commit -m "feat: Add support for custom metrics" - Push and create a PR against
dev— the description must contain a closing keyword for the linked issue:Fixes #N,Closes #N, orResolves #N. A bare#NorRefs #Nlinks the issue but does not trigger the status automation that moves it through the SDLC, so the issue strands instatus-in-progressafter merge.
We use conventional commits:
feat:New featurefix:Bug fixdocs:Documentation onlystyle:Formatting, no code changerefactor:Code change that neither fixes nor addstest:Adding testschore:Maintenance tasks
Examples:
feat: Add agent custom metrics API
fix: Correct context percentage calculation
docs: Update deployment guide for production
Every PR is validated against the Trinity development methodology before merge — maintainers run an automated validation pass and no PR merges without passing it. Running through this checklist yourself before opening the PR is the fastest path to a first-pass approval.
- PR targets
dev(notmain) - PR title/body carries a closing keyword (
Fixes #N/Closes #N/Resolves #N) referencing an existing issue - Commit messages are descriptive and use the conventional prefix (
feat/fix/refactor/docs) - PR is focused — fewer than ~50 changed files (larger PRs will be asked to split)
- Minimal necessary changes: no unrelated refactoring, no cosmetic formatting of untouched code, no unrequested documentation files
Documentation scales with the change type:
| Change Type | Required Docs |
|---|---|
| Bug fix | Descriptive commit message only |
| Feature / API change | docs/memory/architecture.md and/or docs/memory/feature-flows/*.md as needed |
| New capability | docs/memory/requirements/ (via the docs/memory/requirements.md index) + a feature flow |
| Refactor | Descriptive commit message only (unless it changes architecture) |
| Docs only | No additional docs needed |
Specifically:
- New/changed API endpoints, DB schema, or integrations → update
docs/memory/architecture.md(endpoint tables, schema section) - New or changed feature behavior → create/update the matching
docs/memory/feature-flows/*.mdand list new flows in thedocs/memory/feature-flows.mdindex. Follow the section structure of existing flow docs (Overview, User Story, Entry Points, Frontend Layer, Backend Layer, Side Effects, Error Handling, Security Considerations, Testing, Related Flows) - New capability → add a requirements entry before implementing (Requirements-Driven Development is a project rule)
- Feature / refactor PRs — each new surface needs a non-happy-path test, not just the success case: a new endpoint gets a non-admin/ownership-scoped call and a parameter-validation check; a new background service gets a restart-survival test; new WebSocket/session state gets a multi-worker assertion. Happy-path-only coverage on a new surface will be flagged.
- Bug-fix PRs — include a regression test that names the issue (e.g.
test_1234_...or a docstring referencing#1234) and cover every call-site of the fixed behavior, not just the reported path.
This is a public repository — every diff is scanned, and any of these blocks the merge:
- No API keys or tokens (
sk-,ghp_,xoxb-,AKIA…, etc.) - No real email addresses — use placeholders like
user@example.com - No public IP addresses or internal URLs/domains
- No
.envfiles with real values (.exampletemplates are fine) - No hardcoded secrets — read from
process.env/os.environinstead - No credential files (
.pem,.key,id_rsa, service-account JSON, etc.) -
docker-compose*.yml/Dockerfilechanges are justified in the PR description
These have each broken deploys before, so validation checks them explicitly:
- New top-level backend module —
docker/backend/Dockerfilecopies top-levelsrc/backend/*.pyfiles by explicit name (subdirectories likerouters/,services/,db/are copied wholesale). If you add a new top-level module, add it to the DockerfileCOPYlist or it's silently dropped from the image and crashes on deploy. - New environment variable — a new
os.getenv("X")in the backend must be wired intobackend.environment:in bothdocker-compose.ymlanddocker-compose.prod.yml, and documented in.env.example. Prod compose launches standalone (noenv_file:), so dev-only wiring leaves the setting inert on deploy. - DB schema change — Trinity runs dual-track migrations: add both a SQLite migration (
src/backend/db/migrations.py) and a PostgreSQL Alembic revision (src/backend/migrations/versions/), plus the DDL update insrc/backend/db/schema.py/db/tables.py. Theschema-parityCI check guards part of this.
Branch protection requires these checks green before merge:
| Required check | What it does |
|---|---|
Analyze (python) / Analyze (javascript-typescript) |
CodeQL static analysis on every PR |
schema-parity |
SQLite schema ↔ migration parity (self-skips when no schema files change) |
verify-non-root |
Container security: non-root UID guard (self-skips when no Docker surface changes) |
Other workflows (backend unit tests, frontend build, image smoke tests) run on PRs and are informational but reviewers expect them green.
- A maintainer reviews the code and runs the validation pass, resulting in APPROVE, REQUEST CHANGES (with a concrete fix list), or NEEDS DISCUSSION (scope/architecture questions)
- Address requested changes and push to the same branch — re-review happens on the same PR
- On approval the PR is squash-merged to
dev; automation moves the linked issue tostatus-in-dev - Your change ships to
mainat the next release cut — the release PR closes the issue
- Docker and Docker Compose v2+
- Node.js 20+ (for frontend development)
- Python 3.11+ (for backend development)
# 1. Clone your fork
git clone https://github.com/YOUR_USERNAME/trinity.git
cd trinity
# 2. Configure environment
cp .env.example .env
# Edit .env with required values
# 3. Build base image
./scripts/deploy/build-base-image.sh
# 4. Start services
./scripts/deploy/start.sh
# 5. Access the platform
# Web UI: http://localhost
# API: http://localhost:8000/docs# Backend tests
cd tests
python -m pytest -v
# Frontend (if applicable)
cd src/frontend
npm run test- Follow PEP 8
- Use type hints
- Document public functions with docstrings
- Keep functions focused and small
- Use TypeScript for new code
- Follow existing code style
- Use meaningful variable names
- Add comments for complex logic
- Use Composition API
- Follow Vue.js style guide
- Keep components focused
- Use Pinia for state management
trinity/
├── src/
│ ├── backend/ # FastAPI - Python
│ ├── frontend/ # Vue.js 3 - TypeScript
│ ├── mcp-server/ # MCP Server - TypeScript
│ └── audit-logger/ # Audit Service - Python
├── docker/
│ ├── base-image/ # Agent base image
│ └── ... # Service Dockerfiles
├── config/ # Configuration files
├── docs/ # Documentation
└── tests/ # Test suite
Look for issues labeled good first issue - these are suitable for newcomers.
- Agent template improvements
- UI/UX enhancements
- MCP tool additions
- Documentation improvements
- Test coverage
- Improve existing docs
- Add examples and tutorials
- Fix typos and clarify language
- Translate to other languages
- Open a Discussion for questions
- Join our community (link coming soon)
- Email: hello@ability.ai
Contributors will be recognized in:
- GitHub contributors list
- Release notes for significant contributions
- Special thanks section (for major features)
Thank you for contributing to Trinity!