.claude/skills/github-specialist/git-hooks/SKILL.md
Central authority on git hook implementations, modern best practices, and tooling for .NET/C#, JavaScript/TypeScript, Python, and polyglot repositories. Covers framework selection (Husky.Net, lefthook, Husky, pre-commit), setup workflows, Conventional Commits, semantic versioning, secret scanning (gitleaks, TruffleHog), performance optimization, CI/CD integration, testing strategies, and team collaboration patterns. Adaptive to project scale from solo developers to enterprise teams. Use for setting up git hooks, configuring pre-commit/commit-msg/pre-push hooks, integrating dotnet format/dotnet test, ESLint/Prettier, Black/Ruff/mypy, commitlint, choosing between frameworks, optimizing hook performance, enforcing code quality, automating testing, and troubleshooting hook issues.
npx skillsauth add prorise-cool/claude-code-multi-agent git-hooksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides comprehensive guidance on modern git hook implementations across multiple ecosystems, with primary focus on .NET/C# and strong support for JavaScript/TypeScript and Python. It covers framework selection, setup workflows, performance optimization, security integration, testing strategies, and team collaboration patterns.
Key capabilities:
Use this skill when you need to:
Trigger scenarios:
Answer these questions:
What's your primary ecosystem?
What's your team size/scale?
What's your performance requirement?
| Ecosystem | Solo/Small Team | Medium Team | Large Team/Enterprise | | --- | --- | --- | --- | | .NET/C# | Husky.Net | Husky.Net or lefthook | lefthook | | JavaScript/TypeScript | Husky + lint-staged | Husky + lint-staged | Husky + lint-staged or lefthook | | Python | pre-commit | pre-commit | pre-commit or lefthook | | Polyglot | lefthook or pre-commit | lefthook | lefthook |
| Feature | Husky.Net | lefthook | Husky (JS) | pre-commit | | --- | --- | --- | --- | --- | | Performance | Moderate | Excellent (parallel) | Good (with lint-staged) | Good | | Ecosystem | .NET/C# | Any | JavaScript/TS | Any (Python primary) | | Config Format | JSON (task-runner.json) | YAML | Shell scripts + package.json | YAML | | Parallel Execution | ❌ No | ✅ Yes | ❌ No | Partial | | Learning Curve | Low (.NET devs) | Moderate | Low (JS devs) | Low (Python devs) | | Monorepo Support | Moderate | Excellent | Excellent | Good |
📖 For detailed comparison: See references/framework-comparison.md for comprehensive feature analysis, pros/cons, and selection criteria.
Quick Start: Install Husky.Net (dotnet tool install Husky) or lefthook (scoop install lefthook), configure task-runner.json or lefthook.yml, and verify.
Key patterns:
${staged} or {staged_files} for incremental processing📖 For complete setup: See references/setup-workflows.md
Examples:
Quick Start: Install dependencies (npm install --save-dev husky lint-staged @commitlint/cli), initialize Husky (npx husky init), configure lint-staged in package.json, and add hooks.
Key patterns:
📖 For complete setup: See references/setup-workflows.md
Examples:
Quick Start: Install pre-commit (pip install pre-commit), create .pre-commit-config.yaml with Black/Ruff/mypy hooks, and run pre-commit install.
Key patterns:
📖 For complete setup: See references/setup-workflows.md
Examples:
For repositories with multiple languages, use lefthook (recommended for performance) or pre-commit.
📖 For complete setup: See references/setup-workflows.md
Examples:
Tools: commitlint (validation), commitizen (interactive prompts), semantic-release (automated versioning)
Quick Start: Install commitlint, configure rules, add commit-msg hook
📖 For complete setup: See references/conventional-commits.md
Examples:
Tools: gitleaks (secret detection), TruffleHog (800+ secret types with API validation)
Quick Start: Install gitleaks/TruffleHog, add to pre-commit hooks, configure allowlist for false positives
Best Practice: Scan locally (pre-commit) AND in CI/CD (pull requests)
📖 For complete setup: See references/secret-scanning.md
Key strategies:
📖 For detailed strategies: See references/performance-optimization.md
Levels:
📖 For examples and patterns: See references/testing-strategies.md
Common issues:
Migration strategies: Gradual rollout (formatting → linting → commit validation → testing/security)
📖 For complete troubleshooting: See references/troubleshooting.md
Complete examples are available in the examples/ directory:
User Query: "I need to set up git hooks for my C# project with 15 developers"
Expected Behavior:
User Query: "My pre-commit hook is taking 35 seconds and blocking developers from committing"
Expected Behavior:
User Query: "Should I use Husky.Net or lefthook for our .NET team?"
Expected Behavior:
User Query: "How do I enforce Conventional Commits in my JavaScript project?"
Expected Behavior:
User Query: "I want to prevent developers from accidentally committing secrets to our repository"
Expected Behavior:
Official Documentation (access via MCP servers):
Detailed references:
Date: 2025-11-28 Model: claude-opus-4-5-20251101
Research Sources: Microsoft Learn MCP, Context7 MCP (Husky.Net, lefthook, Husky, pre-commit repositories), Perplexity MCP (2024-2025 best practices), Firecrawl MCP (official documentation sites), Ref MCP (commitlint, semantic-release).
development
使用 Playwright 与本地 Web 应用程序交互和测试的工具包。支持验证前端功能、调试 UI 行为、捕获浏览器截图和查看浏览器日志。
testing
Plan user research studies - method selection, participant recruitment, study design, and research questions for generative and evaluative research.
development
Design and plan usability tests - task creation, think-aloud protocols, moderator scripts, metrics definition, and analysis frameworks.
content-media
Create service blueprints - frontstage/backstage visualization, touchpoints, support processes, evidence, and service design methodology.