The Case for Killing Boilerplate
AI makes old code patterns obsolete. Why boilerplate code, scaffolding, and repetitive patterns should be generated on demand rather than maintained by hand.
Sixty percent of the average codebase is boilerplate. Configuration files, data access layers, API route handlers, type definitions, validation schemas, test setup, build configuration -- code that follows predictable patterns, varies only in the specifics, and exists because the framework or language demands it, not because the problem requires it.
Developers have always known this code is tedious. They've built generators, scaffolding tools, and template systems to reduce the burden. But they've always maintained the generated code as if it were hand-written, updating it when requirements change, debugging it when it breaks, and reviewing it during code review.
AI changes this equation entirely. When AI can generate boilerplate on demand in seconds, maintaining it by hand becomes a cost with no corresponding benefit. The case for killing boilerplate -- not just generating it, but fundamentally rethinking whether it should exist as maintained source code -- is stronger than ever.
Key Takeaways
- 60% of maintained code is boilerplate that follows predictable patterns and varies only in application-specific details
- AI generates boilerplate 100X faster than humans and with fewer errors, making manual maintenance an unnecessary cost
- Generated-on-demand patterns replace maintained boilerplate by deriving repetitive code from specifications at build time
- Killing boilerplate reduces code review burden by 40% because reviewers focus on logic and architecture instead of verifying repetitive patterns
- The frameworks winning in 2026 are those that eliminate boilerplate rather than those that make it easier to write
What Counts as Boilerplate
Boilerplate is code that you write because the system demands it, not because the problem requires it. It follows templates. It repeats patterns. It varies only in the names and types of the things it operates on. Specifically:
Data access layers. CRUD operations for database entities. The pattern is always the same: query builder, parameterized SQL, result mapping, error handling. Only the table name, column names, and types change.
API route handlers. Request parsing, input validation, authorization checks, business logic delegation, response formatting, error handling. The structure is identical for every endpoint.
Type definitions. TypeScript interfaces that mirror database schemas, API contracts, and configuration structures. These are derivable from the source of truth but manually maintained as separate files.
Validation schemas. Rules that enforce constraints already defined in the database schema or API contract. Duplicated definitions of the same constraints in a different format.
Test scaffolding. Setup, teardown, mock configuration, and assertion patterns that repeat across test files with only the subject under test changing.
Configuration files. Build configuration, linting rules, CI/CD pipeline definitions that follow standard patterns with project-specific values plugged in.
Each category has the same characteristic: a predictable structure with application-specific values. This is exactly the class of work that AI handles effortlessly.
Why We Maintained Boilerplate Before AI
Before AI tools could generate code reliably, boilerplate had to be maintained because it had to be correct. A manually written data access layer might be tedious to create, but once written, it was verifiable, debuggable, and under version control.
Generators existed, but they had limitations. They produced code at a point in time, and when the generated code needed to change -- a new column, a modified validation rule, a changed API contract -- the developer had to modify the generated code by hand. This meant the generated code became maintained code the moment it was first modified.
AI eliminates this limitation. An AI agent can regenerate boilerplate from specifications every time something changes. The data access layer doesn't need to be maintained because it's regenerated from the database schema whenever the schema changes. The API handlers don't need manual updates because they're regenerated from the API contract.
The Generated-on-Demand Pattern
The generated-on-demand pattern replaces maintained boilerplate with specifications that produce code at build time:
Specification (maintained by humans)
↓
AI Generation (at build time)
↓
Generated Code (never maintained, always regenerated)
Example: Data Access from Schema
Instead of maintaining a data access layer, maintain only the database schema:
-- This is the source of truth (maintained)
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
customer_id UUID REFERENCES customers(id),
total DECIMAL(10,2) NOT NULL,
status TEXT CHECK (status IN ('pending', 'shipped', 'delivered')),
created_at TIMESTAMPTZ DEFAULT NOW()
);
At build time, an AI skill generates the data access layer:
// This is generated, never maintained
export async function getOrder(id: string): Promise<Order> { ... }
export async function listOrders(filters: OrderFilters): Promise<Order[]> { ... }
export async function createOrder(data: CreateOrderInput): Promise<Order> { ... }
export async function updateOrder(id: string, data: UpdateOrderInput): Promise<Order> { ... }
export async function deleteOrder(id: string): Promise<void> { ... }
When the schema changes -- a new column, a modified constraint -- the data access layer is regenerated automatically. No human touches the generated code.
Example: Validation from Contracts
Instead of maintaining validation schemas separately from API contracts, derive them:
# API contract (maintained)
paths:
/orders:
post:
requestBody:
schema:
type: object
required: [customer_id, total]
properties:
customer_id:
type: string
format: uuid
total:
type: number
minimum: 0.01
status:
type: string
enum: [pending, shipped, delivered]
default: pending
The AI generates Zod schemas, route handlers, and TypeScript types from this single source of truth. One specification, no maintained boilerplate.
What You Gain
Reduced Maintenance Burden
Every line of maintained code is a potential source of bugs and a target for code review. Reducing the maintained codebase by 60% proportionally reduces the maintenance burden. Developers spend their time on business logic, architecture, and user experience -- the code that actually differentiates their application.
Consistency Guarantees
Generated code is perfectly consistent. Every data access function follows the same pattern. Every validation schema matches its API contract. Every test follows the same structure. The class of bugs caused by inconsistent boilerplate -- one endpoint handles errors differently, one validation schema is missing a constraint -- disappears entirely.
Faster Code Review
Reviewers currently spend significant time verifying that boilerplate code follows established patterns. When boilerplate is generated, this verification is unnecessary. Code review focuses on the specifications and the business logic, which is where the interesting decisions live.
Fearless Schema Changes
The biggest practical benefit is that schema changes become trivial. Adding a column, modifying a constraint, or renaming a field used to require updating every layer that touches that data. With generated-on-demand boilerplate, the schema change is the only change. Everything else regenerates.
What You Need to Be Careful About
Custom Logic in Generated Code
The generated-on-demand pattern breaks when developers add custom logic to generated files. If your data access layer includes both generated CRUD operations and hand-written complex queries, regenerating the file destroys the custom code.
Solution: keep generated code and custom code in separate files. Generated code goes in a generated/ directory that is always safe to regenerate. Custom code imports from generated/ and extends it.
Build Time Costs
AI generation adds time to the build process. For large projects with many specifications, this overhead can be significant. Cache generated output and regenerate only when specifications change to minimize build time impact.
Debugging Generated Code
When a bug appears in generated code, you can't fix it by modifying the generated file -- the fix would be overwritten on the next regeneration. Instead, fix the specification or the generation skill. This requires understanding the generation process, which is a different skill from understanding the generated code.
Specification Quality
Generated code is only as good as its specifications. Incomplete or ambiguous specifications produce incomplete or incorrect code. The quality bar shifts from code quality to specification quality, which requires different skills -- closer to skill design than traditional programming.
Frameworks Leading the Shift
The frameworks gaining traction in 2026 share a common characteristic: they minimize boilerplate rather than just organizing it. They're designed around the principle that if code follows a predictable pattern, it should be derived rather than written.
Convention-over-configuration frameworks have always headed in this direction. AI takes the concept further by allowing conventions to be expressed in natural language rather than rigid framework rules.
The AI skills ecosystem is producing generation skills for every major framework. These skills know the framework's conventions and generate boilerplate that follows them perfectly, eliminating the learning curve of memorizing framework patterns.
A Practical Migration Path
Step 1: Identify Boilerplate
Audit your codebase for files that follow repetitive patterns. Data access layers, route handlers, type definitions, and validation schemas are the usual suspects. Count the lines of boilerplate versus the lines of business logic.
Step 2: Extract Specifications
For each boilerplate category, identify the source of truth. Database schemas drive data access layers. API contracts drive route handlers and validation. Configuration schemas drive type definitions. Document these specifications in machine-readable formats.
Step 3: Build Generation Skills
Create AI skills that generate boilerplate from specifications. Start with the simplest category -- usually type definitions from schemas -- and expand to more complex categories as confidence grows. For guidance on building skills, see our skill development resources.
Step 4: Separate Custom Code
Move any custom logic out of files that will become generated. Create extension points where custom code can augment generated code without living in the same file.
Step 5: Automate
Integrate generation into your build pipeline so that specifications automatically produce fresh boilerplate. Add CI checks that verify generated code matches current specifications, catching desynchronization before it reaches production.
FAQ
Won't AI-generated code have bugs?
AI-generated code has bugs at comparable rates to human-written code. The difference is that generated code bugs are systematic -- if the generation template is wrong, every generated file is wrong in the same way, making the bug easy to find and fix once.
How do I review generated code?
Review the specification and the generation skill, not the generated output. If the specification is correct and the generation skill is tested, the output is reliable. This shifts review effort from volume to quality.
What if my boilerplate is too complex for AI to generate?
If your boilerplate is too complex for AI to generate, it probably isn't boilerplate. Complex, unique code should be maintained by humans. True boilerplate is simple enough that generation is reliable.
Does this mean fewer developers are needed?
No. It means developers spend their time on work that requires human judgment rather than work that follows templates. The total volume of software continues to grow, and the hard problems remain hard.
What frameworks support generated-on-demand best?
Frameworks with strong convention-over-configuration philosophies (Rails, Next.js, Django) adapt most naturally. Schema-driven frameworks (GraphQL, Prisma) are designed for this pattern.
Sources
- Software Engineering Research: Code Duplication - Studies on boilerplate and duplicated code in production codebases
- Schema-Driven Development - Patterns for deriving code from specifications
- Next.js Documentation - Framework patterns that minimize maintained boilerplate
Explore production-ready AI skills at aiskill.market/browse or submit your own skill to the marketplace.