A Practical Workflow for Software Engineering with AI Agents
On this page
The difficult parts are defining the right work, maintaining the architecture, and reviewing the resulting volume of code. A useful workflow keeps humans involved where judgment matters and delegates implementation where feedback can be automated.
Start with Alignment
Write a Lightweight PRD
# Problem
# Proposed Solution
# User Stories
# Definition of Done
# Implementation Decisions
# Testing Decisions
# Modules to Create or Modify
# Out of ScopeConvert the PRD into Vertical Slices
Model the Work as Dependencies
Keep Implementation Bounded
Use TDD as an Agent Feedback Loop
Review in a Fresh Context
The implementation session already contains its own assumptions and decisions. A fresh reviewer can inspect the change independently and use its context for analysis instead of implementation history.
Design Deep Modules
Preserve Human Judgment
Implementation can often run unattended once the work is sufficiently clear and the repository provides reliable feedback. Human involvement returns when the result must be evaluated for correctness, usability, maintainability, and product quality.
Related engineering problems
Syncing Users Between Clerk and Your Database in Next.js is a concrete test of this workflow: concurrent requests, delayed events, and database failures need meaningful checks before an implementation can be trusted.
Monorepos: shared code, explicit boundaries considers the repository side of the same problem: shared code is easier to change safely when its interfaces, dependencies, and ownership are clear.