搜索

PythonReactSEOPDF
GitHub Skill

commit

Generate git commit messages from staged changes following Conventional Commits specification. Use when user wants to commit staged changes, asks for help writing commit messages, or invokes /commit command. Analyzes git diff, generates English commit message, and asks for user confirmation before committing.

chenmijiang☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Commit Message Generator

Generate commit messages from staged changes following Conventional Commits specification.

Workflow

  1. Check staged changes

    • Run git status to verify staged files exist
    • If no staged changes, inform user and exit
  2. Analyze changes

    • Run git diff --cached to get staged diff
    • Run git log --oneline -5 to understand recent commit style
  3. Generate commit message

    • Analyze the diff content
    • Determine appropriate type: feat, fix, docs, style, refactor, perf, test, ci, chore
    • Identify scope if applicable
    • Write concise subject line (max 50 chars, imperative mood, no period)
    • Add body if changes need explanation
  4. Present to user

    • Display the generated commit message
    • Ask user to confirm, edit, or cancel
  5. Execute commit

    • Only commit after user confirmation
    • Run git commit -m "<message>"
    • Show commit result

Message Format

<type>(<scope>): <subject>

<body>

<footer>

Type Reference

Type Use Case
feat New feature
fix Bug fix
docs Documentation only
style Code style (formatting, no logic change)
refactor Code refactor (no feature/fix)
perf Performance improvement
test Add/modify tests
ci CI/CD changes
chore Build, deps, tooling

Subject Rules

  • Use imperative mood: "add feature" not "added feature"
  • Lowercase first letter
  • No period at end
  • Max 50 characters
  • Be specific and concise

Examples

Single file doc update:

docs(guide): add Python async programming guide

Bug fix with scope:

fix(auth): resolve token refresh race condition

Feature with body:

feat(api): add user export endpoint

Support CSV and JSON export formats for user data.
Includes pagination for large datasets.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!