Agent skill
git-pr
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/git-pr
SKILL.md
Variables
TO_BRANCH: $1 (defaults to main)
FROM_BRANCH: $2 (defaults to current branch)
Workflow
Step 1: Ensure remote is synced
git fetch origin
git push -u origin HEAD # Push current branch if not pushed
Step 2: Analyze REMOTE diff (CRITICAL)
IMPORTANT: Always compare REMOTE branches, not local:
# Get commits between remote branches (what PR will actually contain)
git log origin/{TO_BRANCH}...origin/{FROM_BRANCH} --oneline
# Get file diff between remote branches
git diff origin/{TO_BRANCH}...origin/{FROM_BRANCH} --stat
git diff origin/{TO_BRANCH}...origin/{FROM_BRANCH}
DO NOT use:
git diff {TO_BRANCH}...HEAD(includes unpushed local changes)git diff --cached(staged local changes)git status(local working tree state)
Step 3: Generate PR content from remote diff
Based on the REMOTE diff analysis:
- Title: Conventional commit format from the primary change (no version/release numbers)
- Body: Summary of changes that exist ON REMOTE, not local WIP
Step 4: Create PR
gh pr create --base {TO_BRANCH} --head {FROM_BRANCH} --title "..." --body "..."
Notes
- If
ghcommand is not available, instruct the user to install and authorize GitHub CLI first. - If local has unpushed commits, push first before analyzing diff.
- PR content must reflect REMOTE state since PRs are based on remote branches.
IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?