|
| 1 | +--- |
| 2 | +name: create-pr |
| 3 | +description: Create a pull request with a clear, concise description that follows the repository's current PR template. Use when asked to open a PR or prepare its title and description. |
| 4 | +--- |
| 5 | + |
| 6 | +# Create PR |
| 7 | + |
| 8 | +Write for busy developers: make the change and its purpose clear before adding detail. |
| 9 | + |
| 10 | +## Read the current template |
| 11 | + |
| 12 | +- Find and read the repository's applicable PR template every time, including HTML comments, linked guidelines, and contribution instructions. Check the repository root, `.github/`, and `docs/`, including template directories. If several templates exist, choose the one that fits the change. |
| 13 | +- Use the template's current sections, order, length limits, and checklist instructions. Do not copy its structure into this skill or reuse a remembered version. |
| 14 | +- Prefer the actual current PR template over stale copies of its structure in other guidance; still follow any compatible contribution rules. |
| 15 | +- If no local template exists, check the target repository and its shared GitHub defaults. If none exists, use a compact structure suited to the change and say that no template was found. |
| 16 | +- Inspect the full diff against the intended base branch and the relevant issue context. Describe the final change, not the sequence of work or abandoned approaches. |
| 17 | + |
| 18 | +## Write the description |
| 19 | + |
| 20 | +Fit the following content into the template's appropriate sections rather than adding a fixed set of headings: |
| 21 | + |
| 22 | +- Start the narrative with a short summary of what changed and why it matters. If the template starts with links or metadata, preserve that order and lead the first explanatory section with the summary. |
| 23 | +- Use short sentences, simple English, and concrete behavior. Put deeper technical detail later, only where the template permits it and reviewers need it. |
| 24 | +- For a bug fix, include the setup and steps to reproduce the original issue, the expected behavior, the observed behavior before the fix, and how the fix closes that gap. Keep these distinct even when expressed in a compact example. Do not claim to have reproduced an issue unless you did; label unverified steps. |
| 25 | +- Include brief notes on the implementation approach: the key decision and how it produces the intended behavior. Mention tradeoffs or consequences only when they affect review or users. |
| 26 | +- Consider a few small diagrams or code examples when they explain reproduction, before/after behavior, the approach, or consequences more clearly than prose. Prefer focused snippets or Mermaid diagrams; omit visuals that only repeat the text. Respect the template's length limits. |
| 27 | +- Do not add a validation or verification section, command logs, or a list of checks or tests run. You may briefly mention tests added to the codebase and the behavior they cover. This restriction concerns the description; still perform repository-required checks. |
| 28 | +- Preserve required checklist items and mark them truthfully. If the template explicitly requires a validation section or execution results, retain its required heading or field but omit the command/test-run report, following the user's preference. Explain that specific conflict to the user outside the PR. |
| 29 | + |
| 30 | +## Link related work |
| 31 | + |
| 32 | +- Include relevant issues and related PRs in the template's link section or the closest existing section. If it has no suitable section, add a small links section only if its guidelines allow it. |
| 33 | +- Include any Linear ticket supplied with the request in that section. Use its supplied URL, or resolve its identifier through available context or tools; never invent a workspace URL. |
| 34 | +- Use closing keywords only for issues this PR actually resolves. Label other issues, tickets, and PRs as related work or dependencies rather than implying that they will close. |
| 35 | +- Do not invent links or issue numbers. If a required link cannot be resolved, ask for the missing information; when no related work is known, follow the template's convention for an empty field. |
| 36 | + |
| 37 | +## Create the PR |
| 38 | + |
| 39 | +- Confirm the intended repository, base branch, and change scope from the task and repository context. Respect whether the user requested a draft or a ready PR. |
| 40 | +- When opening a PR is requested, carry it through using the available GitHub tools or `gh`. If only a description is requested, return the draft without publishing it. Commit or push only within the user's authorization and exclude unrelated changes. |
| 41 | +- Before publishing, compare the finished description with every template section and instruction. Confirm that claims match the diff, links are accurate, and no placeholders remain. |
| 42 | +- With `gh`, write the exact Markdown to a temporary file and use `--body-file` to preserve newlines and literal code. |
| 43 | +- Check for an existing PR for the branch before creating one. If creation has an ambiguous result, check whether it succeeded before retrying to avoid duplicates. Report unresolved authentication or permission failures instead of repeatedly retrying. |
| 44 | +- Return the PR link and ask the user to review it. Keep execution results and any blockers in the task response, outside the PR description. |
0 commit comments