install-git-hooks

Install a Git pre-commit hook that lints staged Markdown files with markdownlint-cli2.

Updated Oct 11, 2025
One-click install
npx skills add https://github.com/tnez/docent --skill install-git-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: install-git-hooks
Source: https://github.com/tnez/docent/tree/main/.docent/skills/git/install-git-hooks
Command: npx skills add https://github.com/tnez/docent --skill install-git-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git cli, npm, markdownlint-cli2, and includes scripts (resource) components.

What problem does it solve?

Markdown linting errors often go unnoticed until CI/CD fails, causing delays. This Skill automates the installation of a pre-commit Git hook that automatically lints staged Markdown files, providing immediate feedback and preventing commits with formatting errors, saving you time and ensuring documentation quality.

Core Features & Use Cases

  • Automated Hook Installation: Installs a pre-commit hook that runs markdownlint-cli2 on staged .md files.
  • Early Error Detection: Catches Markdown linting errors before they are committed, preventing CI failures.
  • Verification & Testing: Guides through verifying the hook installation and testing its functionality.
  • Bypass & Uninstall: Provides instructions for temporarily bypassing the hook or completely uninstalling it.
  • Use Case: You're working on documentation and want to ensure it's always perfectly formatted. Use this Skill to install a Git hook that automatically checks your Markdown files before every commit, ensuring consistency and preventing linting issues from reaching your repository.

Quick Start

Install the pre-commit Git hooks in this project.

Frequently Asked Questions about install-git-hooks

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

FAQPage Schema
How do I prevent Markdown linting errors from reaching my repository?

Install a pre-commit Git hook that automatically runs markdownlint-cli2 on staged .md files before commits. This catches linting errors locally, blocking commits with formatting issues and providing immediate feedback before code reaches your repository.

Can I set up automated Markdown linting in my local Git workflow?

Yes. This Skill installs a pre-commit hook into .git/hooks that validates staged Markdown files using markdownlint-cli2, runs on every commit, and exits with a non-zero code if linting fails, automating quality checks locally without CI/CD delays.

What's the best way to catch documentation formatting issues before CI fails?

Pre-commit Git hooks provide early detection by linting Markdown files at commit time. This approach runs markdownlint-cli2 on staged .md files locally, stops problematic commits immediately, and saves time by preventing CI failures downstream.

Do I need npm and markdownlint-cli2 installed to use Git pre-commit hooks?

Yes. This Skill requires Git CLI, npm, and markdownlint-cli2 as dependencies. It validates tool availability during hook installation and uses markdownlint-cli2 to lint Markdown files when the pre-commit hook runs on each commit.

How do I temporarily bypass or uninstall a Git pre-commit hook?

This Skill provides instructions for bypassing hooks during a single commit and completely uninstalling the pre-commit script from .git/hooks when needed, giving you control over when automated Markdown linting applies.

Can I use pre-commit hooks to lint Markdown across different developer environments?

Yes. Pre-commit hooks operate locally in each developer's Git repository, making them applicable across diverse environments. Each developer runs the one-time setup independently, and the hook enforces consistent Markdown linting standards automatically.