Steering Files
Steering files are markdown files that Kiro loads into context automatically, every session. They’re how you give the agent durable knowledge about your project instead of repeating yourself in every prompt. Good things to put in a steering file:
- The purpose of the project: what it does and who it’s for.
- The technologies used: language, frameworks, and key libraries.
- Organizational coding standards: conventions that go beyond general language style, like how your team handles money, errors, naming, or comments.
Steering files live under .kiro/steering/ in your project (or ~/.kiro/steering/ for personal,
machine-wide rules). Each file’s YAML frontmatter carries an inclusion field that tells Kiro
when to load it — mark a file inclusion: always and it joins every conversation.
When a steering file loads
Section titled “When a steering file loads”The inclusion field controls when a file enters context. This matters because anything
loaded on every turn costs context whether it’s relevant or not. There are three modes:
inclusion | When the file loads | Use it for |
|---|---|---|
always | Every turn of every session | Project-wide rules that always apply |
fileMatch | Only when a file matching fileMatchPattern is in context | Rules scoped to one part of the codebase |
manual | Only when you reference it with # in a prompt | Occasional context you pull in by hand |
A fileMatch file declares the glob it reacts to:
---inclusion: fileMatchfileMatchPattern: '**/*.Tests.cs'---
# Test conventions
- Name the test class after the class under test, like `MoneyTests`.- Use Arrange-Act-Assert, with one descriptive method per case.That file stays out of context until you open or reference a matching *.Tests.cs file. Then it
loads, whole, automatically.
Exercise: teach Kiro your money convention
Section titled “Exercise: teach Kiro your money convention”The budget tracker follows one firm rule throughout its code: money is integer cents
(long), never decimal or float, and every money value shown to a user goes through
Money.Format (see Money.cs). That’s a project decision. Nothing forces it, and the
agent only follows it if it happens to notice. A steering file turns “happens to notice” into
“always.”
1. Add a feature with no steering
Section titled “1. Add a feature with no steering”Open the budget tracker in Kiro and ask it to extend the summary:
Add a GET /summary/by-category endpoint that returns each categoryand how much was spent in it this month.Run it:
curl "http://localhost:5000/summary/by-category"2. Write the rule, in your own words
Section titled “2. Write the rule, in your own words”Don’t paste a prepared file. In one or two imperative sentences, write the convention the way you’d say it to a new teammate:
---inclusion: always---
# Money
- All monetary amounts are integer **cents** (`long`). Never use `decimal`, `double`, or `float` for money.- Every money value returned from an API or shown to a user is formatted with `Money.Format`.Keep it terse and imperative. “Do this, not that” lands far better than a paragraph.
3. Predict, then regenerate
Section titled “3. Predict, then regenerate”Before you run anything: what will change in the /summary/by-category output once the
rule is loaded? Say it out loud or jot it down.
-
Save the rule and restart Kiro so it loads.
Directory.kiro/
Directorysteering/
- money.md
-
Confirm it’s in context:
/context showYou should see
money.mdlisted. If not, check it’s directly under.kiro/steering/, ends in.md, and has theinclusion: alwaysfrontmatter at the top. -
Remove the previous attempt (delete the endpoint, clear the context) and ask for the exact same feature again.
4. Compare against your prediction
Section titled “4. Compare against your prediction”curl "http://localhost:5000/summary/by-category"