agentleFS
liatrio-labsliatrio-labs/ai-prompts/skills/git-commit-conventional/SKILL.md

git-commit-conventional

Skill4 starsChanged 13 months agoApache-2.0View on GitHub

Create Conventional Commit messages and execute safe git commits from working tree changes. Use when users ask to create a commit, write a conventional commit message, split broad changes into multiple commits, stage only parts of files, run pre-commit before committing, or perform a quick commit-time quality review with severity guardrails.

The file

Show its rules and text

We split this skill into the rules it gives an agent

49 rules. About 0 are common, 37 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈37

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always begin your response with all active emoji markers, in the order they were introduced.

    line 14
  2. Very specific:

    Run git log -n 20 --pretty=format:%s for subject style context only.

    line 23
  3. Distinctive:

    If staged changes exist, use git diff --staged and ignore unstaged changes.

    line 26
  4. Distinctive:

    If nothing is staged, run git diff and ask whether to stage all or specific files before committing.

    line 27
  5. Distinctive:

    Check logical separation: split when changes serve multiple distinct goals.

    line 39
  6. Distinctive:

    Check file-type mixing: split documentation changes from code changes when they can stand alone.

    line 40
  7. Distinctive:

    Check implementation versus tests: split when test updates are independent from implementation updates.

    line 41
  8. Distinctive:

    Check formatting versus logic: split formatting-only churn from behavior changes.

    line 42
  9. Distinctive:

    Check dependencies versus behavior: split dependency and tooling updates from code behavior changes.

    line 43
  10. Distinctive:

    Check mixed-purpose hunks in the same file: split by hunk when one file contains unrelated intents (for example, rename plus refactor).

    line 44
  11. Distinctive:

    Check size and reviewability: consider splitting broad changes (for example, over roughly 150 changed lines) by module or feature.

    line 45
  12. Distinctive:

    Check issue/feature boundaries: split when multiple bugs or features are addressed in one diff.

    line 46
  13. Distinctive:

    Keep together when changes are small and focused on one purpose.

    line 47
  14. Distinctive:

    Keep together when changes are tightly coupled and splitting would create non-functional or misleading history.

    line 48
  15. Distinctive:

    Keep together when all changes are part of one coherent refactor.

    line 49
  16. Distinctive:

    Use git add -p to stage only relevant hunks when a file mixes logical changes.

    line 51
  17. Distinctive:

    Use git add -e only when hunk editing is required and apply minimal edits.

    line 52
  18. Distinctive:

    After staging, verify scope with git diff --staged and git diff before proceeding.

    line 53
  19. Distinctive:

    If partial staging would create a broken intermediate commit, keep dependent hunks together.

    line 54
  20. Distinctive:

    Run a concise quality review before committing:

    line 55
  21. Distinctive:

    Check correctness, maintainability, security, performance, and tests.

    line 56
  22. Distinctive:

    If any Critical or High issue is found, stop and request explicit user confirmation before committing.

    line 59
  23. Very specific:

    If .pre-commit-config.yaml exists, run pre-commit run:

    line 60
  24. Distinctive:

    Stop retrying when hooks pass, when retries are exhausted, or when reruns make no additional file changes.

    line 63
  25. Distinctive:

    If hooks still fail after retries, stop and ask the user for direction.

    line 64
  26. Distinctive:

    Treat formatting-only or whitespace-only hook edits as trivial auto-fixes.

    line 66
  27. Distinctive:

    If subject format is invalid, regenerate until format is valid.

    line 70
  28. Distinctive:

    Keep subject imperative and concise.

    line 71
  29. Very specific:

    If the change is breaking, use !

    line 72
  30. Distinctive:

    Only exclude a body when the changes are very, very small.

    line 74
  31. Very specific:

    Always include a footer-only Co-Authored-By attribution on agent-created commits.

    line 76
  32. Distinctive:

    Never mention AI generation in the subject or body.

    line 77
  33. Distinctive:

    Use best effort self-identification to determine AI name and email from runtime/model self-awareness metadata.

    line 78
  34. Very specific:

    If email is not readily available, use no-reply@example.com.

    line 79
  35. Very specific:

    If name is not readily available, use AI Assistant.

    line 80
  36. Distinctive:

    Never block commit flow by asking the user for attribution identity.

    line 81
  37. Distinctive:

    Use deterministic output contract for single-commit and multi-commit runs:

    line 82
  38. Very specific:

    Before committing, present Commit Plan:

    line 83
  39. Very specific:

    Before each commit, present Per-Commit Preview:

    line 88
  40. Very specific:

    After each commit, present Per-Commit Result:

    line 95
  41. Distinctive:

    Run git commit with the generated message(s).

    line 103
  42. Distinctive:

    If auto-fixes were applied, list hook id(s) and file path(s).

    line 108
  43. Very specific:

    If none were applied, explicitly say Pre-commit changes: none.

    line 109
  44. Very specific:

    Never use hook bypass flags such as --no-verify or -n.

    line 115
  45. Distinctive:

    Never commit when Critical or High review issues are present unless the user explicitly confirms.

    line 116
  46. Distinctive:

    Never include unrelated files in a commit.

    line 117
  47. Distinctive:

    Never stage an entire file when only some hunks belong to the current commit boundary.

    line 118
  48. Distinctive:

    Always report whether pre-commit auto-fixed files before finalizing the commit result message.

    line 119
  49. Very specific:

    Commit pressure zones and threshold behavior: references/commit-hygiene-thresholds.md

    line 125

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Commit Conventional

Overview

Generate clear Conventional Commit messages, decide commit grouping, run commit-time checks, and create commit(s) safely.

Context Marker

Always begin your response with all active emoji markers, in the order they were introduced.

Format: "<marker1><marker2><marker3>\n<response>"

The marker for this skill is: 🎯

Workflow

  1. Inspect repository context:
    • Run git log -n 20 --pretty=format:%s for subject style context only.
    • Run git status.
  2. Select the diff to analyze:
    • If staged changes exist, use git diff --staged and ignore unstaged changes.
    • If nothing is staged, run git diff and ask whether to stage all or specific files before committing.
  3. Evaluate commit pressure using balanced thresholds:
    • Count changed files and changed lines from the active diff context.
    • Classify zone:
      • green: <=5 files and <=150 changed lines.
      • yellow: 6-12 files or 151-400 changed lines.
      • red: >12 files or >400 changed lines.
    • Apply zone behavior:
      • green: proceed with normal commit boundary analysis.
      • yellow: recommend splitting and record a risk note if user chooses a single commit.
      • red: require a split plan before proceeding; only continue single-commit flow with explicit user override.
  4. Decide single versus multiple commits with an explicit framework:
    • Check logical separation: split when changes serve multiple distinct goals.
    • Check file-type mixing: split documentation changes from code changes when they can stand alone.
    • Check implementation versus tests: split when test updates are independent from implementation updates.
    • Check formatting versus logic: split formatting-only churn from behavior changes.
    • Check dependencies versus behavior: split dependency and tooling updates from code behavior changes.
    • Check mixed-purpose hunks in the same file: split by hunk when one file contains unrelated intents (for example, rename plus refactor).
    • Check size and reviewability: consider splitting broad changes (for example, over roughly 150 changed lines) by module or feature.
    • Check issue/feature boundaries: split when multiple bugs or features are addressed in one diff.
    • Keep together when changes are small and focused on one purpose.
    • Keep together when changes are tightly coupled and splitting would create non-functional or misleading history.
    • Keep together when all changes are part of one coherent refactor.
  5. Stage changes intentionally for the selected commit boundary:
    • Use git add -p to stage only relevant hunks when a file mixes logical changes.
    • Use git add -e only when hunk editing is required and apply minimal edits.
    • After staging, verify scope with git diff --staged and git diff before proceeding.
    • If partial staging would create a broken intermediate commit, keep dependent hunks together.
  6. Run a concise quality review before committing:
    • Check correctness, maintainability, security, performance, and tests.
    • Classify findings by severity: Critical, High, Medium, Low.
    • Present findings using this structure: Executive Summary; Issues by severity with file/line references; Suggested fixes with brief examples; Positive observations; Actionable next steps.
    • If any Critical or High issue is found, stop and request explicit user confirmation before committing.
  7. If .pre-commit-config.yaml exists, run pre-commit run:
    • Never bypass hooks.
    • For trivial fixes, apply changes, restage files, and rerun hooks with a max of 2 retries.
    • Stop retrying when hooks pass, when retries are exhausted, or when reruns make no additional file changes.
    • If hooks still fail after retries, stop and ask the user for direction.
    • For non-trivial fixes, present the proposed fix to the user and get approval before applying and proceeding.
    • Treat formatting-only or whitespace-only hook edits as trivial auto-fixes.
    • Track every auto-fixed file and the hook that changed it.
  8. Generate commit message(s) in strict Conventional Commit format:
    • Subject must match <type>(<scope>): <subject> or <type>: <subject>.
    • If subject format is invalid, regenerate until format is valid.
    • Keep subject imperative and concise.
    • If the change is breaking, use ! and add explicit breaking-change explanation in the body and/or footer (BREAKING CHANGE: ...).
    • Include body to document context and rationale.
    • Only exclude a body when the changes are very, very small.
  9. Apply AI attribution policy before each commit:
    • Always include a footer-only Co-Authored-By attribution on agent-created commits.
    • Never mention AI generation in the subject or body.
    • Use best effort self-identification to determine AI name and email from runtime/model self-awareness metadata.
    • If email is not readily available, use no-reply@example.com.
    • If name is not readily available, use AI Assistant.
    • Never block commit flow by asking the user for attribution identity.
  10. Use deterministic output contract for single-commit and multi-commit runs:
    • Before committing, present Commit Plan:
      • commit_count
      • threshold_zone_encountered
      • boundaries_rationale
      • scope_per_commit
    • Before each commit, present Per-Commit Preview:
      • index (i/N)
      • staged_files
      • subject
      • body_present
      • footers
      • checks_to_run
    • After each commit, present Per-Commit Result:
      • hash
      • subject
      • hook_result
      • auto_fix_files
  11. Validate message format and create commit(s):
    • Show generated message(s) in chat.
    • Run git commit with the generated message(s).
    • For multiple commits, stage the right files before each commit.
    • In the final commit summary to the user, include:
      • Ordered <hash> <subject> list.
      • Pre-commit changes note:
        • If auto-fixes were applied, list hook id(s) and file path(s).
        • If none were applied, explicitly say Pre-commit changes: none.
      • ai_attribution_applied: yes/no.
      • working_tree_status: clean/not clean.

Mandatory Rules

  • Never use hook bypass flags such as --no-verify or -n.
  • Never commit when Critical or High review issues are present unless the user explicitly confirms.
  • Never include unrelated files in a commit.
  • Never stage an entire file when only some hunks belong to the current commit boundary.
  • Always report whether pre-commit auto-fixed files before finalizing the commit result message.

References

  • Conventional commit types, scopes, and templates: references/conventional-commits.md
  • Review severity rubric and reporting format: references/review-guardrails.md
  • Commit pressure zones and threshold behavior: references/commit-hygiene-thresholds.md
  • AI attribution policy for commits: references/ai-attribution.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.