Chapter 12 of 12 · The worked example

Build the CRM: the worked example end to end

Six weeks from Priya's brief to a CRM that Sam uses every day, with every agent you have met doing the job you saw it do. Then how to point the same crew at your business.

Company Alderline Coffee RoastersCrew all nineYou need Chapters 1 to 11
Monday 3 August 2026

Priya's founding brief

This is the prompt the whole build started from. Not a spec. A founder saying what she wants and why in her own words. Anvil turns it into slices; that is Anvil's job, not hers.

Use the anvil agent. Read the wiki Charter first.

I want a CRM built for Alderline. Not HubSpot. HubSpot is built for a sales team that closes deals and moves on. We are a delivery business. Our customers are 140 cafés and grocers who order every week, sit on a route, drink a roast mix and remember every bad bag. HubSpot had no idea what a route was. We spent two years fighting it.

Six modules:
1. Accounts. A café or grocer: its route, roast mix, weekly order pattern, quality history and who to call.
2. Contacts. The people at each account.
3. Pipeline. Prospects we are talking to, by stage.
4. Orders and routes. The weekly orders and our four routes: Tuesday East, Wednesday West, Thursday North, Friday Downtown. A route sheet the driver can print.
5. Tickets. Anything a customer asks for or complains about. Ledger triages them.
6. Activity. What happened on an account, in order.

Three users. Sam is on it all day: accounts, orders, tickets, calls. Tom looks at routes, orders and quality once a day. I look at pipeline and the dashboard once a week and I get pinged at the gates.

Roasts: Morning Route (medium), Bridgetown (dark), Slow River (decaf), Harvest Lot (seasonal single origin). Every account has a mix of those.

Start with what Sam touches every day. I would rather have Accounts and Routes working on 4 September than all six half done. Sign-in before any customer data goes live. Import from the HubSpot export so Sam does not retype 140 accounts.

Slice it, size it, flag it. Tell me the order you would build in and why. Ask me the one question that changes the scope.

Anvil's response

claude -p "$(cat brief.md)" --output-format text
Anvil · reading wiki Charter. No decisions yet; this is the first.
The one question: is the weekly order pattern a standing order Sam edits, or last week's order repeated? Assumption until you answer: a standing order, editable by Sam.
15 slices · 43 points · flags: customer-data ×5, auth ×1, external ×1
Order: ALD-1 Accounts, ALD-2 Contacts, ALD-5 Routes, ALD-4 Orders. That is what Sam touches every day.
Then ALD-3 Pipeline, ALD-6 Tickets, ALD-8 Dashboard. Then the rest.
ALD-11 Sign-in runs in Flint's lane from day one and ships before anything with customer data is live.
Two builders, two lanes. Ember: UI-heavy, multi-file. Flint: well-specified back end. Gauge tests every slice against its criteria.
Issues created ALD-1 to ALD-15 in Idea, each with Problem, Out of scope, AC-n, Size, Risk flags, builder.
ANVIL: Scoped 15 slices · 43pt · flags: customer-data, auth, external · gate: yes

The table is the sixteen slices as they stand today. Fifteen came from the brief. The sixteenth, ALD-42, came from a ticket in week five. Chapter 3 covers how Anvil cut them; chapter 4 covers why each has the builder it has.

IdTitlePtsBuilderFlagsBuilt
ALD-1Accounts list and detail3Embercustomer-dataWeek 1
ALD-2Contacts2Flintcustomer-dataWeek 1
ALD-11Sign-in and roles5FlintauthWeek 1
ALD-4Orders and weekly pattern3FlintnoneWeek 2
ALD-5Routes and the driver route sheet3EmbernoneWeek 2
ALD-9Search2FlintnoneWeek 2
ALD-3Pipeline board5EmbernoneWeek 3
ALD-6Tickets inbox3Embercustomer-dataWeek 3
ALD-7Activity feed2FlintnoneWeek 3
ALD-8Dashboard3EmbernoneWeek 4
ALD-10CSV import from the HubSpot export3Flintcustomer-dataWeek 4
ALD-12Ticket replies with the Ready-for-Priya gate2EmberexternalWeek 4
ALD-13Quality log on an account2EmbernoneWeek 4
ALD-14Weekly order forecast per route3FlintnoneWeek 5
ALD-15Export to CSV2Flintcustomer-dataWeek 5
ALD-42Route notes on an account · from ticket TKT-1183Embercustomer-dataWeek 6 · 15 Sep
The order Anvil proposed

What Sam touches daily first: ALD-1, ALD-2, ALD-5, ALD-4. Then what Sam and Tom look at: ALD-3, ALD-6, ALD-8. Then the rest. ALD-11 sign-in in Flint's lane from day one, so it ships before anything with customer data goes live. Two builders meant two lanes, which is why the Built column does not read top to bottom.

Six weeks

The build, week by week

Kickoff to today. Live to Sam on the date Priya asked for.

Mon 3 AugKickoffPriya's brief. Anvil cuts 15 slices. Linear and the wiki set up (chapters 1 and 8).
Week 1 · 3–7 AugALD-1 · 2 · 11Accounts (Ember). Contacts and Sign-in (Flint). First gates: customer-data ×2, auth.
Week 2 · 10–14 AugALD-4 · 5 · 9Orders, Routes and the route sheet, Search. Tom prints his first route sheet.
Week 3 · 17–21 AugALD-3 · 6 · 7Pipeline, Tickets inbox, Activity. The review deadlock gate fires once.
Week 4 · 24–28 AugALD-8 · 10 · 12 · 13Dashboard, HubSpot import, ticket replies with the gate, quality log.
Fri 4 SepLive to Sam140 accounts imported. Sam's first day on it. HubSpot set to read-only.
Week 5 · 7–11 SepALD-14 · 15 · first ticketsForecast, export. TKT-118 to TKT-125 arrive. Ledger's first Ticket pulse.
Tue 15 SepALD-42 deployedRoute notes on an account, from Riverbend's ticket. 7:52 pm.
Mon 21 SepToday47 issues deployed. The Ticket pulse says the next slice is a self-serve order change.
The thread

ALD-42, from a phone call to a deploy

The issue every chapter followed, told once from start to finish. Each step links to the chapter that explains it.

  1. A phone call to Sam Wed 9 Sep, 9:14 am Ch 10

    Maya at Riverbend Café asks whether Sam can leave a note for the driver about the back door. Luis keeps going to the front and they are not open until seven. Sam logs it as TKT-118 in the Tickets module while they talk.

  2. Ledger triages 9:31 am Ch 10

    feature · P3 · Riverbend Café. Ledger drafts the reply in Sam's voice and marks it Ready for Priya. It creates ALD-42 in Idea with the Request template. Priya sends the reply at lunch.

  3. Anvil scopes Mon 14 Sep, 9:30 am Ch 3

    Monday. Priya bumps it to the top of the pile at 9:23 and Bellows runs Anvil. Problem in Maya's words. Out of scope: notes on orders, notes written by customers. AC-1 to AC-5. Three points. Flag customer-data. Builder: ember. The gate question: "This stores free text that a driver reads on a printed sheet. OK to proceed?" Last line: ANVIL: Scoped 3pt · flags: customer-data · gate: yes.

  4. Priya's gate 9:42 am Ch 7

    Bellows asks customer-data. Priya reads the gate question on her phone and replies approve customer-data. Ten seconds.

  5. Warden's threat note 12:40 pm Ch 6

    Scoped with a flag runs Warden before Details. The note is untrusted input; escape it on the sheet. A user from another tenant must not read it. The note never appears in logs. The second control becomes AC-5. Anvil attaches the note and moves to Detailed at 1:15 pm.

  6. Bellows dispatches 1:30 pm Ch 11

    On its next tick Bellows sees Detailed, reads builder: ember, fills kit/prompts/build.md and starts Ember.

  7. Ember builds PR #57 2:31 pm Ch 4

    Branch ALD-42-route-notes. A notes table with a migration (the migrations gate asks; Priya approves), the field on the account page, the save API, a column on the route sheet. The PR body lists every file, what was verified and what was not. Ember moves the issue to In Progress.

  8. Flint: REQUEST CHANGES Mon 14 Sep, 3:02 pm Ch 4

    Flint reads the diff before the description. Should fix: an empty note saves as an empty string; disable Save until the trimmed length is above 0. Nit: the 280 limit is client-side only; validate on the server too. One round.

  9. Ember, round two. Flint: APPROVE 3:40 pm Ch 4

    Ember disables Save on an empty note and enforces the 280 limit on the server, with a unit test for each. Flint approves at 4:05 pm. Bellows moves ALD-42 to In Test.

  10. Gauge: QA RED on AC-3 4:12 pm Ch 5

    Gauge writes tests/e2e/ALD-42.spec.ts, one test per criterion, and runs them against the preview. AC-3 fails: a 281-character note comes back as a 500 instead of a message naming the limit. Defect comment with steps, expected, actual, file and line. Back to In Progress.

  11. Ember fixes. Gauge: QA GREEN 4:52 pm Ch 5

    The limit is enforced on the server and shown as an alert, forty minutes after the defect. Bellows reruns Gauge on the 5:00 tick. All five pass at 5:06 pm. The regression suite passes. Gauge writes the lesson that later becomes a learning-log entry: test the limit from both sides.

  12. Warden: WARDEN CLEAR 5:13 pm Ch 6

    Six checks on the final diff. The controls from the threat note are present. AC-5 covers the cross-tenant read. No new dependencies.

  13. Beacon's journey review 5:22 pm Ch 9

    The box is empty with no hint. Beacon writes the placeholder that names the reader and the limit, commits it, posts the Journey comment. JOURNEY REVIEWED. Bellows moves ALD-42 to Ready to Deploy.

  14. The deploy gate 5:25 pm Ch 7

    GATE · ALD-42 · Production deploy. Always a human. Priya is at the roastery, then out on the Tuesday route. She replies approve prod-deploy from her phone at 7:42 pm on Tuesday 15 September. The next tick runs vercel --prod at 7:45. Deployed at 7:52 pm.

  15. Quill writes back 8:01 pm Ch 8

    A Changelog entry. A Decision record: route notes live on the account, not the order. A Learning-log entry: "A new text field names its reader in the placeholder", with the sentence it added to ember.md. Every entry linked to ALD-42. QUILL DONE.

  16. Beacon's release note. Priya sends. Wed 16 Sep, 8:05 am Ch 9

    Two lines, Ready for Priya. Priya pastes them into Wednesday's order confirmation. Maya writes back the following Tuesday: "Luis came to the back door."

git log --oneline main..ALD-42-route-notes
3f9c2ab ALD-42: route note placeholder names the reader (Beacon)
9d81b6f ALD-42: reject notes over 280 characters with a message, AC-3 (Ember)
c07f4e2 ALD-42: tests/e2e/ALD-42.spec.ts, one test per criterion (Gauge)
5b2c913 ALD-42: guard the empty note state Flint found (Ember)
a41e7d0 ALD-42: route note field, save API, route sheet column (Ember)

Five commits, four authors, one branch, one PR. Every commit names the issue and the agent. That is rule 1 in CLAUDE.md doing its job.

The numbers

What the dashboard showed

Six weeks, 3 August to 21 September. These figures are illustrative: they are Alderline's, and Alderline is invented. Yours will be on your own dashboard, built from your own telemetry file.

96 h
Time working
All nine agents, six weeks. Illustrative.
47
Issues deployed
16 slices plus the defects and fixes filed against them.
212
Tests written
By Gauge, one per acceptance criterion.
31
Defects before deploy
Caught by Flint, Gauge or Warden. Two reached production.
38 · 34 · 4
Gates asked · approved · rejected
Most from Priya's phone.
19
Learning-log entries
Kit files changed 11 times.

The number Priya reads first is the last one. Nineteen times the crew changed how it works because something went wrong, and wrote down why. Chapter 11 explains how that is counted.

The map

The same map from chapter 0, now that you know every name on it

Press play. Each step is one you have now read a chapter about.

Your company

Adapt this to your business

You are not a coffee roaster. The crew does not care. Here is what changes and what does not.

  1. Replace the nouns

    The Alderline words in the fact sheet are the only things that have to change: the company, the three users, the six modules, the routes and roasts, the account names. They live in CLAUDE.md, AGENTS.md, the wiki Charter and the seed data. Where an agent file names Alderline or a café, swap the noun. Nothing in the hooks, the gates or Bellows knows about coffee.

  2. Answer Anvil's five questions

    Who uses it every day? What do they touch first? What data do customers trust you with? What must never be deleted without a human? What reaches a customer? Your answers become the brief, the risk flags, the paths in gates.json and Beacon's gate. Write them before you write a single module name.

  3. Keep the crew

    Nine roles cover a software company at any size you will be for a while. Rename them if you want. Do not merge Warden into Ember or Gauge into Flint to save a run. The separation is what makes a review a review. One model reviewing its own work is not one.

  4. Keep the gates

    Copy gates.json as it is on day one. Change the paths under billing-code and auth-code to match your repo. Loosen nothing until you have four weeks of dashboard to look at. Every rule in that file is a promise to the humans on your team.

  5. Change the modules

    Your six will not be Accounts, Routes and Roasts. Write yours in the brief in one line each, the way Priya did. Say who touches each one daily. Anvil cuts the slices, sizes them and flags them. You approve the order. That is the whole first morning.

See it

Open the demo

Everything on this page is in the CRM the crew built. It runs in your browser and saves to your browser. Break it if you like.

What the crew built, as it looks today

Real screenshots of the demo, taken on 21 Sep 2026. Click any of them to open that screen in the CRM.

The Alderline CRM dashboard for Monday 21 Sep 2026: bags this week, open tickets, pipeline value, accounts at risk, and this week's orders by route
The dashboard Sam opens on Monday. Orders by route against the four-week forecast (ALD-8, ALD-14).
Riverbend Cafe account page with the Route note field, the saved note by Sam Lindqvist, the weekly order pattern, contacts and the TKT-118 ticket
Riverbend Café with the route note from ALD-42, saved by Sam, shown with author and time (AC-2).
Ticket TKT-118 with the customer's request, Ledger's triage chips, the linked Linear issue ALD-42 marked Deployed, and Priya's two replies
TKT-118: the request, Ledger's triage, the link to ALD-42, and the replies Priya sent (ALD-6, ALD-12).
The Accounts list with the Built by the crew panel open, listing ALD-1, ALD-13 and ALD-42 with their builders, flags, deploy dates and test counts
The "Built by the crew" panel on Accounts: which slices, which agents, which gates, how many tests.
The pipeline board with deals across Lead, Sampled, Proposal, Trial week and Won
The pipeline (ALD-3). Drag a card, or use the Move to menu from the keyboard.
The Tuesday East driver route sheet listing stops in order with bags, roast mix and the route note column
The Tuesday East route sheet Luis prints (ALD-5). The note column is where ALD-42 lands (AC-4).
The dashboard on a phone with the bottom navigation bar
On a phone: the bottom bar and the same numbers.
Ticket TKT-118 on a phone
TKT-118 on a phone, where Priya usually answers.

What to click first. Accounts → Riverbend Café, then the route note under Contacts. That field is ALD-42, placeholder and all. Tickets → TKT-118: Ledger's classification and the reply marked Ready for Priya, with the Send (Priya) button. Then the Built by the crew panel at the bottom of any module. It names the slice, the builder, the reviewer and the tests that cover what you are looking at.

Founder Q&A

How long did this take in wall time?

Six weeks, with Priya part time. Model time was about 96 hours across the whole crew. Most of the wall time was gates: an issue waiting for Priya's approve at lunch or after dinner. When she checked Linear twice a day, a slice shipped in a day or two. When she was on the road with Sam, slices waited. That is the trade. The gates are the pace.

What did the humans do?

Priya: the brief on day one, then gates. 38 asked, 34 approved, 4 rejected, most from her phone. She read every release note before it went out. Tom: quality and delivery tickets, and the layout of the route sheet. He never opened Linear. Sam: used it from 4 September and filed tickets. TKT-118 was his.

What broke?

Thirty-one defects were found before deploy, most by Gauge and Flint. Two issues reached production: a route sheet that sorted accounts by name instead of stop order, and a CSV export that dropped the last row. Gauge's regression run the next morning caught both. Both were fixed the same day. Both are tests now.

What would you do differently?

Sign-in first, not in parallel. ALD-11 shipped in week one but two slices were built against a preview without it, so Warden reviewed them twice. And tighter gates in week one. Priya approved a batch of customer-data slices with one comment to save time, and two of them needed Warden's review after the fact. One approve per issue costs ten seconds. It is worth it every time.

The whole pack

What you have now

A company. Nine agents with names, files and one gate each. A loop with seven states that Linear holds and Bellows turns. A wiki that remembers what was decided and why. A dispatcher you have read line by line, and a dashboard that shows time, work and learning without anyone filling in a timesheet. A ticket system with no vendor. A marketing seat in every review. A security review on every PR. And a working CRM you can open right now, built the way this pack says to build it.

Monday morning: copy the kit into an empty repo. Write your brief the way Priya wrote hers. Run Anvil. Approve the order. Then let Bellows tick. The foundations this pack leans on, memory, policy, connectors and the loop, are in the AI Workflows playbook.