| name | write-pr |
| description | Generate PR title, body, and labels from commits since the base branch, then create the PR on GitHub. Handles base branch detection, label selection, and PR creation end-to-end. |
| allowed-tools | Bash(git *:*), Bash(bash *create-pr.sh:*), Bash(cat *:*), Read, Write |
Step 1 โ Gather Context
git branch --show-current
git log origin/develop..HEAD --oneline 2>/dev/null || git log --oneline -15
git diff origin/develop...HEAD --stat 2>/dev/null || git diff HEAD~5...HEAD --stat
git diff origin/develop...HEAD 2>/dev/null || git diff HEAD~5...HEAD
Also read the PR template:
cat .github/PULL_REQUEST_TEMPLATE.md
Step 2 โ Determine Labels
Read references/labels.md and select 1โ2 appropriate labels based on the nature of the changes.
Read references/commit-conventions.md for commit type and scope naming rules.
Step 3 โ Generate PR Content
Title โ Generate 3 options in the format [scope] description:
- Scope: determine from changed files โ run
sh scripts/discover-domains.sh to get the current domain list, then pick the one matching the changes. Use [global] / [ci/cd] for cross-cutting changes only. Wrap in brackets: [auth], [student], etc.
- Description: Korean, concise, no emojis, max 50 characters total
- Wrap class names, method names, annotations, and technical terms in backticks (e.g.,
@Transactional, StudentServiceImpl)
Body โ Follow the .github/PULL_REQUEST_TEMPLATE.md structure:
- Korean ํฉ์ผ์ฒด:
~ํ์์ต๋๋ค, ~๋์์ต๋๋ค, ~์ถ๊ฐํ์์ต๋๋ค
- No emojis
- Max 2500 characters
- Wrap all proper nouns and technical identifiers in backticks: class names, method names, annotations, file names, field names, config keys, module names
Step 4 โ Write Body & Show Preview
Write the body to PR_BODY.md, then display:
## PR ์ ๋ชฉ ํ๋ณด
1. [title1]
2. [title2]
3. [title3]
## ์ ํ๋ ๋ผ๋ฒจ
- label1, label2
## PR ๋ณธ๋ฌธ ๋ฏธ๋ฆฌ๋ณด๊ธฐ
[body content]
Ask the user which title to use (present options 1/2/3). Wait for the answer before proceeding.
Step 5 โ Create PR
Run the creation script with the confirmed title and labels:
bash scripts/create-pr.sh "<confirmed-title>" "PR_BODY.md" "<label1>,<label2>"
After creation, display the PR URL.
Cleanup: remove PR_BODY.md.