Skip to content

feat: add Kiro CLI agent support#958

Merged
njbrake merged 3 commits intonjbrake:mainfrom
nycjay:feature/add-kiro-cli-agent-support
May 7, 2026
Merged

feat: add Kiro CLI agent support#958
njbrake merged 3 commits intonjbrake:mainfrom
nycjay:feature/add-kiro-cli-agent-support

Conversation

@nycjay
Copy link
Copy Markdown
Contributor

@nycjay nycjay commented May 7, 2026

Register Kiro CLI (kiro-cli) as a built-in agent with:

  • Detection via which kiro-cli
  • YOLO mode via --trust-all-tools flag
  • Session resume via --resume-id flag
  • Hook-based status detection via a dedicated agent config file (~/.kiro/agents/aoe-hooks.json) using Kiro's native hook format (lowercase event names, flat {command} objects)
  • Container config mount for ~/.kiro (syncs agents, steering, prompts, and settings dirs into sandbox)
  • Kiro CLI installed in the sandbox Docker image

Docs updated: README, docs/index.md, docs/guides/sandbox.md.

Closes #951

Description

Adds built-in support for the Kiro CLI agent (AWS).

This PR:

  • Registers Kiro CLI as a built-in agent with detection, YOLO flag (--trust-all-tools), and session resume (--resume-id) support.
  • Adds hook-based status detection via a dedicated agent config file (~/.kiro/agents/aoe-hooks.json) using Kiro's native hook format.
  • Only sets aoe-hooks as the default Kiro agent if the user is on the built-in kiro_default; does not override custom defaults.
  • Syncs ~/.kiro config (agents, steering, prompts, settings) into sandbox sessions.
  • Installs Kiro CLI in the sandbox Docker image.
  • Updates supported-agent docs.

PR Type

  • New Feature
  • Bug Fix
  • Refactor
  • Documentation
  • Infrastructure / CI

Checklist

  • I understand the code I am submitting
  • New and existing tests pass
  • Documentation was updated where necessary
  • For UI changes: included screenshot or recording

AI Usage

  • No AI was used
  • AI was used for drafting/refactoring
  • This is fully AI-generated

AI Model/Tool used:
Claude Sonnet 4 via Kiro CLI

Any Additional AI Details you'd like to share:
Verification included:

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test --lib (82 relevant tests pass)
  • Live testing: created session, verified hook installation, confirmed status detection works end-to-end
  • I mostly understand what the code does, but still very new to rust, so relying on AI to help explain what it is doing and how.

NOTE:
When responding to reviewer questions, please respond yourself rather than copy/pasting reviewer comments into an AI and pasting back its answer. We want to discuss with you, not your AI :)

  • I am an AI Agent filling out this form (check box if true)

Register Kiro CLI (kiro-cli) as a built-in agent with:
- Detection via `which kiro-cli`
- YOLO mode via `--trust-all-tools` flag
- Session resume via `--resume-id` flag
- Hook-based status detection via a dedicated agent config file
  (~/.kiro/agents/aoe-hooks.json) using Kiro's native hook format
  (lowercase event names, flat {command} objects)
- Container config mount for ~/.kiro (syncs agents, steering, prompts,
  and settings dirs into sandbox)
- Kiro CLI installed in the sandbox Docker image

Docs updated: README, docs/index.md, docs/guides/sandbox.md.

Closes njbrake#951
…i side effect

Three review fixes from PR njbrake#958:

1. Sandboxed Kiro sessions had no hook status volume mount and no
   per-instance aoe-hooks.json install (the host kiro path was gated on
   !is_sandboxed but no sandbox branch existed). Add a kiro_hooks
   special-case alongside hermes_hooks in build_container_config so the
   sidecar dir is mounted and the agent config is materialized inside
   the sandbox dir.

2. install_kiro_hooks shelled out to `kiro-cli` unconditionally, which
   meant cargo test mutated the developer's real default Kiro agent on
   any machine with kiro-cli installed. Split into pure file IO
   (install_kiro_hooks) and a separate set_kiro_default_agent_if_builtin
   that the host install path calls explicitly.

3. Update the stale comment in agents.rs that referred to "until a
   Kiro-specific hook installer is added"; the installer is here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch set_kiro_default_agent_if_builtin from substring-matching plain
text output to using `kiro-cli settings --format json`, which returns
`null` (unset), `"kiro_default"` (built-in), or `"custom-name"`
(user-chosen). Eliminates false matches on agent names containing
'kiro_default' or 'not set' as substrings.

Fixes njbrake#962
nycjay pushed a commit to nycjay/agent-of-empires that referenced this pull request May 7, 2026
Add pitfalls discovered during njbrake#958 review:
- Sandbox hooks need separate wiring in build_container_config
- Keep install_*_hooks() as pure file IO (no subprocess calls)
- Use --format json when parsing agent CLIs
- Document missing Waiting status as a limitation
@njbrake njbrake merged commit 1d8a93c into njbrake:main May 7, 2026
11 checks passed
njbrake pushed a commit that referenced this pull request May 7, 2026
* docs: add guide and skill for adding new agent support

- docs/development/adding-agents.md: comprehensive reference covering
  levels of support, step-by-step instructions, hook format reference,
  and common pitfalls
- .claude/skills/add-agent/SKILL.md: interactive skill that walks
  through the agent addition workflow with verification checkpoints;
  includes a self-update section so the skill stays current
- .kiro/skills/add-agent -> symlink to .claude/skills/add-agent so the
  skill works for both Claude Code and Kiro CLI users

* docs: incorporate lessons from PR review

Add pitfalls discovered during #958 review:
- Sandbox hooks need separate wiring in build_container_config
- Keep install_*_hooks() as pure file IO (no subprocess calls)
- Use --format json when parsing agent CLIs
- Document missing Waiting status as a limitation

* fix: address PR review feedback

- Remove .claude/skills/ and .kiro/skills/ (skill precedent decision
  deferred per maintainer)
- Add website sync entries (PAGES, URL_MAP in sync-docs.mjs, nav in
  docsNav.ts)
- Add cross-link from AGENTS.md to docs/development/adding-agents.md

---------

Co-authored-by: Jason Knaster <jason.knaster@infor.com>
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.

Support for Kiro, and other agents

2 participants