Privacy choices: we'd like to measure visits anonymously (our own cookie-free counter plus Google Analytics, which sets its own cookies; no ads) and load Beehiiv's newsletter sign-up, which may set its own cookies. Nothing optional runs until you choose. Privacy policy

AgentScout / Prompt library / Coding agents

Coding agents prompts

Prompts that keep a coding agent honest: plan first, prove the fix, never weaken a test.

Illustration of a checklist with arrows pointing at code blocks.Starter

Plan first, code second

Coding agentsClaude CodeCodex

Get a written plan and a chance to correct it before the agent touches your code.

Use it when: Starting any change bigger than a one-line fix.

Show promptHide prompt
Before you change any code, read [FILES OR AREA] and write a short plan: what you will change, in what order, and what could break. List the tests you will run to prove it works. Then stop after the plan and wait for me to say go. Do not write code yet.
Illustration of a diff panel with red and green lines and two comment bubbles.

Review this diff like a senior engineer

Coding agentsClaude CodeCodex

A review that finds real bugs instead of praising your code.

Use it when: Before you open a pull request.

Show promptHide prompt
Review the diff below as a senior engineer who has to maintain this code. For each issue, give the file and line, what is wrong, and why it matters. Rank issues: blocker, should fix, nit. Ignore style nits unless they hide a bug. Check specifically for: [1] logic errors and off-by-one mistakes, [2] missing error handling, [3] security issues (injection, secrets, auth), [4] tests that do not actually test the change. End with a one-line verdict: ship it, fix first, or needs rework.

Diff: [PASTE DIFF OR PR LINK]
Illustration of a failing test turning into a passing test, with the test file locked.

Fix the failure, not the test

Coding agentsClaude CodeCodex

Stops the agent from weakening a test just to make it green.

Use it when: A test is red and you are tempted to weaken it.

Show promptHide prompt
This test is failing: [TEST NAME AND FAILURE OUTPUT]. Find the real cause. Rules: do not change the test's assertions to make it pass, do not delete the test, and do not skip it. If the test itself is wrong, prove it: show what the code actually does versus what the test expects, and say which one is correct and why. Then fix the code (or, only with proof, fix the test) and show the test passing.
Illustration of tangled blocks becoming tidy blocks beside an equals sign.

Refactor without changing behavior

Coding agentsClaude CodeCodex

Clean up code that already works, with the tests as the guardrail.

Show promptHide prompt
Refactor [FILE OR FUNCTION] to [GOAL: e.g. remove duplication / make it readable / split it up]. Do not change what it does: same inputs, same outputs, same edge cases. Keep the public interface identical. After each step, run [TEST COMMAND] and stop if anything fails. At the end, list what changed and what you deliberately left alone.
Illustration of a bug inside a loop, then a checkmark.

Reproduce the bug before you fix it

Coding agentsClaude CodeCodex

No fix without a repro: proves the bug is real and the fix worked.

Use it when: A bug report lands with no repro steps.

Show promptHide prompt
Bug report: [PASTE REPORT]. Before fixing anything, write the smallest reproduction you can: the exact input, the exact steps, and the wrong output you see. If you cannot reproduce it, say so and list what you tried and what information is missing — do not guess a fix. Once it reproduces reliably, fix the cause (not the symptom), re-run the reproduction to prove it is gone, and run [TEST COMMAND] to check for regressions.

More prompts

Have a prompt worth sharing?

Send us one prompt that makes a coding, MCP or browser agent do better work. Hand-written and original only — we check every prompt by hand before it goes live.

Submit a prompt

Related