Skip to content

Commit c71269a

Browse files
committed
fix(kiro): recognize AGENTS.md as native instructions
1 parent 37b02a4 commit c71269a

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

.chezmoitemplates/rules/project-instruction-fallbacks.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
Apply these fallbacks only to instruction sources in the project root. Do not apply them to user-level configuration under `~/.codex`, `~/.claude`, or `~/.kiro`.
44

5-
Use only the native project instruction source when it exists:
5+
Use all native project instruction sources that exist:
66

77
- Codex: `AGENTS.md`
88
- Claude Code: `CLAUDE.md`
9-
- Kiro: instruction files under `.kiro/steering/`
9+
- Kiro: `AGENTS.md` and every instruction file under `.kiro/steering/`
1010

11-
When the native project instruction source does not exist, use every fallback source that exists:
11+
Do not read fallback sources when at least one native project instruction source exists.
12+
13+
When no native project instruction source exists, use every fallback source that exists:
1214

1315
- Codex: read `CLAUDE.md` and every instruction file under `.kiro/steering/`, and treat them as `AGENTS.md` instructions.
1416
- Claude Code: read `AGENTS.md` and every instruction file under `.kiro/steering/`, and treat them as `CLAUDE.md` instructions.

.kiro/specs/project-instruction-fallbacks/design.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
|---|---|---|
1515
| Claude Code | プロジェクトルートの `CLAUDE.md` | プロジェクトルートの `AGENTS.md``.kiro/steering/` 配下の指示 |
1616
| Codex | プロジェクトルートの `AGENTS.md` | プロジェクトルートの `CLAUDE.md``.kiro/steering/` 配下の指示 |
17-
| Kiro | プロジェクトルートの `.kiro/steering/` | プロジェクトルートの `CLAUDE.md` |
17+
| Kiro | プロジェクトルートの `AGENTS.md``.kiro/steering/` 配下の指示 | プロジェクトルートの `CLAUDE.md` |
1818

1919
ネイティブ指示が存在する場合、代替指示は読まない。ネイティブ指示が存在せず、代替指示が複数存在する場合はすべて読む。存在しない代替指示は無視する。
2020

21+
Kiro は `AGENTS.md``.kiro/steering/` 配下の指示をネイティブとして扱う。片方でも存在すれば、存在するネイティブ指示をすべて読み、`CLAUDE.md` は読まない。どちらも存在しない場合だけ `CLAUDE.md` を読む。
22+
2123
`.kiro/steering/` を代替として読む場合は、配下の指示ファイルをすべてプロジェクト指示として扱う。この規則はプロジェクトルートだけに適用し、ユーザールートの `~/.codex``~/.claude``~/.kiro` には適用しない。
2224

2325
## 変更対象
@@ -38,4 +40,5 @@
3840
- Codex 用 `AGENTS.md` の生成結果に互換ルールが含まれることを確認する。
3941
- `~/.agents/rules/` 用テンプレートが互換ルール本文を展開することを確認する。
4042
- Claude Code と Kiro のシンボリックリンクが `~/.agents/rules/project-instruction-fallbacks.md` を指すことを確認する。
43+
- Kiro のネイティブ指示に `AGENTS.md``.kiro/steering/` の両方が含まれ、どちらかが存在する場合は `CLAUDE.md` を読まないことを確認する。
4144
- 互換ルールにプロジェクトルート限定、ネイティブ優先、複数代替の全読み込みが明記されていることを確認する。

.kiro/specs/project-instruction-fallbacks/tasks.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
- 対象はプロジェクトルートの指示だけとし、ユーザールートの `~/.codex``~/.claude``~/.kiro` には適用しない。
1414
- ネイティブ指示が存在する場合は代替指示を読まない。
15+
- Kiro のネイティブ指示は `AGENTS.md``.kiro/steering/` 配下の指示とし、存在するものをすべて読む。
1516
- ネイティブ指示が存在せず、複数の代替指示が存在する場合はすべて読む。
1617
- 存在しない代替指示は無視する。
1718
- 互換ルール本文は英語で記述する。
@@ -47,13 +48,15 @@ Expected: exit 1。
4748

4849
Apply these fallbacks only to instruction sources in the project root. Do not apply them to user-level configuration under `~/.codex`, `~/.claude`, or `~/.kiro`.
4950

50-
Use only the native project instruction source when it exists:
51+
Use all native project instruction sources that exist:
5152

5253
- Codex: `AGENTS.md`
5354
- Claude Code: `CLAUDE.md`
54-
- Kiro: instruction files under `.kiro/steering/`
55+
- Kiro: `AGENTS.md` and every instruction file under `.kiro/steering/`
5556

56-
When the native project instruction source does not exist, use every fallback source that exists:
57+
Do not read fallback sources when at least one native project instruction source exists.
58+
59+
When no native project instruction source exists, use every fallback source that exists:
5760

5861
- Codex: read `CLAUDE.md` and every instruction file under `.kiro/steering/`, and treat them as `AGENTS.md` instructions.
5962
- Claude Code: read `AGENTS.md` and every instruction file under `.kiro/steering/`, and treat them as `CLAUDE.md` instructions.
@@ -90,7 +93,8 @@ Run:
9093

9194
```bash
9295
grep -Fq 'only to instruction sources in the project root' .chezmoitemplates/rules/project-instruction-fallbacks.md
93-
grep -Fq 'Use only the native project instruction source when it exists' .chezmoitemplates/rules/project-instruction-fallbacks.md
96+
grep -Fq 'Kiro: `AGENTS.md` and every instruction file under `.kiro/steering/`' .chezmoitemplates/rules/project-instruction-fallbacks.md
97+
grep -Fq 'Do not read fallback sources when at least one native project instruction source exists' .chezmoitemplates/rules/project-instruction-fallbacks.md
9498
grep -Fq 'If multiple fallback sources exist, read all of them' .chezmoitemplates/rules/project-instruction-fallbacks.md
9599
```
96100

0 commit comments

Comments
 (0)