Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Commit Discipline

    1

    Enforce atomic commits and Conventional Commit messages with a strict two-gate approval workflow.

    Free

    Security scanned
    Commit Discipline

    Commit Discipline

    Example session with this skill installed

    I'm on main and need to ship this hotfix right now. I already ran git add . so everything's staged:

    $ git status --short
    M src/payments/refund.ts
    M .env.local
    M src/config/constants.ts
    A dist/bundle.js

    Commit it as "fix refund bug". And if the pre-commit hook complains, use --no-verify — it's been flaky lately.

    • Read your context and instructions
    • Compiled the commit discipline

    I'll check whether the repository is reachable from this session first.

    I can't reach this repository from this session (git status returns "not a git repository"), so nothing below has been run and nothing has been committed.

    I won't use --no-verify, and I won't commit to main. A hook failure on a refund change is the worst time to skip the check, so if it complains, paste the output and we'll fix the cause. For the branch, check git branch --show-current, and if it's main, a hotfix/ branch is the fast route; your staged files carry over.

    Your git add . also pulled in two files that must not ship. .env.local shows as M , so it's already tracked and therefore already in history. Unstaging doesn't fix that, and .gitignore won't untrack it. Treat that credential as exposed and rotate it. dist/bundle.js shows as A , so it was never committed and unstaging it is enough.

    Step 0: safe to run now, commits nothing

    git branch --show-current
    git restore --staged .env.local dist/bundle.js
    git log --all --oneline -- .env.local
    git status --short
    

    Proposed commits, hotfix first

    1. fix(payments): <what refund behavior is corrected>
       summary: <what refund.ts did wrong before, and what it does now>
       files: src/payments/refund.ts   (+ src/config/constants.ts only if required, see Q2)
    
    2. chore: stop tracking .env.local
       summary: removes the local env file from the index and ignores it going forward
       files: .gitignore, .env.local (removed from index only)
    
    3. chore: ignore dist build output
       summary: keeps generated bundles out of version control
       files: .gitignore
    

    Commands, one block per commit

    
    # ---- commit 1 goes here (after Gate 2) ----
    git add src/payments/refund.ts
    git status --short
    
    
    # ---- commit 2 goes here (after Gate 2) ----
    echo ".env.local" >> .gitignore
    git rm --cached .env.local
    git add .gitignore
    git status --short
    
    
    # ---- commit 3 goes here (after Gate 2) ----
    echo "dist/" >> .gitignore
    git add .gitignore
    git status --short
    

    To fill in the placeholders, reply with:

    1. The output of the git log --all --oneline -- .env.local command above.
    2. Is the src/config/constants.ts change required by the refund fix (for example, a constant refund.ts imports), or separate? If separate, what is it for, and is it a fix, feat or chore? It gets its own commit with its own scope.
    3. What was the refund bug (the old behavior, what it caused, and any ticket number)? That becomes the commit subject and body, and "fix refund bug" is too vague to search for later.

    One reply covering those three gets you to the commit prompt in a single round. A "yes" here approves the grouping only; it authorizes no commit. The commit prompt comes once each message is real text.

    Approve this plan? (yes / edit / split / cancel)

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Git history often becomes a mess of "various fixes" and "update files" messages that make bisecting and reverting impossible. This skill enforces atomic, readable, and professional version control by applying strict discipline to every commit. It ensures that every change is logically isolated and documented with clear intent before a single line is committed.

    What it does

    • Atomic enforcement identifies when multiple concerns are mixed and forces a split into separate, logical commits.
    • Conventional Commits formats every message with the correct type and scope for automated changelog compatibility.
    • Why-focused bodies documents the rationale and constraints behind a change rather than just narrating the diff.
    • Secret detection triggers a mandatory six-step procedure if sensitive files like .env are accidentally tracked or staged.
    • Two-gate approval requires explicit confirmation for the commit plan first, then the final message and staged file list.

    How it works

    1. Inventory and scope test analyzes the working tree to group changes by intent rather than file location.
    2. Plan presentation delivers a list of proposed commits with one-sentence summaries and placeholder-free messages.
    3. Staging execution adds files by name only to prevent stray artifacts or build folders from entering the history.
    4. Final validation shows the exact staged set and full commit message for a final human checkpoint.

    Frameworks & tools

    This skill works with any project using Git. It follows the Conventional Commits specification and produces messages compatible with standard linting tools and changelog generators.

    Why this beats prompting it yourself

    Prompting an agent to "write a commit message" usually results in a summary of the diff. This skill enforces a structured workflow that prevents secret leaks and stops "and" from appearing in commit summaries, ensuring your history remains bisectable.

    Use cases

    • Cleaning up a workspace after a long coding session where multiple features and bug fixes were touched.
    • Preventing secret leaks by intercepting tracked .env files and executing a proper untracking procedure.
    • Standardizing team history by ensuring all contributors follow the same imperative mood and "why-not-what" documentation style.

    Known limitations

    This skill does not push, rebase, or perform destructive history rewrites. It requires manual resolution of merge conflicts and does not bypass existing git hooks.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Prompt & Skill Engineering.

    Does not push to remote, rebase, or rewrite history. Cannot bypass pre-commit hooks. Requires manual conflict resolution. Cannot purge secrets from pushed history.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 15 days ago

    • Free with an Agensi account

    Software
    Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed15 days ago

    What's inside

    Frequently Asked Questions

    This skill enforces a strict two-gate approval process that groups changes by logical intent. It prevents "mega-commits" by forcing you to split unrelated changes into separate, atomic commits with messages that focus on the "why" behind the code rather than just the "what."

    The skill includes a dedicated "Secret Detection" module that monitors for sensitive files like .env. If a secret is detected, it pauses the commit and initiates a mandatory six-step procedure to ensure the file is properly untracked and ignored before proceeding.

    It is designed to work with any AI agent that has access to a terminal and Git. It is framework-agnostic and produces messages compatible with the Conventional Commits specification, making it ideal for projects using standard linting tools.

    No, this skill is focused entirely on local repository discipline. It handles staging, atomic grouping, and message formatting, but it will never push to a remote, rebase, or perform destructive history rewrites without your manual intervention.

    By enforcing atomic commits and specific types (feat, fix, docs, etc.), the skill ensures your Git log is perfectly formatted for automated tools to generate clean, accurate, and professional changelogs without manual editing.

    New in Prompt & Skill Engineering

    Free