If AI coding is lowering your code quality, you're not managing quality right
TL;DR Highlight
Seven layers of defense cut bugs while output rose 2-3x with coding agents
Who Should Read
Backend or full-stack developers worried that adopting coding agents will raise their team's bug count
Core Mechanics
- Have AI review requirements first
- After adopting spec-driven development, bugs in newly written code reportedly dropped sharply.
- Before that, up to a third of a feature's effort went to post-development bug fixing.
- The key step is having AI find gaps, edge cases, and conflicts with existing code in the requirements or tech design.
- Tests first, implementation second
- Have the agent think through test scenarios from the requirements first.
- Then write tests, write the implementation, run the tests and fix issues, and backfill coverage gaps.
- This avoids tests that merely pass on bugs the agent just introduced.
- Manual testing is not replaced
- Human testing of edge cases saw only modest productivity gains.
- That is why output rose 2-3x rather than 10x.
- E2E tests are only a rough check and don't replace manual testing.
- Split quality checks into separate passes
- The author finds agents poor at following complex instructions in AGENTS.md or CLAUDE.md.
- Separate passes for security, duplication, naming rules, logic review, and AI-ese comments work well.
- Adding them to the implementation skill costs about 5-15 minutes.
- Two AI reviewers catch different issues
- The current team runs both Claude and Cursor reviews on PRs.
- Each finds different problems.
- Since AI can be nitpicky, add an agent pass that prunes meaningless comments.
- Complex changes still need human review
- The author still regularly finds big-picture mistakes, adverse interactions, and overcomplicated implementations.
- For minor tweaks and simple bug fixes, human review can be optional if the other layers exist.
Community Reactions
- Opinion that tests end up mirroring the implementation
- One commenter suggested running two sub-agents in parallel for tests and implementation so neither pollutes the other's context.
- Skepticism about coverage numbers
- A commenter argued that 95%+ coverage says nothing about the solution itself.
- Another recommended a functional core, imperative shell design instead.
- Experience applying it to legacy code
- One commenter used Claude on a 22-year-old legacy system for dependency updates, security audits, and new features.
- They raised coverage from 65% to 80%+ and still review code before merging.
- Doubt about TDD with agents
- A commenter cited an HN article concluding that asking agents to do TDD wasn't particularly helpful.
- They worried about slower work, more tokens, and more code to review.
- Limits of turning authors into editors
- One commenter said finding bugs in AI code can be harder than writing correct code yourself.
- Another said they can't tell working code from great code in languages they aren't fluent in.
How to Apply
- Run a requirements gap-review prompt
- Today, paste the spec of the feature you're building into an AI before implementing.
- Check the proposed edits yourself, since AI can invent issues.
- Add quality passes to your implementation skill
- Split security, duplication, naming, and logic checks into separate passes in your agent workflow.
- Measure whether implementation time grows by 5-15 minutes.
- Add two AI reviews plus a pruning pass to PRs
- Run reviews from different models on each PR.
- Add a final agent pass that filters out trivial comments.
- Connect your error tracker to auto-diagnosis
- Have an agent root-cause errors captured by a service like Sentry and open fix PRs.
Try It
# Paste into a Claude or ChatGPT chat (the article's Layer 1 method turned into a prompt)
Review the requirements document below. Do not write code.
Find: 1) missing requirements and edge cases 2) unexpected interactions with existing code 3) contradictions or ambiguities in the scenarios
[Requirements]
{{requirements document}}
[Existing code context]
{{relevant code or description}}
Give a one-line rationale for each problem, and mark anything that may not be a real issue as 'uncertain'.
Next step: add only the confirmed items to the requirements, then ask 'write test scenarios based on these requirements first'.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques