Designing Your Personal AI Coding Workflow
A concrete system: which tool, which task, which guardrails, and when to just write it yourself.
We've explored how open-source agents like Aider orchestrate tools and manage context. Now it's time to turn that understanding into a system you own, a personal workflow that works across every task in a real workweek. A personal AI coding workflow is not about picking one tool. It is a deliberate system built from three components: a task-triaging framework that decides when to delegate to AI, a plan-first implementation loop with explicit checkpoints, and a context strategy that keeps the model focused on the right code. This article gives you a concrete, battle-tested system you can apply starting Monday morning.
The biggest productivity gain you'll see does not come from generating code faster. It comes from never having to context-switch between exploratory thinking and mechanical typing. When your workflow treats the AI as infrastructure rather than a smart autocomplete widget, the tool handles the typing while you stay locked in the architectural and product-level decisions. The rest of this article maps exactly how to wire that up.
The mental model: treat AI tools like an engineering team
Before we wire up concrete tools, we need a clear mental model. Think of your AI coding workflow as a small, high-leverage engineering team. You are the tech lead. The team consists of a planner, an implementer, a reviewer, and a documentation specialist. Each role uses a different AI tool or mode because different tasks demand different strengths. The planner is best at decomposing ambiguous requirements into a crisp specification. The implementer shines at turning that specification into working code, but only when it has a tight scope and a good plan to follow. The reviewer catches missing edge cases and inconsistencies. The documentation specialist distills intent into prose without inventing new bugs.
This model maps directly onto a workweek. On Monday you kick off a feature: you collaborate with the planner to create a structured plan file. Tuesday you hand that plan to the implementer and approve each step as it lands. Wednesday you bring in the reviewer for a fast sanity check on your PRs. Thursday you refactor a gnarly module with the implementer in a more exploratory agent mode. Friday you generate release notes with the documentation specialist. The specific tools you assign to each role depend on your constraints, but the separation of concerns stays constant.
Now let's make this concrete.
How do I decide which tasks to delegate to AI and which to write myself?
Start with a simple triage rule: delegate anything that is mechanical, well-specified, and verifiable. Write yourself anything that requires deep product judgment, novel algorithms, or architectural decisions that affect multiple teams.
This rule is not about capability. Modern agents can produce plausible code for all of those categories. The distinction is about reversibility and cost of error. If the AI generates a wrong implementation of a well-specified API (application programming interface) endpoint, a test suite catches it and you roll back a commit. If the AI invents an authentication flow because a requirement was fuzzy, you might ship a security hole that no test covers. The decision tree is straightforward: before delegating, ask yourself, “Can I specify success objectively?” If you can write a passing test that captures the requirement, the task is a candidate for delegation. If success depends on judgment you haven't yet articulated, write it yourself or at least pair with the AI in planning mode until that articulation exists.
Within a workweek, this splits cleanly. Monday morning you get a new feature ticket: “Add payment method caching to the checkout flow.” The frontend UI states and the API contract are well-understood. That's a delegable implementation task after you write the plan. Tuesday afternoon you need to design a new retry strategy for a brittle downstream service. The correct behavior depends on the downstream's known failure modes and business SLAs. That design work stays with you. You might use an AI chat to explore tradeoffs, but you don't ask an agent to ship the final implementation until you've written the specification yourself. This triage keeps your cognitive load low on the high-stakes thinking, and hands off the typing-intensive work to the machine.
Which tool should I use for each kind of task?
Different AI tools have different context strategies and autonomy models, which makes them better suited to different points in the workweek. This mapping isn't dogmatic, but it's a starting point you can tune.
For tasks where you need to understand code before changing it, use a chat-oriented mode. Copilot's ask mode or Cursor's chat panel lets you interrogate a function, explore possible refactors, or generate examples without risking a stray edit. This is ideal for the Wednesday code review or the Friday documentation task. You provide the exact file or diff as context, ask targeted questions, and get answers without any modifications to your branch. No guardrails needed beyond reading the output.
For targeted edits within files you already understand, use an edit mode. Cursor's edit mode or Copilot's edit mode shines here. You select the exact range of files, describe the transformation, and review a diff immediately. This fits the Thursday refactoring task where you are modernizing a component. You remain in full control of what files are touched, and the review is low-cost because the change is localized.
For multi-file implementations driven by a plan, use an agent mode with explicit checkpoints. Windsurf's planning mode or Cline's plan-first approach are designed for this. You start by creating a plan file, either by writing it yourself or by prompting the tool to generate one from your requirements. Windsurf's planning mode stores that plan as a local Markdown file that persists across sessions. You can edit it manually, and the agent will treat it as the source of truth when implementing. Cline surfaces each tool call as a checkpoint you approve before it proceeds. For Monday's feature implementation, you'd open Windsurf, load the plan, and let the agent execute step by step, running tests after each logical chunk. You review the diff after each step, not just at the end, so you catch misunderstandings early.
For complex refactors that span many files and require behavioral changes, Claude Code in a plan-then-execute loop is powerful. You start a session with a clear directive to analyze the codebase, propose a plan, and only after your approval, make changes. You can ask it to break the work into small commits, run tests between each commit, and update the plan as it goes. This gives you a linear, reviewable sequence of small changes that you can bisect if something breaks.
A quick reference table ties these mappings to concrete guardrails. Keep this open during your workweek.
| Task type | Recommended tool / mode | Guardrail |
|---|---|---|
| Feature implementation (multi-file, well-specified) | Windsurf agent mode with plan file | Plan file, per-step test runs, human approval of each step's diff |
| Refactoring with behavioral changes | Claude Code plan + executor loop | Small commits, tests between commits, human-in-the-loop for plan |
| Localized edit or small refactor | Cursor edit mode or Copilot edit mode | Manual selection of files, diff review before accepting |
| Code review, exploration, documentation | Cursor chat / Copilot ask | Zero side effects; no file edits allowed |
| Bug fix with unclear root cause | Cursor edit with diagnostic prompt | Write failing test first, require explanation before code |
How do I structure planning and execution across a workweek?
The plan-first workflow is the backbone of a reliable system. Without a plan, agentic tools wander. With a plan, they become predictable.
Start your feature work on Monday morning by opening a planning session. Use a tool's planning mode or a dedicated chat window. State the feature clearly, include links to relevant specs or ticket descriptions, and request a structured plan. The best plans break the work into small, independent steps, each with a clear success criterion. A good prompt for this looks like: "You are a senior engineer planning the implementation of feature X. The requirements are [link to ticket]. The API contract is [link]. The relevant files are [list]. Produce a plan.md with numbered steps. Each step must describe the files to modify, the expected changes, and the test that will verify it. Do not write code yet."
Once you have a first draft of the plan, interrogate it. Ask the planner to explain why it chose that order, what risks it sees, and how it would test the integration between steps. Edit the plan yourself to add missing constraints or to reorder steps for a cleaner commit history. Save the final plan as a file in your repository, e.g., plan.md. This file becomes the durable specification that all subsequent agent work will reference.
Now you switch to execution mode. In Windsurf or Cline, you load the plan and ask the agent to implement step 1. The agent reads the plan, identifies the next incomplete step, proposes changes, runs tests, and updates the plan's status. You review the diff, approve it, and let it move to step 2. For tasks where you are using Claude Code or a terminal agent, you'd start a new session with the plan as context and ask it to implement the first step, commit, run tests, then proceed to the next step only after you review the diff.
By Tuesday afternoon when you're fixing a bug, you don't need a full plan. But you still use a structured diagnostic prompt. The template: "The bug: [description]. The failing test: [test]. The relevant files: [list]. First, explain your step-by-step reasoning for the root cause. Then propose a fix. Do not implement the fix until I confirm." This separates reasoning from action, giving you a chance to correct the model's understanding before it touches files.
This pattern of plan-first, then execute in small increments, creates a natural review rhythm. You never review a large blob of generated code at once. Each step is small enough to understand in seconds, and any mistake is caught by tests before it cascades. The plan file itself becomes a commit artifact that documents what the AI did and why.
What guardrails keep AI-generated code safe and reviewable?
Guardrails are the difference between a workflow you trust and one that silently corrupts your codebase. The previous episode covered verification techniques in depth. Here we operationalize them into your daily workflow.
First, never let an agent modify code without a corresponding test. Before the agent implements a step, it must either find an existing test that covers the behavior or write one first. If you are following a plan, the success criteria for each step already include a test. The agent should not mark a step complete until that test passes. This rule is non-negotiable because it turns every AI-generated change into a provable contract.
Second, use small, reviewable diff increments. Whether you are using Cline's per-step checkpoints or Claude Code's commit-each-step approach, the human must review every change before the next step begins. The review should take seconds. If a diff is too large to understand in one screen, the step was too big. Break it down further. This pattern also makes git bisect effective; if a bug appears later, you can pinpoint exactly which AI step introduced it.
Third, restrict tool access by mode. In planning mode, disable file editing. In chat mode, disable all tool access. In agent mode, allow only the set of tools the task genuinely needs. For a feature that only touches the cart service, do not give the agent access to the auth or payment modules. This containment prevents the agent from making "helpful" changes to unrelated code when it encounters a perceived inconsistency.
Fourth, use context-scoped prompts. Instead of giving an agent access to your entire repository, give it only the files it needs, either by mentioning them with @-syntax in Cline or by listing them in the prompt in Cursor. This leverages the concepts from episode 4: smaller, more relevant context produces better results than feeding the entire codebase and hoping the model's attention works.
Finally, keep the plan file as the source of truth. If the agent deviates from the plan, stop it. Ask it to explain why it thinks the deviation is necessary, update the plan if you agree, then resume. This prevents the agent from going rogue mid-implementation.
These guardrails are lightweight but they build an audit trail and a safety net. After a week, you have a series of small, test-backed commits with a plan that explains each one. That's far more readable than a single giant commit that says "AI refactored checkout."
How do I manage context across a large codebase during a workweek?
Context management is the silent multiplier of an AI workflow's effectiveness. Episode 4 detailed how tools index and retrieve code. Here we focus on what you, the engineer, do to keep context tight and relevant across a workweek.
Start your week by creating a "context snapshot" for the feature you'll work on. This is a short Markdown file that lists the primary modules, their responsibilities, key types, and the interfaces between them. You can generate this with a chat tool: "Given the cart module, the product service, and the payment gateway, summarize the flow and list the entry points and data structures." Paste that summary into a context.md file and reference it in every prompt for the week. This small upfront cost pays off every time the model would otherwise grab irrelevant files.
During implementation, be explicit about which files the agent can read. In Cline, use @file or @folder to scope reads. In Cursor, attach the files manually to the chat or edit prompt. Avoid saying "look at the whole codebase"; the model will pull in too much noise and its responses will degrade. Instead, build the context incrementally. For step 1, give it the files that step needs. For step 2, give it those files plus any new ones introduced. This keeps the model's working memory focused.
When using tools that automatically index your codebase, like Sourcegraph Cody, you still benefit from explicit scoping. The index helps the tool find relevant snippets, but you should still tell it which module or area to focus on. This reduces the chances of a retrieval error sending the wrong code into the prompt.
A useful trick is to treat the plan file as a context map. Each step in the plan should list the files it touches. When you ask the agent to implement that step, feed it exactly those files. This turns the plan into a context spec, making the agent's job mechanical and your review trivial.
For ad-hoc debugging or exploration, you can still use chat modes with wide context because you aren't making changes. The risk of a bad context is lower when the output is only informational. But even then, pointing the tool at the specific error stack and the files it mentions gives you sharper answers.
Context discipline also means knowing when to reset. If a conversation with an agent has gone through many iterations and the context window is filling with old tool calls and irrelevant history, start a new session. Load the plan file and the current state of the code, summarize the progress so far, and continue. This prevents the model from getting confused by stale information.
Quick reference
| Property | Value |
|---|---|
| Default planning mode requirement before agent execution | A plan.md file with numbered steps and verification criteria |
| Guardrail for any AI code change | A passing test that validates the change |
| Context scoping technique | Explicit file reference using @ syntax or manual attachment, never "look at everything" |
| Tool for exploratory understanding | Chat mode (Copilot ask, Cursor chat) with zero file edit capability |
| Tool for multi-step feature implementation | Windsurf agent mode or Cline with plan file and per-step approval |
| Tool for large-scale refactoring | Claude Code with plan-then-execute loop, small commits |
Test yourself
Your task is to implement a new "wishlist" feature across frontend and backend, with a shared API contract already defined in a spec. You've written a plan file with 5 steps. Which tool and mode do you use for the initial implementation, and what is the checkpoint you set before pushing to CI?
Answer: Use Windsurf's agent mode (or Cline) with the plan file loaded. Before pushing to CI, require that every step's changes are committed separately with a passing test suite. The checkpoint is that step 5's tests pass and you've reviewed each step's diff. Only then do you squash-merge into a feature branch and open a PR (pull request). The plan file and the small commits make the PR reviewer's job easy; they can see the AI's intended changes step-by-step alongside the tests that validate them. If any step's test fails in CI, you bisect to the offending commit and re-plan that step rather than debugging a large monolithic change.
Frequently Asked Questions
Q: When should I override the AI's suggestion and write the code myself? If you can't articulate a clear success criterion, or if the change involves a novel algorithm or security-sensitive path. Writing it yourself is faster than fighting the AI when the spec lives only in your head.
Q: How do I handle a plan that turns out to be wrong mid-implementation? Stop the agent. Discuss the gap in a planning session, update the plan file, and resume. The plan is a living document, but it must never drift without explicit human approval.
Q: Can I use the same workflow with local models via Ollama? Yes, but the context size and reasoning quality will be lower. You may need to use smaller step sizes and simpler plans. Configure your tool's endpoint to point to the local API as described in Ollama's documentation. Test the workflow with a small, non-critical feature first.
Q: How do I ensure the AI doesn't introduce subtle bugs that pass my tests? Review the diffs, not just the test results. For logic-heavy code, use a second AI tool in chat mode as a reviewer: feed it the diff and ask for edge-case analysis. A two-human review pattern translates to a human-plus-AI review pattern.
Q: Is it worth paying for multiple AI tools simultaneously? If you map each tool to a distinct task in your workweek, yes. The productivity gain from having a specialized planner, implementer, and reviewer often outweighs the subscription cost. Start with one tool that covers a couple of modes and expand as your workflow matures.
Build systems, not one-off prompts
If you want to stop guessing and start engineering your AI-assisted development, you need a system that you can iterate on like any other piece of infrastructure. This series has walked you through the landscape, the internals, the trust model, and the context strategies. Now the last piece is the workflow itself, and it's the piece you own. Subscribe to Internals Decoded at internalsdecoded.com to get this kind of breakdown every week: how real systems work under the hood, so you can build your own with confidence.
Sources
- GitHub Copilot modes documentation
- Cursor IDE (integrated development environment) documentation
- Cline GitHub repository
- Windsurf planning mode documentation
- Model Context Protocol (MCP) specification
- Ollama local model hosting
- ForgeCode prompt engineering best practices (retrieved 2026-07-03)