setup-husky-dotnet

Install Husky as a dotnet tool to validate commits and format code.

192|32|Updated May 20, 2025
One-click install
npx skills add https://github.com/SebastienDegodez/copilot-instructions --skill setup-husky-dotnet
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: setup-husky-dotnet
Source: https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/setup-husky-dotnet
Command: npx skills add https://github.com/SebastienDegodez/copilot-instructions --skill setup-husky-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and assets (resource) components.

What problem does it solve?

Configure and enforce Git governance in .NET projects by installing and wiring Husky as a dotnet tool to validate commits and format code.

Core Features & Use Cases

  • Install Husky as a .NET tool manifest and enable a Git hook system, ensuring hooks are available to all developers.
  • Create commit-msg hooks to validate conventional commit messages and pre-commit hooks to run dotnet-format on staged code.
  • Provide an end-to-end setup workflow for new or existing .NET projects, including testing the hooks before pushing.

Quick Start

Create a .NET tool manifest, install Husky as a dotnet tool, run dotnet husky install, and configure commit-msg and pre-commit hooks as described.

Frequently Asked Questions about setup-husky-dotnet

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

FAQPage Schema
How do I enforce conventional commits and code formatting in a .NET project?▼

You can enforce conventional commits and code formatting by configuring Git hooks via Husky as a dotnet tool. This setup validates commit messages with commit-msg hooks and runs dotnet-format on staged code using pre-commit hooks across all developer machines.

How do I set up Husky Git hooks for an existing .NET project?▼

To set up Husky Git hooks for an existing .NET project, create a .NET tool manifest, install Husky as a dotnet tool, run the dotnet husky install command, and configure the required commit-msg and pre-commit hooks to validate commits and format code.

What are the prerequisites for running dotnet Husky to manage Git hooks?▼

The prerequisites for running dotnet Husky to manage Git hooks include having .NET SDK 6.0 or higher, Git installed on your machine, and dotnet-format availability to successfully execute automated code formatting within the pre-commit hooks.

Does Husky work with dotnet-format to automate code styling before commits?▼

Yes, Husky works with dotnet-format by wiring a pre-commit Git hook that automatically runs dotnet-format on staged code. This integration ensures that automated code styling and formatting standards are enforced before any code is committed locally.

How do I ensure Git hooks are shared across all developers in a .NET repository?▼

To ensure Git hooks are shared across all developers in a .NET repository, install and wire Husky using a .NET tool manifest. This approach makes the configured commit-msg and pre-commit hooks available to everyone who restores the project tools.