Kiro specs and spec-driven development: the three files, spec mode, and examples
Short answer: a Kiro spec is a folder in .kiro/specs/<name>/ with three Markdown files: requirements.md (what to build, written as user stories and WHEN ... THE SYSTEM SHALL ... lines), design.md (how to build it) and tasks.md (the step-by-step plan). A Bugfix spec has bugfix.md in place of requirements.md. In the normal Spec flow you check each file before Kiro writes the next one. Quick Spec writes all three in one go after a few questions. Then Kiro works through tasks.md, one task at a time or all at once, running tasks that don't depend on each other side by side. You commit the folder with your code, so the plan stays next to what it built.
What "spec-driven development" means in Kiro
Kiro's docs call specs "structured artifacts that formalize the development process for features and bug fixes". In plain terms: instead of typing "build me a login page" and hoping, you agree on a written plan first, and the agent builds from that plan. The plan is saved as files, so you can read it, change it, and come back to it next week. That's the difference from Kiro's chat-only "vibe" sessions, where nothing is saved to .kiro/specs/.
| Feature (Kiro's tables) | IDE | CLI | Web | Mobile |
|---|---|---|---|---|
| Feature specs, Bugfix specs, Quick Spec | Yes | Yes | Yes | No |
| Running tasks in parallel | Yes | Yes | Yes | No |
| Analyze Requirements | Yes | Yes | No | No |
| Property-based tests (Correctness) | Yes | No | No | No |
| Plan mode (not a spec, see below) | Yes | Yes | No | No |
The spec folder and its three files
my-project/
└── .kiro/
└── specs/
├── user-authentication/
│ ├── requirements.md # what to build (user stories + EARS)
│ ├── design.md # how to build it
│ └── tasks.md # the step-by-step plan Kiro runs
└── checkout-500-error/
├── bugfix.md # a Bugfix spec has bugfix.md instead
├── design.md
└── tasks.md
Free rules starter pack for Cursor, Claude Code, Codex and Antigravity
One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.
Free. No spam. Unsubscribe anytime. See our privacy note.
requirements.md: user stories with acceptance criteria, written in EARS notation (more below). It covers the normal path plus edge cases and errors.bugfix.md: for Bugfix specs only. It lists the current (broken) behavior, the expected behavior, and the behavior that must not change.design.md: architecture, data flow, interfaces, data models, error handling and a testing plan, often with diagrams. Kiro's own tutorial says to treat any code in it as rough sketches, not the final code.tasks.md: small, trackable tasks with expected outcomes, which tasks depend on which, and which are optional. Kiro marks tasks in progress and done as it works.
Kiro recommends one spec per feature, not one giant spec for the whole app. Its example has separate specs for login, product catalog, cart, payments and an admin dashboard. There's no limit on how many specs a repo can have.
Spec, Quick Spec, Bug Fix, or Plan: which one?
| Mode | What you get | Do you review each step? | Use it when |
|---|---|---|---|
| Spec, Requirements-First | requirements.md → design.md → tasks.md | Yes, before each next file | You know what the app should do; the tech can be decided later |
| Spec, Design-First | design.md → requirements.md → tasks.md | Yes | You already have an architecture, a sketch, or hard limits like speed or compliance |
| Quick Spec | All three files in one pass | No. You answer questions up front, then land on the task list | A feature you've built before, or a quick prototype |
| Bug Fix | bugfix.md → design.md → tasks.md | Yes | A bug where the cause isn't obvious or past fixes broke something else |
| Plan | A plan in the chat, no files | You approve the plan once | Kiro's tip: work that takes 15 to 60 minutes |
You pick Requirements-First or Design-First when you create the spec, and you can't switch later. Kiro's advice is to start a new spec and copy over what you need. Design-First also asks how much detail you want: High Level (architecture, components, performance and security) or Low Level (pseudocode, interfaces, data structures). You can set a default workflow in Kiro's settings so it stops asking.
Spec vs Plan mode: Plan mode is read-only. It asks you questions, reads your code and searches the web, but it can't write files, run commands or use MCP tools. Its plan lives in the conversation, and once you approve it, Kiro switches to building. A spec is slower but leaves files you can review, share and update. For planning in other tools, see our plan mode guide.
How to start a spec (IDE, CLI, Web)
- IDE: click the
+under Specs in the Kiro pane, or choose Spec in the chat. Kiro asks if it's a Feature or a Bug. For a Feature, describe it and pick Requirements-First or Design-First. The new-session screen ("Let's build") also lists Spec, Quick Spec and Bug Fix, and you can switch mid-chat by clicking the agent name under the chat box. Each spec document (except tasks.md) has a floating Review button that lets you comment on exact lines and send all your comments to Kiro at once. - CLI: use
/spec. At each phase checkpoint, pressCtrl+Xto read that phase's file and leave line comments; answering the checkpoint question sends them as one revision request. - Web (app.kiro.dev): start a session, pick one or more repos with Select repo, choose Spec, and describe the work. You refine the files in the browser, then the agent builds it and opens a pull request. Use Download to save a spec file to your computer. Kiro warns to only select repos you trust, because the agent follows instructions it finds in the code.
/spec new save-for-later # start a spec; Kiro asks Feature, Bug or Quick Spec
/spec save-for-later # resume it and step through tasks one by one
/spec run save-for-later # full-screen task runner; pick which tasks, watch progress
/spec analyze_requirements save-for-later # check requirements.md for gaps (CLI and IDE only)
Already chatting? Kiro's best-practices page says you can type Generate spec in a vibe session, and Kiro offers to start a spec from what you've discussed.
Write a good first prompt
Kiro's docs say to be clear about who the user is, what they want to do, why, and what "done" looks like. Here's one we wrote for a made-up shop. It names what must not change, which saves a round of fixes later.
Build a "save for later" list for the shop.
Who: signed-in shoppers. Guests should be asked to sign in first.
What: a heart button on each product card and product page, and a
/saved page that lists saved items with a "Move to cart" button.
Rules: max 100 saved items per user. If a product is deleted or out
of stock, keep it in the list but grey it out.
Don't change: the cart, checkout, or the product card layout on mobile.
Done means: tests for saving, removing, the 100-item limit, and the
guest redirect all pass.
Already have requirements in Jira, Confluence or a Word doc? Copy them into a file in your repo, open a spec chat and type #your-file.md Generate a spec from it, or connect the tool through MCP if it has a server. For a whiteboard sketch or diagram, use Design-First and attach the image.
requirements.md and EARS notation
Kiro writes each requirement in EARS (Easy Approach to Requirements Syntax): WHEN [something happens] THE SYSTEM SHALL [do this]. The point is that each line is clear enough to turn into a test. This is Kiro's own example:
## User Authentication
### User Registration
WHEN a user submits valid registration data
THE SYSTEM SHALL create a new user account
WHEN a user submits an email that already exists
THE SYSTEM SHALL display "Email already registered" error
WHEN a user submits invalid email format
THE SYSTEM SHALL display email validation error
And here's what a fuller one looks like for the shop prompt above, with user stories and numbered acceptance criteria. Kiro writes its own version from your prompt; use this to see what to check for, like limits, guest users and deleted items.
# Requirements: Save for later
## User story 1
As a signed-in shopper, I want to save a product for later
so that I can find it again without searching.
### Acceptance criteria
1. WHEN a signed-in shopper clicks the heart on a product
THE SYSTEM SHALL add that product to their saved list
2. WHEN a shopper clicks a filled heart
THE SYSTEM SHALL remove that product from their saved list
3. WHEN a guest clicks the heart
THE SYSTEM SHALL send them to sign in and return them to the same page
4. WHEN a shopper already has 100 saved products and saves another
THE SYSTEM SHALL show "Your saved list is full (100 items)"
and SHALL NOT add the product
## User story 2
As a shopper, I want to see my saved products in one place
so that I can move them to my cart.
### Acceptance criteria
1. WHEN a shopper opens /saved
THE SYSTEM SHALL list their saved products, newest first
2. WHEN a saved product is out of stock or deleted
THE SYSTEM SHALL show it greyed out with "No longer available"
3. WHEN a shopper clicks "Move to cart"
THE SYSTEM SHALL add one of that product to the cart
and remove it from the saved list
Analyze Requirements (IDE and CLI) runs a deeper check for contradictions, vague wording and gaps before you move to design. In the IDE it's in the chat options and in the Continue dropdown next to Proceed to Design; in the CLI it's /spec analyze_requirements. It takes minutes, not seconds, and asks you questions with suggested fixes, then updates requirements.md as you answer. Kiro suggests it for big features, sensitive areas like money or health data, and Quick Spec sessions, where nobody reviewed the requirements.
design.md
Once you approve the requirements, Kiro reads your code and writes design.md: components, data flow, interfaces, data models, error handling and a testing plan, often with diagrams (click Preview in the IDE to see them drawn). Check that every requirement is covered and that it uses the tech you already have. If you change the requirements later, ask Kiro in a spec chat to update the design to match.
tasks.md and running the tasks
Kiro turns the requirements and design into tasks.md. You can reorder tasks, mark some as optional, or ask Kiro to change the list before you start. Kiro's tutorial notes that tests often end up as the last task; if you'd rather write tests first, tell Kiro with a steering file (example below).
Kiro's docs don't publish a fixed format for tasks.md, so don't try to write one from scratch by hand. Let Kiro generate it, then edit it, and use Sync Files to keep it in line with the other two files.
- One task: in the IDE, click Start Task above it. In chat, name it: "implement tasks 1 and 2".
- All tasks: click Run all Tasks (IDE) or use
/spec run(CLI). Kiro works out which tasks depend on which and runs them in "waves": every task with no dependencies runs at the same time, then the next group, and so on. It only runs tasks that aren't done yet and are marked required. - Web: tell the agent to do all tasks or name the ones you want. When it's done it opens a pull request, and you can keep giving feedback.
Sync Files (in tasks.md) does two jobs: after you change the requirements or design it adds tasks for the new parts, and it marks tasks done if the code already exists, say because you built something in another chat. You can also ask "Check which tasks are already complete" in a spec chat. Kiro's tutorial adds a fair warning: a task marked "Task completed" still needs you to test it.
Bugfix specs and bugfix.md
A Bugfix spec follows the same three steps but starts with bugfix.md, which has three parts: what happens now, what should happen, and what must keep working. That last part is how Kiro avoids fixing one thing and breaking another. In the design step Kiro looks for the root cause, and the tasks include tests that show the bug exists, show it's fixed, and show nothing else changed. Kiro's tip for the prompt: give the steps to reproduce it, what happens now, what should happen, and what must not be touched.
When a shopper types a coupon code with a space at the end
(for example "SAVE10 "), checkout says "Invalid coupon" even though
SAVE10 is a real, active code. It should accept the code.
Don't change how expired or used-up coupons are rejected, and
don't touch the payment step.
# Bugfix: coupon codes with spaces are rejected
## Current behavior (defect)
- WHEN a shopper enters a valid coupon code with a leading or
trailing space THEN the system shows "Invalid coupon"
## Expected behavior
- WHEN a shopper enters a valid coupon code with a leading or
trailing space THEN the system SHALL apply the coupon
## Unchanged behavior
- WHEN a shopper enters an expired coupon code THEN the system
SHALL CONTINUE TO show "This coupon has expired"
- WHEN a shopper enters a used-up coupon code THEN the system
SHALL CONTINUE TO show "This coupon has already been used"
- WHEN a shopper enters a code that doesn't exist THEN the system
SHALL CONTINUE TO show "Invalid coupon"
A typo or a clear one-line fix doesn't need a Bugfix spec; Kiro says a quick fix in chat is fine for those. If the fix turns out to need a real new feature, Kiro suggests a separate Feature spec instead of growing the bug spec.
Property-based tests (the "Correctness" feature)
In the IDE, Kiro can pull "properties" out of your requirements: rules that should always be true, like "for any user and any product, saving it puts it in their list". It then tries hundreds or thousands of random inputs to break that rule, and when one fails it shrinks it down to the smallest input that still fails. Kiro's docs are honest that this is evidence, not proof, and that some requirements (outside services, random behavior) don't fit. These tests are optional by default, so Run all Tasks skips them unless you mark them required.
Make specs fit how you work
Steering for spec tasks. Kiro's tutorial suggests a steering file, .kiro/steering/specs.md, to change how Kiro plans tasks, for example tests first. Here's ours. Full guide to steering: Kiro steering files.
---
inclusion: always
---
# How to plan spec tasks in this project
- In tasks.md, put the test task for a piece of work BEFORE the task
that writes the code, so each feature starts with a failing test.
- Keep each task small enough to finish and check in one go.
If a task touches more than 3 files, split it.
- Every requirement number must be covered by at least one task.
- Never add a task that changes the payment code unless the spec
is about payments.
- The last task of every spec: run the full test suite and update
README.md if a command or setting changed.
A hook on spec tasks. Kiro has two hook triggers just for spec tasks: PreTaskExec (before a task starts, can block it with exit code 2) and PostTaskExec (after it finishes, can't block, and its output is ignored). This pair of files, which we wrote, stops Kiro from starting the next task while your tests are failing and tells the agent why. Hooks run in the IDE and CLI V3, not in Web sessions. Every trigger and exit code: Kiro hooks.
{
"version": "v1",
"hooks": [
{
"name": "tests-before-each-spec-task",
"description": "Don't start the next spec task while tests are failing",
"trigger": "PreTaskExec",
"action": { "type": "command", "command": "bash .kiro/hooks/scripts/tests-before-task.sh" },
"timeout": 300
}
]
}
#!/bin/bash
# .kiro/hooks/scripts/tests-before-task.sh
# Exit 2 = Kiro does not start the spec task, and what we print to
# stderr goes to the agent as the reason. Any other non-zero exit only
# warns, so every failure below exits 2 on purpose (fail closed).
if ! out=$(npm test --silent 2>&1); then
echo "Tests are failing, so this spec task was not started." >&2
echo "Fix these first, then run the task again:" >&2
echo "$out" | tail -n 30 >&2
exit 2
fi
exit 0
One catch: when Run all Tasks runs a wave of tasks side by side, this hook runs your tests once per task. If your test suite is slow, use it with single tasks, or point it at a faster test command.
Pull a spec into any chat. Type #spec and pick one; Kiro adds all of its files to the chat. Kiro's examples:
#spec:user-authentication implement task 2.3
#spec:user-authentication update the design file to include password reset flow
#spec:user-authentication does my current implementation meet the acceptance criteria for task 7.1?
#spec:user-authentication why did we choose JWT over session-based authentication?
Kiro's Spec, Quick Spec and Bug Fix modes are built-in agents. If you want your own agent with different tools or permissions, see Kiro custom agents.
Commit your specs
Kiro says specs are meant to live in git, next to the code they describe. Over time the folder becomes a record of why the code is the way it is, for you, for teammates, and for Kiro when it revisits a feature. To share specs across several repos, Kiro suggests a central specs repo linked in with git submodules or package references.
Kiro specs not working? 8 things to check
- No spec files appeared. You were probably in a vibe session. Start a Spec, Quick Spec or Bug Fix session, or type
Generate spec. - Can't switch from Requirements-First to Design-First. That's by design. Start a new spec and copy what you need.
- tasks.md is out of date after you edited the requirements. Ask Kiro to update
design.md, then click Sync Files intasks.md. - Tasks you already built show as not done. Sync Files, or ask "Check which tasks are already complete".
- Run all Tasks skipped some tasks. It only runs unfinished tasks marked required. Optional ones (including property tests by default) need to be run on their own or marked required.
- The requirements are vague or the design misses things. Kiro's fix: add more detail and edge cases to your prompt, tighten the acceptance criteria, then regenerate the design. Run Analyze Requirements first.
- Can't find Analyze Requirements or property tests on Web. Analyze Requirements is IDE and CLI only; property tests are IDE only.
- Tests come last in every task list. Add a steering file like ours above.
Where Kiro's own docs disagree
- Approval gates. The Built-in agents page says the Spec, Quick Spec and Bug Fix agents all "guide you through structured phases with approval gates between each one". The Quick Spec page, and the table on that same Built-in page, say Quick Spec has no gates. Quick Spec has no gates.
- Property tests outside the IDE. The Correctness page lists property-based testing as IDE only. The Bugfix Specs page, which has CLI and Web steps, says bug fix tasks "are generated with property-based tests". Expect them in the IDE; in the CLI or Web, check what your tasks.md actually contains.
- Marking tasks optional. The Requirements-First page tells you to "mark optional tasks", and Run all Tasks skips optional ones, but no page shows how a task is marked optional in
tasks.md. Ask Kiro in a spec chat to make a task optional or required instead of guessing the syntax.
Related setups
Specs work alongside the rest of a Kiro setup: steering files for your rules, hooks for automation, skills for step-by-step jobs, custom agents for access and subagents, and AGENTS.md, which Kiro reads too. Planning first in other tools: plan mode guide. Need a starting rules file? The free rules generator writes one.
Best value
All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)
A spec turns an idea into a plan. The kits give you the idea and the plan already worked out, step by step: a small game, a Discord bot, an email-triage agent, an MVP, or a cleanup of messy code.
Get all 6 kits for $29 → See what's in each kit
$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.
Related
- Kiro steering files (.kiro/steering, inclusion modes, AGENTS.md, examples)
- Kiro hooks (.kiro/hooks JSON, every trigger, exit codes, examples)
- Kiro custom agents (.kiro/agents, permissions, subagents, examples)
- Kiro skills (SKILL.md, .kiro/skills, skills vs steering vs powers)
- Plan mode guide (6 tools + 6 plan prompts)
- Vibe coding prompts cheat sheet (21 prompts for any tool)
- AGENTS.md examples (Kiro reads AGENTS.md as steering)
- Vibe coding security checklist (12 checks before you launch)
- Free rules file generator
Sources
- Kiro docs: Specs
- Kiro docs: Feature Specs
- Kiro docs: Requirements-First workflow
- Kiro docs: Design-First workflow
- Kiro docs: Bugfix Specs
- Kiro docs: Quick Spec
- Kiro docs: Plan mode
- Kiro docs: Analyze Requirements
- Kiro docs: Correctness with property-based tests
- Kiro docs: Specs best practices
- Kiro docs: Built-in agents
- Kiro docs: Hook actions (exit codes)
- Kiro docs: Using specifications for complex work (tutorial)
Every file name, command, button and workflow here was checked Nov 11, 2026 on Kiro's own docs. Kiro changes often, so the Specs pages in Kiro's docs win over this page. If something here no longer matches, tell us at [email protected].