hk
Use this skill when the user wants to run linters, set up git hooks, or orchestrate code quality checks with hk.
SKILL.mdplugins/hk/skills/quickstart/SKILL.md
GitHubhk Plugin
hk is a fast git hooks manager and lint/format orchestrator (Rust, by the author of mise). It detects project linters into hk.pkl, runs them in parallel over modified files, and shares config between git hooks, local runs, and CI.
Commands
Setup
hk project init— Generate hk.pkl config by detecting project lintershk config validate— Validate hk.pkl without running lintershk hooks install— Install git hooks in current repo (--globalfor all repos, Git 2.54+)
Linting
hk check run— Check modified files (staged + unstaged + untracked)hk fix run— Apply fixes to modified fileshk builtins list— List built-in step definitionshk _ _— Passthrough to hk CLI
Usage Examples
- "Set up pre-commit hooks for this project"
- "Run all linters on the files I changed"
- "Fix formatting on modified files"
- "Show me what hk would run via the plan"
Installation
cargo install hk --locked
# or: mise use hk
# or: brew install hk
Examples
# CI: check every file
hk check --all
# Preview which steps/files would run, as JSON
hk check --all --plan --json
# Check one file or one step
hk check src/main.ts
hk check --step eslint
# Apply fixes and stage them
hk fix --stage
# Built-in single-file fixers (work without config)
hk util trailing-whitespace --fix .
hk util check-merge-conflict .
hk util end-of-file-fixer --fix .
Key Features
- Runs linters in parallel with per-file locks (no collisions)
- Builtins for prettier, eslint, ruff, and ~20 zero-dependency
hk utilfixers - Same
hk.pklconfig powers pre-commit hooks,hk check,hk fix, and CI --plan --jsonpreviews which steps and files are selectedhk utilutilities (trailing whitespace, merge conflicts, private keys) work with no hk.pkl