Thanks for your interest in contributing! This guide covers everything you need to get started.
git clone https://github.com/RANDSUM/randsum.git
cd randsum
bun install
bun run check:all # Verify everything workspackages/roller/-- Core dice engine (all packages depend on this)packages/notation/-- Dice notation parser (zero dependencies)packages/games/-- Game system packages (subpath exports per game)packages/display-utils/-- Browser utilities for step visualization and StackBlitz integrationapps/site/-- Documentation site (Astro)
Game packages are code-generated from .randsum.json specs. To add a game:
- Create
packages/games/<shortcode>.randsum.jsonwith the game spec - Run
bun run --filter @randsum/games gento generate the TypeScript module - Add tests in
packages/games/__tests__/<shortcode>.test.ts - Add a subpath export to
packages/games/package.json
See packages/games/CLAUDE.md for detailed patterns and conventions.
- Framework:
bun:test(import { describe, expect, test } from 'bun:test') - Tests go in
__tests__/directories - Property-based tests use
fast-check(suffix:.property.test.ts) - Coverage target: 80% project, 70% patch
- Run all tests:
bun run test - Run one package:
bun run --filter @randsum/roller test
- TypeScript strict mode with
isolatedDeclarationsandexactOptionalPropertyTypes constonly (nolet),import typefor type-only imports- No
any, noas unknown as T-- use type guards - Explicit return types on exported functions
- Prettier: no semicolons, single quotes, no trailing commas
See the root CLAUDE.md for the full TypeScript conventions reference.
Run bun run fix:all to auto-fix lint and format issues.
- Branch from
main - Make focused changes with tests
- Run
bun run check:allbefore pushing - Use conventional commit messages (
feat:,fix:,docs:,chore:,test:,refactor:) - Open a PR with a clear description of what and why
Lefthook runs on commit: ESLint, Prettier, and typecheck. If hooks fail, run bun run fix:all.
- GitHub Issues -- bugs and feature requests
- Project Board -- roadmap and priorities
- Dice Notation Spec -- notation syntax reference
- Architecture Decisions -- key design decisions and rationale