# Contributing

> How to work on the framework itself: setting up a machine, the repository, the rules, writing tests, the verification ladder, CI, pull requests and keeping the docs true.

Source: https://omardev29.github.io/rmp-docs/framework/contributing/index.html

These pages are for whoever changes the framework itself: Omar, a teammate, and the agents that work on it, on a laptop or in the cloud. They say what to install, where things are, which rules hold and why, how a change is proved, and how it reaches `main`. To make a game with the framework you need none of this: [Getting started](https://omardev29.github.io/rmp-docs/getting-started/index.html) is for that.

They are written for a person first and an agent second. An agent working in the repository reads the framework's `CLAUDE.md`, which holds the same rules in fewer words; these pages give the reason beside each one and every command in full, ready to paste. Like the rest of this site they are checked against the framework: every `rmp` command on them is one `rmp help` lists, every path exists, and the sentences about how the framework works are pinned to its source.

## The rule that outranks the others

Before any of the rest: the API has to be as simple as possible for the person making the game. Complexity may exist for the advanced case; it may not stand in the way of the simple one. The measure is a main menu, and it is three calls:

```cpp
rmp::ui::begin();
if (rmp::ui::button("Play")) play();
if (rmp::ui::button("Quit")) rmp::app::quit();
rmp::ui::end();
```

A change that makes those lines longer is wrong, whatever else it buys. A feature gets in by answering three questions, in this order: is there a real game that needs it; can it be made from what already exists, in which case it is an example and not new API; and does it make the menu longer, in which case it is redesigned until it does not. [The three-function menu](https://omardev29.github.io/rmp-docs/framework/why/the-three-function-menu.html) has the whole argument.

## The order to read them in

Top to bottom is the order a change goes through, from an empty machine to a merged pull request:

1. [Setting up](https://omardev29.github.io/rmp-docs/framework/contributing/setup.html): `rmp`, a clone, the pinned clang tools, Python, and the build image CI uses.
2. [The repository](https://omardev29.github.io/rmp-docs/framework/contributing/repository.html): what lives where, what `rmp new` copies into a game, and what a new file needs before it is accepted.
3. [The rules](https://omardev29.github.io/rmp-docs/framework/contributing/rules.html): the framework's rules for its own code, each with the reason it exists.
4. Writing tests: [unit tests, the headless UI, render and smoke](https://omardev29.github.io/rmp-docs/framework/contributing/tests.html); [examples as tests, and the scripts that play them](https://omardev29.github.io/rmp-docs/framework/contributing/examples-and-e2e.html); [properties, fuzzing and mutation](https://omardev29.github.io/rmp-docs/framework/contributing/properties-fuzzing-mutation.html); [coverage, and the gates](https://omardev29.github.io/rmp-docs/framework/contributing/coverage-and-gates.html).
5. [The verification ladder](https://omardev29.github.io/rmp-docs/framework/contributing/ladder.html): what to run before a change leaves your machine, in order, and when the slow stages are worth their time.
6. [CI](https://omardev29.github.io/rmp-docs/framework/contributing/ci.html): what a push and a pull request run, the debug lane, the full matrix, and how to read a red run.
7. [Pull requests](https://omardev29.github.io/rmp-docs/framework/contributing/pull-requests.html): the branch, the template, the checks `main` requires, the API-change approval, and the commits.
8. [Keeping the docs true](https://omardev29.github.io/rmp-docs/framework/contributing/docs.html): this site, the commit it documents, and the check that says when a change broke a page.

Upgrading a dependency, rebuilding the build image and the changes the stores force every year are in [Maintaining](https://omardev29.github.io/rmp-docs/framework/maintaining/index.html).

## A change, in short

1. A branch of its own, from an up-to-date `main`. If an issue labelled `nightly-finding` is open, it comes first.
2. The change, and a test that fails without it. Every test and every gate is seen red on the mistake it exists for before it is trusted green.
3. `rmp fmt`, `rmp lint` and `rmp test` on your machine, and the slower stages the change calls for: `rmp test examples`, `rmp test sanitize`, `rmp test fuzz`, `rmp test coverage`.
4. Where it matters, the same in the build image, which is what CI runs.
5. A pull request that fills in the template: what changed and why, what ran where, what was seen red, and what is not verified.
6. Every required check green, and Omar's approval when the change touches the public API or the `.toml`.
7. The pages of this site that the change makes untrue, fixed in the same stretch of work.

## For an agent

The framework's `CLAUDE.md` is loaded by Claude Code in every session in the repository, and `.claude/skills/` holds the detail it loads on demand: the code style, API design, the verified facts about Clay, and the verification ladder. Neither is copied into a game. `CLAUDE.md` also keeps the list of mistakes that have already cost time once, each with how it was found; read the entry for an area before changing it. Everything on these pages applies to an agent the same way: the ladder before a pull request, the template filled in honestly, and `nightly-finding` issues first.
