Spec-Driven Development with Kiro: Planning a Small Feature from a Spec
Learn spec-driven development with Kiro. Set steering files, generate and review requirements, design and task files for a small feature, run tasks in small reviewed steps, and know where the assistant still needs human supervision.
Instead of prompting an AI assistant one request at a time, write down what you want first. Here's how Kiro's specs work, with a small worked feature, and where the tool still needs a careful human.
The usual way to use an AI coding assistant is a conversation. You ask for something, it writes code, you ask for a change, and so on. It's quick and often fun. It also drifts. By the tenth request, the assistant may have quietly made decisions nobody wrote down, and a week later nobody can say why the code looks the way it does.
Kiro, AWS's agentic development environment and the named successor to Amazon Q Developer's IDE plugins, takes a different approach. You start with a written spec: what the feature must do, how it will be built, and the steps to build it. Then the assistant works from the spec.
In this article we'll walk through that process on a small feature, and then be honest about where it needs supervision. If you're moving from Q Developer, the previous article in this series covers the timeline and migration. This one is about how Kiro actually works.
What you need
- Kiro, downloaded from its website. Check the current sign-in options and pricing before you install, since both have changed this year.
- A small project to practise on. We'll use the Lambda-based AI endpoint from the API Gateway article earlier in this series, but any small project will do.
- Git, so you can review every change the assistant makes
- About ninety minutes
Kiro's agent uses credits when it works, so a long session costs money. Check the current plans, and start with a small feature.
The idea in one paragraph
A Kiro spec is made of three Markdown files that Kiro generates and you review:
File | What it holds |
|---|---|
requirements.md | The behaviour you want, written as user stories with acceptance criteria, in a structured style called EARS |
design.md | The technical plan: architecture, components, data flow and sequence diagrams |
tasks.md | A numbered list of implementation steps, each one trackable |
The files are saved in your project as ordinary Markdown, so they live in version control next to the code. The aim is that you agree on what's being built before any code is written, and the plan stays in the repository as a record afterwards.
Step 1: Teach Kiro your conventions with steering files
Before creating a spec, tell Kiro how you work. Steering files are Markdown files that give it persistent context about your project: standards, libraries, security rules. They live in a
.kiro/steering/ folder in your project, and you can also keep global ones in your home folder.Here's an example for our AI endpoint project:
# Project conventions
- Language: Python 3.12 with type hints on every function.- Tests: pytest. Write the tests for each task before the implementation.- Never log full prompts or model responses. Log token counts only.- Permissions: grant the minimum IAM permissions. No wildcard resources.- Input limits: reject questions longer than 4,000 characters.- Infrastructure is defined in the CDK stack. Don't create resources by hand.Three things make steering files effective. Keep each one short and about one subject. Write rules you'd actually check in a code review. And update them when the assistant gets something wrong more than once, so you fix it for good.
Steering files can also change how Kiro plans. Kiro's own guides note that its task lists often put tests last, and show how a steering rule can ask for tests first. The rule above does exactly that.
Step 2: Create a spec
Our small feature: a new
/summarise endpoint that takes a block of text and returns a short summary, with input limits and sensible errors.In Kiro, start a new spec and describe the feature in plain language:
Add a /summarise endpoint to the existing API. It accepts JSON with a"text" field and returns a summary of three bullet points. It shouldreject empty or oversized input, handle model throttling gracefully,and not store or log the text.Kiro asks what kind of work this is. Choose Feature. Then pick a workflow:
- Requirements-first. You describe the behaviour, and Kiro generates requirements, then a design, then tasks. Good for product-driven work like this.
- Design-first. You start with the architecture, and Kiro derives the requirements and tasks from it. Good when the technical approach is fixed or you're porting an existing design.
There are also spec types for bug fixes, and lighter-weight options for quick jobs. For anything bigger than a small change, the feature spec is the one to learn.
Choose requirements-first, and let Kiro generate
requirements.md .Step 3: Review the requirements
This is the most important review in the whole process. Read what Kiro wrote and ask: is this what I meant?
The acceptance criteria use EARS notation, which follows a pattern like "WHEN something happens, THE SYSTEM SHALL do something." For our feature, expect lines like these. They're my example of the style, not Kiro's exact output:
Requirement 1: Summarise textUser story: As an API client, I want to send text and receive a shortsummary, so that I can read long documents quickly.
Acceptance criteria1. WHEN a valid request contains text, THE SYSTEM SHALL return a summary of three bullet points.2. WHEN the text field is missing or empty, THE SYSTEM SHALL return a 400 response with an explanatory message.3. WHEN the text exceeds 4,000 characters, THE SYSTEM SHALL return a 413 response.4. WHEN the model is throttled, THE SYSTEM SHALL return a 429 response and not retry indefinitely.5. THE SYSTEM SHALL NOT write the submitted text to any log.Then check it properly:
- Is anything missing? Authentication? A maximum summary length? What about other languages?
- Is anything invented? Kiro may add requirements you never asked for. Delete or keep them deliberately.
- Is each criterion testable? If you can't write a test for it, it isn't a requirement yet.
Kiro can also analyse your requirements for logical inconsistencies, ambiguities, conflicting constraints and gaps before you move on. Use it. Fixing a misunderstanding in a requirements file costs a minute. Fixing it in finished code costs far more.
Edit the file directly. It's your document.
Step 4: Review the design
When the requirements are right, move to
design.md . It documents the technical approach: the components, how data flows, and often a sequence diagram.A design review for our feature should focus on what's easy to get wrong:
- Security and permissions. Does it propose the narrowest IAM permission, on one model? Or a wildcard?
- Error handling. Does every error path from the requirements appear in the design?
- Consistency with your project. Does it reuse your existing code and conventions, or invent a parallel structure?
- Simplicity. Is it adding services, queues or abstractions you don't need?
- Unstated assumptions, such as a model ID it has picked or a library you didn't choose.
If the design isn't right, edit it, or ask Kiro to revise it. Don't move on with a design you don't understand.
Step 5: Review the task list
tasks.md breaks the design into steps, such as "write the request validation and its tests," "add the model call," "add the route to the CDK stack."Check that:
- the order makes sense, with tests where your steering file says they belong
- each task is small enough to review in one go
- every requirement is covered by at least one task
- no task does something you didn't ask for
You can edit the list, remove tasks or reorder them.
Step 6: Run tasks, one at a time
Now let Kiro implement. Resist the temptation to run everything at once. Start the first task, then stop and look at what changed.
After each task:
- Read the diff in Git, as you would a colleague's pull request.
- Run the tests, and make sure they test the requirement, not just the code that was written.
- Check against the spec. Does the change do what the task said, and nothing more?
- Commit, with a message that names the task.
Small commits make it easy to undo a task that went wrong, and they leave a readable history that matches the spec. Kiro's IDE offers ways to review changes in pieces, which helps for larger diffs. Use them.
Once you trust how it's working on your project, you can let it run several tasks between reviews. Increase that slowly.
Step 7: Keep the spec and the code honest
Specs help only while they match reality. When you change behaviour, update the spec first, or at least in the same commit. Otherwise the documents become fiction.
Kiro's hooks can help. A hook is an automation that runs when something happens in your project, such as saving a file, and the configuration files live in a
.kiro/hooks/ folder so they can be shared and version-controlled. People use them to run tests, update documentation or check for problems after changes. Start with one simple hook, and check what it does before you rely on it. The hook options and file format are documented on Kiro's website, and they're changing, so follow the current guide.Where it needs supervision
Spec-driven development is a real improvement over unplanned prompting, but it doesn't remove the need for judgement. In practice, watch for these:
Over-engineering. Generated designs can be bigger than the problem. Ask whether each component earns its place.
Specs that are too long. Large generated specs cost credits and time, and they're hard to review. Kiro's guides suggest steering rules that keep generated specs minimal, for example limiting the number of acceptance criteria. Try them if your specs balloon.
Invented details. The assistant may use a function, option or API that doesn't exist, or assume a setting you never chose. Tests catch some of this, and your own reading catches the rest.
Broad permissions. Check the IAM policies it writes, every time.
Tests that prove nothing. A test that only mirrors the implementation passes even when the behaviour is wrong. Make sure each acceptance criterion has a test that could fail.
Drift. Over several sessions, code and spec can diverge. Review them together.
Secrets and sensitive data. Don't put keys or personal data in files the assistant reads, including steering files and specs.
Accountability. The assistant writes the code, but you ship it. Review accordingly.
When specs are too much
Not every job needs three documents. For a one-line fix, a quick question about a function or an experiment, a plain chat is faster. Specs pay off for features with several parts, work that others must understand later, and changes where a misunderstanding would be costly. Kiro's own documentation describes a plan mode for discussing options without producing files, and lighter-weight spec options, so use the least ceremony that does the job.
What it costs
Kiro's agent works on a credit system, according to the sources I read, with plans at different price points. I haven't quoted figures, since they're changing and I've seen them only on third-party pages. Check the current pricing, watch how many credits a spec and its tasks use on your first feature, and multiply to estimate team usage.
Common mistakes
- Accepting the generated spec without reading it. The review is the point.
- Running every task at once before you trust the process.
- Never updating the spec after changing the code.
- No steering file, so the assistant guesses your conventions.
- Too many conventions in one steering file. Split by topic.
- Trusting passing tests without checking what they test.
- Using specs for trivial changes.
A checklist
- Do you have a steering file with your real conventions?
- Did you read and edit
requirements.md, and check each criterion is testable?
- Did you review
design.mdfor permissions, errors and unnecessary complexity?
- Does
tasks.mdcover every requirement, in an order you accept?
- Do you run tasks in small steps, reviewing each diff and running tests?
- Do you update the spec when behaviour changes?
- Do you know what a spec and its tasks cost in credits?
- Do you still review generated code like any other pull request?
Where we go next
Next in the AWS series, we'll look at Amazon SageMaker JumpStart: deploying an open-weight model, calling the endpoint, and shutting it down before it costs you.
Kiro's features, workflows, file formats, plans and pricing change often. This article draws on Kiro's published documentation and guides and on AWS's own articles. Check the current Kiro documentation before you follow any step here, and review everything an AI assistant writes before it ships.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article