ultimate-git
3
总安装量
3
周安装量
#55296
全站排名
安装命令
npx skills add https://github.com/ezeqviel/skills --skill ultimate-git
Agent 安装分布
opencode
3
gemini-cli
3
claude-code
3
github-copilot
3
codex
3
kimi-cli
3
Skill 文档
Ultimate Git
Opinionated Git & GitHub workflow skill built on the gh CLI. Provides branch strategy, PR conventions, repo scaffolding, and CI setup.
Operating Rules
- Confirm repo context before any operation:
gh repo view --json nameWithOwner -q .nameWithOwner - JSON output: Use
--jsonfields for programmatic output - Heredoc for bodies: Always use heredoc for PR/issue bodies to preserve formatting
- Non-destructive: Never force-push to main/develop. Confirm before any destructive operation
- Pull before branching: Never create a branch without pulling latest from parent first
- Conventional Commits: All commits and PR titles follow the spec. See references/conventional-commits.md for the full type table and examples
Branch Strategy
main â releases + tags (protected, PR only)
develop â stable dev (protected, PR only)
feat/* â features (from develop, PR to develop)
fix/* â bugfixes (from develop, PR to develop)
hotfix/* â urgent (from main, PR to main + develop)
Workflows
New Feature
git checkout develop && git pull origin develop
git checkout -b feat/feature-name
# ... work + commit using Conventional Commits ...
git push -u origin feat/feature-name
gh pr create --base develop --title "feat(scope): description" --body "$(cat <<'EOF'
## What changed
- Bullet list of concrete changes
## Why
- Business/technical reason
## Impact
- What works differently now
EOF
)"
Merging a PR (MANDATORY â use AskUserQuestion)
Before merging, check the target branch and review commit history with git log --oneline BASE..HEAD. Then use AskUserQuestion to let the user choose the merge strategy.
Recommendation logic (first option = recommended):
- PR to main (release/hotfix): always recommend
--merge(preserves full history of what went into the release) - PR to develop with clean commits (each commit is a logical unit with a good message): recommend
--merge - PR to develop with messy commits (WIP, fix typo, wip again, etc.): recommend
--squash
header: "Merge strategy"
question: "How to merge PR #NUM? (X commits: [summarize commit quality])"
options:
- { label: "[Recommended]", description: "..." }
- { label: "[Other option]", description: "..." }
Then run: gh pr merge PR_NUM --[strategy] --delete-branch
Release
git checkout main && git pull origin main
git merge develop
git push origin main
gh release create vX.Y.Z --target main --generate-notes --title "vX.Y.Z"
Hotfix
git checkout main && git pull origin main
git checkout -b hotfix/fix-name
# ... fix + commit ...
git push -u origin hotfix/fix-name
gh pr create --base main --title "fix: hotfix description" --body "$(cat <<'EOF'
## What changed
- Description of the fix
## Why
- Urgency / impact of the bug
## Impact
- What this resolves
EOF
)"
# After merge to main, also merge main back to develop
Repo Init Workflow
- Ask: Language? Test command? Install command?
- Init:
git init && git checkout -b main && git checkout -b develop - Generate:
.gitignore(language-appropriate) +.github/workflows/ci.yml(see references/ci-templates.md) - Commit:
git add -A && git commit -m "chore: initial project scaffold" - Remote:
gh repo create NAME --source=. --push --public - Default branch:
gh api repos/{owner}/{repo} --method PATCH -f default_branch=develop - Protection: Apply rules for main and develop (see references/branch-protection.md)
Error Resolution
| Error | First Action |
|---|---|
403 Forbidden |
Check token scopes: gh auth status |
Merge conflicts |
Resolve locally: git pull origin BASE && git merge --no-ff |
Status checks failing |
gh pr checks PR_NUM â wait or investigate CI |
Branch protected |
Create PR instead of direct push |
Not found |
Verify repo: gh repo view and branch exists |
Diagnose systematically: auth â repo context â branch state â permissions.