husky

Use Husky to run scripts in Git hooks: guidance on configuring and running scripts in Git hooks, appropriate for running code checks before commits, validating commit messages, running tests before pushes, or setting up hooks consistently for a team.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "husky" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7f55b2575ffd601ae69e5897ee3acc31a285e536d5193c3d99e5075190726dc2. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Use Husky to run scripts in Git hooks: guidance on configuring and running scripts in Git hooks, appropriate for running code checks before commits, validating commit messages, running tests before pushes, or setting up hooks consistently for a team.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: husky
description: >-
  Run scripts on Git hooks with Husky. Use when a user asks to run linters before commit, validate commit messages, run tests before push, or set up Git hooks for a team.
license: Apache-2.0
compatibility: 'Any Git repository, Node.js'
metadata:
  author: terminal-skills
  version: 1.0.0
  category: development
  tags:
    - husky
    - git-hooks
    - pre-commit
    - lint
    - ci

Husky

Overview

Husky manages Git hooks from package.json. Run linters, formatters, tests, and commit checks automatically before commits and pushes.

Instructions

Step 1: Setup

npm install -D husky lint-staged
npx husky init

Step 2: Pre-commit Hook

# .husky/pre-commit — Run lint-staged before each commit
npx lint-staged
// package.json — lint-staged configuration
{
  "lint-staged": {
    "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
    "*.{css,md,json}": ["prettier --write"]
  }
}

Step 3: Pre-push Hook

# .husky/pre-push — Run tests before pushing
npm test

Guidelines

  • Husky v9+ uses .husky/ directory with plain shell scripts.
  • lint-staged runs linters only on staged files — fast even in large repos.
  • Don't run full test suite in pre-commit (too slow); save it for pre-push or CI.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供 Git 钩子自动化管理,适用于前端/Node.js 开发团队
  • 覆盖代码检查、提交验证、测试运行等高频开发场景
Trigger Precision85/100

Highlights

  • 触发描述完整覆盖多种使用场景,边界清晰
  • description 位置正确,内容无截断
Structure and Standards88/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档结构完整但缺少明确的 When to Use 使用场景说明章节

    Recommendation: 建议添加 When to Use 章节,明确说明适用场景和使用时机

Highlights

  • 步骤划分清晰,包含端到端配置示例
  • frontmatter 完整,包含兼容性、许可证等必要信息
Execution Reliability82/100

Highlights

  • 工具来源明确,命令参数正确
  • 提供了最佳实践建议,避免常见陷阱
Evidence Verifiability (mean of the first four)83/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 28, 29, 35

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.