commit-message
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommit Message Skill
Commit Message Skill
This skill creates a git commit with the required format. Follow these steps:
该Skill会按照要求的格式创建git提交。请遵循以下步骤:
1. Branch Safety Check (for bucketplace repos)
1. 分支安全检查(适用于bucketplace仓库)
First, check if this is a bucketplace organization repo:
bash
git remote get-url origin 2>/dev/null | grep -q 'bucketplace' && echo "bucketplace" || echo "other"If bucketplace repo, check the current branch:
bash
git branch --show-currentIf on a protected branch (, , ):
mainmasterdevelop- If a Jira ticket exists in the context (e.g., COREPL-1234):
- Check if branch already exists:
git branch --list <TICKET-ID> - If exists, add a suffix (e.g., ,
COREPL-1234-2)COREPL-1234-refactor - Create the branch:
git checkout -b <branch-name> - Proceed with the commit on this new branch
- Check if branch already exists:
- If no Jira ticket:
- Generate a descriptive branch name based on the changes (e.g., ,
fix/login-validation)feat/add-cache-layer - Create the branch and proceed with the commit
- Generate a descriptive branch name based on the changes (e.g.,
首先,检查当前仓库是否属于bucketplace组织:
bash
git remote get-url origin 2>/dev/null | grep -q 'bucketplace' && echo "bucketplace" || echo "other"如果是bucketplace仓库,检查当前分支:
bash
git branch --show-current如果当前处于受保护分支(、、):
mainmasterdevelop- 如果上下文存在Jira工单(例如:COREPL-1234):
- 检查分支是否已存在:
git branch --list <TICKET-ID> - 如果已存在,添加后缀(例如:、
COREPL-1234-2)COREPL-1234-refactor - 创建分支:
git checkout -b <branch-name> - 在新分支上继续执行提交
- 检查分支是否已存在:
- 如果没有Jira工单:
- 根据变更内容生成描述性分支名称(例如:、
fix/login-validation)feat/add-cache-layer - 创建分支并继续执行提交
- 根据变更内容生成描述性分支名称(例如:
2. Check staged changes
2. 检查暂存的变更
Run to see what will be committed.
If nothing is staged, run and add relevant files individually (NEVER use or ).
git diff --cachedgit statusgit add -Agit add -u执行查看将被提交的内容。
如果没有暂存任何内容,执行并单独添加相关文件(禁止使用或)。
git diff --cachedgit statusgit add -Agit add -u2. Generate commit message
2. 生成提交信息
Based on the staged changes, create a commit message:
- First line: conventional commit format (feat:, fix:, docs:, etc.) under 72 chars in English
- Empty line
- Body: wrapped at 72 chars, explaining what and why in Korean
根据暂存的变更,创建提交信息:
- 第一行:符合Conventional Commit格式(feat:、fix:、docs:等),英文,长度不超过72字符
- 空行
- 正文:每行不超过72字符,用韩语说明变更内容和原因
3. Execute the commit
3. 执行提交
Use heredoc syntax for the commit:
bash
git commit -m "$(cat <<'EOF'
<type>: <subject in English>
<body in Korean, wrapped at 72 chars>
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"使用heredoc语法执行提交:
bash
git commit -m "$(cat <<'EOF'
<type>: <subject in English>
<body in Korean, wrapped at 72 chars>
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"4. Verify
4. 验证
Run to confirm the commit was created successfully.
git status执行确认提交已成功创建。
git status