Thanks for taking the time to contribute. This project enforces a few non-negotiable disciplines; please read them before opening a PR.
git clone https://github.com/datascry/openroles.git
cd openroles
bun install
bunx lefthook install # wire up pre-commit hooks
bun test # full test suiteYou'll need:
- Bun 1.3.x (pinned in
.tool-versions) - lefthook —
brew install lefthook - git-cliff — only required if regenerating the changelog locally
Strict TDD — Red, Green, Refactor:
- Write a failing test first. Place it next to the source file (
thing.test.tsnext tothing.ts). Runbun test path/to/thing.test.tsand confirm it fails for the expected reason. - Implement minimally. Make the test pass with the smallest change possible. Don't add features the test didn't ask for.
- Refactor. Improve naming and structure with the safety net of the green test.
- Coverage. Run
bun test --coveragefor the file. Per-file thresholds: line ≥ 95%, function ≥ 95%, branch ≥ 90%. CI fails on any file below threshold. - Property tests. If the function has invariants, add a
fast-checkproperty intests/property/. - Commit with a Conventional Commits message. Format:
type(scope): summary.
type(scope): summary in imperative mood, ≤ 72 chars
Optional body explaining the *why*. Wrap at 72 chars.
Refs: #issue-number (optional)
Allowed types: feat, fix, docs, style, refactor, test, chore, ci, build, perf, revert.
commitlint runs in pre-commit and CI; non-conformant messages are rejected.
The lefthook configuration runs on every commit:
biome-check— lints + formats staged filestypecheck—tsc --noEmiton the affected packagecommitlint— validates the commit message
Bypassing hooks (--no-verify) is not permitted on this project. If a hook is wrong, fix the hook.
Before writing implementation code for a new feature:
- Open or update the relevant spec under
specs/. - If your change makes a new architectural decision (or supersedes an existing one), open a new ADR under
docs/adr/. Number it sequentially. - PR description must link the spec / ADR.
Each implementation phase ends with a fresh adversarial code review performed by an outside reviewer. Critical and Major findings remediate before the next phase begins. If you're contributing during a phase, expect your work to be re-read with hostility.
bun run lint # Biome check
bun run typecheck # tsc --noEmit
bun test # full suite + coverage
bun run e2e # Playwright e2e + a11y (Phase 4 onwards)
bun run lighthouse # local Lighthouse run (Phase 4 onwards)CI runs the same set on every PR.
By submitting a PR, you agree that your contribution is licensed under
the terms of this repository — code under MIT (see LICENSE), data
under CC BY-SA 4.0 (see LICENSE-DATA).