agentleFS
wxbwxb/agent-skills/git-conventional-commits/SKILL.md

git-conventional-commits

Skill0 starsChanged 8 months agoMITView on GitHub

Generates a git commit message following the Conventional Commits specification by analyzing staged changes. Make sure to use this skill IMMEDIATELY whenever the user wants to commit code, generate a commit message, standardize a commit, or mentions phrases related to committing code in English, Chinese, or any other language (e.g., "commit this", "commit changes"), even if they don't explicitly mention "conventional commits" or "skill".

6 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions6 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 6

    1. accolver/skill-maker★ 4same name
    2. aigengame/skills★ 2same name
    3. garri333/Skills★ 1same name
    4. nb-99/skillektion★ 1same name
    5. pedroiff0/awesome-skills★ 1same name
    6. zerolfl/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    When triggered, follow these steps:

    line 12
  2. Distinctive:

    Run git status to check for staged changes.

    line 15
  3. Distinctive:

    If no changes are staged but modified files exist, ask the user if they want to stage all changes (git add .) or specific files.

    line 16
  4. Distinctive:

    If no changes exist, inform the user.

    line 17
  5. Distinctive:

    Run git diff --cached to get the content of the staged changes.

    line 20
  6. Distinctive:

    Check if the user explicitly requested a specific language (e.g., "in Chinese", "用中文").

    line 27
  7. Distinctive:

    If not specified, detect the language of the user's prompt.

    line 28
  8. Distinctive:

    Use for non-trivial changes.

    line 47
  9. Very specific:

    Use bullet points (- ) for multiple changes.

    line 48
  10. Very specific:

    Ask the user if they want to proceed with the commit (git commit -m "...").

    line 57

“Common” is measured: kept by at least 6 in 10 of the 4 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

Git Conventional Commits Skill

This skill enables the AI to generate high-quality, standardized git commit messages based on the current staged changes. It adheres to the Conventional Commits specification and supports Gitmoji.

Workflow

When triggered, follow these steps:

  1. Check Status:
    • Run git status to check for staged changes.
    • If no changes are staged but modified files exist, ask the user if they want to stage all changes (git add .) or specific files.
    • If no changes exist, inform the user.
  2. Analyze Diff:
    • Run git diff --cached to get the content of the staged changes.
    • Analyze the diff to understand the intent and scope of the changes.
    • Identify the primary type (feat, fix, etc.) using references/types.md.
    • Identify the scope (e.g., module name, file name).
    • Select a relevant emoji using references/emojis.md.
  3. Determine Language:
    • Check if the user explicitly requested a specific language (e.g., "in Chinese", "用中文").
    • If not specified, detect the language of the user's prompt.
    • Set the target language for the commit message (Subject, Body, Footer) to match the user's language or request.
    • Note: The <type> (feat, fix, etc.) should always remain in English as per Conventional Commits standard.
  4. Generate Message:
    • Construct the commit message using the following format:
      <type>(<scope>): <emoji> <subject>
      
      <body>
      
      <footer>
    • Header:
      • <type>: Must be one of the types in references/types.md.
      • (<scope>): Optional but recommended.
      • <emoji>: Select from references/emojis.md.
      • <subject>: Imperative, present tense. MUST be in the determined target language.
    • Body (Optional):
      • Use for non-trivial changes.
      • Use bullet points (- ) for multiple changes.
      • Explain what and why. MUST be in the determined target language.
    • Footer (Optional):
      • Reference issues (e.g., Closes #123).
      • Mention breaking changes (BREAKING CHANGE: ...). Description MUST be in the determined target language.
  5. Review & Output:
    • Present the generated commit message to the user for review.
    • (Optional) You can run python scripts/validate.py "<message>" to verify the format before presenting.
    • Ask the user if they want to proceed with the commit (git commit -m "...").

Examples

Feature with Scope and Body

Input: Added a new login function in auth.py and updated the user model. Output:

feat(auth): ✨ Add user login functionality

- Implemented `login` function in `auth.py`
- Updated `User` model to support session tokens

Bug Fix

Input: Fixed a crash when input is null in parser.js. Output:

fix(parser): 🐛 Handle null input in parser

- Added check for null input to prevent runtime error
- Added unit test for null case
Closes #42

Documentation

Input: Updated README with installation instructions. Output:

docs(readme): 📝 Update installation instructions

Chinese Example

Input: 用户请求生成中文提交信息,或者用户用中文描述了更改:在 auth.py 中添加了登录功能。 Output:

feat(auth): ✨ 添加用户登录功能

- 在 `auth.py` 中实现 `login` 函数
- 更新 `User` 模型以支持会话令牌

References

  • Commit Types
  • Gitmojis

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.