Overview

3 AI as a partner and problem

The chapter argues that AI should be treated as a tool for Lean development, not as a teammate that shares decision-making. It opens with a cautionary example: code generated by AI can look correct, pass tests, and still encode business behavior that nobody intentionally chose. The central point is that AI speeds up both value and waste, so teams need a way to distinguish between the two before they let generated output harden into the system.

A Lean approach keeps the human above the loop, where they define intent, constraints, and success criteria, while AI operates inside the loop to reduce mechanical effort. In practice, this means using AI for low-commitment work such as scaffolding handlers from contracts, generating failing tests from specs, and summarizing pull requests so reviewers can focus on decisions rather than reconstruction. When AI is constrained in this way, it shortens feedback cycles, reduces setup friction, and preserves human judgment for business logic and design choices.

The chapter also shows how AI can create waste when prompts are vague or when teams let it invent requirements, abstractions, or error handling. That leads to overproduction, inventory, extra processing, and deferred decisions that reviewers and maintainers must later untangle. To prevent this, teams need AI standard work: shared expectations for where AI may act, what it may generate, what must remain human-owned, and how AI use should be documented. The result is not rigidity, but flow protection—less variability, fewer surprises, and a system that is easier to review, maintain, and improve.

A human developer embedded within the AI-governed execution loop.
A human developer positioned above the AI-governed execution loop.
Separating high commitment decisions from low commitment execution.
Low effort + low commitment = Lean AI usage.
How unconstrained AI generates cascading waste.
Examples of four wastes hidden in "complete" AI-generated code.
Standard work stabilizes AI output variability.
Use AI heavily when changes are cheap to reverse and sparingly when they're expensive to undo.
Standard work filters AI output, protecting flow and preventing rework later.
Systematic comparison of handwritten versus AI approaches.

Summary

  • Position matters: Keep yourself above the loop, not inside it. AI is a power tool, not a collaborator. You design the system; AI executes within the boundaries you set.
  • AI creates value when it reduces effort without increasing commitment: scaffolding, test skeletons, PR summaries, and other low-commitment work that accelerates feedback. AI creates waste when it invents behavior: overproduction, premature abstraction, and decisions disguised as completeness.
  • Waste hides in "productivity": Fast output feels like progress. But code that looks complete, tests that pass, and high velocity can still mask inventory, deferred decisions, and underused skills.
  • Standard work stabilizes the system: shared AI personas, prompt templates, and PR templates make output predictable. Standards aren't rules; they're baselines for improvement. They protect the flow by filtering waste before it enters your system.
  • Prompts are interfaces, not magic spells: constrain what AI does with negative constraints, reference contracts, bias toward less, and separate thinking from code generation. The test for any prompt: Does this reduce downstream work?
  • Visibility prevents waste from surviving review: When reviewers can't see the value stream, the prompt, the contract, the decisions, they approve what looks reasonable. PR templates that expose intent, AI usage, and deferred decisions shift reviews from "does it work?" to "does it serve the intent with minimal waste?"

FAQ

What does it mean to keep the human above the loop when using AI in software development?

It means the human remains responsible for defining intent, constraints, and success criteria, while AI operates as a tool within the execution flow. The human designs and observes the system instead of merely approving AI output after the fact.

Why is the “AI as pair programmer” metaphor considered risky?

Because it suggests AI is a peer in decision-making, which can pull the human into the loop as an executor rather than keep them above it as a system designer. That obscures where value is created and makes it easier for waste and invented behavior to slip into the codebase.

How can AI help a Lean development workflow?

AI helps when it removes mechanical friction without absorbing human judgment. Good uses include scaffolding, generating test skeletons, producing review summaries, and handling boilerplate so developers can get faster feedback with less waste.

What kinds of AI usage create waste instead of value?

Waste appears when AI is asked to make decisions it shouldn’t make, such as inventing business rules, adding unnecessary validation, or creating abstractions with no current value. This leads to overproduction, inventory, extra processing, and defects that must be reviewed and maintained later.

Why is an unconstrained prompt like “Implement the GET /orders/:id endpoint” problematic?

It leaves too much undefined, so AI fills in missing details with assumptions. The result may look complete, but it can include invented rules, status codes, validation, or abstractions that were never requested and now become someone else’s maintenance burden.

What is “intent” in Lean terms for AI-assisted development?

Intent is the explicit definition of the problem, the constraints, and the success criteria. It tells both humans and AI what outcome is desired, reducing ambiguity and limiting rework, clarification, and late-stage corrections.

How does AI support test-driven development without replacing it?

AI can generate test scaffolding and reduce setup friction, but the developer still defines the behavior and writes the implementation. This keeps TDD intact while cutting down the waiting and motion that often slow teams down.

What is standard work for AI-assisted development?

Standard work is the team’s documented best-known way to use AI under current conditions. It defines where AI is allowed to act, what prompts and outputs are acceptable, where human judgment must intervene, and how AI usage should be documented.

Why should AI prompts for production code reference a contract or spec?

Because a spec or contract constrains AI behavior and prevents it from inventing requirements. Referencing source artifacts like API specs or schemas keeps the output aligned with explicit intent and reduces downstream waste.

What is the main Lean principle behind using AI effectively?

Use AI to reduce effort without increasing long-term commitment. If AI speeds up work but also creates more code, more assumptions, or more review burden, it is adding waste rather than creating value.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build High Value Software Systems ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Build High Value Software Systems ebook for free