Pull Request Conventions
Use the pull request structure from the repository. If the repository defines a structure, do not replace it.
Locale
Before you draft a pull request, resolve its language:
- If project instructions specify a pull request language, use that language.
- If project instructions do not specify a language, use the resolved
pull-requestskey from the context. - If the context has no resolved keys, read the first existing locale file.
- Use this file order: local, project, user, and bundled
LOCALE.default.md. - Use
<absolute-git-dir>/rules-for-ai/LOCALE.mdfor the local file. - Use
<repo>/.rules-for-ai/LOCALE.mdfor the project file. - Use
${XDG_CONFIG_HOME:-${HOME:-}/.config}/rules-for-ai/LOCALE.mdfor the user file. - If no locale file exists, use
en_US. - Use the
pull-requestslanguage for the pull request title and body.
Use the exact section headings from the selected template. For the default structure, always write the headings in English.
If pull-requests is ja_JP, keep the English headings. Write the text below each heading in Japanese.
When to Use
- Before
gh pr create - Before you edit a pull request body with
gh pr edit --body - If the user asks you to draft a pull request
Repository Template (preferred)
Before you draft the body, search for a pull request template in this order:
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE.mdpull_request_template.mdat the repository root- A single
.mdfile under.github/PULL_REQUEST_TEMPLATE/
If a template exists, read it. Use its headings, order, and subsections without changes.
Fill every Markdown ATX heading that the template defines (# through ######).
If the repository has multiple templates, use the template that the user or repository selects.
Default Template (fallback)
If the repository has no pull request template, use this structure:
## Summary
## Motivation
## Changes
## Testing
Default Section Guide
| Section | Purpose |
|---|---|
| Summary | Describe the pull request in one or two sentences. |
| Motivation | Explain the reason for the change. Link the issue with Closes #NNN. |
| Changes | List important changes. |
| Testing | List the commands that you ran and their results. Use real output without mocks or stubs. |
Creating a Pull Request
If the work is not complete, open the pull request as a draft.
If the repository has a template, use that file. If it has no template, use this default structure:
gh pr create --draft --title "<type>: <subject>" --body "$(cat <<'EOF'
## Summary
## Motivation
## Changes
## Testing
EOF
)"
Use the same type for the <type>: <subject> title, branch, and commit. See the hashiiiii-git skill.
Common Mistakes
| Mistake | Fix |
|---|---|
| Ignore the repository template | Read the repository template first. If no template exists, use the default structure. |
| Empty or vague Testing | Add the actual commands and their output. |
| Put Motivation information in Summary | Put the change in Summary. Put its reason and issue link in Motivation. |
| Omit a template section | Include every Markdown ATX heading from the selected template. |
| Change the heading order or names | Keep the exact headings and order from the template. |