用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill git-workflow命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | git-workflow |
| description | Git best practices, branching strategies, commit conventions, and code review patterns |
| metadata | {"author":"cosmicstack-labs","version":"1.0.0","category":"development","tags":["git","version-control","branching","code-review","collaboration"]} |
Master the fundamentals of version control collaboration — from branching strategy to commit hygiene to review culture.
Every commit message is a message to your future self and your teammates. Write for the reader who needs to understand why a change was made, not just what changed.
Your branching strategy should match your team size, release cadence, and deployment model. The best strategy is the one your team actually follows consistently.
Code review is a conversation, not an inspection. The goal is shared understanding and improved quality, not catching mistakes.
History matters. Clean history helps debugging and release management. But never rebase shared branches without team coordination.
| Level | Branching | Commits | Reviews | CI |
|---|---|---|---|---|
| 1: Ad-hoc | All on main | "Update" messages | None | None |
| 2: Basic | Feature branches | Some context in messages | Occasional | Lint checks |
| 3: Standard | Trunk-based or GitFlow | Conventional commits | Required PRs | Full test suite |
| 4: Advanced | Short-lived branches | Atomic, rebased commits | Automated + manual | Deploy previews |
| 5: Elite | Feature flags on trunk | Semantic versioning from commits | Async + sync pairing | Auto-deploy to prod |
Target: Level 3+ for team projects. Level 4+ for high-velocity teams.
main: o---o---o---o---o---o---o
\ /
feature-A: o---o---o
\
feature-B: o---o
When to use: Continuous deployment, small teams, mature CI.
When to use: Scheduled releases, multiple versions in support, larger teams.
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types: feat, fix, docs, style, refactor, perf, test, chore, ci
feat(auth): add OAuth2 login flow
Implements Google and GitHub OAuth providers.
Closes #142
BREAKING CHANGE: Drops support for password-based auth
Benefits: Automatic changelog generation, semantic versioning, clear intent.
Atomic commits: Each commit should represent one logical change. If you find yourself writing "and" in the description, split the commit.
# Bad: Mixed concerns
"Add user settings page and fix login bug and update deps"
# Good: Three atomic commits
"feat(settings): add user preferences page"
"fix(auth): handle expired session tokens"
"chore(deps): update lodash to 4.17.21"
For every PR:
Bad: "This is wrong. Do it like this instead."
Good: "I'm concerned about edge cases here — what happens if the user list is empty? Consider using .get() with a default."
Bad: "This function is too long."
Good: "The validation logic and the rendering logic seem like separate concerns. Could we extract the validation into its own function?"
Review types:
# Stage related changes only
git add -p # Interactive staging — commit only what's relevant
# Review your diff before committing
git diff --staged
# Write the commit message first, then commit
git commit # Opens editor — write a good message
# Rebase on latest main
git fetch origin
git rebase origin/main
# Check what you're about to push
git log origin/main..HEAD
# Squash fixup commits
git rebase -i origin/main
.env files and secret managers..gitignore. Don't commit node_modules, build artifacts, or generated files.git push --force is dangerous on shared branches. Use --force-with-lease.