Skip to content

Add Kiro CLI as third coding agent with hooks and CLI skill#245

Open
b0x42 wants to merge 4 commits intosupabitapp:mainfrom
b0x42:add-kiro-agent-hooks
Open

Add Kiro CLI as third coding agent with hooks and CLI skill#245
b0x42 wants to merge 4 commits intosupabitapp:mainfrom
b0x42:add-kiro-agent-hooks

Conversation

@b0x42
Copy link
Copy Markdown

@b0x42 b0x42 commented Apr 15, 2026

Adds Kiro CLI as a third coding agent alongside Claude Code and Codex in Settings → Coding Agents.

image

Changes

New files

  • KiroHookSettings.swift — Hook entry struct (command + timeout_ms) and payloads for progress (userPromptSubmit → busy on, stop → busy off) and notification (stop → notify) events
  • KiroHookSettingsFileInstaller.swift — File installer for Kiro's flat hook format: install, uninstall, and containsMatchingHooks
  • KiroSettingsInstaller.swift — Targets ~/.kiro/agents/kiro_default.json, creates default agent config when file is absent
  • KiroSettingsClient.swift — TCA dependency client wrapping the installer

Modified files

  • AgentHooksInstallState.swift — Added .kiroProgress, .kiroNotifications to AgentHookSlot
  • SkillAgent.swift — Added .kiro case with configDirectoryName: ".kiro"
  • SettingsFeature.swift — Wired Kiro state, dependency, check/install/uninstall effects
  • DeveloperSettingsView.swift — Added Kiro section with progress, notifications, and CLI skill rows
  • CLISkillContent.swift — Added kiroSkillMd (SKILL.md with YAML frontmatter)
  • CLISkillInstaller.swift — Added .kiro case
  • AgentHookSocketServer.swift — Added assistant_response decoding (see below)

Assets

  • kiro-mark image set (SVG from kiro.dev)

Design decisions

Why kiro_default.json

Kiro has no global hooks file — hooks live per-agent in ~/.kiro/agents/<name>.json. The kiro_default agent is what runs in Supacode terminals, so that's the only file we target. The built-in kiro_default has no file on disk; creating kiro_default.json overrides it entirely, so the installer writes a complete config (name, tools, resources, hooks) — not just hooks.

Why a separate KiroHookSettingsFileInstaller

Kiro's hook format is flat:

{ "hooks": { "stop": [{ "command": "...", "timeout_ms": 10000 }] } }

Claude/Codex use a grouped format:

{ "hooks": { "Stop": [{ "hooks": [{ "type": "command", "command": "...", "timeout": 10 }] }] } }

Rather than generalizing AgentHookSettingsFileInstaller and risking regressions in Claude/Codex, this isolates the format difference in a separate installer.

Socket server: assistant_response field

Kiro sends the agent's final response in assistant_response rather than message (Claude) or last_assistant_message (Codex). Extended the notification body fallback chain:

let body = payload.message ?? payload.lastAssistantMessage ?? payload.assistantResponse

Without this, Kiro notifications would have empty bodies.

Uninstall safety

Uninstall is a no-op if kiro_default.json doesn't exist, preventing creation of a broken config file that would override Kiro's built-in agent with missing fields.

Verification

  • make check passes (swift-format + swiftlint)
  • make test passes (716 tests, 57 suites)

@b0x42 b0x42 force-pushed the add-kiro-agent-hooks branch from f285a2c to 30cce77 Compare April 15, 2026 12:44
- KiroHookSettings: progress (userPromptSubmit/stop) and notification (stop) payloads in Kiro's flat format
- KiroHookSettingsFileInstaller: thin wrapper for Kiro's flat hook JSON format
- KiroSettingsInstaller: targets ~/.kiro/agents/kiro_default.json, creates default agent config when absent
- KiroSettingsClient: TCA dependency for install/uninstall/check
- AgentHookSlot: add .kiroProgress/.kiroNotifications
- SkillAgent: add .kiro
- SettingsFeature: wire Kiro hook checks, install/uninstall, skill install
- CLISkillContent: add Kiro skill (SKILL.md with frontmatter)
- AgentHookPayload: decode assistant_response for Kiro stop events
- DeveloperSettingsView: add Kiro section with progress, notifications, CLI skill rows
- kiro-mark asset from kiro.dev/icon.svg
@b0x42 b0x42 force-pushed the add-kiro-agent-hooks branch from 30cce77 to 0b831ce Compare April 15, 2026 12:44
# Conflicts:
#	SupacodeSettingsFeature/Reducer/SettingsFeature.swift
#	SupacodeSettingsShared/BusinessLogic/KiroHookSettings.swift
#	SupacodeSettingsShared/BusinessLogic/KiroHookSettingsFileInstaller.swift
#	SupacodeSettingsShared/BusinessLogic/KiroSettingsInstaller.swift
#	SupacodeSettingsShared/Models/SkillAgent.swift
@b0x42 b0x42 marked this pull request as ready for review April 15, 2026 13:08
Copy link
Copy Markdown
Collaborator

@sbertix sbertix left a comment

Choose a reason for hiding this comment

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

Thanks 💪 just a few changes required, though.

Comment thread supacode/Clients/CodingAgents/KiroSettingsClient.swift Outdated
Comment thread SupacodeSettingsFeature/Reducer/SettingsFeature.swift
Comment thread SupacodeSettingsShared/BusinessLogic/KiroSettingsInstaller.swift
Comment thread supacode/Features/Settings/Views/DeveloperSettingsView.swift Outdated
Comment thread SupacodeSettingsShared/BusinessLogic/KiroHookSettings.swift Outdated
b0x42 and others added 2 commits April 15, 2026 21:58
- Move KiroSettingsClient to SupacodeSettingsShared/Clients/CodingAgents/ with public access
- Collapse Kiro section in DeveloperSettingsView (isExpanded: false by default)
- Update KiroSettingsInstaller comment with Kiro version (1.x, 2026-04)
- Remove KiroHookPayloadSupport; reuse AgentHookPayloadSupport.extractHookGroups
- Add tests: KiroSettingsInstallerTests, KiroHookSettingsFileInstallerTests
- Extend SettingsFeatureAgentHookTests with kiro hook install/uninstall cases
- Update taskChecksAllFourHookSlotsOnStartup → All Six (includes kiro slots)
- Update receiveStartupHookChecks to assert kiro{Progress,Notifications,Skill}State

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	SupacodeSettingsFeature/Reducer/SettingsFeature.swift
@b0x42 b0x42 requested a review from sbertix April 17, 2026 11:51
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.

2 participants