git-workflow
Provides a consistent process for committing code, rebasing, and creating pull requests while ensuring upstream synchronization.
Install
mkdir -p .claude/skills/git-workflow-majiayu000 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14404" && unzip -o skill.zip -d .claude/skills/git-workflow-majiayu000 && rm skill.zipInstalls to .claude/skills/git-workflow-majiayu000
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.Key capabilities
- →Commit and push changes to a Git repository
- →Fetch updates from an upstream or origin remote
- →Rebase a feature branch onto the latest main branch
- →Resolve merge conflicts during a rebase operation
- →Create pull requests to a specified repository
- →Merge pull requests with rebase and delete the branch
How it works
This skill guides through Git operations like committing, fetching, rebasing, and creating pull requests, ensuring that feature branches are up-to-date with the main branch before submission.
Inputs & outputs
When to use git-workflow
- →Rebase branch on main
- →Create pull request
- →Resolve git merge conflicts
About this skill
Git Workflow
Committing Work
cd ~/Code/community-patterns
git add patterns/$GITHUB_USER/pattern.tsx
git commit -m "Add pattern: description"
git push origin main
Getting Updates (Already done in Step 1)
git fetch upstream
git pull --rebase upstream main
git push origin main
Sharing Work Upstream (Creating Pull Requests)
IMPORTANT: Wait for user to tell you to create a PR. Don't push or create PRs automatically.
Before creating any PR, you MUST update from main and rebase your branch:
Step 0: Update and Rebase Before Creating PR
Use cached repository type from workspace config:
# Read IS_FORK from .claude-workspace (set during Step 2)
IS_FORK=$(grep "^is_fork=" .claude-workspace | cut -d= -f2)
# Determine which remote to use
if [ "$IS_FORK" = "true" ]; then
echo "Working on fork - will fetch from upstream"
MAIN_REMOTE="upstream"
else
echo "Working on main repo - will fetch from origin"
MAIN_REMOTE="origin"
fi
Then fetch latest main and rebase your branch:
# Fetch latest main
git fetch $MAIN_REMOTE
# Rebase current branch on top of main
git rebase $MAIN_REMOTE/main
# If rebase succeeds, push (force-with-lease if on feature branch)
if [ "$(git branch --show-current)" != "main" ]; then
git push origin $(git branch --show-current) --force-with-lease
else
git push origin main
fi
If rebase has conflicts:
- Show conflict files:
git status - Help resolve conflicts
- Continue:
git rebase --continue - Then push
Why this matters:
- Ensures your PR is based on the latest main
- Avoids merge conflicts during PR review
- Makes PR review easier
If User Has Their Own Fork (Most Common)
When user wants to contribute patterns from their fork to upstream:
Step 1: Ensure changes are committed and pushed to their fork
cd ~/Code/community-patterns
git status # Verify all changes are committed
git push origin main
Step 2: Update and rebase (see Step 0 above)
Step 3: Create pull request to upstream
gh pr create \
--repo jkomoros/community-patterns \
--title "Add: pattern name" \
--body "$(cat <<'EOF'
## Summary
- Brief description of the pattern
- Key features
- Use cases
## Testing
- [x] Pattern compiles without errors
- [x] Tested in browser at http://localhost:8000
- [x] All features working as expected
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
If Working Directly on jkomoros/community-patterns
CRITICAL: When working directly on the upstream repository, you MUST use branches and PRs. Direct pushes to main are NOT allowed.
Step 1: Create feature branch
cd ~/Code/community-patterns
git checkout -b username/feature-name
Step 2: Commit and push branch
git add patterns/$GITHUB_USER/
git commit -m "Add: pattern name"
git push origin username/feature-name
Step 3: Update and rebase (see Step 0 above)
Step 4: Create pull request
gh pr create \
--title "Add: pattern name" \
--body "$(cat <<'EOF'
## Summary
- Brief description
## Testing
- [x] Tested and working
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Step 5: Merge with rebase (when approved)
gh pr merge PR_NUMBER --rebase --delete-branch
Important Notes
- Always wait for user permission before creating PRs
- All PRs are merged with
--rebase(NOT--squashor--merge) - This preserves individual commit history
- Commit frequently locally, but only create PR when user asks
- PRs will be reviewed before merging to upstream
- After merge, everyone gets your patterns automatically on next update
When not to use it
- →When the user does not want to interact with Git or GitHub
- →When the task does not involve version control operations
- →When the user explicitly states not to create pull requests
Limitations
- →Requires user permission before creating pull requests
- →All pull requests are merged with `--rebase`
- →Direct pushes to main are not allowed when working directly on the upstream repository
How it compares
This skill enforces a specific Git workflow, including rebasing before PR creation and merging with rebase, which differs from simpler workflows that might use merge commits and not prioritize a clean history.
Compared to similar skills
git-workflow side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| git-workflow (this skill) | 0 | 3mo | Review | Intermediate |
| github-workflow-automation | 11 | 2mo | Review | Advanced |
| testing-workflow | 16 | 9mo | Review | Intermediate |
| github-actions-templates | 7 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by majiayu000
View all by majiayu000 →You might also like
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.
github-actions-templates
wshobson
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
create-pr
n8n-io
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
gh-fix-ci
openai
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.