feat(hooks)!: move every hook to the Kiro IDE 1.0 v1 schema - #44
Merged
Conversation
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.
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.
Kiro retired the
.kiro.hookformat 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
.kiro.hookfiles.jsonin.kiro/hooks/,{version:"v1", hooks:[...]}when/thentrigger/matcher/actionfileEdited,agentStop, …PostFileSave,Stop, … (PascalCase)askAgent/runCommandaction.type: "agent"/"command"when.patternsglob arraymatcherregexuserTriggeredAll 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.jsonhad ahookskey registering six Node scripts under a camelCaseagentStop. 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
commandhooks, 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 commandsThat trigger no longer exists. The 10 on-demand hooks install as
.kiro/steering/*.mdwithinclusion: 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.mjslisted only 6 of the 9 presets, soai-engineer,kiro-kit-dev, andsawere 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
doctorvalidated the 0.xwhen/thenshape and would have called every migrated hook invalid. It now validates v1 and warns, by name, about leftover.kiro.hookfiles..kiro.hookreappears, and that everymatchercompiles as a regex.hooks.md, 11 ofhooks/README.md, 12skill.mdexamples, and the docs-site page.mergeSettingsandManifestParserkeep the oldhookskey as documented-deprecated passthrough so third-party presets on 0.x still parse.Tested
tsc --noEmitclean; 340/340 tests pass;tsupbuild succeeds.init --preset devops): 12 v1 hooks, 2 steering slash commands, no legacy files, nohookskey in settings,doctorreports[PASS] All 12 native hook(s) are valid.One caveat:
npx eslint srcfails in this worktree because@eslint/jsisn'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 initto install them, then delete any.kiro.hookfiles left in.kiro/hooks/—doctorlists 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 onkiro-kit@0.10.7.