@@ -5,15 +5,7 @@ description: Create a pull request from the current branch. Use this instead of
55
66# Create Pull Request Skill
77
8- ## Dispatch
9-
10- If you were dispatched by the controller or by speedrun, continue below.
11- Otherwise, read ` .claude/skills/controller/SKILL.md ` first — it will send
12- you back here with the proper workflow context.
13-
14- ---
15-
16- You are preparing to submit a bug fix as a pull request. This skill provides a
8+ You are preparing to submit changes as a pull request. This skill provides a
179systematic, failure-resistant process for getting code from the working directory
1810into a PR. It handles the common obstacles: authentication, fork workflows,
1911remote configuration, and cross-repo PR creation.
@@ -27,7 +19,7 @@ fallback ladder at the bottom of this file.
2719
2820## Your Role
2921
30- Get the bug fix changes submitted as a draft pull request. Handle the full
22+ Get the changes submitted as a draft pull request. Handle the full
3123git workflow: branch, commit, push, and PR creation. When steps fail, follow
3224the documented recovery paths instead of guessing.
3325
@@ -59,7 +51,7 @@ These are determined during pre-flight checks. Record each value as you go.
5951| ` FORK_OWNER ` | Step 3: owner portion of fork's ` nameWithOwner ` , or ` GH_USER ` if newly created | ` jsmith ` |
6052| ` FORK_REMOTE ` | Step 4: the git remote name pointing to the fork | ` fork ` / ` origin ` |
6153| ` REPO ` | The repository name (without owner) | ` myproject ` |
62- | ` BRANCH_NAME ` | Step 5: the branch you create | ` bugfix /issue-42-null-check ` |
54+ | ` BRANCH_NAME ` | Step 5: the branch you create | ` feature /issue-42-auth-middleware ` |
6355
6456### Step 0: Determine Auth Context
6557
@@ -129,7 +121,7 @@ checks above to set `AUTH_TYPE` and `GH_USER`.
129121
130122### Step 1: Locate the Project Repository
131123
132- The bugfix workflow runs from the workflow directory, but the code changes live
124+ The workflow runs from the workflow directory, but the code changes live
133125in the project repository. Before doing any git work:
134126
135127``` bash
@@ -163,7 +155,7 @@ git config user.email "GH_USER@users.noreply.github.com"
163155```
164156
165157- If missing and ` gh ` is NOT authenticated: set reasonable defaults so commits
166- work. Use ` "bugfix- workflow" ` / ` "bugfix@ workflow.local" ` as placeholders.
158+ work. Use ` "workflow-agent " ` / ` "workflow@agent .local" ` as placeholders.
167159
168160** 2b. Inventory existing remotes:**
169161
@@ -461,13 +453,17 @@ git rebase FORK_REMOTE/DEFAULT_BRANCH
461453git checkout -b BRANCH_NAME
462454```
463455
464- Branch naming conventions:
456+ Branch naming conventions — choose the prefix that matches the work type:
457+
458+ - ` bugfix/issue-NUMBER-SHORT_DESCRIPTION ` — bug fixes
459+ - ` feature/issue-NUMBER-SHORT_DESCRIPTION ` — new features
460+ - ` refactor/SHORT_DESCRIPTION ` — refactoring
461+ - ` docs/SHORT_DESCRIPTION ` — documentation changes
465462
466- - ` bugfix/issue-NUMBER-SHORT_DESCRIPTION ` if there's an issue number
467- - ` bugfix/SHORT_DESCRIPTION ` if there's no issue number
468- - Use kebab-case, keep it under 50 characters
463+ Use kebab-case, keep it under 50 characters. Include the issue number when one
464+ exists.
469465
470- If a branch already exists with the changes (from a prior ` /fix ` phase), use
466+ If a branch already exists with the changes (from a prior phase), use
471467it instead of creating a new one.
472468
473469### Step 6: Stage and Commit
@@ -476,22 +472,25 @@ Stage changes selectively (`git add path/to/files`, not `git add .`), review
476472with ` git status ` , then commit using conventional commit format:
477473
478474``` bash
479- git commit -m " fix (SCOPE): SHORT_DESCRIPTION
475+ git commit -m " TYPE (SCOPE): SHORT_DESCRIPTION
480476
481477DETAILED_DESCRIPTION
482478
483479Fixes #ISSUE_NUMBER"
484480```
485481
486- Use prior artifacts (root cause analysis, implementation notes) to write an
482+ Where ` TYPE ` matches the work: ` fix ` , ` feat ` , ` refactor ` , ` docs ` , ` test ` , etc.
483+
484+ Use prior artifacts (analysis, implementation notes) to write an
487485accurate commit message. Don't make up details.
488486
489487** Include the PR description in the commit body.** When a PR has a single
490488commit, GitHub auto-fills the PR description from the commit message. This
491489ensures the PR form is pre-populated even when ` gh pr create ` fails (a
492- common case for bot environments). If ` artifacts/bugfix/docs/pr-description.md `
493- exists, append its content after the ` Fixes #N ` line. If it doesn't exist,
494- compose a brief PR body from session context (problem, root cause, fix, testing)
490+ common case for bot environments). If a ` docs/pr-description.md ` artifact
491+ exists in the workflow's artifact directory, append its content after the
492+ ` Fixes #N ` line. If it doesn't exist,
493+ compose a brief PR body from session context (problem, approach, testing)
495494and include that instead.
496495
497496### Step 7: Push to Fork
@@ -532,8 +531,8 @@ gh pr create \
532531 --repo UPSTREAM_OWNER/REPO \
533532 --head FORK_OWNER:BRANCH_NAME \
534533 --base DEFAULT_BRANCH \
535- --title " fix (SCOPE): SHORT_DESCRIPTION" \
536- --body-file artifacts/bugfix/ docs/pr-description.md
534+ --title " TYPE (SCOPE): SHORT_DESCRIPTION" \
535+ --body-file docs/pr-description.md
537536```
538537
539538` --head ` must be ` FORK_OWNER:BRANCH_NAME ` format (with the owner prefix) for
@@ -545,8 +544,8 @@ composed from session artifacts.
545544This is a common and expected outcome when running as a GitHub App bot.
546545Do NOT retry, do NOT debug further, do NOT fall back to a patch file. Instead:
547546
548- 1 . ** Write the PR description** to ` artifacts/bugfix/ docs/pr-description.md`
549- (if not already written).
547+ 1 . ** Write the PR description** to ` docs/pr-description.md ` in the
548+ workflow's artifact directory (if not already written).
550549
5515502 . ** Give the user a pre-filled GitHub compare URL** with ` title ` and ` body `
552551 query parameters so the PR form opens fully populated:
@@ -607,7 +606,7 @@ Diagnose it using the Error Recovery table and retry.
607606If ` gh pr create ` fails but the branch is pushed to the fork (this is a
608607** common and expected** outcome when running as a GitHub App bot):
609608
610- 1 . ** Write the PR body** to ` artifacts/bugfix/ docs/pr-description.md`
609+ 1 . ** Write the PR body** to ` docs/pr-description.md ` in the artifact directory
6116102 . ** Provide the compare URL with ` title ` and ` body ` query params** so the
612611 PR form opens fully populated (see Step 8 failure path for format)
6136123 . ** Provide clone-and-checkout commands** for local testing
@@ -627,17 +626,17 @@ If no fork exists and automated forking fails:
627626Only if ALL of the above fail — for example, the user has no GitHub account,
628627or network access is completely blocked:
629628
630- 1 . Generate a patch: ` git diff > bugfix .patch `
631- 2 . Write it to ` artifacts/bugfix/bugfix .patch`
632- 3 . Explain to the user how to apply it: ` git apply bugfix .patch `
629+ 1 . Generate a patch: ` git diff > changes .patch `
630+ 2 . Write it to the workflow's artifact directory as ` changes .patch`
631+ 3 . Explain to the user how to apply it: ` git apply changes .patch `
6336324 . ** Acknowledge this is a degraded experience** and explain what prevented
634633 the normal flow
635634
636635## Output
637636
638637- The PR URL (printed to the user)
639- - Optionally updates ` artifacts/bugfix/ docs/pr-description.md` if it didn't
640- already exist
638+ - Optionally writes ` docs/pr-description.md ` to the artifact directory if
639+ it didn't already exist
641640
642641## Usage Examples
643642
@@ -676,13 +675,13 @@ or network access is completely blocked:
676675
677676## Notes
678677
679- - This skill assumes the bug fix work (code changes, tests) is already done.
680- Run ` /fix ` and ` /test ` first .
681- - If ` /document ` was run, the PR description artifact should already exist at
682- ` artifacts/bugfix/docs/pr-description.md ` . This skill will use it.
683- - If ` /document ` was NOT run , this skill creates a minimal PR body from
684- session context (conversation history, prior artifacts).
685- - The fork workflow is the standard for open source contributions. Even if the
678+ - This skill assumes the implementation work (code changes, tests) is already
679+ done before invoking ` /pr ` .
680+ - If a ` docs/pr-description.md ` artifact already exists in the workflow's
681+ artifact directory, this skill will use it.
682+ - If no PR description artifact exists , this skill creates a minimal PR body
683+ from session context (conversation history, prior artifacts).
684+ - The fork workflow is the standard for open- source contributions. Even if the
686685 user has write access to upstream, using a fork keeps the upstream clean.
687686
688687## When This Phase Is Done
@@ -693,4 +692,5 @@ Report your results:
693692- What was included
694693- Any follow-up actions needed (mark ready for review, add reviewers, etc.)
695694
696- Then announce which file you are returning to (e.g., "Returning to ` .claude/skills/controller/SKILL.md ` ." or "Returning to ` .claude/skills/speedrun/SKILL.md ` for next phase.") and ** re-read that file** for next-step guidance.
695+ Then return to the coordinating skill that dispatched you (if any) and
696+ ** re-read that file** for next-step guidance.
0 commit comments