Mistake L2 · Context engineering informational

Generate in Small Units, Not a Whole App at Once

What it is

A scoping rule: ask ChatGPT for one testable unit at a time — a function, a component, a module — and verify it before moving on, rather than requesting an entire app in a single prompt.

One mega-requesthard to trust· 'Build the whole app'· Hundreds of lines at once· One hidden bug taints allSmall unitsverifiable→ One function/module at a time→ Test each before the next→ Bugs stay isolated
Small units you can verify beat one giant blob you can't.

Why it works

A giant generation is impressive and unverifiable: you can't tell which of 300 lines is subtly broken, and one bad assumption early propagates everywhere. Small units keep each piece within what you can actually read and test, so errors stay isolated and cheap to fix.

When to use it

Any non-trivial build. The bigger and more interconnected the feature, the more it pays to slice it into units the model gets right one at a time.

When not to use it

Genuinely boilerplate scaffolding (a config file, a standard CRUD stub) where the whole thing is predictable and low-risk to generate at once.

Prompt

We're building <feature>. Let's go one piece at a time. Start with just <first unit> — its signature, implementation, and a test. I'll confirm it works, then we'll do the next piece.

Example

Instead of 'build a todo app', you generate the data model, then the store, then one component at a time — each verified — and never hit the tangled-blob debugging spiral.

Common mistakes

  • Prompting 'build the whole thing' and then debugging an opaque wall of code.
  • Moving to the next piece before the current one is verified.
  • Losing the thread of how pieces connect because none were reviewed in isolation.

Related