validate-git-hygiene

Validate commit messages, branch names, and repository state for Git hygiene.

7|3|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill validate-git-hygiene
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: validate-git-hygiene
Source: https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/skills/git-workflows/validate-git-hygiene
Command: npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill validate-git-hygiene

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, jq, grep, sed.

What problem does it solve?

Inconsistent commit messages, non-standard branch names, and accidental commitment of sensitive files lead to messy repositories, difficult audits, and potential security risks. This Skill automates checks to maintain high git hygiene.

Core Features & Use Cases

  • Commit Message Validation: Checks commit messages against Conventional Commits format (e.g., feat: add new feature).
  • Branch Naming Compliance: Validates branch names against standard patterns (e.g., feat/*, fix/*, chore/*).
  • Sensitive File Detection: Scans for and warns about sensitive files (.env, credentials, .pem) in both tracked and untracked areas.
  • Use Case: Integrate this Skill into your pre-commit hooks or CI/CD pipeline to automatically enforce git best practices and prevent security vulnerabilities.

Quick Start

Run git hygiene validation on the current repository

The skill will execute checks and output structured JSON:

{

"status": "warning",

"gitHygiene": {

"branch": {"valid": false},

"commits": {"invalid": 3},

"sensitiveFiles": {"count": 1}

},

"canProceed": false,

"details": "Sensitive files detected - must be removed or added to .gitignore"

}

Frequently Asked Questions about validate-git-hygiene

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

FAQPage Schema
How do I validate commit messages and branch names in Git?

Commit message and branch name validation enforces standards like Conventional Commits (e.g., `feat: description`) and branch patterns (e.g., `feat/*`, `fix/*`). This Skill automatically checks both against your repository's rules and flags violations, enabling consistent git history across teams.

Can I detect sensitive files before committing to Git?

Sensitive file detection scans for untracked and tracked files like `.env`, credentials, and `.pem` keys in your repository. The Skill warns you before they're committed, preventing accidental security leaks into version control.

How do I integrate git hygiene checks into my CI/CD pipeline?

Git hygiene validation outputs structured JSON results that fit directly into CI/CD gates and pre-commit hooks. Run the Skill as a pipeline step to automatically block commits that violate branch naming, message format, or contain sensitive files.

What dependencies do I need to run git hygiene validation?

Git hygiene validation requires `git`, `jq`, `grep`, and `sed`. These standard Unix tools parse repository state, commit history, and file patterns to produce machine-readable validation results.

Does git hygiene validation work with Conventional Commits?

Yes. Conventional Commits validation is a core feature—the Skill checks commit type, scope, and subject length against the Conventional Commits standard to maintain consistent messaging conventions.

What happens if uncommitted changes or sensitive files are found?

The Skill returns a structured JSON report with status, specific issues (invalid commits, non-conforming branch names, sensitive files), and a `canProceed` flag. Issues block progression until resolved or added to `.gitignore`.