Skip to content

feat(kiro-ide): add hooks adapter plus global skills/subagents scope#2093

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2070-kiro-ide-hooks-global
Jun 30, 2026
Merged

feat(kiro-ide): add hooks adapter plus global skills/subagents scope#2093
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2070-kiro-ide-hooks-global

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow-up for Kiro IDE 1.0 upstream updates (#2070). Implements the well-defined parts; two parts are deferred with documented reasons.

Implemented

  1. KiroIdeHooks adapter — Kiro IDE 1.0 stores hooks as .kiro/hooks/*.json v1 ({ "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), supports command and promptagent actions, matcher/timeout/enabled, and round-trips on import. IDE-only triggers (PostFileSave/PreTaskExec/etc.) pass through verbatim via a kiro-ide override block (no speculative new canonical events).
  2. Global skills ~/.kiro/skills/ for kiro-cli and kiro-ide (KiroSkill no longer throws on global; legacy kiro kept project-only).
  3. Global subagents ~/.kiro/agents/ for kiro-ide.

The legacy kiro alias is left frozen throughout.

Deferred (documented, not guessed)

  1. Global ignore ~/.kiro/settings/kiroignoreIgnoreProcessor is project-only by architecture for every tool (it throws on global mode), so this needs a cross-cutting change out of scope here.
  2. Global permissions + IDE format — the maintainer flagged the CLI default.json shape 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 cicheck fully 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)

cm-dyoshikawa and others added 2 commits June 30, 2026 10:32
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>
@dyoshikawa
dyoshikawa merged commit b7fe3e3 into main Jun 30, 2026
8 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2070-kiro-ide-hooks-global branch June 30, 2026 17:53
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