Repository navigation
Backlog
Labels
difficulty: mediumLeaderboard: 6 points when the PR closing this is mergedenhancementNew feature or requesthelp wantedExtra attention is needed
Description
Part of #240. Builds on #242 and #241. Neither tool has a secfoo agent adapter, so there is no recursion risk from secfoo's own runs. Keep the guard anyway.
Kiro (checked against the docs on 2026-12-03)
Sources: Hooks, Hook types.
-
Config: one JSON file per hook in
.kiro/hooks/<id>.json(workspace); CLI V3 also reads~/.kiro/hooks/.{"version": "v1", "hooks": [{"name": "…", "trigger": "…", "matcher": "…", "action": {"type": "command", "command": "…"}, "timeout": 60, "enabled": true}]} -
Triggers:
- File Save / File Create / File Delete: the matcher matches the file path. This is unique among the tools here, and ideal for
dependency-watch. - Agent Stop, Pre Tool Use (can block), Post Tool Use, Prompt Submit, Session Start/End, Permission Request (CLI V3 3.4+), Manual.
- The docs are inconsistent: the overview example uses
PostFileSave, which isn't in the trigger list. Test the real names.
- File Save / File Create / File Delete: the matcher matches the file path. This is unique among the tools here, and ideal for
-
Actions:
command(stdin gets session context JSON; on exit 0, stdout is added to the agent's context) oragent(inject a prompt). Command timeout default 60 s.
| Recipe | Kiro trigger | Behaviour |
|---|---|---|
commit-guard |
Pre Tool Use (shell) | Block with reason |
turn-review |
Agent Stop | stdout → agent context with findings (verify whether that starts a new turn; if not, show it to the user) |
dependency-watch |
File Save with matcher for manifests/lockfiles | Background SCA; debounce repeated saves |
design-review |
File Save on docs/**, OpenAPI, IaC |
Background, debounced |
session-brief |
Session Start |
Cline (checked against the docs on 2026-12-03)
Sources: Hooks, Hook reference.
- Events:
TaskComplete,TaskCancel,PreToolUse,PostToolUse(can returncancel: true, cannot undo),UserPromptSubmit. Lifecycle hooks gettaskMetadata.taskId. - Location differs by version:
~/Documents/Cline/Hooks/vs~/Documents/Cline/Rules/Hooks/(global),.clinerules/hooks/(project). Scripts must be executable and enabled in the Hooks tab. - Field names in the payload differ between the official samples (
.postToolUse.toolName) and mirrors (.postToolUse.tool), so record real payloads before writing the parser.
| Recipe | Cline event |
|---|---|
commit-guard |
PreToolUse (command execution tool) |
turn-review |
TaskComplete (findings surfaced to the user; check whether Cline can continue the task) |
dependency-watch etc. |
PostToolUse on file edits, background |
Tasks
-
hosts/kiro.py+hosts/cline.pywith recorded payloads (record the versions; the docs disagree on names) -
enable --tool kirowrites.kiro/hooks/secfoo-<recipe>.json.enable --tool clinewrites executable scripts into the right folder and tells the user to enable them in the Hooks tab - Debounce for File Save triggers (one run per path set per N seconds)
- Verification rows: Kiro IDE/CLI version, Cline version, portal shows
trigger.host
Done when
The recipes work in Kiro (IDE and CLI V3) and Cline, with fixtures in CI. Every run reports back. Splitting this into two PRs is fine.
Metadata
Metadata
Assignees
Labels
difficulty: mediumLeaderboard: 6 points when the PR closing this is mergedenhancementNew feature or requesthelp wantedExtra attention is needed
Activity