Coding agents (Claude Code, Copilot agents, Cursor and friends) don't just answer — they act: they read files, edit, run tests, and keep going. A vague instruction doesn't produce one bad answer anymore; it produces ten confident steps in the wrong direction before anyone checks.
A good agent prompt reads like a job description: the goal, the boundaries (what must not be touched), the definition of done, and how to verify. Front-load constraints — an agent discovers 'don't modify the public API' much more cheaply in its instructions than in your code review. For anything non-trivial, ask for a plan first: 'show me the files you'll change and why, then wait.'
Refactor internal/payments for readability. Job spec:
GOAL: reduce the 3 near-duplicate charge-retry code paths to one.
BOUNDARIES:
DEFINITION OF DONE:
go test ./internal/payments/... passes with no test edits, except adding coverage for the unified retry pathgit diff --stat under ~300 linesPROCESS: first reply with a short plan — files you'll change, the unified design, risks. Wait for my OK before editing.
Fix exactly one bug: users with a + in their email ([email protected]) get 'invalid email' at login.
Repro: curl -s localhost:8080/auth/login -d '{"email":"[email protected]", ...}' → 400.
SCOPE: the fix plus a regression test. Nothing else — no drive-by refactors, no formatting other files, no 'while I was here'.
If you find the root cause is bigger than the validator (e.g. it's mangled at ingestion), STOP and report instead of fixing beyond scope.
DONE: the curl above returns 200; new test covers + emails; full test suite still green.
Claude Code reads CLAUDE.md automatically — put permanent rules there (build commands, protected paths, conventions) and per-task specs in the prompt. Its plan mode formalizes the plan-first gate.