DEV Community

Nao San for AWS Community Builders

Posted on

[AWS] Kiro steering application timing and scope verification [Kiro]

This article is a machine translation of the contents of the following URL, which I wrote in Japanese:

https://qiita.com/Nana_777/items/9130b466b5cb82e3a82e

Introduction

By configuring Kiro's Steering file, you can keep Kiro aware of unique coding conventions, best practices, and other rules that must always be kept in mind during product development.

A steering file can be applied to all files at all times, but you can also control the timing and scope of application.

In this article, we examined the scope and timing of Kiro's Steering.

Conclusion

  • Steering application timing can be controlled in three ways: always (default), under specific conditions, and explicitly specified.
  • Verification process description
  • Steering application scope can be controlled in two ways: globally (everything on an individual's PC) and by workspace (application).
  • Verification process description
  • Workspaces take priority in steering application scope.
  • To ensure that the generative AI generates accurate, expected results, more detailed rules must be clearly documented.

What is Steering?

In Kiro, steering refers to the rules that Kiro applies to what it generates.
Specification-driven development uses SPECs, and Vibe coding uses prompts that are entered on an ad-hoc basis. However, it can be tedious to write down rules that must be executed every time, or rules that apply across all projects at an organizational level.
By defining these rules as steering, you can avoid having to enter prompts every time or writing them in the specification (SPEC).
Furthermore, to ensure that AI-generated results are more accurate and less prone to rework, more detailed and specific rules are required.
Steering is also effective in avoiding situations where specifications become too detailed and difficult to read.

How to Create a Steering File

You can create a steering file by having Kiro create it through Kiro chat, by manually placing a ".md" file in the appropriate Kiro directory, or by using the Kiro IDE as shown below.

How to Create Using Kiro's IDE

Select the Kiro icon in Kiro's sidebar menu to display the Kiro feature menu.
Select the "+" sign in the upper right corner of the "AGENT STEERING" section in the Kiro feature menu.

image.png

A dialog box will appear, allowing you to select one of three creation methods.
Details for options 1 and 2 from the top will be explained later, but the options are as follows:

  • [Workspace Name] agent steering: Steering file applied only to the currently open workspace.
  • Global agent steering: Steering file applied to all workspaces opened on the currently used PC.
  • Project steering files: Kiro automatically generates a steering file recommended by Kiro based on the contents of the currently open workspace (for the workspace).

Screenshot 2026-01-31 082939.png

Once created, it will appear in the "AGENT STEERING" column as shown below.
[Workspace Name] agent steering
image.png

Global agent steering
image.png

Project steering files *The generated file will vary depending on the workspace contents.
image.png

Steering Application Timing

There are three steering application timing patterns.

Default

This setting defines a steering file that defines rules that are always applied.
If you add the following to the beginning of the steering file or do not specify inclusions, the rules in the steering file will be used by default.

---
inclusion: always
---
Enter fullscreen mode Exit fullscreen mode

Conditional (applies only to specific files)

For rules that you want to apply only to specific files, you can specify the scope of application by specifying "inclusion: fileMatch" as shown below, and then specifying "fileMatchPattern: "【Application Condition】"" on the next line.
For example, you can define a rule that applies only to .txt files in the TEST02 folder by specifying "fileMatchPattern: "TEST02/*/.txt"".

---
inclusion: fileMatch
fileMatchPattern: "【Application Condition】"
---
Enter fullscreen mode Exit fullscreen mode

Manual Reflection (Applies only when explicitly specified)

This setting applies to rules you want to apply at any time.
By adding the following to the beginning of a steering file, you can set the rule for manual reflection.
To apply a rule, instruct Kiro in chat to "apply the rule in "[steering file name].md" and generate a result with that rule applied.

---
inclusion: manual
---
Enter fullscreen mode Exit fullscreen mode

Verification: Steering files for different application timings

Preparation: Creating three steering file patterns

I created three steering files and prepared three empty folders.
The steering file contents are as follows:

  • str01-JPN.md: Rule to always create files in Japanese
    image.png

  • str02-ENG.md: Rule to always create files in English, with the condition "Only text files generated in TEST2"
    image.png

  • str03-SPA.md: Rule for creating files in Spanish only when explicitly instructed
    image.png

With this file in place, have the user create a text file in each folder.

Test 1: Create a text file in the TEST01 folder (the steering file should always be applied).

Enter the following in the Kiro chat and execute it.

Create a text file in the TEST01 folder.
The file contents should briefly explain what Kiro is.
Enter fullscreen mode Exit fullscreen mode

The chat response referenced the contents of "str01-JPN.md," and a Japanese text file was generated.
image.png
The file contents are also written in Japanese.
image.png

Verification ②: Create a text file in the TEST02 folder (the steering file applied under the conditions should be applied).

Enter the following in Kiro chat and execute it (only the folder name has been changed):

Create a text file in the TEST02 folder.
Please include a brief explanation of what Kiro is in the file contents.
Enter fullscreen mode Exit fullscreen mode

The chat response referenced the contents of "str02-ENG.md" and generated an English text file.
image.png

The file contents are also written in English.
image.png

:::note info
The problem of English being used for more than just the file contents
In this test, even the chat responses and filename are in English, apart from the file contents. This occurs because the rules in the steering wheel do not specify the chat responses or filename.
If you want the AI ​​to perform as expected, you must provide more detail in the prompts, including the steering wheel.
:::

Test 3: Generate a text file in the TEST03 folder (it should be generated in Japanese if not specified, or in Spanish if explicitly specified).

Enter the following in Kiro chat and execute it (only the folder name has been changed):

Create a text file in the TEST03 folder.
Please include a brief explanation of what Kiro is in the file contents.
Enter fullscreen mode Exit fullscreen mode

The chat response had previously verified "str01-JPN.md" and then "str02-ENG.md" in order, so perhaps an automatic inference was run and "str03-SPA.md" was read.
However, as explained in the response, the default rule was ultimately applied.
"I created a file called 'kiroexplanation.txt' in the TEST03 folder and included a brief Japanese explanation of Kiro. The steering rule for str03-SPA.md has 'inclusion: manual' specified, so it will only be applied when explicitly referenced in chat and will not be automatically applied to the TEST03 file. The workspace-level str01-JPN.md rule will be applied by default." "
image.png

The created file is also written in Japanese.
image.png

Next, let's explicitly specify the steering file to apply.
Enter the following in the Kiro chat and execute it (clearly specify the steering file to load):

Create a text file in the TEST03 folder.
Include a brief explanation of Kiro in the file's contents.
This time, apply the rules for the steering file "str03-SPA.md."
Enter fullscreen mode Exit fullscreen mode

Perhaps because the file was explicitly specified, the referenced steering file name was not included in the chat response, but a Spanish file was generated.

image.png

The file contents are also written in Spanish.
image.png

Steering Scope

The steering scope is determined by the directory in which the Kiro steering file is placed.
The scope of application is divided as follows depending on the placement location:

Workspace (specific to each project)

(In a Windows environment) Steering files placed in the following directory are rules that are valid only within the workspace in which the steering file is placed.
This is a good place to define system-specific rules during development.

C:\Users\[Username]\[Workspace Path]\.kiro\steering
Enter fullscreen mode Exit fullscreen mode

Global (for all projects referenced in your local Kiro environment)

(In a Windows environment) Steering files placed in the following directory are rules that apply to all workspaces on your current PC.

This is useful for rules common to your organization or team, or for rules that affect Kiro's behavior, such as when you want Kiro to always respond in your native language.

C:\Users\[Username]\.kiro\steering
Enter fullscreen mode Exit fullscreen mode

Verification: Does the placement of the steering file affect the steering applied?

Preparation: Place one steering file globally (for your own use) and one in each of the two workspaces.

Three steering files were created.

  • str-GLOBAL.md: Global steering file. Include the word "GLOBAL" in the first line of the text. image.png

image.png

  • str-WORK01.md: Steering file for workspace 01. Write "WORK01" on the last line of the text.
    image.png

  • str-WORK02.md: Steering file for workspace 02. Add the word "WORK02" to the last line of the text.
    image.png

Test 1: Generate a text file in Workspace 01 (the contents of the GLOBAL and WORK01 steering files will be applied)

Enter the following in the Kiro chat in Workspace 01 and execute it.

Create a text file.
Include a brief explanation of what Kiro is in the file's contents.
Enter fullscreen mode Exit fullscreen mode

The characters specified in the steering file are also included in the first and last lines of chat responses.
This issue can be avoided by including a statement such as "chat responses excluded" in the steering file.
image.png
Checking the generated text file, we can see that the contents of the GLOBAL and WORK01 steering files have indeed been applied.
image.png

Verification ②: Generate a text file in Workspace02 (the contents of the GLOBAL and WORK02 steering files are applied).

With Workspace01 already present, in Workspace02, enter the following in the Kiro chat and execute it.

Create a text file.
Please include a brief explanation of what Kiro is in the file contents.
Enter fullscreen mode Exit fullscreen mode

Although the steering file contents were not applied to this chat response message, we can see that the processing itself referenced the steering file.

image.png

Checking the contents of the generated file confirms that the global steering and workspace-specific steering file contents were applied.
image.png

Verification: Is there a priority between global and workspace steering files? Checking the behavior of conflicting steering files.

For this verification, we prepared steering files that produce different results under the same conditions.
Both of these steering files define rules for the last line.

  • str-GLOBAL.md: Global steering file. The first line of the text should contain the word "GLOBAL."
  • str-WOAK03.md: Steering file for workspace 03. Write "WORK03" in the first line of the text.

image.png

If you create a text file in this state, what will the first line look like?
In Workspace 03, enter the following in the Kiro chat and execute it.

Create a text file.
Include a brief explanation of what Kiro is in the file's contents.
Enter fullscreen mode Exit fullscreen mode

As a result, the workspace rules took precedence.
image.png
The generated file also has the word "WORK03" added to the first line, in accordance with the rules defined in the workspace steering file.
image.png

Conclusion

In this article, we examined the behavior of the steering file.
By controlling the timing and scope of application of the rules defined in the steering file, we believe we can have Kiro generate the desired results more efficiently.
Furthermore, in this testing, Kiro's behavior was unstable in areas that were not clearly described (for example, even "chat responses" and "file names" were written in different languages).
It seems that the key to ensuring that AI-driven development deliverables meet expectations is how detailed the rules are.

Top comments (0)