Back to Skills

create-pull-request

pjt222
Updated 2 days ago
2 views
17
2
17
View on GitHub
Metawordaiautomation

About

This Claude Skill automates creating and managing GitHub pull requests using the GitHub CLI. It handles branch preparation, crafting PR titles/descriptions, creating the PR, and managing review/merge workflows. Use it when proposing changes from a feature branch for review or merging completed work into main.

Quick Install

Claude Code

Recommended
Primary
npx skills add pjt222/agent-almanac -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternative
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-pull-request

Copy and paste this command in Claude Code to install this skill

Documentation

Create Pull Request

GitHub PR w/ clear title + structured desc + branch setup.

Use When

  • Feature/fix branch → review
  • Merge completed → main
  • Req code review
  • Doc purpose + scope of changes

In

  • Required: Feature branch w/ committed changes
  • Required: Base branch (usually main)
  • Optional: Reviewers
  • Optional: Labels / milestone
  • Optional: Draft status

Do

Step 1: Branch Ready

Verify up-to-date + all committed:

# Check for uncommitted changes
git status

# Fetch latest from remote
git fetch origin

# Rebase on latest main (or merge)
git rebase origin/main

Got: Branch ahead of origin/main, no uncommit, no conflicts.

If err: Rebase conflicts → resolve (see resolve-git-conflicts) → git rebase --continue. Diverged → git merge origin/main.

Step 2: Review Changes

Full diff + commit history:

# See all commits on this branch (not on main)
git log origin/main..HEAD --oneline

# See the full diff against main
git diff origin/main...HEAD

# Check if branch tracks remote and is pushed
git status -sb

Got: All commits PR-relevant. Diff = intended changes only.

If err: Unrelated commits → interactive rebase → clean up history pre-PR.

Step 3: Push Branch

# Push branch to remote (set upstream tracking)
git push -u origin HEAD

Got: Branch on GitHub remote.

If err: Rejected → git pull --rebase origin <branch> + resolve.

Step 4: Title + Desc

Title <70 chars. Body for details:

gh pr create --title "Add weighted mean calculation" --body "$(cat <<'EOF'
## Summary
- Implement `weighted_mean()` with NA handling and zero-weight filtering
- Add input validation for mismatched vector lengths
- Include unit tests covering edge cases

## Test plan
- [ ] `devtools::test()` passes with no failures
- [ ] Manual verification with example data
- [ ] Edge cases: empty vectors, all-NA weights, zero-length input

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

Draft:

gh pr create --title "WIP: Add authentication" --body "..." --draft

Got: PR on GitHub + URL. Desc = what changed + how to test.

If err: gh not auth → gh auth login. Wrong base → --base main.

Step 5: Review Feedback

Respond + push:

# View PR comments
gh api repos/{owner}/{repo}/pulls/{number}/comments

# View PR review status
gh pr checks

# After making changes, commit and push
git add <files>
git commit -m "$(cat <<'EOF'
fix: address review feedback on input validation

EOF
)"
git push

Got: New commits on PR. Comments addressed.

If err: CI fail post-push → gh pr checks → fix pre-rereq.

Step 6: Merge + Cleanup

Post-approval:

# Merge the PR (squash merge keeps history clean)
gh pr merge --squash --delete-branch

# Or merge with all commits preserved
gh pr merge --merge --delete-branch

# Or rebase merge (linear history)
gh pr merge --rebase --delete-branch

Update local main:

git checkout main
git pull origin main

Got: PR merged, remote branch deleted, local main updated.

If err: Blocked by fail checks / missing approvals → address first. No force-merge w/o resolve.

Check

  • Title <70 chars + descriptive
  • Body: summary + test plan
  • All commits PR-relevant
  • CI passes
  • Branch up-to-date vs base
  • Reviewers assigned (if req)
  • No sensitive data

Traps

  • PR too large: Focus 1 feat/fix. Large → hard review + merge conflicts.
  • No test plan: Always describe verify, even docs.
  • Stale branch: Base moved ahead → rebase pre-PR → min conflicts.
  • Force-push during review: Avoid on branch w/ open comments. Push new → incremental visible.
  • Ignoring CI: Check gh pr checks pre-rereq. Fail CI = waste reviewers.
  • Branch not deleted: Use --delete-branch → remote clean.

  • commit-changes — PR commits
  • manage-git-branches — branch create + naming
  • resolve-git-conflicts — rebase/merge conflicts
  • create-github-release — release post-merge

GitHub Repository

pjt222/agent-almanac
Path: i18n/caveman-ultra/skills/create-pull-request
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

polymarket

Meta

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

View skill

creating-opencode-plugins

Meta

This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill