v0.5.1/Node.js 24+ Native ยท Zero Dependencies

Zero-dependency Git metadata validation. Engineered for microsecond CI performance.

Enforce Conventional Commits, branch naming policies, and PR titles with native Node.js 24+ type-stripping speed. Pure built-ins, zero transitive attack surface, SLSA Level 3 provenance.

0Runtime Packages

Pure Node.js built-ins. Zero transitive dependency attack surface.

< 5 msCold Startup

Native Node 24+ type-stripping execution without transpilation overhead.

SLSA-3Supply Chain

100% SHA-pinned workflows with OpenSSF & Zizmor security audits.

Node 24+Native Types

Executes pure TypeScript directly via built-in experimental-strip-types.

Interactive Workbench

Test your Git metadata rules live in the browser.

Evaluate commit messages, branch patterns, and semantic release recommendations in real time with the pure client-side core engine.

Live Metadata Inspector

Test commit messages, branch rules, and live package.json configurations in real-time.

Presets:
13 types ยท Max 100 chars
Format: type(scope): subject45 / 100 chars
Engine Analysisโœ“ VALID
Type:feat
Scope:core
Semver Release:+minor
Engine: @chitrank2050/git-hygiene-coreCold Start: <5ms
Architecture & Telemetry

Engineered for microsecond execution and zero bloat.

Why install dozens of transitive packages just to validate a string? git-hygiene is built purely on Node.js built-in APIs.

Engineering Metricgit-hygiene (Native)Husky + Commitlint (Traditional)
Cold Startup Latency< 5 ms~220 ms
Runtime Dependencies0 packages38+ packages
Supply Chain SecuritySLSA Level 3Unverified
Multi-Registry DistributionNPM ยท JSR ยท ActionNPM only
Core Architecture

Everything you need for strict, automated Git hygiene.

01/

Unified Metadata Engine

Define your naming rules once in package.json. Simultaneously validate local git commit messages, pre-push branch names, and remote GitHub pull requests.

02/

Instant Native Execution

Leverages Node.js 24+ type-stripping (node --experimental-strip-types). Microsecond cold starts without heavy CLI frameworks like yargs or commander.

03/

Smart Semantic Bumping

Inspects commit patterns to automatically recommend semantic version increments (major, minor, patch) with machine-readable JSON outputs for release bots.

04/

Commitlint Compatibility

Seamlessly extends @commitlint/config-conventional. Reuse your existing team conventions with zero migration friction.

Developer Workflows

Integrates in seconds into your existing hooks & CI.

Switch between Lefthook, Husky, or GitHub Actions to see the exact drop-in configuration.

Lefthook Integration

Fast parallel git hooks with native pre-commit and pre-push validation.

โœ“Validates standard Conventional Commits
โœ“Enforces type/description branch patterns
โœ“Inherits package.json custom settings
lefthook.yml
# lefthook.yml
commit-msg:
  commands:
    hygiene:
      run: npx @chitrank2050/git-hygiene commit {1}

pre-push:
  commands:
    hygiene:
      run: npx @chitrank2050/git-hygiene branch
Integration & APIs

Declarative CLI config or headless programmatic library.

Define rules in package.json for zero-config CLI enforcement, or import the standalone core engine directly into your custom CI tools.

Declarative Git Hook Configpackage.json
package.json
{
  "git-hygiene": {
    "extends": ["@commitlint/config-conventional"],
    "types": [
      "feat", "fix", "chore", "docs",
      "style", "refactor", "perf", "test",
      "build", "ci", "revert"
    ],
    "ignoreBranches": ["main", "master", "develop"],
    "maxHeaderLength": 100,
    "allowEmptyScope": false,
    "rules": {
      "header-max-length": [2, "always", 100]
    }
  }
}

Seamlessly extends @commitlint/config-conventional with zero extra configuration. Custom types, branch filters, and scope rules merge automatically.

Programmatic Core EngineTypeScript ESM
validate.ts
import {
  validateCommit,
  validateBranch,
  getRecommendedBump
} from '@chitrank2050/git-hygiene-core';

// 1. Validate Commit Message
const commit = await validateCommit('feat(api): add webhook support');
console.log(commit.valid); // true

// 2. Validate Git Branch
const branch = await validateBranch('feat/webhook-retry-policy');
console.log(branch.valid); // true

// 3. Recommended Release Increment
const bump = await getRecommendedBump();
console.log(bump.releaseType); // Derived from repository history
Install Core:
Release Shelf

Multi-registry distribution across Node, Deno, and GitHub Actions.