Skip to content

feat(triage): kit triage check-skills — pre-commit gate requiring deep skill triage (increment 2b) - #330

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 11, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

Increment 2b of the SkillSpector delegate. Increment 2 began recording whether a skill triage ran deep (the deep flag in .kit-triage.jsonl); 2b enforces it at commit time.

kit triage check-skills is a fail-closed pre-commit gate: any agent skill with staged changes under .claude/skills/<name>/… must have a kit triage skill <name> --deep entry 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

  • New feature (non-breaking change that adds functionality)

Related Issues

Changes Made

  • kit triage check-skills (src/commands/triage.ts): new pre-commit subcommand, mirroring check-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 exact kit triage skill <name> --deep command to run.
  • Pure, exported gate core (unit-tested): parseStagedSkillNames, latestDeepSkillTriage, missingDeepSkillTriage. Timestamp math and log parsing are pure and take nowMs explicitly, so the gate is deterministic under test.
  • Help text + dispatch wiring for the new subcommand.

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 — clean

  • npx eslint src — 0 errors (pre-existing warnings only)

  • npm run build — clean

  • node scripts/test.mjs — 2805/2805 pass

  • Public surface unchanged (new subcommand only; top-level triage already listed) — no public-surface.json regen needed

Manual Testing

  1. Stage a change under .claude/skills/foo/SKILL.md with no deep triage logged → kit triage check-skills exits non-zero, lists foo with the suggested command.
  2. Run kit triage skill foo --deep, re-stage → gate passes (exit 0).
  3. Stage no skill files → gate is a no-op (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

  • My code follows the project's style guidelines
  • All new code has test coverage
  • All tests pass locally (npm test)
  • No new warnings or errors introduced
  • No hardcoded secrets or sensitive data
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

Symmetry with check-deps: same log file (.kit-triage.jsonl), same 7-day freshness window, same --no-verify bypass audited to .kit-skipped-commits.jsonl. The one deliberate asymmetry is that skills require the deep flag specifically — a plain kit triage skill won't clear the gate.

🤖 Generated with Claude Code


Generated by Claude Code

…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
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit f3a444e into main Jul 11, 2026
18 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 11, 2026 13:20
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