Building Software
Sections

Contents Section 9, Delegating to Agents

Telling Agents What, Not How

A prompt states what you want: the goal, the facts the agent cannot see, the boundaries of what it may touch and the checks that prove it done. The agent chooses the steps, and a task is as large as its checks can verify.

Section 9 of 9, subsection 2 of 6. Depth: do. Core 23 of 25. A 10-minute read.

Mistakes to catch in review

  1. An agent told to 'make the tests pass' that deletes or weakens the tests.

  2. A request to fix one module that the agent treats as permission to edit the build scripts, the CI configuration and a shared library.

  3. A date-parsing helper reinvented because the prompt never pointed to the one that already exists.

  4. A prompt that dictates the steps, so the agent carries out the writer's partial diagnosis faithfully and reports done while the bug survives in a file the steps never named.

  5. An outcome no check can fail, such as 'the PDF should look professional', handed to the agent as part of the definition of done.

Telling an Agent What You Want

You typed: "Invoice due dates are off by one day for some customers. Fix it and make sure the tests pass." Twenty minutes later the agent is done.

It added a new formatDueDate function inside the invoices module, changed the CI configuration to run tests in a different time zone, and deleted an assertion in a test that started failing along the way. The tests pass.

Each of those changes is a reasonable reading of what you wrote. You never said which date helper to use, which files were off limits, or what "fixed" would look like. The agent settled each of those questions without you.

The tempting repair is to take the wheel: tell it which file to open, which line to change and what to type. That prompt fails in a different way. A prompt should say what you want precisely enough that someone could check the result: the outcome, the facts the agent cannot see, the limits on what it may touch, and the evidence that proves it done. The steps belong to the agent. The criteria themselves are the subject of Requirements and Acceptance Criteria.

What the agent does with silence

As How Agents Work and How They Fail showed, the model knows only the text in its context plus the patterns from training. When the request leaves a decision open, the agent may infer, inspect the repository, or ask.

"Fix it" leaves the method open. The agent does not know that src/lib/dates.ts already has a function for exactly this, so it is as ready to write a new one as to search for the old one, and the codebase ends up with two date helpers that handle time zones slightly differently.

"Make sure the tests pass" states a goal with several routes. Fixing the code is one. Changing the test, loosening an assertion or skipping a test are others, and all of them satisfy the sentence you wrote. An agent in a loop that stops when the tests are green can take any of them.

The request also sets no boundary around the module. If the existing instructions and permissions allow it, the agent may edit the build scripts, the CI configuration or the shared library, and editing them can look like progress toward the goal.

The bug

Due dates are stored as date-only strings like "2026-10-15". The invoice page calls new Date(dueDate), and JavaScript parses a date-only ISO string as midnight UTC. Formatted in the browser for a customer in Los Angeles, midnight UTC on October 15 is 17:00 on October 14 local time, so the invoice shows the 14th. The test suite runs with TZ=UTC, where the two dates agree, so it never caught the bug.

The stored due date `"2026-10-15"` goes into `new Date(dueDate)`, highlighted, which makes it midnight UTC. One path leads to a Los Angeles browser, which shows 17:00 on October 14, the 14th. The other leads to the test suite under `TZ=UTC`, which shows October 15; beside it the stored date reads October 15, and both feed a box reading test suite passes, the two dates agree. A note reads so it never caught the bug.
new Date(dueDate) turns the stored date into midnight UTC, which a Los Angeles browser shows as 17:00 on October 14. The test suite runs with TZ=UTC, where the two dates agree, so it never caught the bug.

You can watch both halves of that. The time zone passed to each call plays the part of the customer's browser.

TypeScriptRuns in your browser
// The renderer's current code. timeZone stands in for the customer's browser.
function renderDueDate(dueDate: string, timeZone: string): string {
  return new Date(dueDate).toLocaleDateString("en-US", { timeZone, month: "short", day: "numeric", year: "numeric" });
}

// A stand-in for formatCalendarDate: the date-only string becomes midnight UTC,
// and formatting in UTC reads back the same calendar date wherever the customer is.
function formatCalendarDate(isoDate: string, locale: string): string {
  return new Date(`${isoDate}T00:00:00Z`).toLocaleDateString(locale, { timeZone: "UTC", month: "short", day: "numeric", year: "numeric" });
}

const expected = "Oct 15, 2026";
for (const tz of ["UTC", "America/Los_Angeles", "Asia/Tokyo"]) {
  const before = renderDueDate("2026-10-15", tz);
  console.log(`${tz}: old code shows ${before} (test ${before === expected ? "passes" : "fails"}), fixed code shows ${formatCalendarDate("2026-10-15", "en-US")}`);
}

The old code fails only west of UTC, so any check of a fix has to run in a time zone like Los Angeles.

A prompt made of steps

Suppose you found that cause yourself, in src/invoices/render.ts, and wrote the fix down as instructions:

Output
Open src/invoices/render.ts. Find the line that calls new Date(dueDate).
Replace it with formatCalendarDate(dueDate, locale), imported from
src/lib/dates.ts. Then run bun test and tell me when it passes.

The agent does exactly that. Every step is done, the suite is green, and a customer in Los Angeles who opens the invoice list still sees October 14. The list page lives in src/invoices/list.ts and has its own new Date(dueDate). Your diagnosis covered one file, so your steps covered one file, and the agent had no reason to look further.

Two rows. The top row, the step prompt: open, replace, run tests, leads to the agent following the steps and editing `render.ts` only, then to the suite passing under `TZ=UTC`, then to `list.ts` still showing Oct 14. A note reads steps inherit the diagnosis. The bottom row, the outcome prompt, highlighted: every place, every time zone, leads to the agent searching and finding `render.ts` and `list.ts`, then to a check per place in Los Angeles and UTC, then to goal met with evidence in the report. A note reads the goal sends it searching.
The step prompt carries one diagnosis, so the agent edits render.ts, the suite passes under TZ=UTC, and list.ts still shows Oct 14. The outcome prompt says every place and every time zone, so the agent searches, and a check per place proves the goal.

Three things went wrong at once. The prompt carried your diagnosis as steps, so the agent inherited its blind spot. It named no outcome, so nobody had anything to hold the result against; "tell me when it passes" checks a suite that already passed before the change. And searching a repository for every place that formats a due date is quick work for an agent, which the steps gave it no reason to do.

That last cost grows with time. Richard Sutton's 2019 essay "The Bitter Lesson" observed that across decades of AI research, methods built on human knowledge of how to solve a problem were overtaken by general methods that scale with computation. Daniel Miessler applies it to prompts and harnesses in his essay "Bitter Lesson Engineering", with the rule "Don't confuse the 'what' with the 'how'." Steps written for last year's model hold back this year's. What you want, and the facts about your system, stay useful however capable the model becomes.

A prompt made of outcomes

Here is the same task written as what you want.

Output
Goal
Invoice due dates display one day early for customers west of UTC.
Everywhere the app shows an invoice due date, a date stored as
"2026-10-15" must display as "Oct 15, 2026" with locale en-US, in every
time zone. Other locales keep the same calendar date in their existing
format.

Context
- Due dates are stored as date-only strings ("2026-10-15").
- src/invoices/render.ts formats them with new Date(dueDate), which parses
  a date-only string as midnight UTC. That is the likely cause; confirm it.
- src/lib/dates.ts already exports formatCalendarDate(isoDate, locale),
  which treats a date-only string as a calendar date. Use it. Do not add
  another date helper.
- Tests run with TZ=UTC, which is why they never caught this.

Scope
- You may edit files in src/invoices/ and test/invoices/.
- Do not edit src/lib/, package.json, the lockfile, or anything in .github/.
  If the fix seems to need one of those, stop and explain why.
- Do not modify or delete existing tests or assertions.
- Other problems you notice are out of scope. List them in your report.

Done when
- For each place that displays a due date, a new test renders a due date
  of "2026-10-15" with locale en-US and expects "Oct 15, 2026".
- Against the original code, with the time zone set to America/Los_Angeles,
  each new test fails because it displays "Oct 14, 2026". Against your
  change, the same tests and setup pass.
- The full suite passes with the rendering time zone set to
  America/Los_Angeles and then to UTC. If any tests run in a browser,
  set the browser context's time zone, not only TZ for the test runner.
- Your report lists every place you found that displays a due date, the
  commands you ran after your last edit with their output and time-zone
  configuration, and the files you changed.

Every line describes the result or the system, and the order of work is the agent's. Finding the list page is now its problem, because the goal says "everywhere" and the report has to show what it found.

The prompt still names render.ts and the helper. Those are facts about your system that the agent would otherwise have to discover or guess. "Use it. Do not add another date helper." is a preference and a constraint, a statement about what an acceptable result looks like, so it counts as what. A smarter model would still need to be told it, because the convention lives in your head.

The test for every line

Every line of a prompt is either a statement about the result or a step toward it. To sort them, ask of each line: would a more capable model, given the same facts, make this line unnecessary? If yes, the line is how. Cut it, or rewrite it as the outcome, fact or check it was protecting.

Line What it states Kind
Open src/invoices/render.ts. A step How
render.ts formats them with new Date(dueDate) A fact about the code What
Replace it with formatCalendarDate(...) A step built on one diagnosis How
Use it. Do not add another date helper. A convention the result follows What
Do not edit ... anything in .github/. A boundary What
Then run bun test and tell me when it passes. A step How
the commands you ran after your last edit The evidence you will check What

The same knowledge can be written either way. "Open render.ts and find new Date" and "render.ts formats them with new Date(dueDate)" carry the same information about the code. The order stops the agent's thinking at your diagnosis. The fact leaves it free to find a second call site.

Most how lines come from a worry. "Run bun test" was a worry about unverified work. The done-when line asking for the commands and their output, run after the last edit, answers the same worry as a requirement on the result, whatever route the agent takes. When you catch yourself writing a step, write down the worry underneath it as an outcome or a check.

Checks on the outcome work the same whoever chose the steps. This block turns the goal into a check and runs it on the code the step prompt left, and on code that meets the goal.

TypeScriptRuns in your browser
// The original code that both files started with.
const buggy = (iso: string, timeZone: string) =>
  new Date(iso).toLocaleDateString("en-US", { timeZone, month: "short", day: "numeric", year: "numeric" });
// A stand-in for formatCalendarDate from src/lib/dates.ts.
const formatCalendarDate = (iso: string, locale: string) =>
  new Date(`${iso}T00:00:00Z`).toLocaleDateString(locale, { timeZone: "UTC", month: "short", day: "numeric", year: "numeric" });

type Surfaces = Record<string, (iso: string, timeZone: string) => string>;
// After the step prompt: render.ts changed as instructed, list.ts untouched.
const afterSteps: Surfaces = { "render.ts": (iso) => formatCalendarDate(iso, "en-US"), "list.ts": buggy };
// Code that meets the goal: every place that displays a due date uses the helper.
const meetsGoal: Surfaces = { "render.ts": (iso) => formatCalendarDate(iso, "en-US"), "list.ts": (iso) => formatCalendarDate(iso, "en-US") };

// The suite runs under TZ=UTC only.
const suiteUnderUtc = (s: Surfaces) => Object.values(s).every((show) => show("2026-10-15", "UTC") === "Oct 15, 2026");
// The goal: every place, every time zone, shows the stored calendar date.
function checkGoal(name: string, s: Surfaces): void {
  const failures: string[] = [];
  for (const [file, show] of Object.entries(s))
    for (const tz of ["UTC", "America/Los_Angeles", "Asia/Tokyo"]) {
      const shown = show("2026-10-15", tz);
      if (shown !== "Oct 15, 2026") failures.push(`${file} in ${tz} shows ${shown}`);
    }
  console.log(`${name}: suite ${suiteUnderUtc(s) ? "passes" : "fails"}, goal ${failures.length ? `fails (${failures.join("; ")})` : "met"}`);
}
checkGoal("after the step prompt", afterSteps);
checkGoal("meets the goal", meetsGoal);

The step prompt's result passes the suite and fails the goal, though every step was carried out as written. Only a check on the outcome exposes it.

What each section adds

The context section does the work a new teammate would do in their first hour. It names the file, the suspected cause and the helper that already exists, so the agent has an implementation to call and a reinvented one is easy to spot afterward.

Context also means leaving things out. Pasting the whole invoices module, the last three incident reports and a style guide makes the prompt long without making it clearer, and irrelevant context can bury the task's own instructions. Include what the fix needs: the files involved, the conventions that apply, and any past decision that rules out an obvious approach. Standing context that applies to every task, such as the test command and what good work looks like to you, belongs in files the agent reads at the start of every session, which the lesson on harness design covers.

A next edit branches three ways: to make it, for edits in the allowed directories; to the highlighted stop, explain, when it needs `src/lib/`, `package.json`, the lockfile or `.github/`; and to list in report, for other problems.
With a scope list, each edit has a defined exit: edit inside the allowed directories, stop and explain when the fix seems to need src/lib/, package.json, the lockfile or .github/, and list other problems in the report instead of fixing them in the diff.

The scope section turns a vague permission into a list. Naming the directories the agent may edit, and the ones it may not, makes an edit to .github/ a visible violation. The instruction to stop and explain gives the agent something to do other than push through the boundary when the task does need to cross it. The line about other problems gives the agent a place to report cleanup it would otherwise do in the diff, which is how a ten-line fix grows into a change across twenty files.

The done-when section closes the routes you did not intend. "Do not modify existing tests" rules out weakening the assertions already there.

The agent can still edit the new tests, their fixtures or their mocks, so the prompt fixes the expected text and requires the same tests to fail against the original code for the right reason: the wrong displayed date. A test that passes against the buggy code proves nothing.

Five routes on the left. Fix the code runs along the top and down to tests pass. Change the test, loosen an assertion and skip a test run with dashed arrows into a box reading do not modify existing tests, rules these out. Edit the new tests, their fixtures or mocks, runs with a dashed arrow into a box reading fixed expected text, must fail on the original. A note under tests pass reads: these close the routes you did not intend.
Fixing the code is the one route to passing tests the prompt intends. "Do not modify existing tests" rules out changing, loosening or skipping them, and the fixed expected text, which must fail against the original code, closes the route through the new tests.

Running under both time zones matters because the original suite already passed under UTC, and a browser test needs its own time-zone setting because the runner's TZ may not reach it.

The last line asks for evidence. An agent's final message is generated text, and "all tests pass" is a likely sentence whether or not the tests ran. A pasted command with its output, run after the last edit, is something you can check.

The stranger test

Before you send a prompt, read it as a capable engineer who has never seen the repository. List what they would need to ask: which file, which helper, whether CI is off limits, how you will judge the result. Each item is a decision the agent may investigate, ask about or guess. Answer the ones that affect scope or correctness in the prompt.

Some items will be design decisions, such as whether generated files are stored or rebuilt on demand, which affects cost and how long customer data is kept. Those are yours. Decide them and write the answer into the prompt as a constraint. The stranger also flags how lines. Told to open a file and replace a line, a capable engineer would ask what the change is for, and the answer is the line the prompt should have contained.

Sizing a task by its checks

Once a prompt is written as outcomes, how much to hand over at once has a direct answer: as much as its checks can verify.

Take "let customers download invoices as PDFs and get them by email". It touches rendering, storage, permissions, a background job and email. Written as outcomes, each with its check:

  • A test renders a fixture invoice to PDF, and the extracted text contains the customer name, the total and the due date.
  • Tests show the owner can download the PDF, another customer's request gets a 404, and a logged-out request gets a 401.
  • A test issues an invoice and finds exactly one queued email addressed to the customer, with the PDF attached.

Every outcome has a check the agent can run and you can run again, so this is one task. The agent will break it into steps and order them, building the renderer before the endpoint that serves it, because planning the steps is part of executing them. The size of the diff has no bearing on whether these checks prove the feature works.

Now add "the PDF should look professional". Nothing in the list can say pass or fail on that, so the agent decides what professional means, and its choice will pass every test you have. Before that outcome goes into a prompt, give it a check, such as a reference layout the output must match or a rubric with examples of good and bad, or keep it out of done-when and judge it yourself.

Split the work where a check is missing or different in kind: an outcome whose check needs something that does not exist yet, a decision only you can make, or a one-way change, such as a migration that drops a column, whose check is a rehearsal on a copy of production data. Inside each task, the decomposition is the agent's.

What to check when the work comes back

The prompt tells you what to check. Record the starting commit before the agent runs. Afterward compare git diff --stat <starting-commit> with the scope list, and run git status --short --untracked-files=all to see new files. Any file outside the scope is a finding.

That comparison, and a count of assertions and skipped tests, are mechanical enough to script. This block runs them on the vague prompt's result:

TypeScriptRuns in your browser
// The scope section of the prompt, as data.
const mayEdit = ["src/invoices/", "test/invoices/"];

// Files the vague prompt's run touched: `git diff --stat <starting-commit>` plus new untracked files.
const changed = [
  "src/invoices/render.ts",
  "src/invoices/formatDueDate.ts",
  "test/invoices/render.test.ts",
  ".github/workflows/test.yml",
];
for (const file of changed.filter((f) => !mayEdit.some((dir) => f.startsWith(dir)))) {
  console.log("outside scope:", file);
}

// The test file before and after the run. Count assertions and skipped tests.
const before = `
test("due date", () => { expect(render(inv)).toContain("Oct 15, 2026"); });
test("total", () => { expect(total(inv)).toBe(120); expect(tax(inv)).toBe(20); });`;
const after = `
test("due date", () => { expect(render(inv)).toContain("Oct 15, 2026"); });
test.skip("total", () => { expect(total(inv)).toBe(120); });`;
const count = (src: string, pattern: RegExp) => (src.match(pattern) ?? []).length;
console.log("assertions:", count(before, /expect\(/g), "->", count(after, /expect\(/g));
console.log("skipped tests:", count(before, /\.skip\(/g), "->", count(after, /\.skip\(/g));

The new formatDueDate.ts sits inside an allowed directory, so the scope check passes it. Catching a duplicate helper takes a search of the diff for new functions whose names resemble existing helpers. Then check the execution log to see that the reported commands ran after the final edit; if there is no log, rerun them against the final tree.

These checks show the agent stayed inside the lines you drew. Whether it reached the goal is a check against the goal itself: render a due date on every page that shows one, in a Los Angeles browser context, and read what it displays.

Check your understanding

8 questions on this lesson. Pick an answer to see whether it holds and why.

  1. 1A prompt reads: "Add the customer's country to the CSV export. Make sure the tests pass." Which added line closes the route where the agent weakens a test to get a green run?
    Show the answer

    Answer C. Real output from a run on the final code can show that the suite passed, but a deleted or loosened assertion passes too, so the evidence line is worth having and still leaves the shortcut open. Coverage can stay high while assertions get weaker. Forbidding changes to existing tests removes the shortcut, and a new test that must fail on the old code makes the change prove itself.

  2. 2The prompt said: "You may edit files in src/reports/ and test/reports/." This is git diff --stat against the starting commit. Which files are findings?
    Output
     src/reports/csv.ts        | 14 ++++++----
     src/lib/strings.ts        | 22 ++++++++++++++
     test/reports/csv.test.ts  |  9 ++++---
     .github/workflows/ci.yml  |  2 +-
    Show the answer

    Answer B. Both files sit outside the two allowed directories, so each needs an explanation whatever it does. The shared library edit is easy to wave through because it looks like ordinary code, yet it could affect callers outside the task, so read the diff and its callers. Also run git status --short --untracked-files=all, since new untracked files do not appear in this diff.

  3. 3An agent added this function. src/lib/money.ts already exports parseMoney, which handles currency symbols, thousands separators and rounding. Which prompt line would most directly have prevented it?
    TypeScript
    // src/checkout/total.ts, added by the agent
    function toCents(amount: string): number {
      return Math.round(parseFloat(amount.replace("$", "")) * 100);
    }
    Show the answer

    Answer D. Naming the helper gives the agent an implementation to call and gives you a line to check the diff against. It is a convention the result must follow, so it belongs in the prompt however capable the model is. Style advice leaves the choice open, and a size limit does not touch it. The src/lib/ boundary is the tempting pick, but it only forbids editing the file and says nothing about using what is in it.

  4. 4Here is a prompt for an email change. Which line would a more capable model, given the same facts, make unnecessary?
    Output
    1  Goal: order confirmation emails show the delivery window, such as "Tue 14:00 to 16:00".
    2  Context: the window is stored in orders.delivery_slot; emails are built in src/email/confirm.ts.
    3  Read delivery_slot in loadOrder(), pass it to the template, then add a line under the total.
    4  Keep the subject line unchanged; customers' mail filters match on it.
    5  Done when a test sends a confirmation for a fixture order and the body contains "Tue 14:00 to 16:00".
    Show the answer

    Answer A. Line 3 lists steps a capable agent would work out from the goal and the context, and it fixes one route through the code before anyone has looked. Line 2 is the tempting pick because it names a column and a file, but it states facts the agent would otherwise have to search for. Line 4 is a constraint the agent cannot infer, because the mail filters live outside the repository.

  5. 5Which of these is ready to hand to an agent as one task?
    Show the answer

    Answer C. Every outcome in the export task has a check that can fail, so its size is fine and the agent can plan the steps. The 200-line function is the tempting pick, but a line limit is no check, and nothing in it says when the function is right. Whether exports are kept, and for how long, sets cost and data retention, so that choice is yours to settle before handing over the work.

  6. 6Bug: German customers see prices like 12.50 instead of 12,50. The prompt said: "Open src/cart/summary.ts. Replace price.toFixed(2) with formatMoney(price, locale) from src/lib/money.ts. Run the tests and tell me when they pass." The agent did every step and the suite passes, but the checkout page, which formats prices in src/checkout/total.ts, still shows 12.50. What is wrong with the prompt?
    Show the answer

    Answer B. Every step was carried out, so the agent skipped nothing. Adding total.ts as one more step is the tempting fix, but it works only because you now know where the second call site is. A goal such as every page shows prices in the customer's locale, with a check per page, makes finding them the agent's job, and the check catches a page anyone missed.

  7. 7Bug report: tax on discounted orders is computed on the price before the discount. The agent says the fix is done and adds this test, which passes. What should you do before accepting the test as proof?
    TypeScript
    test("tax on discounted order", () => {
      const order = { price: 100, discount: 20, taxRate: 0.1 };
      expect(tax(order)).toBeGreaterThan(0);
    });
    Show the answer

    Answer D. A test that passes on the buggy code proves nothing about the fix. The original code returns 10 and the fixed code returns 8, both greater than 0, so this test passes either way. Rerunning on the fixed code repeats evidence you already have. An assertion such as toBe(8) would fail on the old code for the right reason.

  8. 8Before sending a prompt, you list what a capable engineer new to the repository would need to ask. The list has eleven items. Eight are facts you know or the agent could find; three are design decisions about the job queue and the database schema. What do you do?
    Show the answer

    Answer A. Design decisions with lasting cost are yours, and once made they are constraints the agent follows, so the task can still go as one prompt. Writing out every step is the tempting answer, but it settles the questions by turning them into orders, and the agent inherits your plan with its blind spots. Eleven prompts would split the work along your questions, which no check follows.

You understand it when you can

Drill

An engineer gave an agent this prompt: 'Fix the flaky tests in the payments module and clean up anything that looks wrong.' Find every way an agent could satisfy it while making the codebase worse, then rewrite it with a goal, scope, constraints, relevant context and a definition of done, keeping out any line that tells the agent a step it could choose for itself.

Topics

Prompts as Specifications
Writing a prompt with the same care as a requirement, stating the goal, scope, non-goals and expected output.
Supplying Context
Putting the files, examples, conventions and past decisions the model needs into the prompt, and leaving out what distracts it.
Constraints and Boundaries
Naming what the agent may change, what it must not touch, and which rules are fixed.
Definition of Done
Stating the checks that prove completion, so the agent can verify its own work and you can verify it again.
What Versus How
Testing every instruction by asking whether a more capable model would make it unnecessary, and rewriting each step as the outcome, fact or check it protects.
Sizing a Task by Its Checks
Handing over as much work as its checks can verify, leaving the breakdown into steps to the agent, and settling first the decisions only you can make.

Further reading

Start here

  • AGENTS.md. Specification.

    The open format for a repository file that tells coding agents the build commands, conventions and boundaries once, so every prompt starts from the same context.

Short reads

Watch

  • Prompting for Agents | Code w/ Claude. Hannah Moran and Jeremy Hadfield, 2025. 29-minute talk.

    Anthropic's applied AI team covers how prompting an agent that runs a tool loop differs from prompting a single reply: giving it heuristics, stating its limits and describing what finished looks like.

  • The New Code — Sean Grove, OpenAI. Sean Grove, 2025. 22-minute talk.

    Argues that the written statement of intent is now the main thing an engineer produces, and uses OpenAI's Model Spec to show a versioned spec that tests and evaluations are generated from.

  • Simon Willison: Engineering practices that make coding agents work - The Pragmatic Summit. Simon Willison, 2026. 28-minute talk.

    Makes the case for test-driven development as the definition of done you give an agent, so it can check its own work before you check it again.

Books

  • Beyond Vibe Coding: From Coder to AI-Era Developer. Addy Osmani, 2025.

    A Google engineering leader's practical guide to directing coding agents: writing precise requests, supplying project context, and stating what done looks like so the result can be checked.

  • Specification by Example: How Successful Teams Deliver the Right Software. Gojko Adzic, 2011.

    The classic on turning intent into concrete, checkable examples. Agents need exactly that kind of executable definition of done so that 'make the tests pass' cannot be met by weakening the tests.

Primary sources

  • Best practices for Claude Code. Manual.

    Anthropic's official guide to specifying coding-agent work: pointing the agent at existing files and helpers, giving it tests to check against, and saying what done looks like before it starts.