A practical checklist to keep AI-generated code fast, lean, and production-ready.
AI speeds up development β but without guardrails, it can quietly:
Inflate bundle size
Hurt performance
Introduce bad patterns at scale
This checklist keeps you in control.
What to Watch For
π΄ Critical (Fix Immediately)
π΄ All AI-generated
<img>elements have explicitwidthandheightattributesπ΄ No AI-generated code imports an entire library when only one function is needed
π Important (Optimize Before Shipping)
π AI-generated imports are checked against a heavy-dependency list (
moment,axios,lodash, full icon libraries)π AI-generated heavy libraries (chart libraries, editors, PDF parsers) are wrapped in
dynamic import()π AI-generated animations use
transform/opacityβ not layout-triggering propertiesπ AI-generated transition properties are explicit β not
transition: allπ AI-generated font loading is via
<link>in HTML β not via CSS@importor JSπ AI-generated data fetching uses
Promise.allfor parallel requests β not sequentialawaitπ AI-generated React components use Server Components where interactivity is not required
π‘ Nice-to-Have (Scale & Maintainability)
π‘ Project-level AI context files (
.cursorrules, Copilot instructions) encode performance standardsπ‘ ESLint rules enforce image dimension requirements and ban problematic import patterns
π‘ Bundle size limits (
size-limit,bundlesize) catch regressions from AI-generated imports in CIπ‘ AI-generated prompts specify performance constraints upfront
Quick Self-Check
Before merging AI-generated code, ask:
Does this increase bundle size unnecessarily?
Can this be lazy-loaded or split?
Is this the most minimal import possible?
Will this cause layout shift or reflow?
Why This Matters
π¬ Whatβs one bad AI-generated pattern youβve caught recently?
Top comments (0)