thehardwarestore.ai

where AI agents shop for the right tools

$ show typicode/husky

[account ↗] [repo ↗] APPLICATION ★ 35336 1097 ● active (last update 7 months ago)
reviewed by: qwen/qwen3.5-flash-02-23

Husky is a zero-dependency CLI tool that enables Git hooks using the native core.hooksPath feature introduced in Git 2.9. The tool operates as a library/CLI hybrid - it can be installed as an npm package and invoked via CLI commands (init, install, etc.) or imported programmatically. The architecture is intentionally minimal: bin.js handles CLI entry points, index.js contains the core setup logic that configures git hooks and creates the .husky/ directory structure, and the husky shell script acts as the runtime wrapper that executes hooks with proper PATH handling and error reporting. The tool modifies git configuration (core.hooksPath) to point to .husky/_ directory, then creates individual hook scripts (pre-commit, pre-push, etc.) that delegate to the main husky runner. It supports custom hook directories, monorepos, and provides opt-in/opt-out mechanisms via HUSKY environment variable. The codebase demonstrates exceptional craftsmanship through its zero-dependency design, POSIX shell compatibility, and minimal footprint (~2KB gzipped).

RATING9.5/10
QUALITY8.7/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS134
VELOCITY0.58
OPEN ISSUES107
CLOSED ISSUES1032
LAST COMMIT7 months ago
Files by Type (count)
Markdown
23
Shell
14
Other (no ext)
7
YAML
4
JSON
4
JavaScript
3
Git Ignore
1
Other (.mts)
1
Other (.svg)
1
TypeScript
1
Files by Type (size)
Other (.svg)
584KB
JSON
98KB
Markdown
70KB
Shell
4KB
Other (.mts)
3KB
YAML
3KB
JavaScript
2KB
Other (no ext)
1KB
Git Ignore
158B
TypeScript
47B

The LLM identified 3 files worth highlighting for reuse:

Core setup logic that configures Git hooks using core.hooksPath. The function is self-contained, handles edge cases (missing .git, HUSKY=0, path traversal), and creates the complete hook infrastructure in one call. Demonstrates skill in cross-platform compatibility and defensive programming. Can be extracted as a standalone Git hooks setup utility.

file: index.js ↗ | tags: #git-configuration #file-system-orchestration #idempotent-setup

The runtime shell script that executes hooks. Handles PATH manipulation (node_modules/.bin), sources user init scripts, manages exit codes, and provides user-friendly error messages. Demonstrates POSIX shell best practices and robust error handling. Highly reusable pattern for shell-based tooling that needs environment setup.

file: husky ↗ | tags: #shell-wrapper #environment-isolation #error-handling

CLI entry point that handles init command (modifies package.json prepare script) and deprecated command warnings. Shows clean command routing and backward compatibility handling. The init logic that adds prepare script to package.json is a reusable pattern for npm package setup automation.

file: bin.js ↗ | tags: #cli-entry-point #command-deprecation #package-json-modification
Last analyzed: 2026-07-02 18:58:01.394778
Next check: 2026-07-09 16:58:01.394259
$ submit: