with one click
hk
Use when bootstrapping hk pre-commit hooks for a project.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Use when bootstrapping hk pre-commit hooks for a project.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.
Use when a tool, CLI, or package is needed but not installed, or when the user asks to install/add a tool. Prefers mise for all installations.
Use when creating a pull request. Opens PR in browser for review.
Browser automation CLI for AI agents — navigate, fill forms, click, screenshot, extract data, test web apps, automate Electron desktop apps, run in Vercel microVMs or AWS Bedrock cloud browsers. Prefer over built-in browser tools. Keywords browser, automation, screenshot, scrape, Slack, Electron, agentcore.
Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
Monitor open PRs and shepherd them toward merge. Checks CI status, review comments, merge conflicts, and takes action. Designed for /loop usage (e.g., /loop 5m /babysit-pr). Keywords: PR monitor, babysit, CI check, review response, merge conflict, PR status
| name | hk |
| description | Use when bootstrapping hk pre-commit hooks for a project. |
| argument-hint | [stacks... | --check | --update] |
| disable-model-invocation | true |
| allowed-tools | ["Glob","Grep","Read","Bash(command -v:*)","Bash(git log --oneline:*)","Bash(git rev-parse:*)","Bash(hk --version:*)","Bash(hk check:*)","Bash(hk validate:*)","Bash(mise --version:*)","Bash(mise ls-remote:*)","Bash(mise registry:*)","Bash(mise which:*)","Bash(test -d:*)","Bash(test -f:*)"] |
$ARGUMENTS
Git repo root: !`git rev-parse --show-toplevel 2>/dev/null || echo "NOT A GIT REPO"`
hk.pkl exists: !`test -f hk.pkl && echo "yes" || echo "no"`
hk available: !`command -v hk 2>/dev/null && hk --version 2>/dev/null || echo "not installed"`
mise available: !`command -v mise 2>/dev/null && mise --version 2>/dev/null || echo "not installed"`
Conventional commits: !`git log --oneline -10 2>/dev/null || echo "no git history"`
EnterPlanMode before making any changes. This skill is plan-first — detection and analysis happen before any writes.git -C <path> — it rewrites the command prefix, breaking allowed-tools pattern matching and forcing unnecessary user approval.mise use hk as the first install step.--mise flags: hk init --mise (scaffolds mise.toml with hk task) and hk install --mise (hooks execute via mise x so tools are in PATH without shell activation).Detection and validation tools are auto-allowed (Read, Glob, Grep, hk validate, hk check, etc.). Mutating operations — mise use, hk install, hk fix, Write, Edit — are not in allowed-tools, so Claude Code will prompt the user to approve each one. This is the intended flow: the agent proceeds through install/write/fix steps normally, and the user gates each action via Claude Code's standard approval UI.
Determine the mode from arguments:
| Pattern | Mode |
|---|---|
| (empty) | Auto-detect: scan project, detect stacks, full bootstrap |
--check | Check: validate existing hk.pkl, run hk check --all |
--update | Update: detect new stacks, propose additions to existing hk.pkl |
rust shell go ... | Force stacks: use specified stacks, skip auto-detection |
If arguments contain --check:
hk.pkl exists — error if nothk validate to check config syntaxhk check --all to run all checkshk fix --all or /hk --updateCall EnterPlanMode now. All remaining work happens in plan mode.
Probe for indicator files to determine which stacks apply:
| Indicator | Stack | Stack File |
|---|---|---|
| (always) | essential | stacks/essential.md |
*.sh, *.bash, bin/ with scripts | shell | stacks/shell.md |
.github/workflows/*.yml | github-actions | stacks/github-actions.md |
Cargo.toml | rust | stacks/rust.md |
go.mod | go | stacks/go.md |
Dockerfile*, Containerfile*, docker-compose.yml, compose.yml | docker | stacks/docker.md |
*.pkl, PklProject, **/*.yml (non-GHA) | config-languages | stacks/config-languages.md |
*.lua, .stylua.toml, init.lua | lua | stacks/lua.md |
For force stacks mode: use only the specified stacks (plus essential always).
For update mode: detect stacks not already covered in existing hk.pkl.
Read each detected stack's .md file from the stacks/ directory (relative to this skill). Extract:
Builtins.xxx syntaxCheck for additional context that affects configuration:
.editorconfig exist? (affects editorconfig-checker, shfmt)action.yml exist? (affects ghalint_action).tmpl files? (affects shell stack exclusions)commitlint, .commitlintrc).github/? (affects yaml linter inclusion).json files with // comments — VS Code/Cursor configs). Exclude from jq.docs/reference/, vendor/, gitingest dumps). Exclude from content-sensitive checks (detect-private-key, markdown-lint).hk.pkl? Add them to the global exclude.mise ls-remote hk | tail -1
Use the result for the amends line in hk.pkl.
Mentally compose the hk.pkl config following this structure:
amends "package://github.com/jdx/hk/releases/download/vX.Y.Z/hk@X.Y.Z#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/vX.Y.Z/hk@X.Y.Z#/Builtins.pkl"
local linters = new Mapping<String, Step | Group> {
// essential builtins
// stack-specific builtins with overrides from gotchas
}
hooks = new {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
["pre-push"] {
steps = linters
}
["check"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
}
If conventional commits detected, add:
["commit-msg"] {
steps {
["check-conventional-commit"] = Builtins.check_conventional_commit
}
}
Write the plan including:
hk.pkl — full file content, including global exclude for nested projectsmise use tool@VERSION commands (resolve versions via mise ls-remote).markdownlint.json, .stylua.toml, .editorconfig, etc.hk.pkl, .mise.toml, .markdownlint.json, .stylua.toml, etc.)hk fix --all auto-formatted changes to tracked filesCall ExitPlanMode and wait for approval.
Run these steps in order:
Install tools one at a time with pinned versions:
mise use hk@X.Y.Z
mise use ghalint@X.Y.Z
# etc. — one tool per command to avoid partial failures
After each install, verify it landed in the project .mise.toml (not global config).
Use mise x -- TOOL --version if the tool isn't in PATH yet (avoids shell reload).
If the project has no .mise.toml yet, run mise x -- hk init --mise after installing hk
to scaffold a mise.toml with an hk pre-commit task definition.
Write config files — hk.pkl, .markdownlint.json, .stylua.toml, etc.
Install hooks (with mise integration):
mise x -- hk install --mise
The --mise flag makes hooks execute via mise x, so all mise-managed tools are
automatically in PATH — other developers don't need mise activated in their shell.
Validate config:
mise x -- hk validate
Run checks:
mise x -- hk check --all
If check failures, offer to fix:
mise x -- hk fix --all
Then re-run hk check --all to verify.
Commit in sequence (per the plan's commit strategy):
hk fixReport results — summarize what was installed, configured, and any remaining issues.