PromptZone - Leading AI Community for Prompt Engineering and AI Enthusiasts

Working with coding agents

Coding agents fail in ways ordinary prompting does not. They run for a long time before you find out they misunderstood, they touch files you did not expect, they declare success on work that does not build, and they cheerfully rewrite a test until it passes instead of fixing the code underneath.

These prompts are the guardrails: scoping a task tightly enough that an agent cannot wander, getting a plan before any edit is made, forcing an honest report of what actually changed, and reviewing agent-written code for the specific failure modes agents have rather than the ones humans have. They assume you are supervising something capable and fallible, which is the accurate model.

Curated

Break an agent out of a loop

You have attempted this several times without success. Stop trying. Instead: state precisely what you have tried and what happened each time, name the assumption common to all your attempts, describe what would have to be true for that assumption to be wrong, and propose the single cheapest experiment that would distinguish between the assumption holding and failing. Do not attempt another fix in this response. History: {{history}}

Fill in: What the agent has tried so far and how each attempt failed.

Known limits: Works only if the loop is caused by a wrong assumption; a genuinely missing capability needs a different intervention.

Curated

Compare two approaches an agent proposed

You proposed two approaches. Argue against each in turn as a hostile reviewer would, then state which you would ship and what would change your mind. For each: the failure mode most likely to bite in production, what it costs to reverse once shipped, and the hidden work it creates that is not visible in the proposal. Do not conclude that both are reasonable — commit to one. Approaches: {{approaches}}

Fill in: Both approaches as the agent described them.

Known limits: Forcing a choice can produce false confidence on genuinely close calls; read the argument, not just the verdict.

Curated

Constrain an agent to a blast radius

Complete this task under a hard constraint: you may modify only the files listed and nothing else. If completing the task correctly requires touching a file outside that list, stop and explain what needs to change and why, rather than working around the constraint with a hack inside the allowed files. Do not add a new file unless the list permits it. State at the end which allowed files you actually changed. Task and allowed files: {{task}}

Fill in: The task plus the explicit list of files the agent may touch.

Known limits: A too-tight list produces a refusal, which is the intended behaviour but can feel like failure — widen the list rather than dropping the constraint.

Curated

Debug with an agent without letting it guess

We are debugging together and you must not propose a fix yet. State your top three hypotheses for the cause, ranked. For each, give the single observation that would confirm it and the single observation that would eliminate it, and tell me exactly what to run or look at to get that observation. Then stop. When I report back, update the ranking rather than starting over. Symptom: {{symptom}}

Fill in: The symptom, what changed recently, and what you have already ruled out.

Known limits: Only pays off across several turns; a single response is just a hypothesis list.

Curated

Decide whether to hand a task to an agent at all

Assess whether this task is a good fit for an autonomous coding agent. Judge it on: how verifiable the result is, whether the context needed fits in what the agent can see, how reversible a wrong answer is, whether it needs judgement about product intent rather than code, and how expensive a plausible-but-wrong result would be. Give a verdict of good fit, fit with supervision, or do it yourself, and say which factor weighed heaviest. Be willing to say the task is not worth delegating. Task: {{task}}

Fill in: The task and what verification exists for it (tests, staging, review).

Known limits: Biased toward saying yes when a task sounds mechanical; weight reversibility yourself.

Curated

Get a plan before the agent edits anything

Before changing any file, produce a plan for this task: the order of changes and why that order, every file you intend to touch with a one-line reason each, the assumptions you are making that could be wrong, what you will do if an assumption fails, and how you will verify each step. Then stop and wait for approval. Do not write code in this response. If the task is underspecified, list the questions instead of a plan. Task: {{task}}

Fill in: The task, and whatever the agent already knows about the codebase.

Known limits: Some agents narrate a plan and start editing anyway; check that no files changed before approving.

Curated

Make an agent read the codebase before proposing a change

Before proposing any change, investigate and report. Find how this concern is already handled elsewhere in the codebase, name the existing pattern and where it lives, state whether the task should follow that pattern or deliberately break from it, and identify the code that would need to change together with it. Cite specific files and functions you actually read — if you did not read a file, do not cite it. Only then propose an approach. Task: {{task}}

Fill in: The task plus the existing code the agent should learn from — in a live session it reads the repo itself; pasted here it works from what you give it.

Known limits: An agent with no file access will still produce confident citations, so verify every file it names actually exists.

Curated

Review code an AI agent wrote

Review this agent-written change for the failure modes specific to agent output, not general style. Check for: tests whose assertions were weakened to pass, error handling that swallows the failure the task was about, invented APIs or config keys that do not exist, duplicated logic that already exists elsewhere in the codebase, changes outside the stated scope, and confident comments describing behaviour the code does not have. Quote each and say what you would verify. Change: {{change}}

Fill in: The diff, plus the task the agent was originally given.

Known limits: Cannot know what already exists in your codebase, so the duplicated-logic check is a prompt to grep rather than a finding.

Curated

Scope a task before handing it to an agent

Turn this loose request into a brief tight enough that a coding agent cannot drift. Produce: the single outcome that defines done, the files or modules in scope, an explicit out-of-scope list, the constraints that must hold (public interfaces, migrations, dependencies), how the result will be verified, and the two decisions the agent should stop and ask about rather than guess. Keep it under 200 words. Do not design the solution. Request: {{request}}

Fill in: The request as you'd say it to a colleague, plus any constraints you already know.

Known limits: Only as good as your sense of scope; if you don't know which files are involved it will guess, and that guess becomes the boundary.

Curated

Turn a repeated agent session into a reusable instruction

You have completed this kind of task several times. Write the reusable instruction that would let it be done correctly first time without re-deriving anything: the trigger describing when it applies, the ordered steps, the decisions that recur and how to resolve each, the mistakes made along the way and how to avoid them, and how to verify the result. Write it for an agent with no memory of this session. Omit everything specific to this one instance. Session: {{session}}

Fill in: What you did, in order, including the wrong turns.

Known limits: Over-generalises from a single instance; run it after the third time, not the first.

Curated

Verify a claim that the work is done

An agent reports the task is complete. Write the verification checklist a reviewer should run before believing it, ordered cheapest first. Include the specific commands to run, what output would indicate a real pass versus a hollow one, the manual check no command covers, and the one thing most likely to be broken despite the tests passing. Be concrete to this task rather than generic. Task and claim: {{claim}}

Fill in: The original task and exactly what the agent said it did.

Known limits: Cannot run anything itself; this produces the checklist, you run it.

Curated

Write the project instructions an agent needs

Draft the project instruction file an AI coding agent should read before working in this repository. Cover only things an agent could not infer from reading the code: conventions that are enforced but invisible, commands to run tests and lint, directories that are generated and must not be hand-edited, subsystems where changes are risky and why, and the review standards a change must meet. Omit anything obvious from the file tree. Under 400 words. Repository: {{repo}}

Fill in: Your stack, test and lint commands, and the conventions people actually get corrected on in review.

Known limits: Produces generic advice unless you supply the corrections your team repeats — those are the real content.