Rewriting legacy code via doc distillation: why E2E tests are the guardrail that matters
dotey · x · 2026-09-28
A workflow gaining traction: distill a legacy codebase into a detailed feature spec, then have the latest model rewrite the project from that spec. dotey shares his hands-on caveats:
- Don't expect stability on day one — rewritten code needs a validation period.
- Old unit tests lose value since the code structure changed; skip them.
- E2E tests are the real guardrail: before rewriting, have AI write tests covering the main flows, then use them to verify the rewrite and future changes. Playwright is mature enough for web E2E.
- E2E limits: flaky under environment changes and slow to run, so cover only main flows and don't run them too often.
More from coding & agent
- Base44 launches Base Code, turning existing codebases into AI-powered team workspaces — omarsar0 · 2026-09-29
- Paper-proposed sandbox-and-interception AI safety mitigation already implemented in verifiers v1 — xeophon · 2026-09-29
- WebMCP lands everywhere in one morning: Meta wearables, Shopify checkout, Cloudflare — jeff_weinstein · 2026-09-29
- A 9-feature roadmap for building AI agents with Claude Code, from CLAUDE.md to MCP — MaryamMiradi · 2026-09-29
- Zeeg: Paper won't work with WSL, seeking structured visual design agent workflows — zeeg · 2026-09-29
- OriginTrail ships DKG V10.0.19 on mainnet for faster AI agent context graphs — melnykowycz · 2026-09-29