Home › Rules › Kiro specs

Kiro specs and spec-driven development: the three files, spec mode, and examples

From Kiro's own docs (Specs, Feature Specs, Requirements-First, Design-First, Bugfix Specs, Quick Spec, Plan mode, Analyze Requirements, Correctness, Best practices, Built-in agents, CLI terminal UI and Markdown Review pages), checked Nov 11, 2026. Sources below.

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)IDECLIWebMobile
Feature specs, Bugfix specs, Quick SpecYesYesYesNo
Running tasks in parallelYesYesYesNo
Analyze RequirementsYesYesNoNo
Property-based tests (Correctness)YesNoNoNo
Plan mode (not a spec, see below)YesYesNoNo

The spec folder and its three files

What .kiro/specs/ looks like with two specs
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

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?

ModeWhat you getDo you review each step?Use it when
Spec, Requirements-Firstrequirements.md → design.md → tasks.mdYes, before each next fileYou know what the app should do; the tech can be decided later
Spec, Design-Firstdesign.md → requirements.md → tasks.mdYesYou already have an architecture, a sketch, or hard limits like speed or compliance
Quick SpecAll three files in one passNo. You answer questions up front, then land on the task listA feature you've built before, or a quick prototype
Bug Fixbugfix.md → design.md → tasks.mdYesA bug where the cause isn't obvious or past fixes broke something else
PlanA plan in the chat, no filesYou approve the plan onceKiro'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)

The /spec commands in the Kiro CLI
/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.

Our example (VibeKits): a first prompt for a Feature spec
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:

Kiro's example requirements (Requirements-First page)
## 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.

Our example (VibeKits): requirements.md for the save-for-later feature
# 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.

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.

Our example (VibeKits): a bug prompt
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.
Our example (VibeKits): what the bugfix.md for it should cover
# 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.

Our example (VibeKits): steering that shapes every tasks.md
---
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.

Our example (VibeKits): PreTaskExec hook
{
  "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
    }
  ]
}
Our example (VibeKits): the script it runs
#!/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:

Kiro's #spec examples (Best practices page)
#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

  1. No spec files appeared. You were probably in a vibe session. Start a Spec, Quick Spec or Bug Fix session, or type Generate spec.
  2. Can't switch from Requirements-First to Design-First. That's by design. Start a new spec and copy what you need.
  3. tasks.md is out of date after you edited the requirements. Ask Kiro to update design.md, then click Sync Files in tasks.md.
  4. Tasks you already built show as not done. Sync Files, or ask "Check which tasks are already complete".
  5. 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.
  6. 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.
  7. Can't find Analyze Requirements or property tests on Web. Analyze Requirements is IDE and CLI only; property tests are IDE only.
  8. Tests come last in every task list. Add a steering file like ours above.

Where Kiro's own docs disagree

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

Sources

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].

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.

After that, an occasional email when I publish a new guide or rules file.

Free. No spam. Unsubscribe anytime. See our privacy note.