The Ask → Plan → Execute Workflow

The Ask → Plan → Execute Workflow

When I first got my hands on AI coding assistants, my workflow was chaotic. I would open a file, highlight some code, and aggressively prompt the AI to "add this feature" or "refactor this logic."

Sometimes it worked like magic. Other times, the AI would hallucinate a completely incompatible library, break three other components, and leave me spending two hours untangling a mess I didn't write.

I realized that jumping straight into zero-shot code generation is a trap.1 Good software isn't built by writing code quickly; it’s built by making good decisions before writing code. To fix this, I developed a strict, measurable framework for building with AI. I call it the Ask → Plan → Execute workflow.

Step 1: Ask (Building the Context)

Before I let the AI write a single line of code, I force it to read.

If I'm working in a new codebase, I will use an IDE like Cursor to highlight the relevant files and simply ask: "Explain the current architecture to me. How does the authentication state flow through these components?"

I am not asking it to build anything yet. I am forcing the model to load the correct context into its active memory.2 This ensures that the AI actually understands the rules of the biological system (the codebase) before it tries to mutate it.

Step 2: Plan (The Architectural Filter)

Once the context is set, I move to the planning phase. I will prompt: "I want to implement a Stripe checkout flow. Write a step-by-step implementation plan. Do not write the code yet. Just tell me which files we need to touch and what the logic will look like."

This is the most crucial step. The AI will output a bulleted list of its strategy. Usually, it's about 80% correct. I will read the plan, catch the edge cases it missed, and reply: "Good, but step 3 will cause a race condition. Let's use a webhook instead."

We iterate on the plan until the architecture is flawless. By doing this in plain English rather than code, I can review the logic in seconds rather than minutes.3

Step 3: Execute (The Easy Part)

Only after the plan is perfected do I give the green light. I tell the AI: "Great. Execute step 1 of the plan."

Because the AI already understands the codebase, and because we have already agreed on the exact architecture, the code it generates is almost always perfect on the first try. Most developers treat AI like a vending machine: they put a prompt in and expect finished software to fall out. Take the time to draw the blueprints, and the execution will take care of itself.

Back to all articles