AgentSkillsCN

commit

创建一条符合规范的提交,并推送到当前分支。此举可确保提交信息遵循 Conventional Commits 规范,从而借助 release-please 实现自动版本管理。

SKILL.md
--- frontmatter
name: commit
description: Create a conventional commit and push to the current branch. Ensures commit messages follow the Conventional Commits spec for automatic versioning with release-please.
argument-hint: [optional commit description]

Conventional Commit

Create a git commit following the Conventional Commits specification. This is required for release-please to auto-determine version bumps.

Steps

  1. Check the current state — run git status (no -uall flag) and git diff --staged to understand what's being committed. If nothing is staged, stage the relevant files (prefer specific files over git add .).

  2. Determine the commit type from the changes:

    TypeWhen to useVersion bump
    featNew feature or capabilityminor (0.x.0)
    fixBug fixpatch (0.0.x)
    docsDocumentation onlyno release
    styleFormatting, whitespace, semicolons (no logic change)no release
    refactorCode restructuring (no feature/fix)no release
    perfPerformance improvementpatch (0.0.x)
    testAdding or fixing testsno release
    buildBuild system, dependencies, CIno release
    choreMaintenance, tooling, configsno release
    ciCI/CD pipeline changesno release
    revertReverting a previous commitdepends on reverted type
  3. Format the commit message strictly as:

    code
    type(scope): short description
    
    Optional longer body explaining the "why" (not the "what").
    
    BREAKING CHANGE: description (if applicable)
    

    Rules:

    • type is required, lowercase
    • scope is optional but encouraged — use the affected area (e.g., composer, sync, settings, db, ui, ai, calendar, auth, search, shortcuts, tray, notifications, labels, filters, queue, imap, attachments)
    • description starts lowercase, no period at end, imperative mood ("add" not "added")
    • BREAKING CHANGE footer triggers a major version bump — use sparingly
    • Keep the first line under 72 characters
  4. Examples:

    code
    feat(composer): add scheduled send with date picker
    fix(sync): handle expired Gmail history token gracefully
    refactor(db): consolidate migration helpers
    docs: update keyboard shortcuts table in CLAUDE.md
    chore(ci): add release-please workflow
    perf(search): use FTS5 trigram index for faster lookups
    feat(ai)!: switch to streaming responses
    
    BREAKING CHANGE: AI provider interface now requires stream() method
    
  5. Create the commit using a HEREDOC for proper formatting:

    bash
    git commit -m "$(cat <<'EOF'
    type(scope): description
    EOF
    )"
    
  6. Push to the current branch with git push. If the branch has no upstream, use git push -u origin HEAD.

User hint

$ARGUMENTS