Pair Programming with AI - Write the Spec First, Approve the Plan
Pair Programming with AI - Write the Spec First
The developers getting the best results from AI coding tools all follow the same pattern. They do not just type "build me a login page" and hope for the best. They write a short spec, let the agent propose a plan, and approve step by step.
This is not slower. It is dramatically faster than fixing bad code after the fact.
Step 1: Write a Short Spec
The spec does not need to be long. Two to five sentences that cover:
- What the feature should do
- What files or components are involved
- Any constraints or preferences (e.g., "use the existing auth middleware, do not add new dependencies")
This takes about 60 seconds and prevents the most common failure mode: the agent building something that works but is completely wrong for your architecture.
Step 2: Let the Agent Propose a Plan
Before writing any code, ask the agent to outline its approach. What files will it modify? What is the implementation strategy? Are there any edge cases it is considering?
This is where you catch misunderstandings. Maybe the agent plans to refactor a module you do not want touched. Maybe it assumes a database schema that does not exist. Catching this at the plan stage costs nothing. Catching it after 500 lines of code costs everything.
Step 3: Approve Step by Step
Once the plan looks right, let the agent execute - but review each meaningful step. Not every line of code, but each logical change. "I am going to add a new route handler" - yes, go ahead. "I am going to modify the database migration" - wait, let me see that first.
This gives you control without micromanaging. The agent does the typing. You do the thinking.
Why This Works
The spec-plan-approve pattern works because it matches how good engineering teams operate. A senior developer does not write code without understanding the requirements. They do not start implementation without a plan. And they get their approach reviewed before committing to it.
AI pair programming is the same process - just faster. You think, the agent types, and together you ship features in a fraction of the time.
- Write Specs Before PRs to Avoid Redesign Debates
- Writing Code to Reviewing Code - The AI Shift
- AI Ruined Development - Specs Not Coding
Fazm is an open source macOS AI agent. Open source on GitHub.