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 (exercises + docs components)Types 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:
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 test·cargo test·go test ./...·pytest), 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 dependencies