Basics

What is boilerplate — and why it matters now that AI types for free

Illustration: a stack of identical metal plates printing the same text over and over

Boilerplate always had one justification: "so you don't retype the same thing." Fair. Which means it should have died by 2026 — typing is free now, a model spits out a hundred lines in two seconds.

It didn't die. It got more useful. Only now it's useful not to you, but to the model. Let me explain.

What boilerplate is

Boilerplate is code you write almost identically in every project. It solves nothing about your actual problem, but nothing starts without it: project setup, wiring dependencies, the standard skeleton of a file.

The name comes from 19th-century newspapers. Syndicates mailed ready-made content — columns, ads, obituaries — cast onto metal plates as thick as the sheets used for steam boilers. A plate couldn't be edited: it went into the page as-is. So "boilerplate" came to mean text you drop in whole, unread.

Lawyers picked the word up first, programmers second. Same meaning: a standard block you paste without thinking.

Where you've already seen it

  • The HTML skeleton: <!DOCTYPE html>, <head>, <meta charset>. Same thing every time.
  • A fresh package.json — name, version, scripts. Three lines of it are actually yours.
  • Configs: linter, bundler, .gitignore. Copied from project to project for years.
  • Wrapping around the code: imports, error handling, exports. In a 40-line file, twelve lines do the work.
  • Legal text: privacy policy, license. Same principle, human language.

Notice: in none of these is boilerplate "bad code." It's necessary and uninteresting. That's the precise definition.

Boilerplate, template and framework are not the same

Three words people constantly mix up:

  • Boilerplate — repeated lines inside your code. You write (or paste) them yourself.
  • Template (starter) — a ready-made whole project: download, rename, start working. Boilerplate packaged as a repository.
  • Framework — not text but rules. It doesn't hand you lines; it dictates structure and calls your code.

The practical difference: boilerplate you can rewrite however you like, a framework's rules you can't.

Why AI didn't kill boilerplate — it raised its value

Here's the surprising part.

A model doesn't write code "from the docs." It writes by example of what it sees nearby — open files, neighbouring modules, whatever you put in its context. The more uniform your project, the better its aim.

Which leads somewhere non-obvious: boilerplate isn't clutter, it's ruts in the road. If all twenty files handle errors the same way, the model will write the twenty-first the same way. If every file is its own snowflake, it'll pick a pattern from its own head — usually whatever's most popular online, not what you use. That's how you get a zoo: three different database styles in one project.

Hence the working move: start with one reference file, not a prompt. Write (or polish with the model) one module exactly as you want them all, then ask: "do it like users.js." That beats describing a style in words — same principle as feeding AI context about your project.

Where boilerplate hurts

Don't turn this into a cult. Two traps.

One — the 300-file starter you downloaded. You grab an all-inclusive template and half of it addresses problems you don't have. With vibe coding this stings twice: you don't understand the code, and the model burns context reading someone else's abstractions. An empty project plus three files you understand beats it.

Two — copy-paste pretending to be boilerplate. If the same block shows up a third time and changes together everywhere — that's not boilerplate, that's a duplicate. Boilerplate stays boilerplate while it's static. The moment you must edit it in five places at once, move it into a library or a shared function.

Is boilerplate bad?

Not in itself. It's bad when nobody understands it: a config got copied, it "works," and no one knows why. Simple rule — paste freely, but any line you can't explain, ask the model about right now.

How is boilerplate different from scaffolding?

Scaffolding is the action: a command generates the project skeleton for you (create-next-app and friends). Boilerplate is the result — those files. Scaffolding produces boilerplate.

Should I keep my own starter?

If this is your third similar project, yes — make a repository with your minimal skeleton. A ten-file starter of your own beats a three-hundred-file one from strangers: you know every line, and the model finds its way around it fast.

Become an AI architect — don’t just read about AI

The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.

About the Academy
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →