# Pre PR Checklist

> Pre PR Checklist is an Agent Skill for testing & quality published in the golemcloud/golem repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Final checks before submitting a pull request. Use when preparing to create a PR, to ensure formatting, linting, and the correct tests have been run.

- Skill name: `pre-pr-checklist`
- Category: [Testing & Quality](https://www.openparable.com/skill/testing-quality/1)
- Source: https://github.com/golemcloud/golem/blob/HEAD/.agents/skills/pre-pr-checklist/SKILL.md
- Repository: golemcloud/golem (1,605 GitHub stars when collected)

## SKILL.md

# Pre-PR Checklist

Run through this checklist before creating a pull request. It ensures code quality gates pass and the right tests have been executed.

## Step 1: Run cargo make fix

**Always required.** This runs `rustfmt` and `clippy` with automatic fixes:

```shell
cargo make fix
```

Address any remaining warnings or errors that couldn't be auto-fixed.

## Step 2: Run the Right Tests

Choose tests based on what you changed. **Do not run `cargo make test`** — it runs everything and takes a very long time.

| What Changed | Test Command |
|---|---|
| Core logic, shared types, utilities | `cargo make unit-tests` |
| Worker executor functionality | `cargo make worker-executor-tests` |
| Service integration | `cargo make integration-tests` |
| CLI changes | `cargo make cli-integration-tests` |
| HTTP API endpoints | `cargo make api-tests-http` |
| gRPC API endpoints | `cargo make api-tests-grpc` |
| Rust SDK (`sdks/rust/`) | `cargo test -p golem-rust` + `cargo make worker-executor-tests` |
| TypeScript SDK (`sdks/ts/`) | `npx pnpm run test` (in `sdks/ts/`) + `cargo make cli-integration-tests` |
| MoonBit SDK (`sdks/moonbit/`) | `moon test` (in `sdks/moonbit/golem_sdk/`) |
| CLI structured output/schema | `cargo test -p golem-cli cli_output_schema_ --lib` + `cargo make check-cli-output-schema` |
| CLI JSON output affecting skill tests | Update affected `golem-skills/tests/harness` code, tests, or scenarios. Run `npm run build && npm test` in `golem-skills/tests/harness` only if harness TypeScript code/tests changed. |

If your change spans multiple areas, run multiple test suites.

### Worker executor test groups

For faster iteration, worker executor tests can be run by group:

```shell
cargo make worker-executor-tests-group1
cargo make worker-executor-tests-group2
cargo make worker-executor-tests-misc
```

## Step 3: Regenerate Artifacts (if applicable)

| What Changed | Regeneration Command |
|---|---|
| HTTP API endpoints | `cargo make generate-openapi` then `cargo clean -p golem-client && cargo build -p golem-client` (also refreshes `docs/src/content/rest-api/*.mdx`) |
| Service config structs/defaults | `cargo make generate-configs` |
| WIT interfaces | `cargo make wit` |
| TS SDK runtime code | `npx pnpm run build-agent-template` (in `sdks/ts/`) |
| Skill catalog (`golem-skills/skills/**`) | `cargo make generate-docs-skills` (refreshes `docs/src/content/how-to-guides/*.mdx`) |
| CLI output schema summary | `cargo make update-cli-output-schema-summary` |

## Step 4: Verify Build

```shell
cargo make build
```

## Step 5: Review Staged Files

Only stage files directly related to your change:

```shell
git diff --stat          # Review unstaged changes
git add <specific-files> # Stage only relevant files
```

**Never use `git add -A` or `git add .`** — they may include unrelated changes from concurrent work.

## Quick Reference

Minimum steps for any PR:

```shell
cargo make fix           # Format + lint
cargo make build         # Full build
# Run appropriate tests from the table above
```

## Checklist

1. [ ] `cargo make fix` run — no remaining warnings
2. [ ] Correct test suite(s) run — all pass
3. [ ] Artifacts regenerated if applicable (OpenAPI + docs MDX, configs, WIT, agent template, How-To Guides)
4. [ ] `cargo make build` succeeds
5. [ ] Only relevant files staged for commit

---

Source: https://www.openparable.com/skill/testing-quality/pre-pr-checklist (OpenParable). Cite the canonical URL above.
