Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For each tool you select, OpenSpec installs:
| Gemini CLI | `.gemini/skills/` | `.gemini/commands/opsx/` |
| GitHub Copilot | `.github/skills/` | `.github/prompts/` |
| iFlow | `.iflow/skills/` | `.iflow/commands/` |
| Kiro IDE | `.kiro/skills/` | `.kiro/steering/` |
| Kilo Code | `.kilocode/skills/` | `.kilocode/workflows/` |
| OpenCode | `.opencode/skills/` | `.opencode/command/` |
| Qoder | `.qoder/skills/` | `.qoder/commands/opsx/` |
Expand All @@ -53,7 +54,7 @@ openspec init --tools all
openspec init --tools none
```

**Available tool IDs:** `amazon-q`, `antigravity`, `auggie`, `claude`, `cline`, `codebuddy`, `codex`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `iflow`, `kilocode`, `opencode`, `qoder`, `qwen`, `roocode`, `trae`, `windsurf`
**Available tool IDs:** `amazon-q`, `antigravity`, `auggie`, `claude`, `cline`, `codebuddy`, `codex`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `iflow`, `kiro`, `kilocode`, `opencode`, `qoder`, `qwen`, `roocode`, `trae`, `windsurf`

## What Gets Installed

Expand Down
2 changes: 2 additions & 0 deletions openspec/changes/add-kiro-support/.openspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-02-02
57 changes: 57 additions & 0 deletions openspec/changes/add-kiro-support/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Why

Kiro IDE is an AI-powered development environment from AWS with native support for Spec-Driven Development (SDD) workflows. Kiro uses `.kiro/specs/` directory for spec files and steering files (`.kiro/steering/*.md`) for project-level guidance. Integrating OpenSpec with Kiro enables developers to seamlessly use OpenSpec's change management workflow within Kiro while leveraging Kiro's native SDD capabilities.

Kiro IDE 是 AWS 推出的 AI 驱动开发环境,原生支持 Spec-Driven Development (SDD) 工作流。Kiro 使用 `.kiro/specs/` 目录管理规格文件,通过 steering 文件(`.kiro/steering/*.md`)提供项目级指导。将 OpenSpec 与 Kiro 集成可以让开发者在 Kiro 中无缝使用 OpenSpec 的变更管理工作流,同时利用 Kiro 的原生 SDD 能力。

## What Changes

- Add Kiro IDE support to the CLI tool picker (`openspec init`)
- Generate Kiro steering file (`.kiro/steering/openspec.md`) containing OpenSpec workflow guidance
- Create Kiro-compatible spec templates supporting Kiro's `#[[file:]]` reference syntax
- Ensure `openspec update` can refresh existing Kiro configuration files
- Add Kiro-related unit tests and documentation updates

---

- 在 CLI 工具选择器(`openspec init`)中添加 Kiro IDE 支持
- 生成 Kiro steering 文件(`.kiro/steering/openspec.md`)包含 OpenSpec 工作流指导
- 创建 Kiro 兼容的 spec 模板,支持 Kiro 的 `#[[file:]]` 引用语法
- 确保 `openspec update` 可以刷新已存在的 Kiro 配置文件
- 添加 Kiro 相关的单元测试和文档更新

## Capabilities

### New Capabilities

- `kiro-integration`: Kiro IDE integration support including steering file generation, spec template adaptation, and workflow guidance
- `kiro-integration`: Kiro IDE 集成支持,包括 steering 文件生成、spec 模板适配和工作流指导

### Modified Capabilities

- `cli-init`: Add Kiro as a selectable AI tool, generating `.kiro/steering/openspec.md` and related configuration
- `cli-init`: 添加 Kiro 作为可选的 AI 工具,生成 `.kiro/steering/openspec.md` 和相关配置

## Impact

- Specs: `cli-init` (new Kiro tool option), `cli-update` (Kiro file refresh support)
- Code:
- `src/core/command-generation/adapters/` - new Kiro adapter
- `src/core/templates/` - new Kiro steering templates
- Tool registry and slash command registry
- New files:
- `.kiro/steering/openspec.md` - OpenSpec workflow steering file
- Tests: init/update integration tests covering Kiro generation and updates
- Docs: README and tooling docs updated to advertise Kiro support

---

- Specs: `cli-init`(新增 Kiro 工具选项), `cli-update`(支持 Kiro 文件刷新)
- Code:
- `src/core/command-generation/adapters/` - 新增 Kiro adapter
- `src/core/templates/` - 新增 Kiro steering 模板
- 工具注册表和 slash command 注册表
- New files:
- `.kiro/steering/openspec.md` - OpenSpec 工作流 steering 文件
- Tests: init/update 集成测试覆盖 Kiro 生成和更新
- Docs: README 和工具文档更新以宣传 Kiro 支持
103 changes: 103 additions & 0 deletions openspec/changes/add-kiro-support/specs/cli-init/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# CLI Init Specification - Kiro Support Delta / CLI Init 规格 - Kiro 支持增量

## ADDED Requirements

### Requirement: Generating steering file for Kiro IDE / 为 Kiro IDE 生成 steering 文件

The command SHALL generate Kiro steering files when Kiro IDE is selected during initialization.

当初始化时选择 Kiro IDE,命令应生成 Kiro steering 文件。

#### Scenario: Generating steering file for Kiro / 为 Kiro 生成 steering 文件

- **WHEN** the user selects Kiro IDE during initialization
- **THEN** create `.kiro/steering/openspec.md` with OpenSpec workflow instructions
- **AND** include YAML frontmatter with `inclusion: always`
- **AND** wrap the OpenSpec instructions in managed markers (`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`)
- **AND** reference `openspec/AGENTS.md` using Kiro's `#[[file:openspec/AGENTS.md]]` syntax for detailed guidance

---

- **WHEN** 用户在初始化时选择 Kiro IDE
- **THEN** 创建 `.kiro/steering/openspec.md` 包含 OpenSpec 工作流指导
- **AND** 包含 YAML frontmatter 设置 `inclusion: always`
- **AND** 使用管理标记包裹 OpenSpec 指导(`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`)
- **AND** 使用 Kiro 的 `#[[file:openspec/AGENTS.md]]` 语法引用详细指导

#### Scenario: Kiro steering file structure / Kiro steering 文件结构

- **WHEN** the Kiro steering file is generated
- **THEN** the file SHALL have the following structure:
```markdown
---
inclusion: always
---
<!-- OPENSPEC:START -->
# OpenSpec Workflow Guide

This project uses OpenSpec for spec-driven development.

For complete instructions, see: #[[file:openspec/AGENTS.md]]

## Quick Reference
- Proposal: Create `openspec/changes/<name>/proposal.md`
- Specs: Define requirements in `specs/<capability>/spec.md`
- Tasks: Break down work in `tasks.md`
- Apply: Implement tasks and mark complete
- Archive: Run `openspec archive <change-name>`
<!-- OPENSPEC:END -->
```

---

- **WHEN** 生成 Kiro steering 文件时
- **THEN** 文件应具有以下结构:
```markdown
---
inclusion: always
---
<!-- OPENSPEC:START -->
# OpenSpec 工作流指南

本项目使用 OpenSpec 进行规格驱动开发。

完整指导请参见:#[[file:openspec/AGENTS.md]]

## 快速参考
- Proposal: 创建 `openspec/changes/<name>/proposal.md`
- Specs: 在 `specs/<capability>/spec.md` 定义需求
- Tasks: 在 `tasks.md` 分解工作
- Apply: 实现任务并标记完成
- Archive: 运行 `openspec archive <change-name>`
<!-- OPENSPEC:END -->
```

### Requirement: Kiro in non-interactive mode / 非交互模式下的 Kiro

The command SHALL support Kiro selection through the `--tools` option.

命令应支持通过 `--tools` 选项选择 Kiro。

#### Scenario: Select Kiro non-interactively / 非交互式选择 Kiro

- **WHEN** run with `--tools kiro`
- **THEN** configure Kiro IDE without prompting
- **AND** generate `.kiro/steering/openspec.md`

---

- **WHEN** 使用 `--tools kiro` 运行时
- **THEN** 无需提示即可配置 Kiro IDE
- **AND** 生成 `.kiro/steering/openspec.md`

#### Scenario: Kiro included in all tools / Kiro 包含在所有工具中

- **WHEN** run with `--tools all`
- **THEN** include Kiro IDE in the selected tools
- **AND** generate Kiro steering file along with other tool configurations

---

- **WHEN** 使用 `--tools all` 运行时
- **THEN** 在选中的工具中包含 Kiro IDE
- **AND** 与其他工具配置一起生成 Kiro steering 文件
125 changes: 125 additions & 0 deletions openspec/changes/add-kiro-support/specs/kiro-integration/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Kiro Integration Specification / Kiro 集成规格

## ADDED Requirements

### Requirement: Kiro Steering File Generation / Kiro Steering 文件生成

The system SHALL generate a Kiro steering file at `.kiro/steering/openspec.md` containing OpenSpec workflow guidance when Kiro is selected during initialization.

当初始化时选择 Kiro,系统应在 `.kiro/steering/openspec.md` 生成包含 OpenSpec 工作流指导的 steering 文件。

#### Scenario: Generating Kiro steering file / 生成 Kiro steering 文件

- **WHEN** the user selects Kiro IDE during `openspec init`
- **THEN** create `.kiro/steering/openspec.md` with OpenSpec workflow instructions
- **AND** wrap the content in OpenSpec managed markers (`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`)
- **AND** include guidance for proposal, apply, and archive workflows

---

- **WHEN** 用户在 `openspec init` 时选择 Kiro IDE
- **THEN** 创建 `.kiro/steering/openspec.md` 包含 OpenSpec 工作流指导
- **AND** 使用 OpenSpec 管理标记包裹内容(`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`)
- **AND** 包含 proposal、apply 和 archive 工作流的指导

### Requirement: Kiro Steering File Content / Kiro Steering 文件内容

The steering file SHALL contain comprehensive OpenSpec workflow instructions adapted for Kiro's context inclusion mechanism.

steering 文件应包含针对 Kiro 上下文包含机制适配的完整 OpenSpec 工作流指导。

#### Scenario: Steering file includes workflow phases / Steering 文件包含工作流阶段

- **WHEN** the Kiro steering file is generated
- **THEN** include instructions for the proposal phase (creating `openspec/changes/<name>/proposal.md`)
- **AND** include instructions for the specs phase (creating spec files under `specs/`)
- **AND** include instructions for the design phase (optional `design.md`)
- **AND** include instructions for the tasks phase (creating `tasks.md`)
- **AND** include instructions for the apply phase (implementing tasks)
- **AND** include instructions for the archive phase (using `openspec archive`)

---

- **WHEN** 生成 Kiro steering 文件时
- **THEN** 包含 proposal 阶段指导(创建 `openspec/changes/<name>/proposal.md`)
- **AND** 包含 specs 阶段指导(在 `specs/` 下创建 spec 文件)
- **AND** 包含 design 阶段指导(可选的 `design.md`)
- **AND** 包含 tasks 阶段指导(创建 `tasks.md`)
- **AND** 包含 apply 阶段指导(实现任务)
- **AND** 包含 archive 阶段指导(使用 `openspec archive`)

#### Scenario: Steering file references project files / Steering 文件引用项目文件

- **WHEN** the Kiro steering file is generated
- **THEN** use Kiro's `#[[file:]]` syntax to reference `openspec/AGENTS.md` for detailed instructions
- **AND** reference `openspec/config.yaml` for schema configuration

---

- **WHEN** 生成 Kiro steering 文件时
- **THEN** 使用 Kiro 的 `#[[file:]]` 语法引用 `openspec/AGENTS.md` 获取详细指导
- **AND** 引用 `openspec/config.yaml` 获取 schema 配置

### Requirement: Kiro Tool Registration / Kiro 工具注册

The system SHALL register Kiro IDE in the tool registry with appropriate metadata for CLI selection.

系统应在工具注册表中注册 Kiro IDE,包含适当的元数据用于 CLI 选择。

#### Scenario: Kiro appears in tool selection / Kiro 出现在工具选择中

- **WHEN** running `openspec init` interactively
- **THEN** display "Kiro IDE" as a selectable option under "Natively supported providers"
- **AND** use `kiro` as the tool identifier

---

- **WHEN** 交互式运行 `openspec init` 时
- **THEN** 在 "Natively supported providers" 下显示 "Kiro IDE" 作为可选项
- **AND** 使用 `kiro` 作为工具标识符

#### Scenario: Kiro can be selected non-interactively / 非交互式选择 Kiro

- **WHEN** running `openspec init --tools kiro`
- **THEN** configure Kiro without prompting
- **AND** generate the Kiro steering file

---

- **WHEN** 运行 `openspec init --tools kiro` 时
- **THEN** 无需提示即可配置 Kiro
- **AND** 生成 Kiro steering 文件

### Requirement: Kiro File Update Support / Kiro 文件更新支持

The system SHALL support updating existing Kiro configuration files through `openspec update`.

系统应支持通过 `openspec update` 更新已存在的 Kiro 配置文件。

#### Scenario: Updating existing Kiro steering file / 更新已存在的 Kiro steering 文件

- **WHEN** running `openspec update` with existing `.kiro/steering/openspec.md`
- **THEN** refresh content within OpenSpec managed markers
- **AND** preserve any user content outside the markers

---

- **WHEN** 运行 `openspec update` 且 `.kiro/steering/openspec.md` 已存在时
- **THEN** 刷新 OpenSpec 管理标记内的内容
- **AND** 保留标记外的用户内容

### Requirement: Kiro Steering File Frontmatter / Kiro Steering 文件 Frontmatter

The steering file SHALL include YAML frontmatter for Kiro's inclusion configuration.

steering 文件应包含用于 Kiro 包含配置的 YAML frontmatter。

#### Scenario: Steering file has always-included frontmatter / Steering 文件具有始终包含的 frontmatter

- **WHEN** the Kiro steering file is generated
- **THEN** include YAML frontmatter with `inclusion: always` to ensure OpenSpec guidance is always available

---

- **WHEN** 生成 Kiro steering 文件时
- **THEN** 包含 YAML frontmatter 设置 `inclusion: always` 以确保 OpenSpec 指导始终可用
55 changes: 55 additions & 0 deletions openspec/changes/add-kiro-support/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Tasks / 任务

## 1. Tool Registration / 工具注册

- [x] 1.1 Add Kiro to tool registry in `src/core/command-generation/registry.ts` with id `kiro`, name `Kiro IDE`, and appropriate metadata
- [x] 1.1 在 `src/core/command-generation/registry.ts` 中添加 Kiro 到工具注册表,id 为 `kiro`,名称为 `Kiro IDE`,包含适当的元数据

- [x] 1.2 Register Kiro steering file path pattern `.kiro/steering/opsx-<id>.md` in the configurator system
- [x] 1.2 在配置器系统中注册 Kiro steering 文件路径模式 `.kiro/steering/opsx-<id>.md`
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the tasks.md file
find . -name "tasks.md" -type f | head -20

Repository: Fission-AI/OpenSpec

Length of output: 1387


🏁 Script executed:

# Search for the spec files mentioned in the review
find . -name "spec.md" -type f | head -20

Repository: Fission-AI/OpenSpec

Length of output: 1670


🏁 Script executed:

# Search for Kiro adapter implementation
find . -type f -name "*kiro*" | head -30

Repository: Fission-AI/OpenSpec

Length of output: 109


🏁 Script executed:

# Search for references to the path patterns mentioned
rg "kiro/steering" --type md -A 2 -B 2

Repository: Fission-AI/OpenSpec

Length of output: 10087


🏁 Script executed:

# Read the tasks.md file to see the exact content around lines 8-9
cat -n openspec/changes/add-kiro-support/tasks.md | head -30

Repository: Fission-AI/OpenSpec

Length of output: 1726


🏁 Script executed:

# Read the Kiro adapter implementation
cat -n src/core/command-generation/adapters/kiro.ts

Repository: Fission-AI/OpenSpec

Length of output: 1427


🏁 Script executed:

# Read the kiro-integration spec file
cat -n openspec/changes/add-kiro-support/specs/kiro-integration/spec.md | head -100

Repository: Fission-AI/OpenSpec

Length of output: 4564


🏁 Script executed:

# Read the cli-init spec file to see what it says about the file path
cat -n openspec/changes/add-kiro-support/specs/cli-init/spec.md | head -150

Repository: Fission-AI/OpenSpec

Length of output: 3870


🏁 Script executed:

# Let me check the proposal file to confirm the intended design
cat -n openspec/changes/add-kiro-support/proposal.md | grep -A 5 -B 5 "kiro/steering"

Repository: Fission-AI/OpenSpec

Length of output: 2945


🏁 Script executed:

# Also check if there are any other references to understand the intent better
rg "opsx-" openspec/changes/add-kiro-support/ -A 2 -B 2

Repository: Fission-AI/OpenSpec

Length of output: 1187


Update specs to match Kiro adapter implementation—files are per-command, not single.

The Kiro adapter implementation (src/core/command-generation/adapters/kiro.ts) and tasks correctly use the per-command pattern .kiro/steering/opsx-<commandId>.md, but the spec files contradict this. Both cli-init/spec.md and kiro-integration/spec.md specify .kiro/steering/openspec.md (a single fixed filename), which conflicts with the actual implementation.

Update the spec files to reflect that Kiro generates per-command steering files at .kiro/steering/opsx-<commandId>.md, mirroring the adapter's getFilePath() method. This aligns specs, implementation, and task descriptions.

🤖 Prompt for AI Agents
In `@openspec/changes/add-kiro-support/tasks.md` around lines 8 - 9, The spec
files incorrectly document a single fixed steering file name; update
cli-init/spec.md and kiro-integration/spec.md to state that Kiro produces
per-command steering files using the pattern
`.kiro/steering/opsx-<commandId>.md` to match the adapter implementation; mirror
the logic in src/core/command-generation/adapters/kiro.ts by referencing its
getFilePath() behavior and replace any occurrences of
`.kiro/steering/openspec.md` with the per-command pattern and an explanatory
note that `<commandId>` corresponds to the command's id.


## 2. Kiro Adapter Implementation / Kiro 适配器实现

- [x] 2.1 Create `src/core/command-generation/adapters/kiro.ts` adapter following existing adapter patterns (e.g., cline.ts, windsurf.ts)
- [x] 2.1 创建 `src/core/command-generation/adapters/kiro.ts` 适配器,遵循现有适配器模式(如 cline.ts、windsurf.ts)

- [x] 2.2 Implement steering file generation with YAML frontmatter (`inclusion: always`)
- [x] 2.2 实现带有 YAML frontmatter(`inclusion: always`)的 steering 文件生成

- [x] 2.3 Add Kiro-specific `#[[file:]]` reference syntax support in templates
- [x] 2.3 在模板中添加 Kiro 特有的 `#[[file:]]` 引用语法支持

## 3. Template Creation / 模板创建

- [x] 3.1 Add Kiro steering template to `src/core/templates/` with OpenSpec workflow guidance
- [x] 3.1 在 `src/core/templates/` 中添加包含 OpenSpec 工作流指导的 Kiro steering 模板

- [x] 3.2 Include managed markers (`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`) in template
- [x] 3.2 在模板中包含管理标记(`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`)

## 4. Update Command Support / 更新命令支持

- [x] 4.1 Ensure `openspec update` detects and refreshes existing `.kiro/steering/opsx-*.md`
- [x] 4.1 确保 `openspec update` 能检测并刷新已存在的 `.kiro/steering/opsx-*.md`

- [x] 4.2 Preserve user content outside managed markers during update
- [x] 4.2 更新时保留管理标记外的用户内容

## 5. Testing / 测试

- [x] 5.1 Add unit tests for Kiro adapter in `test/core/command-generation/`
- [x] 5.1 在 `test/core/command-generation/` 中添加 Kiro 适配器单元测试

- [x] 5.2 Add init integration tests for Kiro tool selection (interactive and non-interactive)
- [x] 5.2 添加 Kiro 工具选择的 init 集成测试(交互式和非交互式)

- [x] 5.3 Add update integration tests for Kiro steering file refresh
- [x] 5.3 添加 Kiro steering 文件刷新的 update 集成测试

## 6. Documentation / 文档

- [x] 6.1 Update README.md to list Kiro IDE as a supported tool
- [x] 6.1 更新 README.md 将 Kiro IDE 列为支持的工具

- [x] 6.2 Update `docs/supported-tools.md` with Kiro configuration details
- [x] 6.2 更新 `docs/supported-tools.md` 添加 Kiro 配置详情
1 change: 1 addition & 0 deletions src/core/command-generation/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export { factoryAdapter } from './factory.js';
export { geminiAdapter } from './gemini.js';
export { githubCopilotAdapter } from './github-copilot.js';
export { iflowAdapter } from './iflow.js';
export { kiroAdapter } from './kiro.js';
export { kilocodeAdapter } from './kilocode.js';
export { opencodeAdapter } from './opencode.js';
export { qoderAdapter } from './qoder.js';
Expand Down
Loading
Loading