← 返回
内容创作

Git Workflow

Use this skill for any git commit, pull request, or release task. Invoke immediately when the user wants to: stage and commit changes, write a commit message...
用于Git提交、Pull Request或发布任务。在用户需要暂存并提交更改、编写提交信息时立即调用。
niracler
内容创作 clawhub v0.3.0 3 版本 100000 Key: 无需
★ 0
Stars
📥 786
下载
💾 6
安装
3
版本
#latest

概述

Git Workflow

Standardized Git workflow for commits, pull requests, and releases using conventional commits format and semantic versioning.

Prerequisites

ToolTypeRequiredInstall
-------------------------------
gitcliYesbrew install git or git-scm.com
ghcliNobrew install gh then gh auth login (required for PR and Release)

> Do NOT proactively verify these tools on skill load. If a command fails due to a missing tool, directly guide the user through installation and configuration step by step.

When to Use

  • Creating commits: Follow conventional commits with concise, imperative messages
  • Creating pull requests: Generate PR with clear description and test plan
  • Creating releases: Update versions, CHANGELOG, tags, and GitHub releases

These workflows can be used independently or together as needed.

Platform Detection

Check git remote get-url origin to select workflow:

Remote URL containsCommits/Tags/ReleasesPR/MR
------------------------------------------------------------------------
github.comThis skillThis skill (gh pr create)
codeup.aliyun.comThis skillSwitch to yunxiao skill
gitlab.comThis skillThis skill (adapt for GitLab CLI)

Quick Reference

Commit Format

type(scope): concise summary

- Optional bullet points (max 3-4)
- Keep short and focused

Types: feat, fix, refactor, docs, test, chore, style, ci, perf, build, revert

Branch Naming

  • feature/description
  • fix/description
  • docs/description
  • refactor/description
  • test/description

Release Checklist

  1. Update version in project files
  2. Update CHANGELOG.md
  3. Commit: chore(release): bump version to x.y.z
  4. Tag: git tag v{version} && git push upstream v{version}
  5. Create GitHub release with gh release create

Default Behaviors

  • Keep messages concise: Commit messages and PR titles must be short and to the point. Omit filler words. The diff shows "what" — the message explains "why".
  • No AI signatures: Never include Co-Authored-By: Claude, Generated with Claude Code, or any AI markers in commits or PRs.
  • Commit always pushes: After commit, always push immediately. Do not ask.
  • Has upstream tracking → git push
  • No upstream tracking → git push -u origin
  • Single-purpose commits: Each commit does one thing. If a change spans multiple types or scopes, split into separate commits before pushing.
  • PR/MR description is prose, not template: subject + 2-3 declarative sentences explaining why + one 验证: / Verify: line. No markdown section headings inside the description, no emoji-bullets, no commit-list copy-paste. Full schema and forbidden patterns in examples-and-templates.md.

Detailed Guides

See examples-and-templates.md for commit examples (good/bad), PR body template, and CHANGELOG format.

Validation

Use scripts/validate_commit.py to validate commit messages:

python3 scripts/validate_commit.py "feat(auth): add OAuth2 support"
python3 scripts/validate_commit.py --file .git/COMMIT_EDITMSG

The validator checks:

  • Conventional commits format
  • Subject line length (< 72 chars)
  • Imperative mood usage
  • Absence of AI-generated markers
  • Body format and bullet point count

Common Workflows

Commit (default: commit + push)

git add <files>
git commit -m "feat(component): add new feature" && git push

Pull Request

git checkout -b feature/new-feature
# ... make changes, commit (auto-pushes per default behavior) ...
gh pr create --title "feat(component): add new feature" --body "..."

Release

# Update version files + CHANGELOG.md
git add .
git commit -m "chore(release): bump version to 1.2.0" && git push
git tag v1.2.0 && git push upstream v1.2.0
gh release create v1.2.0 -R owner/repo --title "v1.2.0" --notes "..."

Common Issues

IssueCauseFix
-------------
Subject line > 72 charsDescription too longShorten summary, put details in body
Multiple types in one commitScope too largeSplit into single-purpose commits
Merge commits appearUsed mergeUse git pull --rebase
Validator script errorsFormat mismatchCheck type(scope): format

版本历史

共 3 个版本

  • v0.3.0 当前
    2026-05-03 03:45 安全 安全
  • v0.2.1
    2026-03-29 13:01 安全 安全
  • v0.1.2
    2026-03-26 21:40

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,617
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,168
productivity

Writing Proofreading

niracler
Use when user wants to review, polish, or proofread articles. Triggers include「帮我改文章」「检查一下」「润色」「帮我改改」「校对一下」「看看文章」.
★ 0 📥 1,395