setup-pre-commit

Automate pre-commit hook setup with Husky, lint-staged, and Prettier.

34|4|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/redpanda-data/ui-harness --skill setup-pre-commit-redpanda-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/redpanda-data/ui-harness/tree/main/setup-pre-commit
Command: npx skills add https://github.com/redpanda-data/ui-harness --skill setup-pre-commit-redpanda-data

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires husky, lint-staged, prettier, and includes scripts (resource) components.

What problem does it solve?

Manually setting up code quality checks and pre-commit hooks can be time-consuming and error-prone. This Skill automates the setup process to ensure code quality and testing are consistently applied.

Core Features & Use Cases

  • Automated Setup: Simplifies the installation and configuration of Husky, lint-staged, Prettier, and other tools.
  • Code Quality Checks: Runs linters and typecheckers before commit to maintain code consistency.
  • Use Case: Integrating this Skill into your repository workflow ensures that developers adhere to coding standards and run tests without manual intervention.

Quick Start

Run the setup-pre-commit skill in your project repository to configure your pre-commit hooks.

Frequently Asked Questions about setup-pre-commit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate pre-commit hooks for linting and formatting?

Automating pre-commit hooks involves configuring tools like Husky and lint-staged to run Prettier and linters automatically before commits, ensuring consistent code formatting and quality checks without manual intervention.

What are pre-commit hooks and when do I need them in my workflow?

Pre-commit hooks are scripts triggered before a commit is finalized, used to run automated code quality checks, linting, and tests. They are needed to enforce coding standards and prevent unformatted code from entering the repository.

Do I need a package.json to set up Husky and lint-staged?

Yes, setting up Husky, lint-staged, and Prettier requires a valid package.json file where these tools must be installed as dev dependencies to manage and execute your pre-commit hooks effectively.

What's the best way to run Prettier before a commit using Husky?

The best way to run Prettier before a commit is to combine Husky with lint-staged, which targets staged files and automatically applies formatting and linting checks only to the code being committed.

Why set up lint-staged instead of running linters manually across the whole project?

Setting up lint-staged targets only staged files rather than the entire project, significantly reducing the time required for pre-commit checks and preventing unrelated formatting errors from blocking your commit.