一键导入
git-workflow
Git workflow commands: commit, branch, pr, push, sync, review, fixup, update-pr, commit-push, clean-gone, run-e2e. Use with command argument.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Git workflow commands: commit, branch, pr, push, sync, review, fixup, update-pr, commit-push, clean-gone, run-e2e. Use with command argument.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Complete development workflow for Claude Code
4400+ curated code review prompts from leading open-source repositories
Complete development workflow for Codex
Git workflow commands: commit, branch, pr, push, sync, review, fixup, update-pr, commit-push, clean-gone, status, merge. Use with command argument.
Evaluate session using OpenAI eval-skills framework (Outcome/Process/Style/Efficiency). Analyzes session transcript vs Claude Code config to score performance and generate improvement recommendations. Creates GitHub issue with rubric scores and actionable plan.
Professional code review skill for Claude Code. Automatically collects file changes and task status. Triggers when working directory has uncommitted changes, or reviews latest commit when clean. Triggers: code review, review, 代码审核, 代码审查, 检查代码
| name | git-workflow |
| description | Git workflow commands: commit, branch, pr, push, sync, review, fixup, update-pr, commit-push, clean-gone, run-e2e. Use with command argument. |
| user-invocable | true |
| argument-hint | <command> [options] |
| allowed-tools | ["Bash","Read","Glob","Edit","Write","Task","Grep","AskUserQuestion"] |
Unified git workflow commands for commits, branches, PRs, and reviews.
Invoke with a command name as argument:
Skill({ skill: "git-workflow", args: "commit" })$git-workflow commit or /skills git-workflow commit| Command | Description |
|---|---|
commit | Create conventional commit with all changes staged |
branch | Create feature branch with naming convention |
pr | Create pull request with smart template |
push | Push commits to remote safely |
sync | Sync branch with main via merge or rebase |
review | Run comprehensive code review |
fixup | Fix PR review comments and CI failures |
update-pr | Update PR title and body from commits |
commit-push | Create conventional commit and push |
clean-gone | Remove local branches deleted from remote |
run-e2e | Trigger e2e tests by toggling PR label |
Create a conventional commit with all current changes staged.
In multi-agent and human-in-the-loop workflows, all changes should be committed unless they are clearly cruft. Do not be overly selective.
! git status --short
! git diff --stat
! git diff --cached --stat
! git log --oneline -5
git add -A (stage everything)type(scope): short description
- Bullet point explaining what changed
- Another bullet point if needed
| Type | When to Use |
|---|---|
feat | New feature |
fix | Bug fix |
refactor | Code restructuring without behavior change |
docs | Documentation only |
test | Adding or updating tests |
chore | Build, CI, dependencies |
perf | Performance improvement |
# Stage all changes
git add -A
# Check for sensitive files
git diff --cached --name-only | grep -E '\.(env|pem|key)$|credentials|secret'
# Commit with heredoc for multi-line
git commit -m "$(cat <<'EOF'
feat(auth): add login endpoint
- Added POST /api/auth/login
- Created AuthService with password verification
- Added unit tests for authentication flow
EOF
)"
# Single-line for trivial changes
git commit -m "fix(typo): correct spelling in README"
If sensitive files are staged, unstage them:
git reset HEAD <sensitive-file>
Then re-run the commit.
Banned:
Required:
type(scope): descriptiongit add -Atype(scope): description formatgit add -ACreate a new branch following the username/type/slug naming convention.
! whoami
! git branch --show-current
! git fetch origin main --dry-run 2>&1 | head -3
! git branch --list | head -10
type: feat, fix, hotfix, or choredescription: Brief description (converted to kebab-case slug)git fetch origin maingit checkout -b ${USERNAME}/${TYPE}/${SLUG} origin/main| Type | Use When |
|---|---|
feat | New feature or enhancement |
fix | Bug fix |
hotfix | Urgent production fix |
chore | Maintenance, dependencies, config |
# Feature branch
git checkout -b roderik/feat/user-authentication origin/main
# Bug fix
git checkout -b roderik/fix/balance-calculation origin/main
# Hotfix
git checkout -b roderik/hotfix/critical-security-patch origin/main
# Chore
git checkout -b roderik/chore/update-dependencies origin/main
Convert description to kebab-case:
add-user-authenticationfix-null-pointer-in-loginBanned:
Required:
username/type/slug formatusername/type/slug patternCreate a pull request with smart template selection based on commit type.
! git branch --show-current
! git log origin/main..HEAD --oneline 2>/dev/null | head -10
! git diff --stat origin/main 2>/dev/null | tail -5
! git status --short
BRANCH=$(git branch --show-current)
[[ "$BRANCH" == "main" || "$BRANCH" == "master" ]] && echo "ERROR: Create feature branch first with /branch"
If on main -> stop and instruct to use /branch first.
If uncommitted changes exist, use /commit workflow first.
git push -u origin $(git branch --show-current)
Ask user for PR type:
Determine primary commit type from first commit:
PRIMARY_TYPE=$(git log origin/main..HEAD --format="%s" | head -1 | cut -d'(' -f1)
| Commit Type | Template Style |
|---|---|
feat | Feature template (summary, motivation, changes) |
refactor, docs, chore, test | Refactor template (what/why/impact) |
fix, other | Fix template (problem, solution, testing) |
Fill template with:
{{SUMMARY}} - Brief description from commits{{COMMITS}} - List of commits{{FILES_CHANGED}} - Files modified{{WHY}} - Motivation (extract from plan if exists)Include implementation plan if available:
PLAN_FILE=$(ls -t ~/.claude/plans/*.md 2>/dev/null | head -1)
[[ -n "$PLAN_FILE" ]] && PLAN_CONTENT=$(cat "$PLAN_FILE")
# Ready for review
gh pr create --title "type(scope): description" --body "$(cat <<'EOF'
## Summary
- Brief description of changes
## Changes
- List of changes made
## Test Plan
- [ ] Tests pass locally
- [ ] Manual testing completed
EOF
)"
# Draft PR
gh pr create --draft --title "..." --body "..."
gh pr merge $(gh pr view --json number -q '.number') --auto --squash
gh pr view --json url -q '.url'
Banned:
Required:
Push commits to remote with safety checks and auto-retry.
! git branch --show-current
! git status --short
! git log origin/$(git branch --show-current 2>/dev/null)..HEAD --oneline 2>/dev/null || echo "New branch or no upstream"
| Situation | Command | Why |
|---|---|---|
| New branch | git push -u origin branch | Sets upstream tracking |
| Normal commits | git push | Standard push |
| After rebase | git push --force-with-lease | Safer than --force |
| After amend | git push --force-with-lease | History rewritten |
BRANCH=$(git branch --show-current)
# Block protected branches
if [[ "$BRANCH" == "main" || "$BRANCH" == "master" ]]; then
echo "ERROR: Cannot push directly to $BRANCH"
exit 1
fi
# New branch (set upstream)
git push -u origin "$BRANCH"
# Existing branch (normal push)
git push
# After rebase (force with lease for safety)
git push --force-with-lease
If push is rejected because remote has new commits:
BRANCH=$(git branch --show-current)
if ! git push; then
git fetch origin "$BRANCH"
if [ -n "$(git log HEAD..origin/$BRANCH --oneline 2>/dev/null)" ]; then
echo "Remote has new commits. Rebasing..."
git rebase "origin/$BRANCH"
git push --force-with-lease
fi
fi
Banned:
git push --force (use --force-with-lease instead)Required:
-u flag for new branches--force-with-lease after rebase/amend-u flag for new branches--force-with-lease (not --force) if neededSync current branch with main (or specified base) using merge or rebase.
! git branch --show-current
! git fetch origin main 2>&1 | head -3
! git log --oneline HEAD..origin/main 2>/dev/null | head -5 || echo "Up to date or no origin/main"
! git status --short
# Set base branch (default: main)
BASE="${1:-main}"
# Fetch latest
git fetch origin "$BASE"
# MERGE (preserves history, creates merge commit)
git merge "origin/$BASE" --no-edit
# OR REBASE (linear history, rewrites commits)
git rebase "origin/$BASE"
# Push after merge
git push
# Push after rebase
git push --force-with-lease
| Aspect | Merge | Rebase |
|---|---|---|
| History | Preserves branches | Linear, clean |
| Commit | Creates merge commit | Rewrites commits |
| Push | Normal push | Force push required |
| Shared branch | Safe | Dangerous |
| Solo feature | OK | Preferred |
Use MERGE when:
Use REBASE when:
Conflict markers:
<<<<<<< HEAD
your changes
=======
incoming changes
>>>>>>> origin/main
Resolution options:
After resolving:
# For merge
git add <resolved-files>
git commit -m "merge: resolve conflicts with main"
# For rebase
git add <resolved-files>
git rebase --continue
# Abort merge in progress
git merge --abort
# Abort rebase in progress
git rebase --abort
# Reset to before sync
git reset --hard ORIG_HEAD
Banned:
git push --force (use --force-with-lease)Required:
--force-with-lease after rebaseExecute a comprehensive code review using specialized review agents.
! git branch --show-current
! git merge-base HEAD main 2>/dev/null || echo "main"
! git diff --name-only $(git merge-base HEAD main 2>/dev/null || echo "HEAD~1") HEAD 2>/dev/null | head -20
Spawn the code-reviewer agent to apply domain-specific checklists:
Task({
subagent_type: "build-mode:code-reviewer",
description: "Apply domain checklists",
prompt: `Review the following files for code quality:
Files: ${ARGUMENTS || "changed files on current branch"}
Apply relevant domain checklists:
- Frontend (React patterns, accessibility, data fetching)
- API (input validation, error responses, auth)
- Data layer (schemas, transactions, indexes)
- Testing (behavior focus, realistic data, coverage)
Report findings with priorities (P1: must fix, P2: should fix, P3: nice to have).`
})
Spawn the quality-reviewer agent for 3-pass quality analysis:
Task({
subagent_type: "build-mode:quality-reviewer",
description: "Review code quality",
prompt: `Review code quality for:
Files: ${ARGUMENTS || "changed files on current branch"}
3-pass review:
1. Style - naming, formatting, magic numbers
2. Patterns - DRY, single responsibility, abstraction level
3. Maintainability - change impact, dependencies, testability
Only report issues with 80%+ confidence. Distinguish must-fix from nice-to-have.`
})
Spawn the security-reviewer agent for security audit:
Task({
subagent_type: "build-mode:security-reviewer",
description: "Security audit",
prompt: `Security review for:
Files: ${ARGUMENTS || "changed files on current branch"}
Check against OWASP Top 10:
- Injection vulnerabilities (SQL, XSS, command)
- Authentication/authorization issues
- Cryptographic failures
- Security misconfigurations
- Hardcoded secrets
Report P0 (critical), P1 (high), P2 (medium) issues.`
})
Spawn the silent-failure-hunter agent to check error handling:
Task({
subagent_type: "build-mode:silent-failure-hunter",
description: "Check error handling",
prompt: `Hunt for silent failures in:
Files: ${ARGUMENTS || "changed files on current branch"}
Find:
- Empty catch blocks
- Silent returns on error
- Broad exception catching
- Missing error propagation
- Swallowed rejections
Classify: P0 (must fix), P1 (should fix), P2 (consider).`
})
After all reviews complete, aggregate findings:
## Review Summary
### Critical Issues (P0)
[List all P0 issues from all reviewers]
### High Priority (P1)
[List all P1 issues]
### Medium Priority (P2)
[List all P2 issues]
### Low Priority (P3)
[List all P3 issues]
### Verdict: [PASS / NEEDS FIXES]
- Pass: No P0 issues, P1 issues are minor
- Needs Fixes: Any P0 issues or multiple P1 issues
For targeted reviews, use arguments:
--security-only - Only security-reviewer--quality-only - Skip security and error handling--quick - Only code-reviewer with reduced scopeBanned:
Required:
Fix all unresolved PR review comments and CI failures with educational feedback.
! git branch --show-current
! git status --short
! gh pr view --json number,title,state,reviewDecision 2>/dev/null || echo "No PR found"
! gh pr checks 2>/dev/null | head -20 || echo "No checks"
# Get unresolved review threads (uses GraphQL API - reviewThreads field doesn't exist in gh pr view)
! .agents/skills-local/git-workflow/scripts/get-unresolved-threads.sh 2>/dev/null | head -30 || echo "No unresolved threads"
Extract from the data above:
For each unresolved thread or CI failure:
Before pushing, verify locally:
bun run lint
bun run test
bun run ci # if available
Use single responsibility - delegate to commit-push:
Skill({ skill: "git-workflow", args: "commit-push fix: address PR review comments" })
Or manually:
git add -A
git commit -m "fix: address PR review comments"
git push --force-with-lease
After successful push, trigger e2e tests:
Skill({ skill: "git-workflow", args: "run-e2e" })
This removes and re-adds the run-playwright-tests label to trigger a fresh CI run.
For EACH unresolved thread, provide feedback using symbols:
Resolve thread via GraphQL:
# Get thread IDs from context (already fetched above) or fetch again
THREADS=$(.agents/skills-local/git-workflow/scripts/get-unresolved-threads.sh)
THREAD_ID=$(echo "$THREADS" | jq -r '.id' | head -1)
# Resolve the thread
.agents/skills-local/git-workflow/scripts/resolve-thread.sh "$THREAD_ID"
Example feedback patterns:
[checkmark] Good catch! The null check was missing. Fixed in abc123.
[half-circle] Valid concern but useMemo is premature here since component rarely re-renders. Added comment explaining tradeoff.
[x] This pattern is intentional for TypeScript discriminated unions. The 'redundant' check enables type narrowing. Added clarifying comment.
.agents/skills-local/git-workflow/scripts/count-unresolved-threads.sh
Should return 0.
If CI fails after push:
gh pr checks --watchMax 3 CI retry iterations before escalating.
Banned:
Required:
Update an existing PR's title and body based on current commits.
! gh pr view --json number,title,baseRefName 2>/dev/null || echo "No PR found"
! git log origin/main..HEAD --oneline 2>/dev/null | head -10
! git diff --stat origin/main 2>/dev/null | tail -5
PR_NUM=$(gh pr view --json number -q '.number' 2>/dev/null)
[[ -z "$PR_NUM" ]] && echo "ERROR: No PR found for current branch"
If no PR found -> stop and instruct to use /pr first.
Fetch current PR body and identify preserved sections:
gh pr view --json body -q '.body'
Parse for preserved content:
# User description blockUse Full Regenerate mode if:
--regenerate flag is passed, OROtherwise use Incremental Update mode.
BASE=$(gh pr view --json baseRefName -q '.baseRefName')
git log origin/${BASE}..HEAD --pretty=format:"%s" | head -20
git diff --stat origin/${BASE}
type(scope): summary of changesFor Incremental Update:
## Commits with current commit list## Files Changed with current diff statFor Full Regenerate:
Include plan if available:
PLAN_FILE=$(ls -t ~/.claude/plans/*.md 2>/dev/null | head -1)
[[ -n "$PLAN_FILE" ]] && PLAN_CONTENT=$(cat "$PLAN_FILE")
gh pr edit $PR_NUM --title "type(scope): description"
gh pr edit $PR_NUM --body "$(cat <<'EOF'
[assembled body]
EOF
)"
gh pr view --json url -q '.url'
## Summary
- Brief description of changes
## Commits
- list of commits
## Files Changed
- diff stat
<details>
<summary>Implementation Plan</summary>
[Plan content if available]
</details>
Banned:
--regenerateRequired:
--regenerate or body is broken--regenerate)Create a conventional commit and push to remote. This command delegates to commit and push for single responsibility.
! git branch --show-current
! git status --short
! git log origin/$(git branch --show-current 2>/dev/null)..HEAD --oneline 2>/dev/null || echo "New branch"
Delegate to commit command:
Skill({ skill: "git-workflow", args: "commit $ARGUMENTS" })
This will:
git add -ADelegate to push command:
Skill({ skill: "git-workflow", args: "push" })
This will:
-u flag for new branchesIf delegation is not available, execute directly:
# Stage all changes
git add -A
# Commit
git commit -m "$(cat <<'EOF'
type(scope): description
- Change details
EOF
)"
# Push
BRANCH=$(git branch --show-current)
git push -u origin "$BRANCH" || git push
Banned:
--force instead of --force-with-leaseRequired:
Clean up local branches that have been deleted from the remote repository.
! git fetch --prune 2>&1 | head -5
! git branch -vv | grep ': gone]' | awk '{print $1}' || echo "No gone branches"
! git branch --list | wc -l
# Fetch and prune stale remote-tracking branches
git fetch --prune
# List branches with their tracking status
git branch -vv
# Find branches marked as [gone]
git branch -vv | grep ': gone]' | awk '{print $1}'
# Delete a gone branch
git branch -D <branch-name>
# Fetch and prune
git fetch --prune
# Get list of gone branches
GONE_BRANCHES=$(git branch -vv | grep ': gone]' | awk '{print $1}')
if [ -z "$GONE_BRANCHES" ]; then
echo "No branches to clean up"
exit 0
fi
echo "Branches to remove:"
echo "$GONE_BRANCHES"
# Remove each branch
for branch in $GONE_BRANCHES; do
# Check for associated worktree
WORKTREE=$(git worktree list | grep "$branch" | awk '{print $1}')
if [ -n "$WORKTREE" ]; then
echo "Removing worktree: $WORKTREE"
git worktree remove "$WORKTREE" --force
fi
echo "Deleting branch: $branch"
git branch -D "$branch"
done
echo "Cleanup complete"
| Status | Meaning | Action |
|---|---|---|
[gone] | Remote branch deleted | Delete local branch |
[ahead X] | Local commits not pushed | Keep (warn user) |
[behind X] | Remote has new commits | Keep |
This command only deletes branches where:
[gone] by gitIt will NOT delete:
Banned:
Required:
Trigger e2e tests on CI by toggling the run-playwright-tests label on the current PR.
! git branch --show-current
! gh pr view --json number,title 2>/dev/null || echo "No PR found"
run-playwright-tests if present (silently ignore if not)run-playwright-tests to trigger fresh e2e runPR_NUM=$(gh pr view --json number -q '.number' 2>/dev/null)
if [[ -z "$PR_NUM" ]]; then
echo "ERROR: No PR found for current branch"
exit 1
fi
# Remove then add to ensure fresh trigger
gh pr edit "$PR_NUM" --remove-label "run-playwright-tests" 2>/dev/null || true
gh pr edit "$PR_NUM" --add-label "run-playwright-tests"
echo "E2E tests triggered for PR #$PR_NUM"
Required: