AI SDLC
Vibe codingJune 20, 2026· 8 min· 3 120

How to write a spec for Cursor, Codex and Claude Code

AI coding quality depends on input quality. Here is the structure of a technical spec that AI coding tools understand.

Useful? Share it
SPECТЗ для Cursor / Codex

Cursor, Codex and Claude Code can write strong code when they receive a strong specification. A vague prompt like 'build auth' creates random results.

What a good AI spec includes

  • Goal: what the module must do
  • Inputs and outputs: data in and data out
  • Scenarios: happy path and edge cases
  • Constraints: stack, style, libraries and forbidden choices
  • Acceptance criteria: how to know it is done

Example

Bad: build payment. Good: POST /pay accepts orderId and amount, charges through a payment gateway, returns 200 on success and 402 on bank decline, handles gateway timeout and includes unit tests for success, decline and timeout.

Where specs come from

Writing this manually for every feature is slow. AI SDLC generates specs from requirements and architecture, then you pass them to your code-generation tool.

Key idea

Code quality equals spec quality. A clear spec turns AI coding from a lottery into an engineering workflow.

3 120 read this article
Try it on your project

Describe your idea, and AI SDLC will generate requirements, artifacts and documentation. Free to start.

Start for free
Как составить ТЗ для Cursor, Codex и Claude Code / How to write a spec for Cursor, Codex and Claude Code, AI SDLC