If you have spent any time building software with AI recently, you've likely run into the same frustrating wall. You start with a great idea, write a detailed prompt, and the AI generates something magical. But as you add features, fix bugs, and iterate, the magic fades. The AI loses context, starts changing your architecture midway, and suddenly, you are burning through tokens just to get back to where you started.
In my observations of modern AI Software Development, the industry has become obsessed with writing "better prompts." But prompt engineering is a band-aid for a much larger problem: a lack of structured project memory.
This is where Spec Driven Development (SDD) and tools like GitHub Spec Kit come in. If you're new to planning before prompting, start with Before You Build an AI-Powered Application — it covers the lifecycle, context files, and micro-milestones that make spec-first workflows work.
Let's break down why your AI coding agent is failing, and how Spec-Driven Development fixes it.
The Core Problem: AI Doesn't Actually Understand Your Project
It is easy to anthropomorphize AI, but fundamentally, Large Language Models (LLMs) are predicting the next token. They do not intrinsically "understand" your project's history, your business logic, or your preferred tech stack.
Without a written specification, every new prompt forces the AI to reconstruct the context of your project from scratch. It spends precious compute power making assumptions.
Example without Spec Kit:
You prompt: "Build me a Todo App."
Immediately, the AI has to guess:
- Frontend: React? Vue? Next.js?
- Database: SQLite? PostgreSQL?
- Styling: Tailwind CSS?
- Auth: JWT? Sessions?
It spends tokens making assumptions. If you don't like those assumptions, you have to reprompt, wasting more time and context window.
Example with Spec Kit:
Instead of a vague prompt, you use the Spec Kit workflow:
/speckit.specify Build a Todo application. Requirements: Next.js 15, PostgreSQL, Drizzle ORM, Clerk Authentication, Dark Mode, Offline Support, Mobile First.
Now, the agent no longer guesses. It executes. That is the biggest difference in modern AI Programming.
Traditional AI Workflow vs. Spec Kit Workflow
To truly understand the value of SDD, look at how the workflows compare. In traditional AI workflows, bugs increase as conversations get longer because the context window becomes diluted with failed code attempts and prompt revisions.
The Traditional AI Workflow (The "Prompt-First" Trap)
- Idea
- Huge Prompt
- AI writes code
- Prompt again (to fix missed requirements)
- Fix bugs
- Prompt again (to add a feature)
- Refactor
- Context Lost
- Token Explosion
The Spec Kit Workflow (The "Spec-First" Advantage)
- Idea
- Specification (Defining exactly what needs to be built)
- Clarification (The AI asks questions to fill in gaps)
- Architecture Plan (Defining the stack and structure)
- Task Breakdown (Creating step-by-step milestones)
- Implementation (Coding based strictly on the tasks)
- Review
- Code
The Token Utilization Shift
Instead of feeding an AI a 2,000-token prompt, getting a bad result, and feeding it a 3,000-token correction, Spec Kit reuses structured artifacts.
You might spend 1,000 tokens generating the initial Specification, Plan, and Tasks. But when it comes time to implement, the AI only needs to read the specific task it is working on, guided by the overarching project rules. Every phase reuses structured artifacts instead of rebuilding context from scratch. While exact token savings depend on your specific AI Coding Workflow and project size, the goal is highly focused context, eliminating the dreaded "token explosion."
Why Smaller Models Perform Better with Specs
One of the most fascinating observations from using Spec Kit is how it levels the playing field for AI models.
Large reasoning models (like GPT-4 or Claude 3.5 Sonnet) are often used to compensate for vague prompts. They are good at guessing what you actually meant. Smaller, faster, and cheaper models cannot make those logical leaps reliably.
Spec Kit reduces ambiguity. Because the requirements, architecture, and tasks are explicitly defined, you can hand structured requirements to lower-cost models. Instead of asking a model to "Figure out my architecture," you are simply telling it to "Implement Task 4 from tasks.md using plan.md as a guide." This makes it significantly easier for any model to succeed.
Spec-First vs. Prompt-First: The Future of Project Memory
Prompting is ephemeral; specifications are permanent. When you use a Prompt-First approach, the knowledge of how your app works dies as soon as you close the chat window.
By shifting to a Spec-First methodology with tools like GitHub Spec Kit, your specifications become the permanent memory of the project. If you bring a new developer (or a new AI agent) onto the project three months later, they don't need to read your chat history—they just need to read the specs.
In the complete GitHub Spec Kit tutorial, I walk through installation, slash commands, and a full implementation walkthrough from idea to working code.
You can see the production side of this discipline in the projects I've shipped — the same bias toward explicit contracts over improvisation shows up in things like Zod-validated booking forms and multi-service order orchestration.
Continue reading
- GitHub Spec Kit Tutorial — hands-on install, slash commands, and implementation
- Before You Build an AI-Powered Application — plan before you prompt with micro-milestones
- 30 Software Development Principles — fundamentals that make AI output auditable
Related reading
AI Engineering
GitHub Spec Kit Tutorial: Complete Guide from Installation to Implementation
A hands-on walkthrough of GitHub Spec Kit — installation, slash commands, project structure, and building a food delivery platform with Spec-Driven Development.
Read articleAI Engineering
Before You Build an AI-Powered Application: Think First, Prompt Later
200,000 tokens and still broken code — the problem wasn't the model, it was zero planning. A disciplined framework for AI-assisted development before your first prompt.
Read articleEngineering
30 Essential Software Development Principles Every Programmer Needs to Know
What separates junior coders from professional engineers isn't more languages — it's mastering core software development principles. Here are 30 critical concepts grouped for clarity.
Read article