How to Contribute
We welcome contributions! Here's how to get started.
Quick Start
bash
git clone https://github.com/Totoro-jam/battle-tested-patterns.git
cd battle-tested-patterns
pnpm install
pnpm dev # Start docs dev server
pnpm test # Run ALL tests: docs components + exercises in all 4 languagesTypes of Contributions
Add a New Pattern
- Open an Issue to propose the pattern
- Follow SOP 01: New Pattern
- Submit a PR with the filled-out checklist
Add a Language Implementation
- Pick a pattern that's missing your language
- Follow SOP 03: Multi-Language Implementation
- Implementations must be idiomatic — not line-by-line translations
Fix a Broken Link
- Follow SOP 06: Broken Link Fix
Improve Documentation
- Fix typos, clarify explanations, improve diagrams
- Use commit type
docs:for revising existing content; usefeat:when you add a whole new content unit (a new pattern, case study, or guide page)
Quality Bar
Every pattern must meet these minimums:
- ≥ 2 production proofs with precise GitHub links (to line numbers)
- TypeScript implementation + ≥ 1 other language (Rust/Go/Python)
- Exercise files in all 4 languages (TS, Rust, Go, Python) + answer files
- Chinese translation with identical code blocks
- All tests pass (
pnpm testruns all 4 languages + docs), no lint errors
See the full checklist in the PR template.
Commit Convention
We use Conventional Commits:
text
feat: add cooperative-scheduling pattern
fix: update broken Linux source link in bitmask
docs: improve Core Idea diagram for double-buffering
test: add advanced exercise for min-heap
ci: add Go test step to CI workflow
chore: update dependenciesPick the type by reader-facing impact, not by which files changed:
- A whole new content unit (pattern, case study, guide page) →
feat:(this is what bumps the version and lands in the changelog as a milestone). - Revising existing content (deepening, polishing, fixing wording) →
docs:(shown in the changelog, but does not bump the version). - Internal-only changes —
.sop/updates, tooling, config →chore:(kept out of the reader-facing changelog).