Create Pr

Create or update GitHub pull requests using gh. Use when the user asks for a PR, or to open/update a pull request after branch work is ready.

Tsurai7 1024d5c 1.0 KB Updated

File contents

Create pull request

Use gh for all GitHub PR tasks. The PR describes all commits on the branch since it diverged from base — not only the latest.

Before creating

Run in parallel:

  • git status — untracked files
  • git diff — staged and unstaged
  • Branch tracking vs remote (git status / git branch -vv)
  • git log and git diff [base]...HEAD — full branch history since diverging from base

Create PR

  1. Push if needed: git push -u origin HEAD (requires network permission)
  2. Create:
gh pr create --title "title" --body "$(cat <<'EOF'
## Summary
- ...

## Test plan
- [ ] ...

EOF
)"
  1. Return the PR URL to the user.

Rules

  • NEVER update git config
  • Push only the current branch; never force-push
  • Use HEREDOC for body formatting
  • Complete sentences in title and summary

Tsurai7/agentic-playbook/tree/main/skills/create-pr commit 1024d5ca0a

Frequently asked questions

npx skillmds@latest add tsurai7/create-pr