Create PR
Creates a pull request from the current feature branch with a structured summary, test results, and change description. Closes the pipeline loop: init -> build-feature -> create-pr.
When to use
- After completing a feature with
/build-feature
- When you have changes on a feature branch ready for review
- To create a well-structured PR without manual formatting
Usage
/create-pr
Process
Step 1 -- Verify branch state
- Confirm you are NOT on
main or develop -- refuse to create PR from default branches
- Run
git status to check for uncommitted changes -- if any, warn the user and ask whether to commit first
- Run
git log main..HEAD --oneline to get the list of commits that will be in the PR
- If there are no commits ahead of main, report that there is nothing to PR
Step 2 -- Gather context
Collect the information needed for the PR description:
- Commits:
git log main..HEAD --oneline -- list of all commits on this branch
- Diff summary:
git diff main..HEAD --stat -- files changed with line counts
- Test results: Run project tests (e.g.,
npm test) and capture pass/fail
- Lint results: Run project lint (e.g.,
npm run lint) and capture pass/fail
- Branch name: Extract feature name from the branch (e.g.,
feature/dark-mode -> dark-mode)
If tests or lint fail, warn the user but allow them to proceed (some PRs are draft/WIP).
Step 3 -- Generate PR description
Build a structured PR description:
## Summary
[2-4 bullet points describing what this PR does, derived from commit messages]
## Changes
[File-level summary from git diff --stat]
## Test plan
- [x] Tests: [pass/fail] ([count] tests)
- [x] Lint: [pass/fail]
- [ ] [Any manual verification steps if applicable]
Step 4 -- Create the PR
- Push the branch to origin:
git push -u origin [branch-name]
- Create the PR using
gh pr create:
- Title: derived from branch name or first commit message (max 70 chars)
- Body: the generated description from Step 3
- Base:
main (or the project's default branch)
- Report the PR URL to the user
Step 5 -- Post-creation
- Display the PR URL
- Suggest next steps:
- "Request review from a teammate"
- "Run
/code-review for an AI code review"
- "Merge when ready with
gh pr merge [number]"
Example Session
User: /create-pr
Checking branch state...
Branch: feature/dark-mode (4 commits ahead of main)
Tests: 82 passed, 0 failed
Lint: 0 errors
Creating PR...
PR #42: "feat: add dark mode toggle to settings"
https://github.com/org/repo/pull/42
Next steps:
- Request review from a teammate
- Run /code-review for AI code review
- Merge when ready
Notes
- The PR title should be concise (under 70 characters) and follow conventional commits format when the project uses it
- If the branch has
wip: commits from build-feature checkpoints, consider squashing them before creating the PR
- This skill does NOT merge the PR -- that is a manual step or a separate command
1---2name: create-pr3description: "Create a pull request from the current branch with structured summary"4user-invocable: true5workflow:6 version: 17 steps:8 - id: verify-branch9 role: system10 intent: "Verify not on main/develop, check for uncommitted changes, get commits ahead of main."11 produces: [branch-name, branch-state, commit-list]12 - id: gather-context13 role: system14 intent: "Collect diff stats, run tests and lint for PR description context."15 requires: [branch-state]16 produces: [diff-summary, test-result, lint-result]17 - id: generate-description18 role: system19 intent: "Build structured PR description from commits, diff stats, and test results."20 requires: [commit-list, diff-summary, test-result, lint-result]21 produces: [pr-description, pr-title]22 gate: true23 - id: create-pr24 role: system25 intent: "Push branch to origin and create PR via gh CLI."26 requires: [pr-description, pr-title, branch-name]27 produces: [pr-url]28 - id: post-creation29 role: system30 intent: "Display PR URL and suggest next steps."31 requires: [pr-url]32 produces: [summary]33 gate: true34metadata:35 source: https://skillmd.com/skills/guild-agents/create-pr36---3738# Create PR3940Creates a pull request from the current feature branch with a structured summary, test results, and change description. Closes the pipeline loop: init -> build-feature -> create-pr.4142## When to use4344- After completing a feature with `/build-feature`45- When you have changes on a feature branch ready for review46- To create a well-structured PR without manual formatting4748## Usage4950`/create-pr`5152## Process5354### Step 1 -- Verify branch state55561. Confirm you are NOT on `main` or `develop` -- refuse to create PR from default branches572. Run `git status` to check for uncommitted changes -- if any, warn the user and ask whether to commit first583. Run `git log main..HEAD --oneline` to get the list of commits that will be in the PR594. If there are no commits ahead of main, report that there is nothing to PR6061### Step 2 -- Gather context6263Collect the information needed for the PR description:64651. **Commits**: `git log main..HEAD --oneline` -- list of all commits on this branch662. **Diff summary**: `git diff main..HEAD --stat` -- files changed with line counts673. **Test results**: Run project tests (e.g., `npm test`) and capture pass/fail684. **Lint results**: Run project lint (e.g., `npm run lint`) and capture pass/fail695. **Branch name**: Extract feature name from the branch (e.g., `feature/dark-mode` -> `dark-mode`)7071If tests or lint fail, warn the user but allow them to proceed (some PRs are draft/WIP).7273### Step 3 -- Generate PR description7475Build a structured PR description:7677```markdown78## Summary79[2-4 bullet points describing what this PR does, derived from commit messages]8081## Changes82[File-level summary from git diff --stat]8384## Test plan85- [x] Tests: [pass/fail] ([count] tests)86- [x] Lint: [pass/fail]87- [ ] [Any manual verification steps if applicable]88```8990### Step 4 -- Create the PR91921. Push the branch to origin: `git push -u origin [branch-name]`932. Create the PR using `gh pr create`:94 - Title: derived from branch name or first commit message (max 70 chars)95 - Body: the generated description from Step 396 - Base: `main` (or the project's default branch)973. Report the PR URL to the user9899### Step 5 -- Post-creation1001011. Display the PR URL1022. Suggest next steps:103 - "Request review from a teammate"104 - "Run `/code-review` for an AI code review"105 - "Merge when ready with `gh pr merge [number]`"106107## Example Session108109```text110User: /create-pr111112Checking branch state...113Branch: feature/dark-mode (4 commits ahead of main)114Tests: 82 passed, 0 failed115Lint: 0 errors116117Creating PR...118PR #42: "feat: add dark mode toggle to settings"119https://github.com/org/repo/pull/42120121Next steps:122- Request review from a teammate123- Run /code-review for AI code review124- Merge when ready125```126127## Notes128129- The PR title should be concise (under 70 characters) and follow conventional commits format when the project uses it130- If the branch has `wip:` commits from build-feature checkpoints, consider squashing them before creating the PR131- This skill does NOT merge the PR -- that is a manual step or a separate command