AGENT SKILL

skill-lint-gate

Pre-commit gate over staged library `SKILL.md`. Use when composing a role that carries the `ai-hats-dev` trait, or when diagnosing why the skill-lint hook blocked a commit.

License 许可
MIT
所属仓库
muratovv/ai-hats
最近更新
2026-11-05
Stars
★ 3
Forks
1

01 前言 Front Matter

name
skill-lint-gate
ai_hats
{ "git_hooks": { "pre-commit": [ "git_hooks/pre-commit-skill-lint.sh" ] } }
license
MIT
description
Pre-commit gate over staged library `SKILL.md`. Use when composing a role that carries the `ai-hats-dev` trait, or when diagnosing why the skill-lint hook blocked a commit.

02 资源文件 1

03 SKILL.md 正文

Skill Lint Gate

Pure-infrastructure hook-carrier skill. It contributes one git pre-commit hook that runs two checks over the SKILL.md files a commit touches and blocks on either. There is no agent-side decision logic here — the value is delivered entirely through composition.

What it gates

Over STAGED {ai_hats_library,library}/**/SKILL.md (changed-files scope, so the gate never retro-blocks the pre-existing backlog), the hook runs, in order. A consumer's libraries/ is out of scope: this skill ships in the ai-hats-dev layer, which is addressed to the ai-hats repository, not to a consuming project.

  1. License/provenance regression-guard (pure bash, always-on, NOT fail-open). Blocks when a skill has no non-empty license: frontmatter, or is declared-derived (sibling metadata.yaml has an upstream: block) but is missing its co-located LICENSE file. Its scope deliberately includes the golang-* pack — that pack is exactly the third-party derived content this guard protects. It exists to keep the licensing backfill from silently regressing.
  2. agnix spec-lint (agnix against the repo-root .agnix.toml; target claude-code; rules XML-001 / XP-SK-001 / VER-001 disabled as convention false positives). Excludes the golang-* pack (drift handled separately). Fail-open if agnix/node is absent. agnix non-zero exit blocks the commit.

Who gets it

Whatever composes this skill, and nothing else: the hook is written into .githooks/pre-commit.d/ at composition time, so a role that does not carry it never sees the gate. The server-side counterpart is the CI lint-skills job.

How to bypass

Fix the flagged issue, or — after confirming the skill is intentionally non-conforming — ask the supervisor to skip the gate for a single commit: AI_HATS_SKILL_LINT_ACK=1, exported in the shell that runs the commit. Writing it onto your own command line is refused — see safety-guard.

If agnix / node is not installed, only the agnix check is a loud no-op (fail-open): it prints a SKIPPED notice and allows the commit, so a missing optional dev tool never wedges work. The license/provenance guard is pure bash and always runs. Inside an ai-hats agent node is present, so both checks are live.

Overrides

  • AI_HATS_SKILL_LINT_ACK=1 — allow the current commit despite findings.
  • AI_HATS_SKILL_LINT_CMD — override the agnix invocation (default npx --yes agnix@0.29.0); used by the test suite to inject a stub.

04 同仓库更多 Skills

muratovv
muratovv/ai-hats

tool-evaluation-protocol

Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.

★ 3
muratovv
muratovv/ai-hats

systematic-debugging

4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.

★ 3
muratovv
muratovv/ai-hats

skill-template

Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

skill-optimization

Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

silent-fallback-gate

PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.

★ 3
muratovv
muratovv/ai-hats

retro-to-framework

Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.

Skill与智能体开发
★ 3