
Avoid technical debt when using AI by making maintainability an acceptance condition for every task. Give the agent architecture boundaries, naming rules, supported dependencies, and a definition of done that includes tests and documentation. Generated code becomes debt when nobody can explain, change, or safely remove it.
Keep tasks small enough to review as one idea. Ask for the plan and affected interfaces before implementation. Require reuse of existing patterns unless a new abstraction solves a stated problem. Reject speculative helpers, duplicate data models, broad dependency upgrades, and silent compatibility layers. For each change, verify behavior, error paths, migration safety, and cleanup. Record why a non-obvious decision was made and what would trigger revisiting it. Schedule deletion and simplification work instead of allowing temporary code to become permanent by default.
Watch leading indicators: growing diff size, repeated exceptions to project rules, slow tests, unclear ownership, copy-pasted logic, and files that agents repeatedly misread. These signals matter before a conventional debt metric appears. A short review checklist applied consistently is more useful than an occasional large cleanup.
AI can also help pay debt down, but prevention is cheaper. Make the agent return evidence, not confidence: changed files, commands run, results, and remaining uncertainty. Accept code only when a human can trace the intent from requirement to implementation and test.
