Repository navigation
feat(triage): kit triage check-skills — pre-commit gate requiring deep skill triage (increment 2b) - #330
Merged
Conversation
…p skill triage (increment 2b) Adds `kit triage check-skills`, a fail-closed pre-commit gate: any agent skill with staged changes under `.claude/skills/<name>/` must have a recent `kit triage skill <name> --deep` entry in the triage log. A shallow triage does NOT satisfy the gate — skills ship executable scripts, so the deep static pass (SkillSpector Stage 1, no LLM/no egress) is required before they enter history. Fail-closed: no log, a stale entry (> 7 days), or a shallow-only entry all block the commit. Pure gate core (parseStagedSkillNames / latestDeepSkillTriage / missingDeepSkillTriage) is exported and unit-tested; a forged/unparseable timestamp never counts as fresh. Closes the loop with increment 2, which began recording the `deep` flag. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
This was referenced Jul 11, 2026
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.
Description
Increment 2b of the SkillSpector delegate. Increment 2 began recording whether a skill triage ran deep (the
deepflag in.kit-triage.jsonl); 2b enforces it at commit time.kit triage check-skillsis a fail-closed pre-commit gate: any agent skill with staged changes under.claude/skills/<name>/…must have akit triage skill <name> --deepentry in the triage log within the last 7 days. A shallow triage does not satisfy it — agent skills ship executable scripts, so the deep static pass (SkillSpector Stage 1 — no LLM, no egress) is the bar before they enter history.Type of Change
Related Issues
deepflag) and feat(triage): kit triage skill --deep — SkillSpector delegate, Stage-1 only (no LLM, no egress) #327 (the delegate)Changes Made
kit triage check-skills(src/commands/triage.ts): new pre-commit subcommand, mirroringcheck-deps. Diffs staged files (git diff --cached --name-only --diff-filter=ACMR), maps them to touched skill names, and blocks the commit for any skill lacking a fresh deep triage entry. Exits non-zero on missing skills; suggests the exactkit triage skill <name> --deepcommand to run.parseStagedSkillNames,latestDeepSkillTriage,missingDeepSkillTriage. Timestamp math and log parsing are pure and takenowMsexplicitly, so the gate is deterministic under test.Testing
Fail-closed is the point, and it's tested from every angle: a missing log, a stale entry (> 7 days), a shallow-only entry, and a forged/unparseable timestamp all count as "missing" (commit blocked). A fresh deep entry — including a path-form target like
.claude/skills/searxng— satisfies the gate.Test Coverage
Added new tests (10 subtests across the three pure helpers)
All tests pass (
npm test)npx tsc --noEmit— cleannpx eslint src— 0 errors (pre-existing warnings only)npm run build— cleannode scripts/test.mjs— 2805/2805 passPublic surface unchanged (new subcommand only; top-level
triagealready listed) — nopublic-surface.jsonregen neededManual Testing
.claude/skills/foo/SKILL.mdwith no deep triage logged →kit triage check-skillsexits non-zero, listsfoowith the suggested command.kit triage skill foo --deep, re-stage → gate passes (exit 0).Breaking Changes
None / N/A. The gate is opt-in — it only fires when wired into a pre-commit hook and only when skill files are staged.
Checklist
npm test)Performance Impact
Reviewer Notes
Symmetry with
check-deps: same log file (.kit-triage.jsonl), same 7-day freshness window, same--no-verifybypass audited to.kit-skipped-commits.jsonl. The one deliberate asymmetry is that skills require the deep flag specifically — a plainkit triage skillwon't clear the gate.🤖 Generated with Claude Code
Generated by Claude Code