Create pr
Create a high-signal GitHub pull request from the current branch. Use when the user invokes /create-pr, asks to create/open a PR, draft a PR description, write PR title/body, or prepare GitHub changes for review.From its SKILL.md
npx -y skills add shiggydoodah/skills --skill create-prAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.2 KB, as published. Nobody here has run it
Create PR
Prepare a GitHub PR that is scoped to the actual branch diff, follows the repo's PR template when one exists, and is useful to reviewers.
Defaults:
- Target GitHub and use
ghfor PR creation. - Create a draft PR unless the user passes
--open/-o, which creates a ready-for-review PR and opens it in the browser. - Base branch:
--base <branch>if given, otherwise the first oforigin/main,main,origin/master,master, or the repo's default branch that exists. - Use
.github/PULL_REQUEST_TEMPLATE.mdat the repo root unless the user passes a different template path.
Flags:
--open/-o: skip the draft — create a ready-for-review PR — and open it in the browser. There is no flag for "ready-for-review but don't open a browser tab" or "draft but open in browser"; ask the user if they need that split.--base <branch>: base branch for the PR (default: see above).
Workflow
-
Check the current branch is eligible:
-
Run
git branch --show-current. If it'smainormaster, stop:Refusing to create a PR from
main/master. Check out or create a feature branch, then re-run/create-pr. -
Run
gh pr list --head <branch> --state all(orgh pr view <branch>). If an open PR already exists for this branch, stop:This branch already has an open PR: <URL>. Nothing to create.
-
If the existing PR is merged, stop:
This branch's PR is already merged: <URL>. Nothing to create.
-
-
Resolve the base branch:
- Use
--base <branch>if the user supplied one. - Otherwise detect the most likely one in this order:
origin/main,main,origin/master,master, then the repository's default branch if available. Use the resolved branch name (without anorigin/prefix) as the value forgh pr create --base. - If none can be detected and no
--basewas given, stop and ask the user for a base branch.
- Use
-
Choose the PR template:
- Default:
.github/PULL_REQUEST_TEMPLATE.mdfrom the repo root. - Explicit path: resolve the supplied Markdown path from the repo root first, then current working directory.
- If no template is found (default or explicit), don't stop — draft the PR body from scratch, structuring it however best fits the change (summary, changes, testing, etc.).
- Default:
-
Inspect the change in parallel:
git status(no-uall)git diffgit diff --stagedgit log <base>..HEADandgit diff <base>...HEAD
-
Draft the body:
- If using a template: keep its section order, required checkboxes, and wording. Remove irrelevant optional sections instead of writing
N/A. Tick only materially affected areas; incidental files do not count. - If not using a template: cover what changed, why, reviewer entry points, material risks, verification, and anything intentionally out of scope.
- Explain the problem and approach, not just a file-by-file listing.
- If using a template: keep its section order, required checkboxes, and wording. Remove irrelevant optional sections instead of writing
-
Draft the title using the repo's style from the template or recent PRs. Prefer a specific, searchable, action-based title under 70 characters with no trailing period.
-
Verification must be truthful. Only mark commands as passing if they were actually run; otherwise use
not run,blocked, orskipped (docs-only; low risk). -
Create the PR:
gh pr create --draft --base "$base" --title "$title" --body-file "$body_file"Omit
--draftwhen--open/-owas passed (ready-for-review). Use--webonly when the user wants manual browser creation.If creation fails (e.g.
ghauth error, no remote, push required first), stop and report the actual error:PR creation failed: <error from
gh>. Fix the issue above, then re-run/create-pr. -
After creation, add suitable existing labels only (
gh label list, thengh pr edit <num> --add-label ...). Common labels:bug,frontend,backend,tooling,config,docs,infra,refactor. -
If
--openwas used, rungh pr view --web.
Output
TITLE:
<title>
PR:
<GitHub URL>