adam bien's blog

Agents Love The Web Platform's Backward Compatibility 📎

Without further instructions, an agent writes web code from everything it saw during training: tutorials, framework docs, Stack Overflow answers, blog posts from 2014. The output mixes all of it. Restricting the grounding to normative Web Platform specifications (HTML, DOM, CSS, ECMAScript, ARIA) removes the mix.

The Web Platform is unusual as a corpus, because it hardly contradicts itself. A DOM example from 2012 and a DOM example from today still describe the same platform, so old and new material reinforce each other. Documentation for two major versions of the same framework contradicts itself instead, and an agent that read both has no way to tell which half applies.

Public specifications and multiple independent implementations help as well. Neither would be worth much without the strict backward compatibility: a public specification that gets replaced every few years produces the same contradictions as a framework.

Grounded against the specifications, the usual mistakes get rare:

  • presenting Chrome behavior as a standard;
  • confusing React or Angular conventions with browser requirements;
  • inventing APIs that only exist in a framework;
  • declaring an older API invalid because a newer one exists;
  • treating browser error recovery as authoring advice.

The generated code uses the platform directly: semantic HTML, DOM APIs, Custom Elements, form-associated elements, standard events and CSS. Fewer dependencies and less ceremony. The code also survives longer, because a build tool changing its internals does not force a rewrite.

One catch: backward compatibility also preserves what the platform got wrong. Browsers keep supporting obsolete markup and historical quirks, because existing sites depend on them. Browser support is not an authoring recommendation. An agent grounded in the specifications has to know the difference, and it has to check the browser versions the project supports, not only the specification text.

The web platform section at airails.dev ships the skills that encode this: web-conventions, web-static, web-components, and web-latest.