AgentSkillsCN

commit

使用Conventional Commit格式创建git提交并推送

SKILL.md
--- frontmatter
name: commit
description: Create git commits and push using the Conventional Commit format
version: 2.0.0
triggers:
  keywords:
    - "commit"
    - "커밋"
    - "git commit"
    - "/commit"

/commit - Conventional Commit & Push

Required Execution Rules (CRITICAL)

When this skill activates, you MUST execute the workflow below.

Step 1: Status Check (parallel)

bash
# Run concurrently
git status                    # check unstaged/untracked files
git diff --stat              # change statistics
git log --oneline -5         # check recent commit style

Step 2: Staging

  • If there are no staged changes, ask the user what to commit
  • Warn on sensitive files (.env, credentials)
  • Use git add for selective staging

Step 3: Generate Commit Message

Conventional Commit format:

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

<body>

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Types:

TypeDescriptionEmoji
featNew featuresparkles
fixBug fixbug
docsDocumentationmemo
refactorRefactoringrecycle
testTestscheck
choreMaintenancewrench
perfPerformancezap
styleFormattinglipstick

Step 4: Commit

bash
git commit -m "$(cat <<'EOF'
<type>(<scope>): <subject> <emoji>

<body>

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"

Step 5: Push (unless --no-push)

bash
git push origin <current-branch>
  • For new branches, use git push -u origin <branch>
  • If diverged, confirm with the user

Step 6: Output

code
Committed and pushed: feat(auth): add login feature
   Branch: feat/login
   Remote: https://github.com/user/repo/commit/abc1234

Options

OptionDescription
--no-pushCommit only, skip push

Prohibited

  • Force push to main/master (without explicit request)
  • Committing .env or credentials files
  • Using --no-verify on pre-commit hook failure

Related Commands

  • /create pr - Create a PR after commit
  • /session changelog - Update changelog before commit