Ptree: Interactive Tree of Life Explorer Blog & articles

Blog · Craft · · 2 min read

Steering coding agents away from slop

Large parts of Ptree's pipeline, tests, viewer refinements, and this blog were written with AI coding agents. Pretending otherwise would be dishonest, and pretending it works out of the box would be just as dishonest.

The biggest hazard an LLM brings to a codebase like Ptree is not hallucinated syntax or forgotten imports. It is the statistical average of ten million corporate React repositories baked straight into its weights.

The habits you have to beat out of the model

Leave a frontier model unguided on a vanilla HTML/CSS/JS codebase and watch what it reaches for within thirty seconds:

  • Defensive ?. chains, || "" fallbacks, and try/catch blocks around your own DOM elements.
  • JavaScript objects mirroring DOM state, plus a render() function that wipes innerHTML and rebuilds nodes on every click.
  • Wrapper <div>s, BEM class names, and requestAnimationFrame loops where CSS transition and @property already do the work.
  • Hedged, self-important prose with colons in every heading ("The two rules behind every category"), bold-lead-in bullet spam, and moralizing wrap-up paragraphs.

None of those are random mistakes. They are the exact median of what the internet considers "clean, maintainable code." If you want a codebase that sits far off the median, polite suggestions in a prompt do nothing; the model snaps back to React muscle memory two turns later.

Doctrine, tests, and real browsers

Making coding agents genuinely useful on Ptree took three concrete constraints:

  1. An unapologetic AGENTS.md that names the forbidden priors first. The very first paragraph of Ptree's AGENTS.md warns the agent directly that its React and CSS-in-JS instincts are the single largest risk it brings, and forbids null guards on trusted DOM, :has() in viewer stylesheets, wrapper divs, and rebuild-on-change before describing a single file path.
  2. Executable invariants instead of prose checklists. Telling an agent "keep generated files in sync" fails eventually; running a staleness check on every generated fragment, a release gate with an open-issues manifest (which fails on both regressions and unexpected passes), and contract tests that parse every viewer link against the real router makes drift impossible to hide.
  3. Real browser engines instead of headless screenshots. Agents are forbidden from installing Playwright or Puppeteer or passing tests by staring at screenshots. Browser verification runs on real Chrome, Safari, and Firefox over WebDriver on BrowserStack, asserting real layout geometry, console errors, and forced-repaint checks while visual judgment stays human.

What is never delegated

Agents are extraordinary at mechanical verification, pipeline plumbing, SQLite folds, refactoring across twenty files, and searching 310 source dictionaries for anomalies. They are never handed biological meaning or editorial taste.

What a specialist term actually means, which cross-kingdom bin owns it, whether a 19th-century taxonomy edge is a homonym or a synonym, and whether an animation feels right on screen are human calls. An agent without that boundary smooths opinionated choices back into cautious gray mush in both data and prose.

Used without taste, coding agents produce mountains of median software faster than any team ever could. Used inside a sharp doctrine with ruthless deletion and real measurements, they let one developer build and maintain a 13.6-million-taxon reference that would otherwise take an institute.