Agentic AI Coding / Advanced

Build Your Own Coding Agent

Design custom agents, subagents, and guardrails that automate your engineering workflow end to end.

10 chaptersEPUB + PDF + HTMLAdvanced guide pricingDRM-free files
Build Your Own Coding Agent book cover
The problem

It starts with the situation you're actually in.

You've felt this gap. You point a capable model at your repository, describe a change you could make yourself in twenty minutes, and watch it return something fluent, confident, and wrong in a way that takes longer to untangle than doing it yourself.

The agent runs on your machine, the traces are clean, the eval suite is green, the constitution is lean. The temptation is to ship everything—every subagent, every tool, the full spec-plan-build-verify loop—on day one.

Who it is for

For engineers who want to design custom agents, subagents, and guardrails that automate their exact workflow end to end.

Outcomes

What you'll be able to do.

The file your agent reads before anything else

You build the context layer—what the model sees before it acts—the highest-leverage, least off-the-shelf part of any agent, starting from a fresh session in a repository you know well.

When the context window becomes the bottleneck

You watch a single primary agent read files, plan a refactor, edit modules, run the test suite, read the failures, and patch them—and you see exactly where delegating nothing stops working.

A failure you can picture

You learn why autonomy is not a slider you turn up as trust grows, pictured through an agent two hours into a refactor.

A failure you can't explain is a failure you can't fix

You catch the agent that passes every permission check yet writes code that compiles, passes the one test it wrote for itself, and quietly breaks an invariant three modules away—because safety bounds the downside.

Inside the book

A closer look at the work inside.

The same task, two context budgets

Issue one real request—"Fix the bug where premium users still see the upgrade banner after subscribing"—against a bare model with a generic prompt and a flat file dump. It searches for "banner," finds the component, adds a check against an isPremium prop, and reports success.

Can You Name Your Agent's Anatomy?

Run this against your current agent before moving on.

  • I can point to the code that owns turn-taking and termination (the loop), and it does only that.
  • My retry, timeout, and injection policy lives in the harness, not scattered through tool code.
  • Every action the agent can take is an explicit, typed tool—no hidden side effects inside the loop.
  • I can dump exactly what the model saw on any given turn (the assembled context) without re-running.

The Five Parts, and the One Job Each Owns checklist

  • Context layer assembles the turn: system prompt, constitution, the conversation so far, and the failing test output. It hands the model a single coherent message.
  • Runtime loop sends that message, receives a response, and inspects it. The response is a tool call: read_file("src/auth.ts").
  • Tool layer executes the read against the real filesystem and returns the contents.
  • Harness catches that result, formats it, and appends it to state. If the read had thrown, the harness's retry policy—not the model—decides whether to try again.
  • Context layer reassembles, now including the file. The loop sends again. The model proposes an edit_file call.
  • Persistence layer writes the transcript and a checkpoint, so if the session dies you resume from the green test rather than the red one.

Case Study: The Same Bug in Two Architectures

Two teams run the same agent on the same flaky-test task. Team A wrote one monolithic script—loop, context formatting, and tool calls all inline. Team B used the layered model. Team A's agent edits the wrong file.

Cut your constitution to its load-bearing lines

Run your root file through three passes. Frequency test: does the agent need this line on every task? If it's only for payments work, move it to agent_docs/payments.md. Guess test: for what the agent gets wrong repeatedly, is the correct answer written here? If not, add it.

Build Your Own Coding Agent visual framework
Build Your Own Coding Agent frameworkInside the book
Visual preview

A diagram you can keep open while you work.

Table of contents

10 chapters, built to be read in order.

01

The Real Constraint Is Context, Not the Model

02

Anatomy of a Coding Agent

03

The Agent Constitution

04

Designing the Primary Agent

05

Subagents and the Economics of Delegation

06

The Tool and Integration Surface

07

Spec-Driven Workflows That Automate Your Engineering Loop

08

Guardrails, Permissions, and Safety Architecture

09

Evaluating, Observing, and Hardening the Agent

10

Shipping and Scaling Your Agent

158
Pages
15,429
Words
33
Exercises, checklists & tools
10
Chapters
Formats

Three formats. One purchase.

EPUB, PDF, and HTML are included so the book can work on an e-reader, as a designed copy, or as a searchable desk reference.

EPUB

For e-readers and reading apps.

PDF

The designed edition with diagrams and layouts intact.

HTML

Searchable, copy-pasteable, and practical as a reference.

Complete guide

Build Your Own Coding Agent

$12.99
Advanced guide pricing
  • EPUB + PDF + HTML included in one purchase
  • 10 chapters from the complete guide
  • DRM-free files for your own devices
  • 7-day refund review for duplicate purchases, access issues, wrong files, or materially defective downloads
Add to cart - $12.99
Secure checkout / instant download / tax handled at checkout
Before you buy

Questions, answered.

Does this include the full book?

Yes. You get the complete edition, including the chapter sequence and internal materials described on this page.

Which formats are included?

EPUB, PDF, and HTML are included so you can read on an e-reader, keep a designed copy, or use the searchable browser version.

What is the refund policy?

Because this is an instant digital download, broad change-of-mind refunds are not offered after the files have been accessed. Refund requests are reviewed within 7 days for duplicate purchases, accidental purchases before access, access failures we cannot fix, wrong files, corrupted files, or pages that materially misdescribe the book.