Generating Code from Reviewed Specs with Kiro
This lesson explains how Kiro, the AWS agentic development environment, turns requests into reviewed specifications before writing code, and how steering files, MCP servers, completion and refactoring support everyday development.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the surfaces of Kiro and how users sign in.
- Explain the phases and files of a Kiro spec and why reviewing them matters.
- Describe how steering files and their inclusion modes give the agent project knowledge.
- Explain how supervised mode, checkpoints and .kiroignore keep the developer in control.
What Kiro is
Kiro is an AI development environment built around an agent: a model that can read the project, edit files, run commands and check its own results, rather than only suggest the next line. The same agent is available in three places. The Kiro IDE is a desktop editor based on Code OSS, so it supports Visual Studio Code settings and compatible extensions. The Kiro CLI brings the agent to the terminal and to automation, and it replaced the Amazon Q Developer CLI. Kiro on the web runs tasks in a cloud sandbox and can open pull requests.
Users sign in with AWS Builder ID, a social login or the organisation's identity provider, and enterprise administrators manage subscriptions, usage reports and which models and MCP servers users may use. Amazon Q Developer offered similar capabilities in the IDE; its IDE plugins reach end of support on 30 April 2027, and the DVA-C03 exam guide lists Kiro as the in-scope tool.
Chat sessions and specs
Kiro supports two ways of working. In a chat session, sometimes called vibe coding, the developer describes a change and the agent makes it directly, which suits small, well-understood changes and exploration. For a larger feature, the agent may make design decisions that nobody reviewed, and it becomes hard to tell later why the code is the way it is.
Spec-driven development addresses this by making the agent write and agree a plan before it writes code. A spec is created in three phases, and the developer reviews and edits the document produced by each phase before the next one starts.
-
Requirements
requirements.mdholds user stories with acceptance criteria written as testable statements, for example "WHEN a user requests an export THEN the system SHALL return a CSV file within 10 seconds". -
Design
design.mddescribes the architecture, data flow, interfaces, data models, error handling and testing strategy, based on an analysis of the existing code. -
Tasks
tasks.mdbreaks the design into discrete tasks, each linked to the requirements it satisfies, with tests included. -
Implementation
The agent completes tasks one at a time or all at once; independent tasks can run in parallel, and each task's status is updated as it finishes.
Because every task traces back to a requirement, reviewers can check that the code does what was agreed. Variants include a design-first spec, a quick spec that produces all three files in one pass, and a bugfix spec, whose bugfix.md records the current, expected and unchanged behaviour of a defect before the fix is designed.
The following diagram shows the phases of a spec and the reviews between them.

Build a spec
Steering, context and MCP
A model knows nothing about a project's conventions unless it is told. Steering files are Markdown files in .kiro/steering/ that the agent reads as standing instructions. The default files are product.md (purpose, users and goals), tech.md (frameworks, libraries and constraints) and structure.md (layout, naming and architecture), and teams add their own, such as API standards or security rules. Global steering in ~/.kiro/steering/ applies to every project, and workspace steering wins when the two conflict. Front matter at the top of each file sets when it is included, as the following table shows.
| Inclusion mode | When the file is loaded |
|---|---|
always (default) | In every interaction |
fileMatch | When the agent works on files that match a glob pattern, such as infra/**/*.ts |
manual | Only when the developer references the file in chat |
auto | When the request matches the file's description |
Model Context Protocol (MCP) servers connect the agent to external tools and data, such as current AWS documentation or a team's issue tracker, so its answers rely on up-to-date sources. A .kiroignore file lists files the agent must not read, such as local credentials and customer data.
Steer the agent
Completion, refactoring and control
Kiro also helps with smaller tasks. Intelligent code completion suggests the rest of a line or block inline as the developer types, using the surrounding code as context. Refactoring suggestions come from asking the agent to simplify a function, extract a module, replace a deprecated API or apply a steering rule across files; checkpoints record the state before each change, so the developer can rewind if the result is not wanted.
The developer decides how much autonomy the agent has. In supervised mode, each file change is presented for review before it is accepted; in autopilot mode, the agent makes changes and runs approved commands without stopping. Permissions limit which commands and tools the agent may run without asking. Whatever the mode, generated code is reviewed, tested and scanned before it is merged, and enterprise subscriptions do not use customer content to improve the service, while free and individual users can opt out.
A CSV export feature
A developer must add an endpoint that exports a customer's orders from DynamoDB as CSV.
Instead of asking for the code directly, the developer starts a spec. The requirements phase produces acceptance criteria, including one the developer had not considered: what happens for a customer with no orders. In the design phase, the agent proposes a Scan with a filter on customer ID; the developer rejects it, because the tech.md steering file says that table reads must use Query, and edits the design to query the existing CustomerOrders global secondary index.
The task list then includes writing the handler, adding the IAM permission for the index, and unit tests for each acceptance criterion. The developer adds a steering rule so the agent never proposes a Scan on that table again. The review happened on a one-page design, before any code existed.
What is gained by reviewing a Kiro spec's design document before any code is generated?
Show answer
Design decisions, such as which table access pattern or service to use, are reviewed while they are cheap to change, and every task can be traced to an agreed requirement.
Exam Tips
Remember for the exam
- Agreed requirements, design and tasks before code: a Kiro spec.
- Conventions the agent must always follow: steering files in .kiro/steering/.
- Keep secrets and sensitive files out of the agent's context: .kiroignore.
- Connect the agent to current documentation or other tools: an MCP server.
- Review, test and scan AI-generated code like any other code before merging.