Skip to content

feat(hooks)!: move every hook to the Kiro IDE 1.0 v1 schema - #44

Merged
ihatesea69 merged 1 commit into
mainfrom
feat/kiro-hooks-v1-schema
Aug 19, 2026
Merged

feat(hooks)!: move every hook to the Kiro IDE 1.0 v1 schema#44
ihatesea69 merged 1 commit into
mainfrom
feat/kiro-hooks-v1-schema

Conversation

@ihatesea69

Copy link
Copy Markdown
Owner

Kiro retired the .kiro.hook format in IDE 1.0 / CLI 3.0. Every hook the kit ships is now on the v1 schema. Bumped to 0.11.0.

What changed in the format

0.x v1
.kiro.hook files .json in .kiro/hooks/, {version:"v1", hooks:[...]}
when / then trigger / matcher / action
fileEdited, agentStop, … PostFileSave, Stop, … (PascalCase)
askAgent / runCommand action.type: "agent" / "command"
when.patterns glob array single matcher regex
userTriggered removed — manual steering files

All 71 hooks across 9 presets migrated to 97 v1 files. Nothing on 0.x is left. On IDE 1.0 the old files showed an upgrade badge and did not run, so a workspace installed from 0.10.x had silently inert hooks.

The second legacy hook system

Easy to miss: every settings.json had a hooks key registering six Node scripts under a camelCase agentStop. Kiro 1.0 reads hooks only from .kiro/hooks/*.json, so that block was dead config — scout-block (the dangerous-command guard) and the Discord/Telegram notifiers had stopped firing.

Those now ship as v1 command hooks, enabled, with explicit timeouts. They cost no credits and no-op when their env vars are unset. The key was stripped from 22 files; one already present in a user's own settings is left untouched.

userTriggered → slash commands

That trigger no longer exists. The 10 on-demand hooks install as .kiro/steering/*.md with inclusion: manual, which Kiro surfaces as slash commands: /cost-estimate, /deep-scan-stale, /release-checklist, /deployment-readiness, /model-card-update, /agent-card-update. Same prompts, invoked by name instead of a panel button.

Drift fixed along the way

scripts/generate-native-hooks.mjs listed only 6 of the 9 presets, so ai-engineer, kiro-kit-dev, and sa were hand-placed and had diverged from the generated set. All nine are generated now, and a re-run reproduces exactly what ships.

Code and docs

  • doctor validated the 0.x when/then shape and would have called every migrated hook invalid. It now validates v1 and warns, by name, about leftover .kiro.hook files.
  • Structural suite asserts the v1 contract, that no .kiro.hook reappears, and that every matcher compiles as a regex.
  • Rewrote 11 copies of hooks.md, 11 of hooks/README.md, 12 skill.md examples, and the docs-site page. mergeSettings and ManifestParser keep the old hooks key as documented-deprecated passthrough so third-party presets on 0.x still parse.

Tested

  • tsc --noEmit clean; 340/340 tests pass; tsup build succeeds.
  • Real install smoke test (init --preset devops): 12 v1 hooks, 2 steering slash commands, no legacy files, no hooks key in settings, doctor reports [PASS] All 12 native hook(s) are valid.
  • Not verified: behaviour inside a live Kiro IDE 1.0 session — the schema is matched against the published reference, not observed executing.

One caveat: npx eslint src fails in this worktree because @eslint/js isn't installed. Pre-existing environment gap, unrelated to these changes.

Breaking

Native hooks now require Kiro IDE 1.0 / CLI 3.0. Re-run kiro-kit init to install them, then delete any .kiro.hook files left in .kiro/hooks/doctor lists them. Customised a hook? Port the prompt across; the trigger mapping is in .kiro/skills/kiro/references/hooks.md. Staying on Kiro IDE 0.x means staying on kiro-kit@0.10.7.

Kiro retired the `.kiro.hook` format. Hooks are now `.json` files in
`.kiro/hooks/` holding `{version:"v1", hooks:[...]}`, triggers are PascalCase
(`fileEdited` became `PostFileSave`), `when`/`then` became
`trigger`/`matcher`/`action`, `askAgent`/`runCommand` became `action.type`
`agent`/`command`, and the `when.patterns` glob array became a single `matcher`
regex.

All 71 hooks the kit shipped across 9 presets were migrated; nothing on 0.x is
left. On IDE 1.0 the old files showed an upgrade badge and did not run, so a
workspace installed from 0.10.x had silently inert hooks.

The repo carried a second, easily-missed legacy hook system: a `hooks` key in
every `settings.json` registering six Node scripts under a camelCase
`agentStop`. Kiro 1.0 reads hooks only from `.kiro/hooks/*.json`, so that block
was dead config and `scout-block` (the dangerous-command guard) plus the
notifiers had stopped firing. They now ship as v1 `command` hooks, enabled, with
explicit timeouts. The key was stripped from 22 files; one already present in a
user's own settings is left alone.

`userTriggered` no longer exists in v1, so the 10 on-demand hooks became manual
steering files (`inclusion: manual`) invoked as slash commands: /cost-estimate,
/deep-scan-stale, /release-checklist, /deployment-readiness,
/model-card-update, /agent-card-update.

Also fixes a pre-existing drift: generate-native-hooks.mjs listed only 6 of the
9 presets, so ai-engineer, kiro-kit-dev, and sa were hand-placed and diverged
from the generated set. All nine are generated now, and a re-run reproduces
exactly what ships.

doctor validated the 0.x `when`/`then` shape and would have called every
migrated hook invalid; it now validates v1 and warns, by name, about leftover
`.kiro.hook` files. The structural suite asserts the v1 contract and that
matchers compile as regexes.

BREAKING CHANGE: native hooks now require Kiro IDE 1.0 / CLI 3.0. Re-run
`kiro-kit init` to install them, then delete any `.kiro.hook` files left behind.
Staying on Kiro IDE 0.x means staying on kiro-kit@0.10.7.
@ihatesea69
ihatesea69 merged commit 028c774 into main Aug 19, 2026
12 checks passed
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.

1 participant