Setup Pre-Commit configures a JavaScript or TypeScript repo so every commit formats staged files and runs a type check and the tests. It installs Husky, lint-staged and Prettier, writes the hook and config files, and commits the result.
It detects npm, pnpm, yarn or bun from the lockfile and adapts the hook commands.
What You Get
- A Husky pre-commit hook that runs lint-staged, typecheck and tests
- A lint-staged config that runs Prettier on staged files
- A Prettier config with sensible defaults when none exists
- A commit that doubles as a smoke test
Common Use Cases
- Adding commit-time checks to a new repo
- Standardising formatting across a team
- Catching type errors and failing tests before they reach a pull request
- Moving a repo from manual formatting to automatic Prettier runs
What Makes It Unique
It makes concrete choices: lint-staged first for speed, then the full typecheck and tests, and Husky v9 style hooks without a shebang. The final commit runs through the new hook, so the setup tests itself.
Under The Hood
The skill is Markdown with an agent metadata file for Codex. The agent reads lockfiles, installs husky, lint-staged and prettier from the npm registry with your package manager, runs npx husky init, writes three small files, runs npx lint-staged and makes a git commit.