Tutorials
A feature in an existing codebase
This tutorial adds a feature to code that existed before the blueprint. The feature is “Add CSV export to the reports page”.
The stand-in for your codebase is shop-reports, a Node.js server with no dependencies that reads data/ and shows sales by region on /reports, with a month filter. It had two commits and 9 passing tests. Every prompt below is the one typed in a recorded run, and every file, commit and line of output is what that run produced. With your own codebase, the answers, file names and test counts will be different.
Most of the work happens in ab-build-pipeline, which stops after every stage until you say to go on. In this run the pipeline took 59 minutes and asked 12 question forms, and the whole session took 1 hour 20 minutes.
You need Claude Code with Agent Blueprint installed (see Getting started) and your code in a git repository. The setup step reads the code and runs its tests.
The session runs in auto permission mode. In that mode Claude Code’s classifier approves safe tool calls by itself, so you answer the skills’ questions and are not asked to approve every command. In this run no permission prompt appeared, and 94 tool calls show “Allowed by auto mode classifier”.
The recorded run
- Recorded
- 8 October 2026
- Project
- shop-reports, a small Node.js reports server
- Tool
- Claude Code 2.1.294
- Model
- Opus 5.5 at xhigh effort
- Permission mode
auto- Took
- 1 h 20 min, answers included
Step 1: Start Claude Code in your project
In the project folder:
Run in a terminal
claude --permission-mode autoWhat happens
Claude Code asks “Quick safety check: Is this a project you created or one you trust?” with “No, exit” selected. Pick “Yes, I trust this folder”; pressing Enter straight away quits. The footer then reads
auto mode on (shift+tab to cycle).Why it matters
The skills read and write project files, so the session has to trust the folder.
Checkpoint
The footer shows the project name and
auto mode on.Step 2: Set up the project files
Type the skill name and pick it from the menu, which lists it as
/agent-blueprint:ab-project-start:Type in Claude Code
/ab-project-startWhat happens
The skill ran its scaffold script: “created 18, merged 1 (.gitignore, 32 lines added), kept 0”. The new files include
AGENTS.md,CLAUDE.md,BACKLOG.md,blueprint.local.mdanddocs/withcontext/ CONVENTIONS.md,GOALS.mdandSTATUS.md. It left the code, the tests,data/andpackage.jsonalone, and kept theREADME.mdbecause it already had real content.It read the code and ran the tests (“Tests pass (9/9)”), then asked one form of four questions built on what it had read. The run’s answers:
- “Here’s my read of the stack: plain Node.js ESM (engines ≥22; v26 locally), no dependencies, built-in
node --test(9 tests, all passing), no linter or formatter, andnpm startserving on :3000. Is that right?” Yes, no linter. - “What are the top goals right now?” It offered guesses from the code. Typed instead: “1. Let people download the reports page as a CSV file for spreadsheets. 2. Add a sales-by-customer report.”
- “Is there anything an agent must never modify without asking, beyond the usual defaults (.env, CI, new dependencies)?”
data/, so the tests use their own fixtures.orders.json - “Do you work on this alone or with a team?” Typed: “Solo, with a short-lived feature branch for each feature, merged into main locally.”
A follow-up set the priorities: CSV export P1, the customer report P2.
It found a real bug in the app and logged it in
STATUS.mdandBACKLOG.mdwithout fixing it: “If data/orders.json can’t be read or parsed, the first request to /reports stops the whole Node process instead of returning a 500.” Its report also pointed out thatdocs/now holds example files from the template, one of themdocs/, “which has nothing to do with your CSV goal”. Delete the examples when you start. It committed nothing: “Nothing is committed, since the scaffold added files to a repo you already own.”specs/ example-csv-export.md Why it matters
Later skills read the test command, the goals and the files they must not touch from these files instead of asking again.
Checkpoint
docs/names your test command and any read-only files, andcontext/ CONVENTIONS.md git statusshows the new files as untracked and.gitignoreas modified.- “Here’s my read of the stack: plain Node.js ESM (engines ≥22; v26 locally), no dependencies, built-in
Step 3: Commit the setup
Type in Claude Code
Commit the setup.What happens
It followed the git workflow you gave in the setup: it committed on a short-lived branch,
chore/, movedagent-blueprint-setup mainforward to it and deleted the branch. The commit,chore: initialize project with Agent Blueprint, sits on top of the two existing commits.blueprint.local.mdand.agent-blueprint/stay out of it on purpose, since both are ignored..gitignore Why it matters
The scaffold changed a file you own (
.gitignore), so the commit waits until you have looked at it.Checkpoint
git log --oneline -1showschore: initialize project with Agent Blueprint.Step 4: Map the codebase
Type in Claude Code
/ab-codebase-mappingWhen it has saved the map, commit it:
Type in Claude Code
Commit the map and the backlog entries.What happens
“The codebase is small (four source files, two test files), so one mapper helper covers it.” The helper read the whole project without changing anything (3 min 34 s). The session then checked the helper’s line references against the code, reproduced its crash finding, and saved
docs/. Five concerns went intocontext/ CODEBASE-MAP.md BACKLOG.md. What it reported:- Architecture: “This is one Node process with no dependencies, built in layers. src/server.js handles routing and checks the month, src/data.js reads data/orders.json on every request, src/reports.js filters and groups the orders and sums in cents, and src/views/reports-page.js renders the HTML.”
- The top concern: “High: the server process dies on bad order data. The async request handler has no error path.” It found a second trigger for the crash: one order with no date, combined with a
?month=request. - Where to look next, for the CSV goal: “the CSV route should share the month parsing and the rows/total step with the HTML route, so the two can’t drift apart.”
While the map was being saved, a write hook printed a prompt-injection warning for
CODEBASE-MAP.md. The session looked at the text that matched, the words “Blueprint instructions” in the map’s table of modules, and called it a false positive. If you see the warning, look at what matched before you carry on.The commit went through a short-lived branch again:
docs: add codebase map and backlog its concerns.Why it matters
The design and plan that follow start from the map’s file paths and concerns. Here the crash it found became the first decision of the pipeline.
Checkpoint
docs/exists with Architecture, Concerns and Recommendations sections, andcontext/ CODEBASE-MAP.md git log --oneline -1shows the map commit.Step 5: Build the feature with checkpoints
Name the pipeline and the feature. Put your own feature in place of this one:
Type in Claude Code
/ab-build-pipeline Add CSV export to the reports pageWhat happens
The pipeline runs one stage at a time and stops at a checkpoint after each. Every question came as a form with a recommended option, and the run took the recommendation each time except where a typed answer is shown.
Stage 1: Discuss
ab-discussread the goals, the codebase map and the earlier decisions, then asked four questions in one form:- The codebase map found that bad order data crashes the server, and the CSV route goes through the same handler. How should that be handled? Fix it first, on this branch.
- Should the CSV end with a Total row, like the table on the page? Yes.
- Which spreadsheet setup should the file target? Comma separators and dot decimals.
- Do the success criteria in
GOALS.mdstill hold? Yes, as written.
The requirements scored 0.89 on its ambiguity gate, above the 0.8 bar. It wrote the decisions to
docs/and stopped: “These are the locked decisions I’ll plan around. Confirm or adjust?” About 3 minutes.context/ DECISIONS.md Stage 2: Brainstorm
ab-brainstormingset out what you said and what it assumed, then offered three approaches: a separate/reports.csvroute (recommended), the same route with?format=, or building the CSV in the browser. The run took the separate route. The design came in four sections, architecture, data flow and file format, error handling and testing, each approved with “Looks right”. It included the expected file for all months:csv Region,Orders,Total West,4,945.49 North,3,435.75 East,3,387.75 South,2,154.00 Total,,1922.99The format decisions were a UTF-8 byte order mark, CRLF line endings, standard CSV quoting, and a leading
'on text cells that start with=,+,-or@, so a spreadsheet does not run them as formulas. Before writing the design down it checked one claim it depended on by running Node. It saveddocs/, created the branchplans/ 2026-10-08-csv-download-design.md feat/and committed. About 4 and a half minutes.csv-download Stage 3: Plan
Three research helpers ran in parallel, on earlier learnings, the Node documentation and the code the change touches. In the session’s words, “Research before the plan changed it: Node’s captureRejections server option turned out to do nothing”.
ab-writing-plansthen wrotedocs/with seven tasks (an error boundary for the crash, a sharedplans/ 2026-10-08-csv-download.md regionReport, movingmoneytosrc/, the CSV encoder,views/ format.js GET /reports.csv, the download link, the docs), a Boundaries list and a Review Focus list. A plan-checker helper spent 3 min 54 s on it and found no blocking issue.Two questions followed: approve the plan, and how should Stage 4 run, with the choices sequential batches of three (recommended), team waves, or all tasks with no check-ins. The summary on screen before this question was one line, and the full plan is only in the file, so open
docs/and read it before you approve. About 16 minutes, most of it research.plans/ Stage 4: Execute
ab-executing-plansran the tasks in batches of three and recorded each test’s failing run before the code that made it pass. After each batch it reported and asked whether to go on:- Batch 1: the error boundary fix,
regionReport, andmoneymoved tosrc/. 12 of 12 tests passing.views/ format.js - Batch 2: the CSV encoder, the
/reports.csvroute and the download link. 23 of 23. It also started the real server: “/reports.csv?month=2026-09 returns 200, text/csv; charset=utf-8, and attachment; filename=“sales-by-region-2026-09.csv”. The body starts with efbbbf, has CRLF line endings, and totals 697.99, the same as the page.” - Task 7: the docs.
About 10 minutes.
Stage 5: Review
ab-review-swarmstarted six reviewers in parallel, chosen for this diff: code-reviewer, security-sentinel, performance-oracle, code-simplicity-reviewer, convention-enforcer and test-coverage-reviewer. It left out the others because the change had no UI, database or architecture work. A validator rejected 3 of the 13 raw findings, and a synthesizer merged the rest: “Summary: 0 P1 · 4 P2 · 1 P3.” The coverage reviewer “broke the code in 32 small ways and 11 of those breaks went unnoticed by the suite”. The P3 was a real bug: the request URL went intoconsole.erroras its format string, so a URL with%c3%a9in it, an encoded é, dropped the error and stack from the log line.It asked three questions in one form: apply the P3 fix (yes), how to handle
;inside a text cell, which Excel in semicolon locales would split (also quote;and tab), and whether to apply three findings that fell below the confidence threshold (apply all three).ab-resolve-in-parallelthen fixed them in seven commits: “Totals: 9 applied, 0 deferred, 0 skipped.” 29 tests passing. About 20 minutes.Stage 6: Verify
ab-verification-before-completionran fresh checks: “The suite is clean (29/29), every branch commit passes independently”, “All 17 mutants fail against the baseline”, and “All 38 live checks pass.” It named the one thing it could not check: opening the CSV in Excel, Google Sheets or Numbers. It updatedSTATUS.md. Stage 7, the deploy check, did not apply. About 2 minutes.Stage 8: Knowledge capture
ab-knowledge-compoundingasked whether to record two lessons and, with “Capture both”, wrotedocs/and a line insolutions/ 2026-10-08-node-http-async-handler-error-boundary.md docs/.learnings/ LEARNINGS.md The final report ended:
What I checked - Tests: 29 pass (up from 9), and each of the 18 commits on the branch passes on its own. - Mutation check: I broke the code in 17 deliberate ways, and the tests caught every one. - Real data: on the live server, the CSV matched the page exactly for all time, each month (2026-08, -09, -10), and an empty 2026-11. - Constraints: no new dependencies, and data/orders.json is untouched. - Not checked: I didn't open the file in Excel, Google Sheets or Numbers.Nothing was merged or pushed; that is the next step.
Why it matters
Each stage stops for you, so a wrong decision, such as the shape of the route or the file format, is caught before code exists. Most of the hour is helpers: research, the plan check, six reviewers, the validator and the synthesizer.
Checkpoint
git log --oneline main..feat/lists the branch’s commits (18 here),csv-download npm testshowsℹ pass 29, anddocs/has the new file.solutions/ Step 6: Finish the branch
Type in Claude Code
/ab-finishing-a-development-branchWhat happens
It ran the tests (“Step 1 confirms all 29 tests pass”), found the base (
main), and had a read-only helper audit every task of the plan against the branch (1 min 33 s). Four tasks were DONE and three CHANGED, each with its reason; for the CSV encoder, it “also quotes ; and tab, which you decided in review”. “The audit passes the gate. No row is NOT DONE or PARTIAL.”It then asked “Implementation complete. What would you like to do?” with three options: merge to
mainlocally, push and create a PR (noting that this repository has no remote), or keep the branch. With merge locally: “The CSV download is now on main. The branch fast-forwarded to d8c9b07 and its 18 commits landed unchanged. Tests on the merged main give 29/29 with exit 0.” It deletedfeat/.csv-download Why it matters
The merge happens only after the tests pass again and every plan item is accounted for, either done as planned or changed with a reason you agreed to.
Checkpoint
git branchlists onlymain,npm testonmainpasses (29 here), and the reports page has a “Download CSV” link to/reports.csv.Step 7: Hand over to the next session
Type in Claude Code
/ab-session-wrapWhat happens
It printed a summary of the session: the changes, the bugs fixed, the decisions, the remaining work, and two questions only the owner can answer. Then it asked “Is this session summary accurate?” With “Accurate, update the docs” it rewrote
docs/from the git log and a fresh test run, marked goal 1 done incontext/ STATUS.md GOALS.md, added two follow-ups toBACKLOG.mdand a completion note to the plan, and committed through a short-lived branch as before. The newSTATUS.mdopens its next step with “Start here: Run the ab-brainstorming skill for goal 2.”Why it matters
The next session, in Claude Code or another tool, starts from
STATUS.mdinstead of from memory.Checkpoint
docs/says goal 1 is merged and has a “Start here” line that names the next step.context/ STATUS.md
Recap: which skill produced what
| Skill | What it produced |
|---|---|
ab-project-start |
AGENTS.md, CLAUDE.md, BACKLOG.md and docs/ with CONVENTIONS.md, GOALS.md and STATUS.md; the setup commit |
ab-codebase-mapping |
docs/ and five concerns in BACKLOG.md |
ab-build-pipeline |
The staged run in the rows below, with a checkpoint after each stage and a final report |
ab-discuss |
docs/, the locked decisions |
ab-brainstorming |
docs/ and the feat/ branch |
ab-writing-plans |
docs/, seven tasks |
ab-executing-plans |
src/, src/, the GET /reports.csv route in src/, the Download CSV link and test/ |
ab-review-swarm |
A review with 0 P1, 4 P2 and 1 P3 findings from six reviewers, a validator and a synthesizer |
ab-resolve-in-parallel |
The review fixes, with 29 tests passing |
ab-verification-before-completion |
Fresh evidence: 29 of 29 tests, 17 of 17 mutants caught, 38 live checks; the STATUS.md update |
ab-knowledge-compounding |
docs/ and a line in docs/ |
ab-finishing-a-development-branch |
The plan audit (4 DONE, 3 CHANGED) and the fast-forward merge into main |
ab-session-wrap |
The updated STATUS.md, GOALS.md and BACKLOG.md and their commit |