AI Technical Debt: A Pre-Code Architecture Check for Solo Builders
Learn how solo builders can catch AI-driven architecture flaws in requirements before they become expensive technical debt.
The most expensive AI-generated mistake is rarely an untidy function. It is an unstated product assumption that becomes a data model, an API contract, and several dependent features before anyone notices it was wrong.
For a solo builder, that is the dangerous form of AI technical debt. Without a second engineer reviewing the model, a locally reasonable choice can harden into structural debt at generation speed.
The most affordable time to catch that debt is before coding begins, while the architecture is still expressed as entities, states, relationships, and boundaries. A short pre-code check exposes decisions that become expensive after the agent builds on them.
This check complements the agent-ready PRD: the PRD records approved behavior, while the pre-code architecture check challenges the entities, states, boundaries, and failure paths most expensive to reverse.
What is AI technical debt?
AI technical debt is the future cost created when AI-generated implementation choices make a codebase harder to change, understand, or align with the product.
Some debt is local: duplicated logic, oversized functions, or inconsistent naming that review and refactoring can correct. Structural debt affects the shape of the system and spreads into everything built on it.
| Type of debt | Typical example | Usual cost of correction |
|---|---|---|
| Code-level debt | Duplicated validation or an oversized function | Often limited to a file or component |
| Structural debt | A missing entity, impossible state model, or coupled responsibility | Changes to schemas, APIs, workflows, tests, and existing data |
AI coding agents do not invent structural debt. They accelerate it. An agent can implement a reasonable interpretation, then use that code as context for the next task. Once several features depend on the assumption, revisiting it is no longer a small edit.
The control point is therefore not only code review. It is the requirement that authorizes the architecture.
The three product decisions behind structural debt
Most preventable architecture flaws begin with one of three decisions that remained implicit: what exists, how it can change, and where responsibility belongs.
| Decision | Question to answer before coding | Debt created when it stays vague |
|---|---|---|
| Entities and relationships | What are the important objects, and how do they relate? | Overloaded records, duplicated data, and painful migrations |
| States and transitions | What states can each object enter, and what moves it between them? | Flags, contradictory status fields, and unreachable edge cases |
| Boundaries and ownership | Which responsibilities must change independently? | Coupled services, repeated rules, and risky changes |
Under-modeled entities
Suppose a requirement says, "Customers can place and manage orders." An agent may create one order record with a total and status. That fails when the product needs split shipments, partial refunds, item-level returns, or separate payment attempts.
The requirement never established whether orders, payments, shipments, and returns were separate concepts or properties of one object.
Before implementation, name each product-significant entity and answer four questions:
What does it represent?
Which information does it own?
What is it related to?
Can it exist, change, or be deleted independently?
Define enough of the product model to stop the agent from collapsing distinct concepts into one record; you do not need every database column.
Missing states and transitions
A requirement often describes the happy path and leaves the model to infer the rest. A subscription is active or cancelled. An invitation is pending or accepted. An order is open or complete.
Real products also need awkward states: expired, partially fulfilled, recoverable, disputed, suspended, or cancelled in progress. Missing states later become special flags and exceptions.
For every important entity, list:
its valid states
the event that enters each state
which transitions are allowed or forbidden
what the user can do in each state
what happens when a transition fails halfway through
A state diagram is optional. An explicit transition list is not.
Wrong boundaries
Requirements create architecture by deciding what belongs together. If a ticket describes payment and fulfillment as one operation, an agent may couple responsibilities that need different failure handling and change cycles.
A boundary is useful when two responsibilities have different rules, failure modes, data ownership, or reasons to change. Ask:
Can these parts fail independently?
Will they change for different product reasons?
Does one own data the other should only reference?
Would separating them make an important rule easier to verify?
Separate responsibilities when the product requires independence, not because every noun deserves its own service.
A worked example: account deletion
Consider the requirement: "Users can delete their account."
It leaves architectural decisions unresolved. An agent could hard-delete the user and related data while violating recovery, billing, or retention rules that were never supplied.
A pre-code check exposes the missing decisions:
| Area | Decision to make |
|---|---|
| Entities | Account, deletion request, billing record, and active session are distinct concepts |
| Relationships | A deletion request belongs to an account; retained billing records remain linked without allowing product access |
| States | Active, deletion requested, recoverable, and permanently deleted |
| Transitions | Request deletion, restore within the recovery window, or purge after the window expires |
| Boundaries | Account access, data retention, billing history, and cleanup jobs have separate responsibilities |
| Failure path | A failed cleanup job must not reactivate access or leave the account in an undefined state |
The resulting requirement can now say what the architecture must support without dictating its implementation:
When a customer requests deletion, the account enters a recoverable deleted state for 30 days. Product access ends immediately, billing records required for retention remain available, restoration is permitted during the recovery window, and permanent cleanup begins only after the window expires.
The agent may still choose an imperfect design, but immediate hard deletion is no longer an equally valid interpretation.
The solo builder pre-code architecture check
Run this check before a product-significant requirement becomes a ticket. A small feature may take ten minutes; payments, identity, permissions, deletion, and shared data deserve more scrutiny.
1. Define the task boundary
State what changes, what must remain true, and what is out of scope. Non-goals stop the agent from adding related behavior simply because it appears useful.
2. Map entities and relationships
List the objects the feature creates, reads, changes, or deletes. Record ownership and lifecycle dependencies where they affect behavior.
3. Enumerate states and transitions
Include normal, empty, loading, failed, expired, cancelled, recoverable, and partially completed states where relevant. Define who or what can trigger each transition.
4. Test the boundaries
Separate responsibilities with different rules, failure modes, security needs, or reasons to change. Keep them together when separation protects no real product decision.
5. Walk through failure and recovery
Define the product outcome if a service fails, a task runs twice, or a process stops halfway through—not only the error message.
6. Make acceptance observable
Write acceptance criteria for the states and constraints that matter. "Works correctly" cannot reveal structural drift. "A declined payment preserves the cart and creates no confirmed order" can.
7. Record unresolved decisions
Do not hide uncertainty inside a prompt. Mark an open decision, choose an owner, and prevent implementation from treating it as settled.
Use a one-page architecture decision brief
The output does not need to be a large architecture document. A compact brief is enough for most solo-builder features.
| Field | What to record |
|---|---|
| Product outcome | The user or business result the feature must produce |
| Entities | Important objects and the information they own |
| States | Valid states and significant transitions |
| Boundaries | Responsibilities that must remain independent |
| Constraints | Security, retention, permissions, performance, or provider rules |
| Failure behavior | Expected behavior when the normal path does not complete |
| Non-goals | Related behavior the agent must not add |
| Acceptance criteria | Observable evidence that the implementation is correct |
| Open decisions | Questions that block or constrain implementation |
Supply this brief with the task. Existing code describes what exists; the brief describes what the new behavior is authorized to become. For task-level context selection, see context management for AI coding agents.
Review architecture without a second engineer
A second engineer often catches a weak boundary by asking why the system is shaped that way. Solo builders must preserve that question in the workflow.
Use a traceability chain:
Product decision -> requirement -> acceptance criteria -> implementation task -> code and tests
Before approving an AI-generated change, walk backward:
Which requirement authorizes this entity, state, or permission?
Which decision explains why the requirement exists?
Which acceptance criterion proves the behavior is correct?
Did the implementation add a structural choice that the requirement never approved?
If the answer is missing, pause. A sensible option is still a product decision: approve it explicitly or change the implementation.
When a requirement changes, this chain identifies the tickets, tests, and components that inherited it. That ongoing alignment is covered in managing context drift in AI-generated code.
Why a giant README is not enough
A README or instruction file suits stable conventions such as commands, coding style, and common workflows. It is a poor database for changing product behavior.
Long prose can mention accounts, subscriptions, invoices, and payments without establishing ownership or lifecycle. It may also preserve conflicting versions of a rule. The agent receives more context but not more authority.
Structured requirements make missing decisions visible: entities have relationships, states have transitions, and acceptance criteria define what must be observed. Narrative can remain in the README; architecture-shaping decisions need reviewable fields.
Do not turn the check into upfront overdesign
Preventing structural debt does not mean predicting every future feature. Premature abstraction is also debt.
Apply the check to decisions that are expensive to reverse: stored data, identity, permissions, money, irreversible actions, external contracts, and multi-state workflows. A temporary internal screen may need only a task boundary and acceptance criteria.
The goal is not maximum architecture. It is minimum irreversible ambiguity.
How Prodstack supports the pre-code check
Prodstack connects decisions, requirements, acceptance criteria, and backlog work across Discovery, Strategy, Prioritization, Roadmap, Requirement Elicitation, Backlog, and Growth.
During requirement elicitation, states, relationships, constraints, and unresolved questions become explicit before reaching a coding agent. The requirement remains linked to its decision and downstream work.
Prodstack does not guarantee flawless architecture or replace engineering review. It makes architecture-shaping decisions easier to inspect while they are cheap to change.
Pre-code architecture checklist
-
visible.
-
requirement.
Frequently asked questions
What is the difference between AI technical debt and ordinary technical debt?
The debt is not unique to AI. AI changes how quickly an unclear decision becomes implementation and spreads across files and features.
Can a prompt prevent AI-generated technical debt?
A precise prompt reduces task-level mistakes but cannot resolve decisions that were never made. Architecture-shaping choices should exist in the requirement and remain traceable.
Do solo builders need a formal architecture document?
Usually not. A short brief covering entities, states, boundaries, failure behavior, and acceptance criteria is enough for many features. Increase rigor when a decision is risky to reverse.
When should I run the pre-code architecture check?
Run it before implementing features that change stored data, permissions, identity, payments, deletion, integrations, or multi-step workflows. Repeat it when a governing product decision changes.
What if the coding agent proposes a better model?
Treat it as a product and architecture proposal, not an automatic improvement. Compare it with the intended behavior, record the decision, and update the requirement before continuing.
Catch the flaw while it is still a decision
The most expensive AI technical debt often begins before code: an entity not separated, a state not named, or a boundary not decided. Fast implementation turns that ambiguity into a system other features depend on.
Before handing significant work to an AI coding agent, make the costly decisions explicit. Define what exists, how it changes, where responsibility belongs, and how correct behavior will be verified. Ten minutes spent editing a requirement is not guaranteed to save a migration. It is the cheapest opportunity you have to prevent one.
Prodstack turns thinking like this into shipped, evidence-backed work, from discovery to growth.