feat(kiro-ide): add hooks adapter plus global skills/subagents scope#2093
Merged
Conversation
Resolves #2070. Targets kiro-ide / kiro-cli; the legacy kiro alias stays frozen. Hooks: add KiroIdeHooks emitting the Kiro IDE 1.0 structured JSON format to .kiro/hooks/rulesync.json (project) and ~/.kiro/hooks/rulesync.json (global). A single file holds every generated hook in its hooks array ({ version: v1, hooks: [...] }), keeping it within the single-file hooks architecture (no risky multi-file rewrite). Canonical lifecycle events map to PascalCase triggers (SessionStart/UserPromptSubmit/PreToolUse/PostToolUse/Stop); command and prompt(agent) actions, matcher, timeout(seconds) and enabled are supported. IDE-only triggers (PostFileSave/PreTaskExec/...) pass through verbatim via a kiro-ide override block. Skills: KiroSkill.getSettablePaths no longer throws on global; kiro-cli and kiro-ide now support global ~/.kiro/skills/ (legacy kiro stays project-only). Subagents: kiro-ide now supports global ~/.kiro/agents/. Deferred: global ~/.kiro/settings/kiroignore (IgnoreProcessor is project-only by architecture) and kiro-ide permissions global/IDE-format (the IDE 1.0 capability-permission storage format is unconfirmed upstream; not guessing). Regenerated supported-tools tables, .gitignore, and synced skill docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…harden hook import Address PR review: (1) IDE-only triggers supplied via the kiro-ide override block (PostFileSave, PreTaskExec, ...) are emitted verbatim, so the hooks processor no longer reports them as skipped/unsupported (new passthroughOverrideEvents factory flag); (2) emit timeout 0 so it round-trips instead of being dropped; (3) skip prototype-pollution keys when importing kiro-ide hooks to avoid a crafted-trigger crash. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up for Kiro IDE 1.0 upstream updates (#2070). Implements the well-defined parts; two parts are deferred with documented reasons.
Implemented
.kiro/hooks/*.jsonv1 ({ "version": "v1", "hooks": [...] }). Since the v1 schema allows multiple hooks in one file's array, rulesync emits a single.kiro/hooks/rulesync.json(project) /~/.kiro/hooks/rulesync.json(global) — faithful to the format and fitting the existing single-file hooks architecture (no risky multi-file core rewrite). Maps canonical events to PascalCase triggers (SessionStart/UserPromptSubmit/PreToolUse/PostToolUse/Stop), supportscommandandprompt→agentactions, matcher/timeout/enabled, and round-trips on import. IDE-only triggers (PostFileSave/PreTaskExec/etc.) pass through verbatim via akiro-ideoverride block (no speculative new canonical events).~/.kiro/skills/forkiro-cliandkiro-ide(KiroSkill no longer throws on global; legacykirokept project-only).~/.kiro/agents/forkiro-ide.The legacy
kiroalias is left frozen throughout.Deferred (documented, not guessed)
~/.kiro/settings/kiroignore—IgnoreProcessoris project-only by architecture for every tool (it throws on global mode), so this needs a cross-cutting change out of scope here.default.jsonshape may be inert for the IDE, and upstream does not document the IDE 1.0 permission storage format. Guessing a format is out of scope, so no speculative change was made.Verification
pnpm cicheckfully green: 295 test files, 6594 tests; e2e 235 tests; lint/typecheck, sync-skill-docs, gitignore, supported-tools, cspell, secretlint all pass.References
Refs #2070 (parts 4 and 5 remain open)