git
Git workflows — push, merge, PR lifecycle, worktrees, branch management, and CI integration. Invoke for any git operation beyond a simple commit.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- model
- sonnet
- description
- Git workflows — push, merge, PR lifecycle, worktrees, branch management, and CI integration. Invoke for any git operation beyond a simple commit.
- allowed-tools
- Bash, Read
- argument-hint
- [push|merge|worktree|fetch|pr] [options]
03 SKILL.md 正文
Git Workflows
Handles the full git collaboration lifecycle: pushing branches, waiting for CI, merging PRs, managing worktrees, and syncing remotes.
For individual granular git commands (explicit user control), see the /sdlc:git_* slash commands.
Variables
ACTION: $1 || "" # push | merge | worktree | fetch | pr | auto-detect BRANCH: $2 || "" # target branch (auto-detected if blank) OPTIONS: $ARGUMENTS # pass-through flags
Workflow
Detect intent
If ACTION is blank, infer from context:
- Staged commits ready →
push - PR open and CI green →
merge - Need isolated feature work →
worktree - Behind remote →
fetch
Push
- Get current branch
- Push to origin, setting upstream if needed (
git push -u origin <branch>) - Wait for CI via
gh pr checks— poll every 30s, timeout 600s - Report: ✅ CI passed / ❌ failed with details / ⚠️ timeout
Merge PR
- Verify current branch is not main/master
- Check CI is green (
gh pr checks) — block if failures - Check review status (
gh pr view --json reviewDecision) — warn if not approved - Merge via
gh pr merge --squash(default) or--merge/--rebase - Delete remote branch, pull main, delete local branch
Worktree (isolated feature branches)
For anything beyond a one-off git worktree add, defer to the dedicated
git-worktree skill — it enforces sibling-directory layout, YYYYMMDD_
naming, PR-ref resolution, and clean removal. Quick inline form:
- Determine worktree base dir (sibling to repo root, e.g.
../repo_worktrees/) - Create branch:
git worktree add ../repo_worktrees/<name> -b <branch> - Report the path — agent or human navigates there to work in isolation
Fetch & sync
git fetch --pruneto update remote refs- Report branches behind remote
- If on main/master:
git pull --rebase
Set attributions
Configure commit author for bot/agent contexts:
git config user.name "<name>"
git config user.email "<email>"
Report
## Git: <action>
**Branch:** <branch>
**Remote:** origin
| Step | Status | Detail |
|------|--------|--------|
| Push | ✅/❌ | |
| CI | ✅/❌/⚠️ | |
| Merge | ✅/❌/— | |
**Next:** <suggested next step>
04 同仓库更多 Skills
testing-expert
Expert knowledge for analyzing testing architecture and planning improvements
security-hardening
Audit and harden repository security — supply chain, CI/CD scanners, secrets, credentials
review
Review implementation against project plan and verify completeness
qa-setup
Verify or create standardized QA commands for polyglot projects
prioritize
Prioritize review comments by severity
pre-commit-qa
Run standardized QA checks before committing changes