# Pr Open

> Open a GitHub PR for the current branch. Generates a title and description from the diff, and respects the repo's PULL_REQUEST_TEMPLATE if one exists.

- Skill: `driangle/pr-open` (Agent Skill)
- Install (CLI): `npx skillmds@latest add driangle/pr-open`
- Raw SKILL.md: https://api.skillmd.com/api/skills/driangle/pr-open/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: driangle (https://skillmd.com/u/driangle)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/driangle/pr-open

---


1. Detect the base branch via `git remote show origin | grep 'HEAD branch'`. Run in parallel:
   - `git diff <base> --name-only` and `git diff <base>` to understand changes
   - `git log <base>..HEAD --oneline` to see commit history
   - `git status` to check for uncommitted changes
   - `git log @{u}..HEAD --oneline 2>/dev/null` to check if the branch needs pushing
   - Check for `.github/PULL_REQUEST_TEMPLATE.md` or `.github/PULL_REQUEST_TEMPLATE/` directory

2. If there are uncommitted changes, ask the user whether to commit them first or proceed without them.

3. If the branch needs pushing, push it with `git push -u origin HEAD`. **Never force-push. Never push to the main/master branch.**

4. Review all changes (all commits since base) and draft:
   - A short PR title (under 70 characters)
   - A brief description (2-4 sentences or 3-5 bullets max) covering what changed and why. Skip restating the title, low-value details, and obvious implementation notes.

5. Build the PR body:
   - **If a PR template exists:** Fill in the description/summary section. Preserve all other sections and placeholders from the template.
   - **If no template:** Use a simple body with a `## Summary` section. Keep it tight — no filler headings, no "Test plan" unless there's something non-obvious to call out.

6. Create the PR using `gh pr create` with a HEREDOC for the body:
   ```
   gh pr create --title "the pr title" --body "$(cat <<'EOF'
   <body content here>
   EOF
   )"
   ```

7. Output the PR URL when done.

