Disclosure: This guide is editorial. We cite primary sources for every claim about tooling behavior, and we do not accept vendor review copy.
In November 2026, engineer Evan X. Merz reached the Hacker News front page with a warning: AI-heavy teams are quietly building fragile codebases. Merz spent years at Meta before moving to another large tech company, and his argument centers on how agentic coding changes testing, complexity, and human understanding; the models' syntax skills are rarely the bottleneck. The same week, the Google Chrome team (together with Microsoft Edge, Mozilla Firefox, and MDN) shipped modern-web-guidance 1.0, an open-source skill package explicitly built to fix one root cause: coding agents keep generating legacy 2019-era JavaScript because that is what their training data is full of. This guide combines both signals into a practical playbook: why AI-generated code goes brittle, how to recognize it early, and what to actually do about it — including the modernization tooling Chrome wants your agents to use.

Why AI codebases go fragile: four failure modes

Merz's essay, based on watching peers at Meta and his current employer, names four recurring failure modes. They compound each other.

1. AI writes shallow tests

Agents gravitate toward trivial test cases: get/set coverage, happy-path e2e flows that mirror what already exists in the codebase. Line-coverage metrics look healthy while the tests that matter — edge cases, multi-user flows, failure paths — are missing entirely. The gap is invisible in coverage dashboards, which is exactly what makes it dangerous.

2. AI writes overly complex code

Models follow guidelines like DRY to a fault. Two or three helper methods appear where one would do. Rigid abstraction layers get introduced because the pattern "looks correct," even when they make the code harder to debug and harder for the next human (or agent) to reason about.

3. Human understanding decays

This is the structural one. The longer a team delegates generation to agents, the fewer people understand the data structures and architecture. Developers can no longer spot when a pull request introduces an abstraction that conflicts with pre-existing structures — because nobody holds the whole system in their head anymore.

4. The pace outruns the quality bar

Each agent-generated PR arrives faster than the last, and review time shrinks accordingly. Reviewers skim. Small issues — naming, test gaps, error handling — accumulate until the codebase becomes what Merz calls a "morass of spaghetti code."

Four symptoms you can measure

If you suspect agentic coding is degrading your codebase, Merz suggests looking for these patterns:
  • Incident frequency creeps up. Not immediately — a p0 at the end of month one, two SEVs the next month, then an incident every weekend a year later.
  • Recovery takes longer. When humans don't understand the code and the agent can't locate the customer-facing bug, mitigation time balloons.
  • Errors only users can see. Instrumentation and analytics get skipped, so uncaught errors surface in production instead of in dashboards.
  • UX degrades on both sides. The product is made by AI for AI: it fits neither how humans use it nor how humans maintain it.
The through-line: every symptom traces back to missing human judgment at specific points in the loop. Model capability is rarely the root cause.

The root cause Chrome is fixing: legacy patterns

There is a second, more mechanical problem. LLM training data contains enormous volumes of pre-2020 JavaScript. Even when a model knows a modern API exists, it often lacks the density of real-world, modern implementation patterns needed to use it correctly. The result: agents generate bloated script for tasks the web platform now solves natively — event-listener mouseover hacks instead of :hover, heavy polyfills instead of platform features, manual state management where native form validation would do. That is the gap modern-web-guidance is built to close.

What modern-web-guidance actually is

Modern Web Guidance is an open-source skill package stewarded by the Chrome, Edge, Firefox, and MDN teams. It ships curated guides for roughly 250 modern web features — from :has() and container queries to the Popover API, View Transitions, scheduler.yield(), and built-in AI APIs — and delivers them directly into your coding agent's context. Key facts:
  • Install: npx modern-web-guidance@latest install runs an interactive wizard. You can also try it without installing: npx modern-web-guidance@latest search "animate a dialog modal backdrop".
  • Legacy scan: npx modern-web-guidance@latest legacy-scan . scans a codebase for legacy patterns that have modern replacements.
  • Agent integrations: the repo ships plugins for Claude Code, Codex, Cursor, Grok, Kimi, and Gemini, so guidance lands where your agent already reads instructions.
  • Curation over volume: the guides are token-efficient; the team runs evals and prunes content models already know, keeping context windows lean.
  • Docs: the full documentation lives at developer.chrome.com/docs/modern-web-guidance.
At the time of writing the repository sits at 3.4k+ stars with active contribution from the browser vendors themselves — a strong signal that "agents generating legacy code" has become a platform-level concern.

A practical anti-fragility playbook

Combining the two sources, here is a workflow that keeps agentic coding fast without letting quality silently rot. 1. Keep a human on the architecture. Rotate ownership so at least one person can explain every core data structure. Use agents for exploration and first drafts, humans for structural decisions.
2. Demand behavioral tests, not coverage counts. In prompts, require agents to write tests for edge cases and failure paths — and reject PRs that only add trivial assertions. Coverage percentage is a vanity metric; test intent is what matters.
3. Throttle review throughput before it throttles you. Cap open agent PRs per reviewer. A review queue you cannot read carefully is a queue that ships tech debt.
4. Scan for legacy patterns on every sprint. Add modern-web-guidance legacy-scan (or an equivalent audit) to your regular maintenance pass, and convert flagged patterns to native platform features as you touch those files.
5. Feed agents modern guidance proactively. Install the skill plugin for whichever agent harness you use, so "use the platform API" beats "reimplement it in JS" by default.
6. Watch the lagging indicators. Track incident count, mean time to mitigation, and user-reported error rate quarterly. If all three drift up together, the codebase is telling you the human-touch points have eroded.

The bottom line

Ungoverned AI-generated code is what rots. The failure modes (shallow tests, over-abstraction, lost understanding, rushed review) are all governance problems, and they are fixable with deliberate human checkpoints. Meanwhile the legacy-pattern problem now has first-party tooling from the browser vendors themselves. Teams that wire modern guidance into their agents today are buying themselves a meaningfully cheaper refactor in 2027.

Sources

FAQ

Is the "fragile codebase" problem caused by specific models?

No. The failure modes described are workflow problems: review throughput, test intent, and institutional knowledge. Switching models without changing the workflow will reproduce the same fragility.

Does modern-web-guidance replace linting or code review?

No. It solves a narrower problem — steering agents away from legacy platform patterns toward modern native APIs. You still need review gates, behavioral tests, and incident tracking.

How do I know if my codebase already suffers from legacy AI patterns?

Run npx modern-web-guidance@latest legacy-scan . on your repository and review the flagged patterns. Pair the results with your incident and error-rate trends for a full picture.

Is the skill package free to use?

Yes. The repository is public under the Apache-2.0 license, maintained by the Chrome, Edge, Firefox, and MDN teams.