Just a year ago, the question “how to write code” implied an IDE, syntax, and a debugger. Today, for a significant number of AI builders, it means something entirely different: how to precisely describe a task so that Cursor, Claude, or Codex writes the code for you. The task hasn’t changed—the executor has.
This approach is called spec-driven vibe coding: instead of writing lines of code, you write a specification—a structured description of what the program should do. The model then transforms this description into actual code. But there’s a nuance that beginners often overlook: code quality directly depends on spec quality. Garbage in, garbage out, and no GPT-5 will save it.
This article is for anyone who wants to build products with AI but isn’t yet accustomed to thinking in specifications. No prerequisites are needed: just the ability to articulate thoughts clearly in English or Ukrainian.
What is a spec, and how does it differ from a “prompt”?
A prompt is a one-time request. A spec, on the other hand, is a document (or structured text) that describes an entire system: what it does, for whom, its rules, limitations, and interfaces.
The difference is critical. A prompt like “make me a Telegram bot” will give you a “Hello World” in 30 seconds and nothing more. A spec for the same bot might look like this:
- Context: A bot for small businesses, accepting orders via /order
- Actions: Stores name, phone, and comments in Supabase
- State: Confirms orders, sends an admin notification in Markdown format
- Constraints: No inline buttons, text commands only
- Stack: Python, python-telegram-bot 20.x, Supabase Python client
This spec takes 10 lines but gives Claude or Codex enough context to generate real, rather than merely illustrative, code.
Step-by-step process: from idea to working code
Step 1. Formulate your goal in one sentence. “I want X so that Y can do Z.” For example: “I want a web form so that a customer can submit an application and receive email confirmation.” If you can’t fit the goal into a single sentence, the task isn't yet clearly defined.
Step 2. Define the user and scenario. Who interacts with the system? What do they do step-by-step? Write it down as a list: enters → sees form → inputs data → clicks “Submit” → receives notification. This list becomes the backbone of your spec.
Step 3. Specify the stack. AI models are not telepathic. If you don’t tell them, they’ll choose a stack themselves—and not always optimally. State it directly: Next.js + Resend for email, or FastAPI + SQLite, or pure HTML without frameworks. This is the most effective way to avoid “surprises” in the form of outdated libraries.
Step 4. Describe constraints. What should the code not do? No authentication? No database? Single file only? No external dependencies? Constraints are not a weakness of the spec; they are its strength. They narrow the solution space and reduce the number of iterations.
Step 5. Indicate the output format. Do you want a single file? Multiple files with explanations? Only a function without boilerplate? Startup instructions? The more specific you are, the fewer unnecessary clarifications you'll get from the model.
Step 6. Iterate in parts. Don’t try to write a spec for the entire product at once. Break it down into modules: first authentication, then the form, then email. Each module is a separate spec, a separate generation. This makes it easier to verify and correct errors before they accumulate.
Common beginner mistakes with specs
Too general. “Make me a website” is not a spec. There's no stack, no audience, no structure. The result will be equally vague.
Mixing layers. The spec tries to describe UI, business logic, database, and deployment simultaneously. The model gets lost. Write separate specs for each layer.
Ignoring constraints. Without explicit constraints, Codex or v0 will add what they consider “best practice”—often unnecessary for your case. Explicitly state “no TypeScript,” “no tests,” “no Docker,” if you don't need them.
Lack of state context. If you’re refining existing code, show the model the current state: insert a code snippet or file structure. Without this, it will write “from scratch” and break what’s already there.
Expecting a perfect result on the first try. A spec is the first pass. Expect 70–80% readiness from the first generation. Refinement and adjustments are a normal part of the process, not a failure.
AiiN’s Takeaway
The spec-driven approach is not magic or a shortcut to learning. It’s a new type of literacy: the ability to describe systems precisely and structurally. This skill is valuable whether you write code yourself or delegate it to Cursor, Replit, or Bolt.
Start small: take any task you would solve manually and write a spec for it using the six steps above. Check the result. Refine. Run again. After five to ten iterations, you'll feel the difference between a “random prompt” and a “purposeful spec.”
AI models improve monthly. But a clearly written spec today will yield better code even on an average model than a vague idea given to the latest one. Control remains with you.