# PR + test authoring

A reusable skill the "From incident to fix, without the scramble" recipe pulls in. Add it once and every agent on the team can use it.

Open a PR that guards the failing path and adds a regression test.

## Method
1. Locate the code path identified by root-cause tracing.
2. Write a guard that prevents the failure — validation, fallback, or bounds check.
3. Write a regression test that reproduces the original failure and confirms the guard fixes it.
4. Run the test suite locally to confirm the new test passes and nothing else breaks.
5. Open a PR containing the guard, the test, and a description linking the root cause.

## Rules
- Every fix ships with a regression test; never open a guard without a test proving it.
- The PR description states the root cause and the failing endpoint plainly.
- Never merge automatically — the PR always waits for human approval.
- Keep the guard scoped to the failing path; don't fold in unrelated refactors.

## Output
An open PR — guard, regression test, linked root-cause description — awaiting approval, plus the filed P1 bug.
