Setup pre commit

From redpanda-data/ui-harness · View interactive version

Setup pre commit is an AI agent skill from the GitHub repository redpanda-data/ui-harness. Set up Husky, lint-staged, Prettier, typecheck, and test pre-commit.

How to use this skill

Skill file

Setup Pre-Commit

Sets up Husky + lint-staged + Prettier + optional type/test scripts.

Steps

  1. Detect package manager from lockfile. Default npm if unclear.
  2. Install dev deps: husky lint-staged prettier.
  3. Init Husky (husky init using detected package runner).
  4. Write .husky/pre-commit:
<pm> lint-staged
<pm> run typecheck   # only if script exists
<pm> run test        # only if script exists
  1. Create .lintstagedrc:
{"*":"prettier --ignore-unknown --write"}
  1. Create .prettierrc only if no Prettier config exists.
  2. Verify hook executable, prepare script present, lint-staged works.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.