Skip to content

feat(agents): add Kiro CLI and Kiro IDE support#21

Merged
ryderstorm merged 12 commits into
mainfrom
feat/kiro-cli-support
Mar 3, 2026
Merged

feat(agents): add Kiro CLI and Kiro IDE support#21
ryderstorm merged 12 commits into
mainfrom
feat/kiro-cli-support

Conversation

@gmk-liatrio
Copy link
Copy Markdown
Contributor

@gmk-liatrio gmk-liatrio commented Feb 16, 2026

Summary

  • Add Kiro CLI agent generating plain markdown prompts at ~/.kiro/prompts/*.md with @prompt-name invocation
  • Add Kiro IDE agent generating custom subagent files with YAML frontmatter (name, description, tools: ["*"]) at ~/.kiro/agents/*.md
  • Enables the spec-driven-workflow SDD prompts to be installed and used natively in both Kiro CLI and Kiro IDE — no changes required in the upstream prompt repo
  • Rewrite command cross-references from /SDD-N-command-name to @command-name for Kiro's invocation syntax
  • Strip SDD ordering prefixes (SDD-1-generate-specgenerate-spec) for clean filenames and invocation names
  • Add tracking metadata via trailing HTML comments (<!-- slash-command-manager: ... -->) for cleanup detection
  • Document /tools trust-all workaround for Kiro CLI tool permissions

Test plan

  • 231 tests passing (12 new tests for Kiro CLI + Kiro IDE generators and writer)
  • Ruff lint clean
  • Run uv run slash-man generate --agent kiro-cli --github-repo liatrio-labs/spec-driven-workflow --github-branch main --github-path prompts and verify SDD prompts at ~/.kiro/prompts/
  • Run uv run slash-man generate --agent kiro-ide --github-repo liatrio-labs/spec-driven-workflow --github-branch main --github-path prompts and verify SDD agents at ~/.kiro/agents/
  • Verify @name references in generated files (no /SDD-N- references remain)
  • Verify Kiro IDE frontmatter has name, description, tools: ['*']
  • Test SDD workflow end-to-end in Kiro CLI with /tools trust-all

Summary by CodeRabbit

  • New Features

    • Added support for Kiro CLI and Kiro IDE prompt generation and detection
    • Added Cleanup command description for removing generated files/backups
    • Expanded agent support (including Windsurf and other agents)
  • Documentation

    • Updated platform guides with Kiro installation paths and VS Code notes
    • Added Kiro CLI tool permissions guidance and troubleshooting
  • Tests

    • Added comprehensive tests covering Kiro CLI/IDE generation and detection

Add two new agents for Kiro's CLI tool and IDE, bringing the total to 11
supported AI assistants. Kiro CLI generates plain markdown prompts at
~/.kiro/prompts/, while Kiro IDE generates custom subagent files with
YAML frontmatter at ~/.kiro/agents/.

Key changes:
- KIRO and KIRO_IDE command formats with dedicated generators
- Command cross-reference rewriting (/SDD-N-name → @name)
- SDD ordering prefix stripping for clean filenames and invocation names
- Tracking metadata via trailing HTML comments for cleanup detection
- Documentation for /tools trust-all workaround (Kiro CLI permissions)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 16, 2026

📝 Walkthrough

Walkthrough

Adds Kiro support: two new command formats (kiro, kiro-ide), agent configurations, two new generators, writer detection/filename handling for Kiro outputs, documentation updates, and tests for generation and writer behavior.

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/slash-command-generator.md
Added Kiro CLI and Kiro IDE entries, Kiro CLI permissions and cleanup command docs, Windsurf additions, and installation/usage details for Kiro.
Agent Configuration
slash_commands/config.py
Added CommandFormat.KIRO and CommandFormat.KIRO_IDE; registered kiro-cli and kiro-ide agent entries with directories, formats, extensions, and detection dirs.
Generators
slash_commands/generators.py
Added _strip_ordering_prefix, _rewrite_kiro_command_references, KiroCommandGenerator, KiroIdeCommandGenerator; extended CommandGenerator.create to return Kiro generators and integrated reference rewriting/placeholders/frontmatter/tracking comment logic.
Writer / File handling
slash_commands/writer.py
Added _get_output_name to strip ordering prefixes for Kiro outputs, used it for filename generation and existing-file discovery, added _is_generated_kiro detection via tracking HTML comment and integrated into generation-detection flow.
Tests
tests/test_config.py, tests/test_generators.py, tests/test_writer.py
Expanded tests to cover new formats, config validations, Kiro CLI/IDE generator behavior (placeholders, rewrites, frontmatter, tracking comments) and writer detection/generation paths.

Sequence Diagram(s)

sequenceDiagram
  participant Source as Source (repo / local)
  participant Generator as Kiro Generator
  participant Writer as Writer
  participant FS as Filesystem

  Source->>Generator: load prompt + metadata
  Generator->>Generator: strip ordering prefix\nrewrite /SDD-N-name -> `@name`\napply placeholders\nbuild frontmatter (IDE) or body (CLI)\nappend tracking comment
  Generator->>Writer: provide filename suggestion & content
  Writer->>Writer: compute output name (agent rules)\nsanitize filename\nis_generated check via tracking comment
  Writer->>FS: write file to agent-specific dir (`~/.kiro/...` or project target)
  FS-->>Writer: write confirmation
  Writer-->>Source: return generated path/info
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • ryderstorm

Poem

🐰 I hopped through prompts and names so neat,

Stripped prefixes, rewrote commands to meet.
CLI and IDE now cozy in their nook,
Prompts tucked in folders—come take a look!
Hooray — Kiro hops in, light on its feet!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding support for Kiro CLI and Kiro IDE agents.
Docstring Coverage ✅ Passed Docstring coverage is 92.31% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The PR description covers all required template sections: Why (motivation and upstream integration), What Changed (feature overview), Testing (comprehensive test plan with verification steps), and Checklist items are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/kiro-cli-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In `@docs/slash-command-generator.md`:
- Around line 226-228: The fenced code block containing the snippet "> /tools
trust-all" triggers MD040/fenced-code-language; update that Markdown block in
docs/slash-command-generator.md to include a language identifier (e.g., change
the opening fence to ```text or ```bash) so the block becomes a fenced code
block with an explicit language and the CI lint will pass.

In `@slash_commands/generators.py`:
- Around line 344-353: The metadata writer in the generator is checking the
wrong key ("github_repo") so the repo never gets appended; update the
conditional in the generator that builds meta_lines to check for "source_repo"
instead of "github_repo" (do this in the function that constructs meta_lines and
also in KiroIdeCommandGenerator.generate), and update the corresponding tests in
test_generators.py to assert on "source_repo" being used in the tracking
comment.
- Around line 358-412: Extract the duplicated trailing HTML tracking comment
construction from KiroIdeCommandGenerator.generate and KiroCommandGenerator into
a small helper (e.g., _build_kiro_tracking_comment(prompt_name: str,
source_metadata: dict | None) -> str) that builds the meta_lines list, appends
repo when present, formats the comment string ("<!-- slash-command-manager: ...
-->\n"), and returns it; then call this helper from both
KiroIdeCommandGenerator.generate (replace the block that builds meta_lines and
appends the comment) and KiroCommandGenerator (replace its equivalent block) and
keep the existing call to _normalize_output(output) intact.

In `@slash_commands/writer.py`:
- Around line 287-302: Move the lazy import of _strip_ordering_prefix out of
_get_output_name and add a top-level import from slash_commands.generators (e.g.
import or from slash_commands.generators import _strip_ordering_prefix) near the
existing imports; then remove the in-function import and let _get_output_name
call _strip_ordering_prefix directly when agent.command_format.value is "kiro"
or "kiro-ide" to avoid repeated import overhead and keep imports consistent with
the rest of the module.

In `@tests/test_generators.py`:
- Around line 385-396: Update the tests to use the same metadata key the writer
uses: replace the "github_repo" key with "source_repo" in
test_kiro_generator_github_source_metadata and
test_kiro_ide_generator_github_source_metadata so they mirror the runtime shape
constructed by the writer (the KiroCommandGenerator.generate flow expects
"source_repo"); keep the assertion unchanged (e.g., assert "repo:
liatrio-labs/spec-driven-workflow" in generated) so the tests validate output
using the correct metadata key.
🧹 Nitpick comments (2)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed.


In `@slash_commands/generators.py`:
- Around line 358-412: Extract the duplicated trailing HTML tracking comment
construction from KiroIdeCommandGenerator.generate and KiroCommandGenerator into
a small helper (e.g., _build_kiro_tracking_comment(prompt_name: str,
source_metadata: dict | None) -> str) that builds the meta_lines list, appends
repo when present, formats the comment string ("<!-- slash-command-manager: ...
-->\n"), and returns it; then call this helper from both
KiroIdeCommandGenerator.generate (replace the block that builds meta_lines and
appends the comment) and KiroCommandGenerator (replace its equivalent block) and
keep the existing call to _normalize_output(output) intact.

In `@slash_commands/writer.py`:
- Around line 287-302: Move the lazy import of _strip_ordering_prefix out of
_get_output_name and add a top-level import from slash_commands.generators (e.g.
import or from slash_commands.generators import _strip_ordering_prefix) near the
existing imports; then remove the in-function import and let _get_output_name
call _strip_ordering_prefix directly when agent.command_format.value is "kiro"
or "kiro-ide" to avoid repeated import overhead and keep imports consistent with
the rest of the module.
slash_commands/writer.py (1)

287-302: Consider promoting the lazy import to a top-level import.

_strip_ordering_prefix is imported lazily inside _get_output_name, but slash_commands.generators is already partially imported at Line 20. Since there's no circular dependency risk, this can be a top-level import for consistency and to avoid repeated import overhead on every call.

♻️ Suggested change

At the top of the file (around line 20):

 from slash_commands.generators import CommandGenerator
+from slash_commands.generators import _strip_ordering_prefix

Then simplify the method:

 def _get_output_name(self, prompt_name: str, agent: AgentConfig) -> str:
     name = prompt_name
     if agent.command_format.value in ("kiro", "kiro-ide"):
-        from slash_commands.generators import _strip_ordering_prefix
-
         name = _strip_ordering_prefix(name)
     return name
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@slash_commands/writer.py` around lines 287 - 302, Move the lazy import of
_strip_ordering_prefix out of _get_output_name and add a top-level import from
slash_commands.generators (e.g. import or from slash_commands.generators import
_strip_ordering_prefix) near the existing imports; then remove the in-function
import and let _get_output_name call _strip_ordering_prefix directly when
agent.command_format.value is "kiro" or "kiro-ide" to avoid repeated import
overhead and keep imports consistent with the rest of the module.
slash_commands/generators.py (1)

358-412: Consider extracting the shared tracking-comment logic to reduce duplication.

The trailing HTML comment block (Lines 401–410) is nearly identical to the one in KiroCommandGenerator (Lines 344–353). A small helper like _build_kiro_tracking_comment(prompt_name, source_metadata) would reduce duplication across both generators.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@slash_commands/generators.py` around lines 358 - 412, Extract the duplicated
trailing HTML tracking comment construction from
KiroIdeCommandGenerator.generate and KiroCommandGenerator into a small helper
(e.g., _build_kiro_tracking_comment(prompt_name: str, source_metadata: dict |
None) -> str) that builds the meta_lines list, appends repo when present,
formats the comment string ("<!-- slash-command-manager: ... -->\n"), and
returns it; then call this helper from both KiroIdeCommandGenerator.generate
(replace the block that builds meta_lines and appends the comment) and
KiroCommandGenerator (replace its equivalent block) and keep the existing call
to _normalize_output(output) intact.

Comment thread docs/slash-command-generator.md
Comment thread slash_commands/generators.py
Comment thread tests/test_generators.py
Fixes markdownlint MD040 violation in Kiro CLI permissions section.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In `@docs/slash-command-generator.md`:
- Around line 220-230: Add a brief safety caution immediately after the "/tools
trust-all" workaround in the "Kiro CLI Tool Permissions" section: explicitly
warn that running /tools trust-all disables write/shell confirmations and should
not be used in untrusted repositories or shared sessions, recommend using it
only in trusted, ephemeral sessions, and optionally suggest revoking trust by
restarting the CLI session; reference the exact command "/tools trust-all" and
the "Kiro CLI Tool Permissions" heading so reviewers can find and insert a
one-sentence caution.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed.


In `@docs/slash-command-generator.md`:
- Around line 220-230: Add a brief safety caution immediately after the "/tools
trust-all" workaround in the "Kiro CLI Tool Permissions" section: explicitly
warn that running /tools trust-all disables write/shell confirmations and should
not be used in untrusted repositories or shared sessions, recommend using it
only in trusted, ephemeral sessions, and optionally suggest revoking trust by
restarting the CLI session; reference the exact command "/tools trust-all" and
the "Kiro CLI Tool Permissions" heading so reviewers can find and insert a
one-sentence caution.
docs/slash-command-generator.md (1)

220-230: Add a brief safety caution for /tools trust-all.

Since this disables confirmations for write/shell, add a warning to avoid using it in untrusted repos or shared sessions.

✍️ Suggested doc tweak
-Kiro CLI prompts are plain markdown files and do not support declaring tool permissions. By default, Kiro CLI will prompt you to confirm every `write` and `shell` operation, which interrupts workflows like SDD that need to create files automatically.
+Kiro CLI prompts are plain markdown files and do not support declaring tool permissions. By default, Kiro CLI will prompt you to confirm every `write` and `shell` operation, which interrupts workflows like SDD that need to create files automatically. Use the trust-all workaround only in trusted repos/sessions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/slash-command-generator.md` around lines 220 - 230, Add a brief safety
caution immediately after the "/tools trust-all" workaround in the "Kiro CLI
Tool Permissions" section: explicitly warn that running /tools trust-all
disables write/shell confirmations and should not be used in untrusted
repositories or shared sessions, recommend using it only in trusted, ephemeral
sessions, and optionally suggest revoking trust by restarting the CLI session;
reference the exact command "/tools trust-all" and the "Kiro CLI Tool
Permissions" heading so reviewers can find and insert a one-sentence caution.

The writer sends source_metadata with key "source_repo" but both Kiro
generators were checking for "github_repo", so the repo line was never
appended in the real pipeline. Fixed key and updated tests to match.
Replaces the minimal permissions note with a full Kiro section covering
CLI vs IDE differences, quick start commands, automatic command reference
rewriting, and ordering prefix stripping.
Comment thread docs/slash-command-generator.md Outdated
mo-snow-zingo and others added 2 commits February 26, 2026 11:50
* feat: adding in support for kiro ide

* fix: formatting of the test_writer

* chore: fix comment to / command

---------

Co-authored-by: Morgan Snow <msnow@digitalaviationservices.com>
…nces

Kiro IDE steering files are invoked with /command-name, not @command-name.
Parameterize the rewriter so CLI keeps @ and IDE uses /.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
slash_commands/generators.py (1)

361-363: Update the Kiro IDE generator docstring path to match current target directory.

The docstring says ~/.kiro/steering/*.md, but this PR’s docs/config use ~/.kiro/agents/*.md. Please align the comment to avoid future maintenance confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@slash_commands/generators.py` around lines 361 - 363, Update the Kiro IDE
generator docstring path string in slash_commands/generators.py (the docstring
around the Kiro IDE generator description near the Kiro-related functions or
class) to use "~/.kiro/agents/*.md" instead of "~/.kiro/steering/*.md" so it
matches the PR’s docs/config; locate the docstring text referenced in the
generator (search for "Kiro IDE" or the existing "~/.kiro/steering/*.md"
literal) and change that path only.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@slash_commands/generators.py`:
- Around line 361-363: Update the Kiro IDE generator docstring path string in
slash_commands/generators.py (the docstring around the Kiro IDE generator
description near the Kiro-related functions or class) to use
"~/.kiro/agents/*.md" instead of "~/.kiro/steering/*.md" so it matches the PR’s
docs/config; locate the docstring text referenced in the generator (search for
"Kiro IDE" or the existing "~/.kiro/steering/*.md" literal) and change that path
only.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6c30e7 and 5b7b5a4.

📒 Files selected for processing (6)
  • docs/slash-command-generator.md
  • slash_commands/config.py
  • slash_commands/generators.py
  • tests/test_config.py
  • tests/test_generators.py
  • tests/test_writer.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • slash_commands/config.py
  • tests/test_writer.py

Fix README and docs to reflect .kiro/steering/ path, correct CLI flags,
and differentiate @ (CLI) vs / (IDE) command reference syntax.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
slash_commands/generators.py (1)

347-359: Consolidate duplicated tracking-comment construction.

The same metadata/comment assembly is implemented twice; extracting a shared helper will reduce drift risk between CLI and IDE generators.

♻️ Proposed refactor
+def _build_tracking_comment(
+    prompt_name: str, source_metadata: dict[str, Any] | None = None
+) -> str:
+    meta_lines = [
+        f"source: {prompt_name}",
+        f"version: {__version__}",
+        f"updated: {datetime.now(UTC).strftime('%Y-%m-%d')}",
+    ]
+    if source_metadata and "source_repo" in source_metadata:
+        meta_lines.append(f"repo: {source_metadata['source_repo']}")
+    return "<!-- slash-command-manager: " + " | ".join(meta_lines) + " -->"
+
 class KiroCommandGenerator:
@@
-        meta_lines = [
-            f"source: {prompt.name}",
-            f"version: {__version__}",
-            f"updated: {datetime.now(UTC).strftime('%Y-%m-%d')}",
-        ]
-        if source_metadata:
-            if "source_repo" in source_metadata:
-                meta_lines.append(f"repo: {source_metadata['source_repo']}")
-
-        output += "\n<!-- slash-command-manager: " + " | ".join(meta_lines) + " -->\n"
+        output += "\n" + _build_tracking_comment(prompt.name, source_metadata) + "\n"
@@
-        meta_lines = [
-            f"source: {prompt.name}",
-            f"version: {__version__}",
-            f"updated: {datetime.now(UTC).strftime('%Y-%m-%d')}",
-        ]
-        if source_metadata:
-            if "source_repo" in source_metadata:
-                meta_lines.append(f"repo: {source_metadata['source_repo']}")
-
-        output += "\n<!-- slash-command-manager: " + " | ".join(meta_lines) + " -->\n"
+        output += "\n" + _build_tracking_comment(prompt.name, source_metadata) + "\n"

Also applies to: 405-415

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@slash_commands/generators.py` around lines 347 - 359, Duplicate logic
building the trailing HTML tracking comment (meta_lines population and appending
to output) appears in generators.py (meta_lines, source_metadata checks, and
output += "...slash-command-manager..."), so extract a single helper function
(e.g., format_tracking_comment or build_tracking_comment) that accepts
prompt.name, source_metadata and returns the full "<!-- slash-command-manager:
... -->" string using __version__, datetime.now(UTC).strftime('%Y-%m-%d'), and
optional repo entry; then replace both duplicated blocks (the current one around
meta_lines and the similar block at the other location around lines 405-415) to
call that helper and append its return to output to remove duplication and keep
behavior identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@slash_commands/generators.py`:
- Around line 314-315: Update the docstrings in slash_commands/generators.py
that reference the old prompt and path syntax: replace occurrences of the string
"@prompt_name" with "@prompt-name" and "~/.kiro/steering/*.md" with
"~/.kiro/agents/*.md" (also update the duplicate mentions around the block that
previously appeared at the later location). Search for these literal strings in
the module's docstrings/comments and update them to the current conventions so
the text in the functions/classes that document prompt invocation and file
locations is accurate.

---

Nitpick comments:
In `@slash_commands/generators.py`:
- Around line 347-359: Duplicate logic building the trailing HTML tracking
comment (meta_lines population and appending to output) appears in generators.py
(meta_lines, source_metadata checks, and output +=
"...slash-command-manager..."), so extract a single helper function (e.g.,
format_tracking_comment or build_tracking_comment) that accepts prompt.name,
source_metadata and returns the full "<!-- slash-command-manager: ... -->"
string using __version__, datetime.now(UTC).strftime('%Y-%m-%d'), and optional
repo entry; then replace both duplicated blocks (the current one around
meta_lines and the similar block at the other location around lines 405-415) to
call that helper and append its return to output to remove duplication and keep
behavior identical.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7b5a4 and 3c3ec42.

📒 Files selected for processing (2)
  • slash_commands/generators.py
  • tests/test_generators.py

Comment thread slash_commands/generators.py Outdated
@mo-snow-zingo mo-snow-zingo requested a review from ryderstorm March 2, 2026 23:58
@ryderstorm ryderstorm merged commit b927173 into main Mar 3, 2026
9 checks passed
@ryderstorm ryderstorm deleted the feat/kiro-cli-support branch March 3, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants