For developers and AI assistants working on this project. This guide defines Trinity's Software Development Lifecycle (SDLC) and explains how to use the project's tools, agents, and documentation effectively.
Trinity follows a 4-stage lifecycle. Each stage maps 1:1 to an issue's location in the commit graph, tracked via status-* labels (the authoritative surface — gh issue list --label status-in-dev etc.). The GitHub Project board mirrors these for visual tracking but is optional.
Todo → In Progress → In Dev → Done
┌─────────────────────────────────────────────────────────────────────┐
│ TRINITY SDLC │
├──────────┬──────────────────────────────────────────────────────────┤
│ │ │
│ TODO │ Issue created, triaged with priority + type labels │
│ │ Acceptance criteria defined before work begins │
│ │ Label: status-ready (optional) | Board: Todo │
│ │ │
├──────────┼──────────────────────────────────────────────────────────┤
│ │ │
│ IN │ /claim → /autoplan → approve → /implement │
│ PROGRESS │ → /review → /cso --diff → /sync-feature-flows │
│ │ → open PR to dev, /validate-pr │
│ │ Label: status-in-progress | Board: In Progress │
│ │ Code location: feature branch │
│ │ │
├──────────┼──────────────────────────────────────────────────────────┤
│ │ │
│ IN DEV │ PR squash-merged to dev — feature is shippable │
│ │ Awaiting next release cut (dev → main) │
│ │ Label: status-in-dev | Board: In Dev │
│ │ Code location: origin/dev │
│ │ │
│ │ Promoted automatically by │
│ │ .github/workflows/issue-status-on-merge.yml │
│ │ │
├──────────┼──────────────────────────────────────────────────────────┤
│ │ │
│ DONE │ Release PR (dev → main) squash-merged + tagged │
│ │ Issues auto-closed via `Closes #N` in release body │
│ │ Label: (none — issue closed) | Board: Done │
│ │ Code location: origin/main │
│ │ │
└──────────┴──────────────────────────────────────────────────────────┘
| Priority | Label | Meaning |
|---|---|---|
| P0 | priority-p0 |
Blocking/urgent — drop everything |
| P1 | priority-p1 |
Critical path — current focus |
| P2 | priority-p2 |
Important — next up |
| P3 | priority-p3 |
Nice-to-have — when time allows |
Within P1, the Tier field on the project board provides sub-prioritization: P1a (highest) → P1b → P1c.
Rule: Work P0 first, then P1 by Tier (P1a → P1b → P1c), then by Rank (lowest number first).
The project board uses two additional single-select fields for strategic grouping (one value per issue):
| Field | Purpose | Examples |
|---|---|---|
| Epic | Groups related issues into a deliverable | #20 Audit Trail, #306 Event Bus |
| Theme | Strategic category | Security, Reliability, Channels, DevEx, Monetization, Infrastructure, UI/UX |
- Epic: Links issue to one parent epic. Epics track % complete via child issue status. Pick the primary deliverable.
- Theme: Categorizes by one strategic area. Helps balance roadmap coverage. Pick the primary intent.
Commands:
/roadmap epics— epic rollup with progress bars/roadmap themes— coverage by strategic theme/roadmap orphans— issues missing Epic or Theme/groom— assign Epics/Themes to orphan issues
Run /groom periodically to keep the backlog healthy. It audits board coverage, detects unranked items, reviews priority ordering, and applies rank updates after approval. Key checks:
- All open issues are on the project board
- All Todo items have a Rank and Tier assigned
- P1a items ranked highest, bugs above features within same tier
- Stale or resolved items flagged for closure
| Label | Purpose |
|---|---|
type-feature |
New functionality |
type-bug |
Bug fix |
type-refactor |
Code improvement |
type-docs |
Documentation |
- All work on feature branches — direct pushes to
mainanddevare blocked (branch protection) - Default base branch is
dev— PRs targetdev;mainonly receives merges at release cuts (see §4b) - Every PR links to an issue — use
Fixes #Nin the PR description - Claim issues via
/claim— comment/claimon an issue to auto-assign yourself (or assign manually). Use/unclaimto release. - No merge without passing
/validate-pr
Issues are created via GitHub issue templates (bug report or feature request). On creation:
- Apply priority label (P0-P3)
- Apply type label (feature/bug/refactor/docs)
- Add to Trinity Roadmap project board (lands in Todo)
- Add description with enough context to understand the problem
- Define acceptance criteria (how do we know it's done?)
An issue is ready to pick up when it has a clear description, acceptance criteria, and no unresolved blockers (if blocked, apply status-blocked label).
When picking up work:
- Claim the issue — comment
/claimon the issue (GitHub Action auto-assigns you and addsstatus-in-progresslabel), or assign yourself manually - Move to In Progress on the project board
- Create a feature branch from
dev
All work happens on feature branches cut from dev. Direct pushes to main and dev are blocked by branch protection.
Naming: feature/<issue-number>-<short-slug>
- Example:
feature/68-live-execution-output
Merge strategy: Squash merge via PR into dev with Fixes #N. main receives merges only at release cuts (see §4b).
Then follow the development pipeline:
The full pipeline for a sprint (each step can also be run standalone):
/sprint X → /autoplan → approve → /implement → /review → /cso --diff → /sync-feature-flows → PR
| Step | Skill | What it does |
|---|---|---|
| 1. Claim issue | /claim (GitHub) |
Auto-assign + status-in-progress label |
| 2. Plan review | /autoplan |
Strategy + engineering + security review with auto-decisions |
| 3. Human approval | (manual) | Review autoplan output, approve or revise |
| 4. Implement | /implement |
Code the feature, write tests |
| 5. Code review | /review |
Pre-landing diff review for structural issues |
| 6. Security audit | /cso --diff |
Scan actual code changes for vulnerabilities (P0/P1 recommended) |
| 7. Sync docs | /sync-feature-flows |
Update feature flow documentation |
| 8. Ship | /commit + PR |
Commit, push, create pull request |
Always start by loading context.
/read-docs
This loads requirements, architecture, and recent git history. For targeted work, read the relevant feature flow directly:
@docs/memory/feature-flows/user-login.md
See docs/memory/feature-flows.md for the complete index.
- Check requirements: Does
requirements.mdcover this feature? - Read feature flow: Understand existing data flow before modifying
- Implement: Follow patterns established in existing code
- Local testing: Run tests and verify locally
# Health check
curl http://localhost:8000/health
# Run tests
/test-runner # Run full test suite
/test-runner auth # Run tests matching "auth"
/test-runner --verbose # Include detailed outputAfter tests pass, update documentation:
/update-docs
| Change Type | Required Docs |
|---|---|
| Bug fix | Descriptive commit message only |
| Feature / API change | architecture.md or feature-flows/*.md as needed |
| New capability | requirements.md + feature-flows/*.md |
When local development is complete:
- Run
/review— pre-landing code review for structural issues (SQL safety, race conditions, auth boundaries, scope drift) - Fix critical findings —
/reviewoffers a fix-first flow for critical issues - Open a PR — reference the issue with
Fixes #N - Run
/validate-pr— process and documentation validation - For P0/P1 features (recommended): deploy to dev server for additional validation
Code review (/review) checks:
| Category | Check |
|---|---|
| SQL & Data Safety | Raw queries, missing parameterization, mass assignment |
| Race Conditions | Shared state, TOCTOU, Docker container races |
| Auth Boundaries | Missing auth, resource ownership, admin access |
| Credential Exposure | Secrets in logs, error messages, responses |
| Scope Drift | Did the diff match the issue requirements? |
| Enum Completeness | New values handled everywhere they're referenced |
| Test Gaps | New endpoints/paths without tests |
Process validation (/validate-pr) checks:
| Category | Check |
|---|---|
| Commit Messages | Descriptive, with conventional prefix (feat/fix/refactor/docs) |
| Requirements | Updated if new feature or scope change |
| Architecture | Updated if API/schema/integration changes |
| Feature Flows | Created/updated for behavior changes |
| Security | No secrets, keys, emails, IPs in diff |
| Code Quality | Minimal changes, follows patterns |
| Traceability | Links to requirements and issue |
Both produce reports with recommendations: APPROVE, REQUEST CHANGES, or NEEDS DISCUSSION.
If changes are requested, fix and re-run the failing check.
When a PR lands in your queue:
- Check the PR has an issue link (
Fixes #N) - Check priority label — P0/P1 get deeper review
- Check size — large PRs (50+ files) may need to be split
Run these based on PR type:
| PR Type | /review |
/validate-pr |
/cso --diff |
|---|---|---|---|
| Feature (P0/P1) | Required | Required | Required |
| Feature (P2/P3) | Required | Required | Recommended |
| Bug fix | Required | Required | Skip unless auth/security related |
| Refactor | Required | Required | Skip |
| Docs only | Skip | Required | Skip |
Step 1: Code review
/review
Checks structural issues: SQL safety, race conditions, auth boundaries, scope drift, test gaps. Produces a findings report with CRITICAL (block merge) and INFORMATIONAL (review) categories.
Step 2: Process validation
/validate-pr <number>
Checks docs, commit messages, requirements, feature flows, security (no secrets in diff), traceability.
Step 3: Security audit (P0/P1 or security-sensitive changes)
/cso --diff
Runs a scoped security audit on the branch changes only. Checks secrets, dependencies, auth boundaries, injection vectors, Trinity-specific patterns.
| Outcome | When |
|---|---|
| APPROVE | All checks pass, no critical findings |
| REQUEST CHANGES | Critical findings in /review or /validate-pr — list what to fix |
| NEEDS DISCUSSION | Scope drift detected, architecture concerns, or taste decisions |
- Squash merge the PR
- Verify the issue auto-closes via
Fixes #N - Move to Done on the project board
- Remove
status-in-progresslabel (if not auto-removed)
- Secrets, credentials, or real emails in the diff
- New endpoints without auth checks
- Changes to
docker-compose.ymlorDockerfilewithout justification - Large unrelated changes bundled with the feature
- Missing tests for new behavior
requirements.mdnot updated for new features
When the feature PR squash-merges to dev:
- Automation fires (
.github/workflows/issue-status-on-merge.yml)- Parses
Fixes #N/Closes #Nfrom the PR body + title - Adds
status-in-devto each referenced issue - Removes
status-in-progress
- Parses
- Issue remains open — it ships when the next release cuts
dev→main - Board column (if used): In Dev
Querying what's shipping in the next release:
gh issue list --repo abilityai/trinity --state open --label status-in-devThe issue transitions to Done when the release PR squash-merges to main (see §4b):
- The release PR body includes
Closes #N #M ...for everystatus-in-devissue — GitHub auto-closes them on merge status-in-devlabel remains on the closed issue (cosmetic, harmless —--state openqueries ignore it)- Board column: Done
main represents the current release. Day-to-day development flows into dev; main only receives merges at release time.
Run /release to automate this flow (pre-release checklist → version bump → release notes → PR → tag). The manual steps it orchestrates:
- Verify
devis green — tests pass, no open P0/P1 regressions - Open a PR from
dev→main - Review the cumulative diff since the last release
- Squash-merge — the squash commit message is the release notes
- Tag
main(e.g.,cli-v0.4.0for a CLI release — triggerspublish-cli.yml)
Automations that fire on push to main (keep main releasable):
publish-cli.yml— publishes CLI to PyPI + updates Homebrew formula on tagsync-docs-to-vertex.yml— syncsdocs/to the public Vertex AI search index
Branch protection (setup required — see repo Settings → Branches):
| Branch | Require PR | Require status checks | Restrict pushes |
|---|---|---|---|
main |
✅ | ✅ | Maintainers only |
dev |
✅ | ✅ | All contributors via PR |
Both branches must block direct pushes. Feature branches push freely.
The release cut in §4b updates main. If the release includes CLI changes (src/cli/), publish a new CLI version by tagging main:
git tag cli-v0.3.0
git push --tagsThe publish-cli.yml workflow automatically:
- Extracts the version from the tag name
- Injects it into
pyproject.tomlat build time - Publishes to PyPI
- Updates the Homebrew formula (version + sha256)
No manual version edits. The source has a placeholder 0.0.0; the real version comes from the tag. Runtime reads it via importlib.metadata.
Requires: HOMEBREW_TAP_TOKEN repo secret (fine-grained PAT with Contents read/write on abilityai/homebrew-tap).
Trinity Roadmap (GitHub Project #6) is the single view of all work.
| Column | Meaning |
|---|---|
| Todo | Backlog + Ready issues |
| In Progress | Actively being worked on |
| Done | Merged and shipped |
Labels are the authoritative surface (gh issue list --label ...). The project board mirrors them:
| Stage | Label | Board Column | Code location |
|---|---|---|---|
| Todo | (none or status-ready) |
Todo | — |
| In Progress | status-in-progress |
In Progress | feature branch |
| Blocked | status-blocked |
In Progress | feature branch |
| In Dev | status-in-dev |
In Dev | origin/dev |
| Done | (issue closed) | Done | origin/main |
Transitions:
- Todo → In Progress:
/claimaddsstatus-in-progress(via.github/workflows/claim.yml) - In Progress → In Dev: PR merge to
devaddsstatus-in-dev, removesstatus-in-progress(via.github/workflows/issue-status-on-merge.yml) - In Dev → Done: Release PR (dev → main) includes
Closes #Nfor eachstatus-in-devissue; GitHub auto-closes on merge
| Environment | URL | Purpose |
|---|---|---|
| Local | http://localhost |
Development and primary testing |
| Dev Server | (configured separately) | Optional pre-merge validation for P0/P1 features |
| Agent / Skill | Use When |
|---|---|
/test-runner |
After development to validate changes (run full test suite) |
feature-flow-analyzer |
After modifying feature behavior |
security-analyzer |
Before commits touching auth, credentials, or APIs |
Agents are invoked automatically by Claude Code when appropriate. The /test-runner skill can be invoked directly with optional arguments (e.g., /test-runner auth --verbose).
| Command | Purpose | SDLC Stage |
|---|---|---|
/read-docs |
Load project context | In Progress |
/cso [--diff|--comprehensive] |
Security audit (CSO mode) | In Progress |
/autoplan [issue-number] |
Auto-review pipeline (strategy + eng + security) | In Progress |
/implement <issue-number> |
End-to-end feature implementation | In Progress |
/review |
Pre-landing code review (structural issues) | In Progress |
/update-docs |
Update documentation | In Progress |
/feature-flow-analysis <feature> |
Document feature flow | In Progress |
/sync-feature-flows |
Sync feature flow docs with code changes | In Progress |
/security-check |
Validate no secrets in staged files | In Progress |
/add-testing |
Add tests for a feature | In Progress |
/test-runner [filter] [--verbose] |
Run API test suite with report | In Progress / Review |
/validate-pr <number> |
Validate PR against methodology | Review |
/validate-architecture |
Validate codebase against 16 architectural invariants | Weekly / Review |
/validate-schema |
Check schema.py vs migrations.py vs architecture.md for drift | Weekly |
/validate-config |
Check env vars across docker-compose, .env.example, and code | Weekly |
/groom |
Backlog grooming — audit board, rank issues, review priorities | Todo |
/sprint [issue-number] |
Full dev cycle (orchestrates all above) | All |
/release [version-tag] |
Cut a release — pre-release checklist, version bump, notes, dev → main merge, tag push |
Release (§4b) |
The docs/memory/ directory contains persistent project state:
docs/memory/
├── requirements.md ← SINGLE SOURCE OF TRUTH for features
├── architecture.md ← Current system design (~1000 lines max)
├── feature-flows.md ← Index of all feature flow documents
└── feature-flows/ ← Individual feature documentation
requirements.md ──defines──► What features exist
│
▼
GitHub Issues ──prioritizes──► What to work on next
│
▼
feature-flows/* ──documents──► How features work
│
▼
git log ──records──► What changed and when
│
▼
architecture.md ──maintains──► Current system state
Skills in .claude/skills/ define HOW to approach specific tasks:
| Skill | Principle | When |
|---|---|---|
verification |
No "done" claims without evidence | Before saying "done" |
systematic-debugging |
Find root cause BEFORE fixing | When fixing bugs |
tdd |
Failing test first, then minimal code | When writing new code |
code-review |
Verify feedback technically first | When responding to PR comments |
For every development session (or just run /sprint):
-
/claimthe issue (or assign yourself manually) - Create feature branch:
feature/<issue-number>-<slug> - Load context (
/read-docsor read relevant feature flows) -
/autoplan— plan review (strategy + eng + security) - Review and approve the plan
-
/implement— build the feature -
/review— pre-landing code review -
/cso --diff— security audit of changes (recommended for P0/P1) -
/test-runner— run API test suite -
/sync-feature-flows— update documentation - Open PR with
Fixes #N, run/validate-pr - Squash merge when approved
For PR reviews (reviewer/admin):
- Quick triage: issue link, priority label, PR size
-
/review— code quality (structural issues, auth, races) -
/validate-pr <number>— docs and process -
/cso --diff— security (P0/P1 or security-sensitive PRs) - Verify all critical findings resolved
- Squash merge, verify issue auto-closes
Weekly maintenance:
-
/validate-architecture— check codebase against architectural invariants -
/validate-schema— check schema.py vs migrations.py vs architecture.md for drift -
/validate-config— check env vars across docker-compose, .env.example, and code -
/generate-user-docs— regenerate user documentation from code -
/groom— audit backlog, rank issues, review priorities (manual, requires human review)
Automated schedules: The validation tasks and
/generate-user-docsrun automatically on thetrinitydev agent (Mon-Thu 9:00 UTC)./groomremains manual as it requires human judgment for prioritization decisions.