Chapter 6: Planning and building in stages with BDD
The chapter introduction explains when to plan with Claude before coding and how plans at different levels make large work easier to review.
After this chapter you will be able to
- Plan mode before execution. Describe what Claude Code does in plan mode and how the reader participates before execution.
- Levels of planning. Distinguish the strategy, delivery, and implementation plans described for a large piece of work.
- Purpose of layered plans. Explain how strategy, delivery, and implementation plans relate, and how reviewing them gives the tech lead early feedback on proposed delivery.
- Gherkin behavior scenarios. Explain how Gherkin describes expected behavior in technology-agnostic, user-focused terms. Describe what Given, When, and Then represent and how scenarios provide a shared vocabulary for testers and developers.
- Review before implementation. Justify having Claude write Gherkin specifications before code and describe the reader’s review role. Explain how reviewing expected behavior, edge cases, and additional scenarios helps establish confidence in Claude’s work.
- Plan mode permissions. Explain what Claude Code can do in plan mode and how the user enters and leaves it.
- Vertical BDD strategy decisions. Describe why the messaging request calls for a cross-service strategy and what kinds of decisions Claude surfaces before planning it.
- Strategy plan handoff. Explain how to access and retain Claude’s strategy plan, and why its rough phases need not become the detailed implementation plan.
- Subagent delegation and context. Trace how Claude Code starts a subagent, gives it enough background to work independently, and returns its output to the main session.
- Early dependency planning. Explain why planning task dependencies with Claude before building can prevent costly rework.
- Strategy to delivery plans. Describe the delivery plan’s place between the strategy plan and the next round of planning.
- Review effort and BDD specs. Explain where the reader should spend review effort as Claude plans and begins building.
- Reviewable delivery slices. Describe how to ask Claude to turn the strategy plan into a delivery plan, and explain why the author chose thin vertical slices over larger chunks or a frontend/backend split.
- Per-slice delivery protocol. Explain the work pattern specified for every slice and the approval checkpoint the author added before Claude proceeds.
- Per-slice implementation plans. Describe how each slice gets an implementation plan based on the existing plans and design documents, and why Claude should review the approach and flag issues before building.
- Human steering through slices. Explain why planning at different levels and dividing work into slices keeps the reader involved, despite being slower than letting Claude proceed without input.
- First slice plan alignment. Explain how the first slice’s implementation plan is checked against the delivery plan, strategy plan, and design before building.
- Gherkin review gate. Describe how the planned hard stop lets the author review and revise the Gherkin feature before implementation continues.
- Parallel builds and dependencies. Distinguish using subagents within one Claude Code session from running separate sessions on independent features, and explain why the delivery plan’s slices could not be built in parallel.
- Parallel planning and review. Explain how generating the slice plans in parallel can improve productivity while keeping implementation in small, sequential increments.
- Parallel planning prompt. Explain why the author asks Claude to write the prompt for parallel implementation planning and what that prompt must account for.
- Coordinated slice planning. Trace how the generated prompt turns a new Claude session into a lead agent that coordinates parallel plans and resolves open decisions.
- Independent plan review. Describe the three review focuses and explain why the lead agent used fresh subagents to review the plans.
- Gherkin-first review focus. Explain why the main review happens when the Gherkin files are created: the scenarios should be correct and complete before Claude builds the features, because changing a test plan is faster than changing a built feature.
- Per-slice acceptance checks. Describe what to verify after Claude completes each slice: deploy the app, run the new unit tests and BDD suite with everything passing, and use the Gherkin scenarios to guide exploratory testing.
What it builds on
- Changing the permission mode to let Claude run free (chapter 5) · Allowing Claude Code to work with less direct oversight
- Your role as reviewer (chapter 5) · The reader’s role in reviewing Claude’s work
Section by section
Introduction
The chapter introduction explains when to plan with Claude before coding and how plans at different levels make large work easier to review.
- Oversight matched to the work: Explain why some work can be delegated to Claude Code with little oversight while other work calls for closer decisions and more frequent feedback.
Why it matters: The right amount of oversight depends on how confidently you can assess the result and how costly a wrong direction would be. - Plan mode before execution: Describe what Claude Code does in plan mode and how the reader participates before execution.
Why it matters: Planning together gives you a chance to correct the direction before Claude commits to building it. - Levels of planning: Distinguish the strategy, delivery, and implementation plans described for a large piece of work.
Why it matters: Different levels of planning let you review both the direction of a large effort and the work on each feature.
Key terms: quality gates, oversight, feedback opportunities, plan mode, execute, overall strategy, delivery plan, implementation plans
6.1 Working with a hierarchy of plans
The section explains why a hierarchy of Claude-generated plans can provide early feedback without returning to waterfall planning.
- Purpose of layered plans: Explain how strategy, delivery, and implementation plans relate, and how reviewing them gives the tech lead early feedback on proposed delivery.
Why it matters: The plans give you a way to review Claude’s proposed approach before implementation. - Planning without waterfall delays: Distinguish the proposed hierarchy of plans from waterfall planning using the section’s account of feedback and iteration.
Why it matters: You can use plans for early review without treating them as a months-long substitute for delivery and feedback.
Key terms: hierarchy of plans, strategy, delivery plan, implementation plan, waterfall, agile, feedback cycle
6.2 Writing the behavior-driven strategy plan
The section introduces BDD as a way to specify messaging behavior before coding so the author can review Claude’s work with confidence.
- Gherkin behavior scenarios: Explain how Gherkin describes expected behavior in technology-agnostic, user-focused terms. Describe what Given, When, and Then represent and how scenarios provide a shared vocabulary for testers and developers.
Why it matters: A shared description of behavior gives you something concrete to check before implementation. - Review before implementation: Justify having Claude write Gherkin specifications before code and describe the reader’s review role. Explain how reviewing expected behavior, edge cases, and additional scenarios helps establish confidence in Claude’s work.
Why it matters: Reviewing the intended behavior first makes it easier to spot misunderstandings before accepting Claude’s implementation.
Key terms: Gherkin, given… when… then, scenario, BDD, Gherkin specifications, external proof, edge cases
6.3 Try it now — enter plan mode and think through the BDD strategy
The section shows how to use Claude Code’s plan mode to develop a BDD strategy for a cross-service messaging feature and preserve that strategy for later planning.
- Plan mode permissions: Explain what Claude Code can do in plan mode and how the user enters and leaves it.
Why it matters: Plan mode lets you work through an approach before Claude changes project files. - Vertical BDD strategy decisions: Describe why the messaging request calls for a cross-service strategy and what kinds of decisions Claude surfaces before planning it.
Why it matters: A cross-service feature needs decisions that a component-by-component plan alone would not settle. - Strategy plan handoff: Explain how to access and retain Claude’s strategy plan, and why its rough phases need not become the detailed implementation plan.
Why it matters: An accessible strategy gives the next planning session direction without locking it into premature implementation details.
Key terms: plan mode, permission mode, Shift-Tab, vertical slice, Gherkin specs, cross-cutting concerns, strategy plan, QA mechanism, markdown, delivery plan
6.4 How Claude delegates work to subagents
Explains how Claude Code delegates work to separate subagent sessions, what those agents can do, and how parallel work relates to delivery planning.
- Subagent delegation and context: Trace how Claude Code starts a subagent, gives it enough background to work independently, and returns its output to the main session.
Why it matters: Separate context lets Claude delegate work without filling the main session with the subagent's working conversation. - Subagent roles and permissions: Distinguish Explore, Plan, and general purpose agents by the work they are assigned and the permissions described here.
Why it matters: The agent type indicates what delegated work it is suited to do and whether it can change files or run commands. - Explicit and nested subagents: Describe how a user can request subagents explicitly and use nesting to summarize delegated work before it reaches the main session.
Why it matters: Requesting summaries of delegated work helps keep the main session focused on results rather than raw responses. - Parallel work and dependencies: Explain why identifying task dependencies matters before expanding parallel delivery work.
Why it matters: A delivery plan helps you find useful parallel work rather than treating dependent tasks as independent.
Key terms: subagents, main session, context, tool response, Explore agents, Plan agents, General purpose agents, permission model, invoke subagents explicitly, nest subagents
6.5 Generating the delivery plan
This section explains how a delivery plan turns a BDD strategy into manageable tasks, why planning dependencies early matters, and where the reader should focus review time.
- Early dependency planning: Explain why planning task dependencies with Claude before building can prevent costly rework.
Why it matters: Spotting dependencies before coding can save a disruptive change of course. - Strategy to delivery plans: Describe the delivery plan’s place between the strategy plan and the next round of planning.
Why it matters: Each plan has a distinct job, so the large build can be broken down without losing the overall approach. - Review effort and BDD specs: Explain where the reader should spend review effort as Claude plans and begins building.
Why it matters: Reviewing the scenarios before Claude builds helps ensure the feature is described correctly without treating every plan as a lengthy review task.
Key terms: dependency planning, context switch, strategy plan, delivery plan, BDD, implementation plan, BDD specs, Gherkin scenarios
6.6 Try it now — build the delivery plan from the strategy
This section shows how to turn a strategy plan into reviewable delivery slices and refine the plan’s rules before implementation begins.
- Reviewable delivery slices: Describe how to ask Claude to turn the strategy plan into a delivery plan, and explain why the author chose thin vertical slices over larger chunks or a frontend/backend split.
Why it matters: The size and shape of each slice determine how easily you can review progress. - Per-slice delivery protocol: Explain the work pattern specified for every slice and the approval checkpoint the author added before Claude proceeds.
Why it matters: Putting the checkpoint in the delivery plan makes human review part of the process every slice follows. - Delivery plan review priorities: Describe how to handle unclear options Claude offers and identify which parts of the resulting delivery plan deserve close review.
Why it matters: Clarifying consequential choices and reviewing the plan at the right level keeps attention on decisions that shape all subsequent work.
Key terms: strategy plan, delivery plan, thin vertical slices, delivery protocol, BDD, Gherkin scenarios, guard clause, CLAUDE.md, slicing the delivery, way of work
6.7 Building the first feature with BDD
The section explains how per-slice implementation plans turn a strategy and delivery plan into build details while giving the reader a chance to steer Claude before coding.
- Per-slice implementation plans: Describe how each slice gets an implementation plan based on the existing plans and design documents, and why Claude should review the approach and flag issues before building.
Why it matters: The plan gives you build details and a chance to catch problems before code is written. - Human steering through slices: Explain why planning at different levels and dividing work into slices keeps the reader involved, despite being slower than letting Claude proceed without input.
Why it matters: Smaller planned slices preserve your ability to guide the work before Claude commits to extensive code.
Key terms: strategy plan, delivery plan, implementation plan, slice, design documents, plans at different levels, slices, tech lead, let Claude go
6.8 Try it now — write the implementation plan for slice 1
The section follows the first slice from an implementation plan through a Gherkin review gate, build, and test, showing where human review changes the work.
- First slice plan alignment: Explain how the first slice’s implementation plan is checked against the delivery plan, strategy plan, and design before building.
Why it matters: A short prompt can be sufficient when the plans carry the constraints and you check that they agree. - Gherkin review gate: Describe how the planned hard stop lets the author review and revise the Gherkin feature before implementation continues.
Why it matters: The pause makes the scenarios a practical point to correct requirements before Claude builds against them. - Separate BDD test data: Explain why the author separated the BDD test deployment from their own local Docker stack.
Why it matters: Test isolation lets repeatable end-to-end tests run without destroying data used for manual exploration.
Key terms: delivery plan, strategy plan, design, implementation plan, first slice, hard gate, Gherkin scenarios, feature file, channel naming rules, BDD tests
6.9 Using subagents to build plans in parallel
The section explains why dependent feature slices must be built in sequence, even though their plans can be generated in parallel to keep work moving.
- Parallel builds and dependencies: Distinguish using subagents within one Claude Code session from running separate sessions on independent features, and explain why the delivery plan’s slices could not be built in parallel.
Why it matters: It helps you distinguish work that can safely run concurrently from work whose dependencies require an order. - Parallel planning and review: Explain how generating the slice plans in parallel can improve productivity while keeping implementation in small, sequential increments.
Why it matters: It provides a way to save time without giving up the author’s preference for reviewing and building features incrementally.
Key terms: parallelism, subagents, Claude Code, delivery plan, slices, plans, slice N+1, slice N, small increments
6.10 Try it now — use subagents to build all the implementation plans
The section shows how Claude can create a coordinating prompt that uses subagents to plan the remaining vertical slices in parallel and review the resulting plans.
- Parallel planning prompt: Explain why the author asks Claude to write the prompt for parallel implementation planning and what that prompt must account for.
Why it matters: Parallel work needs enough shared direction to keep the separate plans aligned. - Coordinated slice planning: Trace how the generated prompt turns a new Claude session into a lead agent that coordinates parallel plans and resolves open decisions.
Why it matters: The lead agent makes parallel planning a coordinated process rather than six disconnected outputs. - Independent plan review: Describe the three review focuses and explain why the lead agent used fresh subagents to review the plans.
Why it matters: Independent reviewers can reveal gaps and competing conclusions before the plans are used to build features.
Key terms: subagents, slices, dependencies, open decisions, main agent, lead agent, vertical slice, implementation plans, reviewers, gaps
6.11 Your turn: Implement the remaining features
This section shows how to finish the remaining feature slices by reviewing Gherkin scenarios before building, then verifying each completed slice.
- Gherkin-first review focus: Explain why the main review happens when the Gherkin files are created: the scenarios should be correct and complete before Claude builds the features, because changing a test plan is faster than changing a built feature.
Why it matters: Reviewing expected behavior before implementation makes omissions cheaper to fix. - Per-slice acceptance checks: Describe what to verify after Claude completes each slice: deploy the app, run the new unit tests and BDD suite with everything passing, and use the Gherkin scenarios to guide exploratory testing.
Why it matters: These checks give you evidence for accepting each slice rather than trusting the completed build alone. - Parallel scenarios sequential builds: Describe the author’s approach to the remaining work: use subagents to draft Gherkin files for the slices, mark scenarios by slice for ordered review, fix omissions, then run the remaining implementation plans in sequence.
Why it matters: Parallel drafting can speed preparation without losing the order needed to review scenarios and build slices.
Key terms: BDD, Gherkin scenarios, test plan, slice, unit tests, BDD suite, exploratory testing, acceptance, subagents, Gherkin feature files
6.12 Summary
Concepts explained in this chapter
- behavior-driven developmentBehavior-driven development is a software development technique that specifies and validates behavior through examples expressed in a shared natural-language format.
- implementation planAn implementation plan is a structured description of the work, decisions, and sequence required to build a software feature or system change.
- strategyA strategy plan is a high-level plan describing the overall approach for delivering a software feature or initiative.
- subagentA subagent is an agent assigned work by another agent, typically operating in a separate context.
- feature fileA Gherkin feature file is a text file containing structured behavior scenarios for an application feature.
- Gherkin testA Gherkin test is a behavior-focused acceptance test expressed as a structured natural-language scenario.
- delivery planA delivery plan is a staged plan that organizes work into manageable increments for producing and reviewing a deliverable.
- vertical sliceA vertical slice is an end-to-end implementation that crosses the application's layers or components to deliver a complete feature path.
- end-to-end testingAn end-to-end test verifies an application flow across its user interface, services, and persistent data.
- parallelismParallelism is the execution of multiple independent development tasks or plans at the same time.
- permission modeA permission mode is a Claude Code setting that determines how Claude requests or receives authorization for actions.
- plan modePlan mode is an operating mode in which an AI coding agent produces planning documentation instead of implementation code.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
