Skip to content

Contributing

Maelstrom is an Nx monorepo with published TypeScript packages, a demo app, and this Astro docs site. Good contributions keep package boundaries clear, include the right tests, and treat public API documentation as part of the shipped surface.

  1. Fork the repository.
  2. Clone and install dependencies with bun install.
  3. Create a branch for your changes.
  4. Make the smallest focused change that solves the issue.
  5. Add or update tests for code changes.
  6. Run the relevant package target, then broader verification when needed.
  7. Submit a pull request with the user-facing behavior and verification evidence.

Every commit must be signed off:

Terminal window
git commit -s -m "feat: ..." # appends a "Signed-off-by" trailer

This certifies you have the right to submit the change under the project’s license. To have the trailer added automatically, enable the bundled hook once per clone:

Terminal window
git config core.hooksPath .githooks

The dco check is required on main and runs on every pull request. A commit missing its sign-off turns the check red and a bot comment lists the offending commits. See Enforcement in the root CONTRIBUTING.md for how to fix it.

Because you contribute from a fork (step 1 above), every commit you push needs a sign-off. The exemption for commits from a bot account applies only to branches in the maelstrom-co/maelstrom repository itself, so it will never cover a commit on your branch, whatever account that commit appears to be from.

See the root CONTRIBUTING.md for the full DCO 1.1 text, the enforcement rules (what counts as a match, what’s exempt), and sign-off instructions for tools other than plain git (jj, JetBrains IDEs, lazygit, Sourcetree).

When you open a pull request, optimize for reviewability rather than volume:

  • Keep the branch focused on one problem or one coherent slice of work.
  • Explain the user-facing behavior change in the PR description, not just the implementation detail.
  • Include the exact verification you ran so a reviewer can reproduce it quickly.
  • Call out follow-up work explicitly instead of hiding it in TODO comments.

If the change affects public API or generated docs, mention which package or page a reviewer should inspect after the docs build.

The credentialed voice benchmark runs against a deployed preview for an open, same-repository PR. Apply both deploy-preview and bench-voice; deployment approval remains tied to the exact head SHA, and bench-voice does not authorize deployment. Workflow and harness changes must land on the default branch before they can run.

A deployment or label change asks for the benchmark’s preview approval only when both labels are live on the PR. Removing either label stops an active benchmark at its next periodic check.

To request a fresh paid benchmark after the current PR/head was already claimed, manually run Deploy PR Preview from the default branch with the PR number and new_benchmark_request set to true. This authorizes one benchmark per GitHub workflow attempt; rerunning that opted-in workflow authorizes another attempt, while duplicate execution within the same attempt remains suppressed. Leave the input false for normal deduplication. The open-PR, label, approved/deployed-SHA, preview-URL, ownership, and cleanup checks still apply.

Benchmark request history is stored in bot-owned PR comments. The active claim rolls older identities into immutable, hash-linked archive comments every 256 entries; do not edit or delete them. Missing or corrupted history fails closed. Comment discovery is bounded to 50 pages of 100 comments, so PRs exceeding 5,000 comments cannot launch the benchmark until that limit is addressed.

Terminal window
# Install dependencies
bun install
# Run the demo app
nx serve demo
# Build all packages
nx run-many -t build
# Run all tests
nx run-many -t test
# Type check all packages
nx run-many -t typecheck

Package tests can depend on built outputs from other packages. If a test fails because an upstream package is stale, build the dependency before rerunning the focused test.

Maelstrom packages build on each other in layers:

flowchart TD
  Protocol["protocol"]
  Client["client"]
  Engine["engine"]
  React["react"]

  Protocol --> Client
  Protocol --> Engine
  Client --> React

Keep changes in the lowest package that owns the behavior. For example, message shapes belong in @maelstrom-co/protocol, orchestration state belongs in @maelstrom-co/client, and React-specific hooks belong in @maelstrom-co/react.

Anything re-exported from a package src/index.ts appears in the generated API reference. If you add or change a public symbol, update its JSDoc in the source file and verify that the generated page still reads correctly.

Read Document a public symbol before changing a public export.

Use focused commands first, then broaden only as far as the change requires:

  • Package code change: run that package’s tests and typecheck target.
  • Cross-package contract change: run affected downstream package tests too.
  • Docs-only change: run the docs build.
  • Public API/JSDoc change: build docs and inspect the generated reference page.
  • Open an issue on GitHub.
  • Check existing issues and pull requests for related context.
  • Link to the package, page, or API reference affected by your change so reviewers can verify the right surface.