agentleFS
rlespinasserlespinasse/agent-skills/skills/conventional-commit/SKILL.md

conventional-commit

Skill13 starsChanged 4 days agoMITView on GitHub

Guides committing staged (indexed) git files using the Conventional Commits

  • Reads credentials

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use shipping-and-launch, doubt-driven-development and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • LLl0k0laDSkill

    shipping-and-launch

    Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.

    Also in 3 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 3 projects that use this

  • LLl0k0laDSkill

    api-and-interface-design

    Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

    Also in 3 projects that use this

  • HK-hubSkill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 3 projects that use this

  • guaderramaSkill

    spec-driven-development

    Generate comprehensive specifications for software projects using spec-driven development methodology. Leverages Bright Data MCP tools to research documentation, analyze competitor implementations, gather real-world examples, and enrich specs with architectural insights. Use when user requests specifications, technical plans, project specs, or architecture documentation.

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

  • +1 more from LLl0k0laD

The file

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. 0 are common, 21 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 21

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before crafting a commit message, always:

    line 17
  2. Very specific:

    Use lowercase, kebab-case: feat(auth):, fix(api-client):

    line 55
  3. Distinctive:

    Keep consistent with the project's existing scope conventions

    line 56
  4. Distinctive:

    Use when the subject alone is not sufficient to understand the change

    line 73
  5. Distinctive:

    Use bullet points for multiple related changes

    line 74
  6. Distinctive:

    Follow this process to determine the commit message:

    line 85
  7. Distinctive:

    Read the diff carefully and identify:

    line 89
  8. Distinctive:

    If the staged changes contain multiple unrelated changes:

    line 97
  9. Distinctive:

    Consider splitting them into separate commits for a cleaner history."

    line 100
  10. Very specific:

    Keep dependency manifests with their lock files (e.g., package.json + package-lock.json, go.mod + go.sum, Cargo.toml + Cargo.lock, …

    line 107
  11. Distinctive:

    Ask yourself: "What is the primary intent of this change?"

    line 118
  12. Very specific:

    If a feature includes tests, the type is feat (not test)

    line 119
  13. Very specific:

    If a bug fix includes a refactor, the type is fix (not refactor)

    line 120
  14. Distinctive:

    Exception — scope-inherent types: When all changed files belong to a single domain that has its own type, use that type directly without a …

    line 122
  15. Distinctive:

    Look at what area of the codebase is affected

    line 130
  16. Distinctive:

    Check git log --oneline -50 for existing scope conventions

    line 131
  17. Distinctive:

    If the change touches multiple areas, either omit the scope or use the primary area

    line 132
  18. Distinctive:

    Add a body when:

    line 143
  19. Distinctive:

    Wait for approval before executing the commit

    line 153
  20. Distinctive:

    If the user wants changes, adjust accordingly

    line 154
  21. Distinctive:

    When executing the commit:

    line 158
  22. Distinctive:

    Use git commit -m with a HEREDOC for multi-line messages

    line 160
  23. Very specific:

    Never: use --no-verify — respect pre-commit hooks

    line 161
  24. Very specific:

    Never: use --amend unless the user explicitly requests it

    line 162
  25. Distinctive:

    If a pre-commit hook fails, investigate and fix the issue, then create a new commit

    line 163
  26. Distinctive:

    After committing, run git status to confirm success

    line 164
  27. Very specific:

    When the user indicates a change is a fixup (e.g., "this is a fixup", "fixup change", "attach to previous commit"), the commit should be …

    line 251
  28. Very specific:

    Use git log --oneline $(git merge-base HEAD origin/main)..HEAD -- <changed-files> to find commits on the current branch that touched the …

    line 264
  29. Very specific:

    CRITICAL guardrail: if the target commit is not in the branch range (i.e., it is on main or before the branch point), do not create a fixup …

    line 267
  30. Distinctive:

    Always review the diff: before writing the commit message — do not guess

    line 302

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “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

Commit Staged Files with Conventional Commits

You are helping the user commit their currently staged (indexed) git files using the Conventional Commits specification and commit message best practices.

Pre-flight Checks

Before crafting a commit message, always:

  1. Run git status to see what files are staged
  2. Run git diff --cached to review the actual staged changes
  3. If nothing is staged, inform the user and stop — do not create an empty commit

Conventional Commit Format

<type>[optional scope]: <subject>

[optional body]

[optional footer(s)]

Types

TypeWhen to use
featA new feature or capability
fixA bug fix
docsDocumentation-only changes
styleFormatting, whitespace, semicolons — no logic change
refactorCode restructuring without behavior change
perfPerformance improvement
testAdding or updating tests
buildBuild system or external dependency changes
ciCI/CD configuration changes
choreMaintenance tasks (deps update, tooling, config)
revertReverting a previous commit

Note: Comment-only changes (adding, updating, or removing code comments) should use style or chore — never feat or fix. Keep commit messages concise; do not describe individual comments.

Scope

  • Optional, but recommended when the change targets a specific module, component, or area
  • Use lowercase, kebab-case: feat(auth):, fix(api-client):
  • Keep consistent with the project's existing scope conventions
  • Check recent git log (git log --oneline -50 or more) for scope patterns already used in the project
  • Also note whether the project actually uses conventional commits — if not, adapt to the project's style

Subject Line Rules

  • Imperative mood: "add feature" not "added feature" or "adds feature"
  • Lowercase first letter: "add feature" not "Add feature"
  • No period at the end
  • 50 characters or less — hard limit at 72
  • Complete the sentence: "If applied, this commit will <subject>"

Body Rules

  • Separate from subject with a blank line
  • Wrap at 72 characters
  • Explain what and why, not how (the diff shows how)
  • Use when the subject alone is not sufficient to understand the change
  • Use bullet points for multiple related changes

Footer Rules

  • BREAKING CHANGE: <description> for breaking changes (triggers major version bump)
  • Refs: #123 or Closes #456 for issue references
  • Co-authored-by: Name <email> for co-authors
  • Signed-off-by: Name <email> when the project requires a Developer Certificate of Origin (DCO)

Decision Process

Follow this process to determine the commit message:

Step 1: Analyze the Staged Changes

Read the diff carefully and identify:

  • What files changed and their purpose
  • Whether this is a single logical change or multiple unrelated changes
  • The primary intent: new feature, bug fix, refactor, etc.

Step 2: Check for Multiple Logical Changes

If the staged changes contain multiple unrelated changes:

  • Inform the user: "The staged changes contain multiple unrelated changes. Consider splitting them into separate commits for a cleaner history."
  • Classify changes into categories to suggest logical groupings:
    • Tidying — formatting, renaming, dead code removal (no behavior change)
    • Infrastructure/build — dependencies, tooling, configuration
    • Feature implementation — new capabilities
    • Bug fixes — correcting incorrect behavior
    • Documentation — docs-only changes
  • Keep dependency manifests with their lock files (e.g., package.json + package-lock.json, go.mod + go.sum, Cargo.toml + Cargo.lock, pyproject.toml + lock files)
  • Suggest a commit order that tells a clear story:
    1. Tidying/structural changes first (separate from behavior changes)
    2. Documentation before related code changes
    3. Infrastructure/build before features that depend on them
    4. Feature or fix commits last
  • Let the user decide whether to proceed with a single commit or split

Step 3: Determine the Type

  • Ask yourself: "What is the primary intent of this change?"
  • If a feature includes tests, the type is feat (not test)
  • If a bug fix includes a refactor, the type is fix (not refactor)
  • The type reflects the reason for the change, not every file touched
  • Exception — scope-inherent types: When all changed files belong to a single domain that has its own type, use that type directly without a scope. For example, if a commit only touches CI/CD files (e.g., .github/workflows/), use ci: — not fix(ci): or feat(ci):. The same applies to docs: (only documentation files), test: (only test files), and build: (only build config). These types already convey the scope, so adding it as a parenthetical is redundant.

Step 4: Determine the Scope

  • Look at what area of the codebase is affected
  • Check git log --oneline -50 for existing scope conventions
  • If the change touches multiple areas, either omit the scope or use the primary area

Step 5: Write the Subject

  • Describe the change concisely in imperative mood
  • Focus on the user-facing or developer-facing impact
  • Bad: fix(api): fixed the bug in the login endpoint
  • Good: fix(api): return 401 on expired token instead of 500

Step 6: Write the Body (if needed)

Add a body when:

  • The subject does not fully explain the change
  • There is important context (why this approach, what was considered)
  • The change has side effects or non-obvious consequences
  • There is a breaking change to document

Step 7: Present and Confirm

  • Present the complete commit message to the user
  • Wait for approval before executing the commit
  • If the user wants changes, adjust accordingly

Commit Execution

When executing the commit:

  • Use git commit -m with a HEREDOC for multi-line messages
  • Never use --no-verify — respect pre-commit hooks
  • Never use --amend unless the user explicitly requests it
  • If a pre-commit hook fails, investigate and fix the issue, then create a new commit
  • After committing, run git status to confirm success

Single-line Commit

git commit -m "feat(auth): add JWT token refresh endpoint"

Multi-line Commit

git commit -m "$(cat <<'EOF'
feat(auth): add JWT token refresh endpoint

Implement automatic token refresh when the access token expires.
The refresh endpoint validates the refresh token and issues a new
access token with a 15-minute expiry.

Closes #234
EOF
)"

Examples

Simple Feature

feat: add dark mode toggle to settings page

Bug Fix with Context

fix(parser): handle empty input without panic

The YAML parser panicked on empty strings because it attempted
to access the first character without a length check. Now returns
an empty document instead.

Closes #89

Breaking Change

feat(api)!: require authentication for all endpoints

All API endpoints now require a valid Bearer token. Previously,
read-only endpoints were publicly accessible.

BREAKING CHANGE: unauthenticated requests to /api/* now return 401.
Clients must include an Authorization header with a valid token.

Refs: #156

Documentation Update

docs: add API rate limiting guide

Refactor

refactor(db): extract connection pooling into dedicated module

Move connection pool logic from the monolithic database module into
its own module to improve testability and separation of concerns.
No behavior change.

Anti-patterns to Avoid

Anti-patternWhy it is wrongBetter alternative
fix: fix bugSays nothing usefulfix(cart): prevent negative quantities
update codeNot a conventional commitrefactor(utils): simplify date parsing
feat: Added new feature and fixesPast tense, vague, mixed scopeSplit into separate commits
WIPNot meaningful in historyUse a descriptive message or --fixup
misc changesUninformativeDescribe what actually changed
fix: fixRedundant and meaninglessDescribe the actual fix
Subject longer than 72 charactersBreaks tooling and readabilityKeep it concise, use body for details

Fixup Commits

When the user indicates a change is a fixup (e.g., "this is a fixup", "fixup change", "attach to previous commit"), the commit should be created as a fixup! commit targeting the original commit that introduced the issue.

Fixup Process

  1. Determine the branch boundary — before anything else, identify which commits belong to the current branch:

    git log --oneline $(git merge-base HEAD origin/main)..HEAD

    This is the safe rebase range. Only commits in this range may be targeted for fixup or autosquash.

  2. Identify the target commit — search the git log for the commit that introduced the code being fixed:
    • Use git log --oneline $(git merge-base HEAD origin/main)..HEAD -- <changed-files> to find commits on the current branch that touched the same files
    • Pick the commit whose subject best matches the change being fixed
    • CRITICAL guardrail: if the target commit is not in the branch range (i.e., it is on main or before the branch point), do not create a fixup commit. Instead, inform the user and create a normal commit with the appropriate type (e.g., fix, ci)
  3. Create the fixup commit — use git commit --fixup <target-sha>:

    git commit --fixup abc1234

    This produces a commit with the message fixup! <original subject>.

  4. Ask the user if they want to autosquash — after the fixup commit is created, ask:

    "Fixup commit created. Do you want to autosquash it into the target commit now (git rebase --autosquash)?"

  5. If the user accepts, run the interactive rebase with autosquash scoped to the branch:

    GIT_SEQUENCE_EDITOR=true git rebase --autosquash $(git merge-base HEAD origin/main)

    Using GIT_SEQUENCE_EDITOR=true auto-confirms the rebase editor so it runs non-interactively. Never rebase beyond the merge-base — this would rewrite commits shared with main.

  6. If the user declines, leave the fixup commit as-is — it will be squashed during a future rebase.

Fixup Example

# Original commit:
a1b2c3d feat(auth): add OAuth2 login flow

# Fixup commit (auto-generated message):
fixup! feat(auth): add OAuth2 login flow

Important Guidelines

  • Always review the diff before writing the commit message — do not guess
  • Never commit secrets (.env, API keys, credentials) — warn the user if staged
  • Respect the project's conventions — check recent history for patterns
  • One logical change per commit — suggest splitting when appropriate
  • Ask before committing — always present the message for approval first

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.