Skip to content

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 languages

Types of Contributions

Add a New Pattern

  1. Open an Issue to propose the pattern
  2. Follow SOP 01: New Pattern
  3. Submit a PR with the filled-out checklist

Add a Language Implementation

Improve Documentation

  • Fix typos, clarify explanations, improve diagrams
  • Use commit type docs: for revising existing content; use feat: 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 test runs 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 dependencies

Pick 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).

Released under the MIT License.