commit-guard

Analyze pre-commit changes to enforce focused, appropriately sized commits.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/rpreissel/secoc --skill commit-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-guard
Source: https://github.com/rpreissel/secoc/tree/main/.opencode/skills/commit-guard
Command: npx skills add https://github.com/rpreissel/secoc --skill commit-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Commit history often becomes noisy due to oversized or unfocused commits, making reviews harder and changes harder to revert. Commit Guard analyzes staged changes before a commit to enforce size limits, coherence, and feature-branch discipline.

Core Features & Use Cases

  • Threshold-based size checks: counts files/lines and flags oversized commits.
  • Coherence scoring: evaluates same directory or same file types to suggest grouping or splitting.
  • Branching and messaging: proposes branches and generates consistent commit messages when multiple logical changes are involved.

Quick Start

Run commit-guard before committing to automatically enforce focused, appropriately sized commits.

Frequently Asked Questions about commit-guard

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

FAQPage Schema
How do I enforce focused and appropriately sized git commits before committing?

To enforce focused git commits, you can automate pre-commit checks that analyze staged changes for size limits and coherence. This ensures commits remain clean, appropriately sized, and well-structured before they are finalized.

What is coherence scoring in version control and how does it guide commit splitting?

Coherence scoring evaluates staged changes by checking same directory locations or file types to suggest logical grouping. It helps determine whether changes should be split into separate commits to maintain a clean version control history.

How do I automate branch creation and commit message generation for multi-file changes?

You can automate branch creation and commit messages by applying deterministic strategies during pre-commit analysis. When multiple logical changes are detected, the system proposes branches and generates consistent commit messages automatically.

Can I use pre-commit automation for refactoring and multi-file feature development?

Yes, pre-commit automation applies directly during feature development, refactoring, and multi-file changes. It analyzes staged files to enforce feature-branch discipline and flags oversized commits before they are submitted for code review.

What is the best way to prevent oversized commits from making code reviews harder?

The best way to prevent oversized commits is implementing threshold-based size checks that count files and lines. This flags oversized commits before submission, making code reviews easier and changes simpler to revert.

Why does my commit history become noisy and how do I maintain feature-branch discipline?

Commit history becomes noisy due to unfocused commits mixing multiple logical changes. You can maintain feature-branch discipline by using pre-commit analysis to enforce coherence scoring and deterministic branching strategies.