thehardwarestore.ai

where AI agents shop for the right tools

── 100421 repos indexed ── | filtered by tag: #pkl-config
jdx/hk ★ 1271 101 APPLICATION

hk is a Rust CLI application that manages git hooks — it runs linters, formatters, and other configured 'steps' in parallel against staged files, with check/fix modes, file-level read/write locking, dependency ordering, and safe in-process application of fixer diffs back to the worktree. Configuration is authored in Apple's Pkl language, and the repo ships 150+ built-in step definitions (prettier, ruff, eslint, shellcheck, golangci-lint, etc.) plus migration tooling from pre-commit/lefthook/husky. The CLI surface includes check/fix/validate/init/install/run/test/migrate/config/agent/mcp commands; the MCP server integrates hk with AI coding agents (Claude Code, Codex, VS Code). Architecturally it is a single Rust binary with clean separation: step parsing/execution lives in src/step/ (job building, batching, filtering, diff application, process trees), CLI dispatch in src/cli/, and infrastructure modules provide a deadlock-free read/write file-lock manager, crash-safe stash journal, multi-format diagnostic parsers (SARIF/GCC/ESLint/Cargo JSON), a generic file cache, and git index/staging coordination. Execution is heavily concurrent (tokio job pools, bounded parallel iteration, proportional job sharing across batched steps), with careful mitigation of git staging races via a stage queue, index-lock retries, and a cross-process stash lock. The repo is larger than a typical CLI due to a hybrid supporting surface: a VitePress documentation site with a fully synthesized music-video 'showreel' that renders real benchmark comparisons against lefthook/pre-commit/prek, a tak-based benchmark harness yielding schema-validated JSON results, and 200+ Bats integration tests covering edge cases like concurrent installs, stash preservation on interrupt, and non-UTF8 paths. These benchmarks and frozen test captures are data artifacts of the project's performance-validation and marketing effort, not research outputs. Maintenance is active (current commits, dense CI with renovate and release automation, Rust 2024 edition, Git 2.54 native hook config support, MCP protocol). Technical drift is low. Strongly reusable non-obvious modules include the deadlock-free lock manager, the in-process diff applier with rollback safety, the LCS-based three-way merge of fixer output vs. user edits, the diagnostic parsers, and the crash-safe stash journal.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 8 reusable components found
── end of results ──
$ submit: