Before AI Writes Code, I Plan Iteratively with Agents

Plan and discuss with AI over multiple rounds before coding, using a rough plan to constrain AI output and improve code quality.
The article introduces a YouTube creator's workflow with AI coding tools: before letting AI write code, hold multiple rounds of discussion with an AI agent connected to Spaceship to explore approaches, break down components, build conceptual understanding, and then draft a plan. Planning is an iterative process of exploration that exposes blind spots, compares approaches, and builds consensus, turning AI from a code generator into a design discussion partner. Using Semantic Router improvements as an example, the author shows that a plan only needs to clearly express goals (faster, more scalable, integrable with decision models)—it doesn't need to be perfect. The core conclusion: AI coding efficiency depends not only on model capabilities but also on how people use it, and the thinking invested in planning ultimately shows up in code quality.
Why Planning Comes Before Coding
Many developers are used to throwing requirements straight at AI and expecting runnable code right away. But a YouTube creator sharing his workflow offers a different answer: plan first, then code. Before touching anything, he holds multiple rounds of discussion with an AI agent connected to Spaceship, exploring different approaches and breaking down code components—only after gaining a conceptual understanding of the problem does he move on to drafting a plan.
This approach seems to slow down the start, but in reality it reduces rework later. When AI writes code directly without clear context, it often needs repeated revisions; investing time in planning up front gives the subsequent coding process a clearer sense of direction.

Planning Is an Iterative Process of Exploration
What the creator emphasizes is not writing a plan in one pass, but multiple rounds of iteration. He discusses different ideas with the AI agent, explores different code components, and gradually converges on a feasible approach. The value of this iterative planning lies in:
- Exposing blind spots: discovering edge cases you hadn't thought of during discussion
- Comparing approaches: having the AI lay out the pros and cons of multiple implementation paths instead of just picking the first one
- Building consensus: ensuring you have a clear conceptual understanding of the problem to be solved, rather than vaguely "letting the AI figure it out"

This approach turns AI from a "code generator" into a "design discussion partner". The creator describes his process as: initial discussion first, understanding the problem at the conceptual level, and only then building the plan.
A Real Case: An Improvement Plan for Semantic Router
The creator shows a small-ish plan he is currently working on—improvements around Semantic Router. His goals are clear:
- Make Semantic Router faster
- Improve scalability and reliability
- Enable integration with decision models
This plan is a quickly thrown-together draft, not a final document. But it is precisely this "rough plan first" approach that gives the subsequent collaboration with AI an anchor point.

From this sharing, it's clear that the plan itself doesn't need to be perfect. The creator uses descriptions like "small-ish plan", "rough plan", and "quickly thrown together"—the point isn't how refined the plan is, but whether it clearly enough expresses the goals and constraints so that AI can help in the right direction.

Semantic Router is an open-source tool for semantic routing, typically using vector embeddings to classify the intent of user queries, thereby dynamically dispatching requests to appropriate processing logic or models. It is commonly used in building agent systems, RAG pipelines, or multi-model orchestration scenarios: the system first computes the semantic similarity between a query and predefined "route" descriptions, then decides which path to take. The performance bottleneck of such routers often lies in embedding computation and index lookup, so "faster", "scalable", and "integration with decision models" are common improvement directions—the first involves caching, batching, or lighter embedding models, while the latter two relate to how routing rules are organized and how routing results are handed off to downstream decision models.
Who This Workflow Is For
For developers using AI coding tools, this approach offers several takeaways:
Separate discussion from coding. Before letting AI write the first line of code, use conversation to thoroughly talk through the problem. Tools like Spaceship support connecting multiple agents, which is perfect for comparing approaches.
Accept the roughness of the plan. Don't wait until the plan is perfect to start—a quickly assembled list of goals is enough to kick off collaboration.
Use the plan to constrain AI's output. With clear goals (faster, more scalable, integrable with decision models), AI-generated code suggestions have evaluation criteria rather than being blindly accepted.
The creator doesn't go into specific code implementation details, but the signal this workflow conveys is clear: the efficiency gains of AI coding come not only from model capabilities, but also from how people use it. The thinking invested in the planning phase ultimately shows up in code quality.
The Spaceship mentioned in the article belongs to a category of development environments/platforms that support connecting multiple AI agents, characterized by the ability to switch between or call different models and agents in parallel within the same workspace while preserving conversation context. The value of such tools isn't just "being able to call models", but rather letting developers accumulate multi-round discussions, approach comparisons, and plan organization in a single traceable session. Compared to single-turn Q&A tools, multi-agent environments are better suited for "design discussions"—you can have different agents play the roles of proposer and critic, thereby exposing more problems before coding.
Related articles

Reddit Discussion: Real-World AI Agent Use Cases Shared for Business School Classrooms
A Reddit business school lecturer seeks real AI Agent use cases for classroom teaching. This article compiles typical AI Agent applications in professional and personal scenarios and offers three analytical dimensions for selecting classroom cases, helping readers understand the practical value and limitations of AI Agents.

Multi-LLM Provider API Integration: Standardization Challenges and Compliance Headaches
Explore the current state and challenges of multi-LLM provider API standardization, analyze enterprise data compliance pain points, and share community practices and router limitations for data governance in multi-model architectures.

Binance Halts Withdrawals as Hackers Suspected of Stealing Billions in Crypto
Binance paused withdrawals Thursday after a suspected cyberattack, with some estimates claiming billions in crypto stolen. This article reviews the incident, the uncertainty of loss estimates, and the custody trust paradox facing centralized exchanges.