create-pr-jp
SKILL.md
Create PR (JP)
Purpose
- Open a new GitHub PR or update an existing one for the current branch.
- Fill title and body in Japanese (unless AGENTS.md or the repo specifies otherwise).
- Align the description with the repo’s PR template:
.github/pull_request_template.mdordocs/pull_request_template.md(see Procedure for lookup order). - Run
pnpm lint && pnpm testbefore submitting the PR (or the repo’s standard checks per AGENTS.md).
Prerequisites
ghCLI installed, authenticated (gh auth status), and able to act on this repository.- Remote
originpoints at GitHub; the branch exists onorigin(or you will push it in this flow—prefer the push skill for push-only work). - Default base branch is usually
main; use the repo’s default if different (master, etc.).
When to Use
- "PR 作成", "プルリク出して", "create a PR", "更新して" (PR), or similar—when the user wants a GitHub pull request created or updated.
Do Not Use When
- The user only needs a local commit (use commit-jp).
- The user wants commit + push in one flow without focusing on PR copy (use commit-and-push-jp; then optionally use create-pr-jp for the PR).
- The user only needs to push or sync with the remote base branch (use push or pull—this skill does not replace them).
- The goal is only merging or landing an existing PR on the default branch (follow repo / land workflows if defined).
Related Skills
- commit-jp: Stage changes and write a Japanese Conventional Commit before opening a PR when work is not yet committed.
- push: Publish the branch to
originafter commits exist; create-pr-jp assumes the branch is reachable on GitHub. - pull: Merge
origin/main(or the appropriate base) into the current branch when the branch is behind or push was rejected—before pushing and opening/updating the PR. - commit-and-push-jp: Commit and push in one go; use create-pr-jp afterward if the user still needs a PR.
Procedure
- Working tree: If there are uncommitted changes the user wants in the PR, use commit-jp (or commit-and-push-jp if they asked for commit+push). Do not open a PR that should include unstaged work without committing first.
- Sync with base: If the branch is behind the target base or
git pushwould be non-fast-forward, use pull first, then push (or push after pull per repo rules). - Push: Ensure the branch is on
origin(git push/-u origin HEAD). If the user only asked to push, defer to push; if push fails, fix with pull then push again. - Checks: Run
pnpm lint && pnpm test(or project-documented scripts). If checks fail, do not finalize the PR description as “ready” without fixing or noting the gap per repo policy. - Review the change: Use
git diff <base>...HEAD,git log <base>..HEAD, andgit diff <base>...HEAD --statto summarize scope (adapt<base>tomainor the default branch). - Template: Locate a PR body template (use the first path that exists):
.github/pull_request_template.md(GitHub’s usual location), ordocs/pull_request_template.md. If both exist, prefer.github/pull_request_template.mdunless the repo documents otherwise. Replace placeholders and<!-- ... -->comments with concrete content; keep required sections/checklists.
- Create or update:
- If no open PR exists for this branch:
gh pr createwith a Japanese title and body (from template or file). - If an open PR already exists:
gh pr editto update title/body so they match the full branch diff. - If the branch is tied to a closed or merged PR, do not silently reuse it—ask for a new branch (or follow repo policy) before creating a new PR.
- If no open PR exists for this branch:
- Optional: On macOS, if
openis available and the user benefits from it,openthe PR URL fromgh pr view --json url. - Return the PR URL to the user.
Output
- A created or updated GitHub PR with Japanese title and body (unless the repo says otherwise).
- The PR URL in the assistant’s reply.
Usage
Reference flow (adapt main, paths, and flags):
base=main
pnpm lint && pnpm test
git fetch origin
git diff "origin/${base}...HEAD" --stat
git log "origin/${base}..HEAD" --oneline
# If .github/pull_request_template.md or docs/pull_request_template.md exists, draft body from it into a temp file, then:
gh pr create --base "$base" --title "<日本語タイトル>" --body-file /tmp/pr_body.md
# Or update an existing PR:
# gh pr edit --title "..." --body-file /tmp/pr_body.md
gh pr view --json url -q .url
Present Results to User
- Include the PR URL and whether the PR was created or updated.
- Summarize scope in one short paragraph (Japanese if the user prefers Japanese in chat).
- If another skill should have been used first (e.g. commit, push, pull), say so explicitly and what to run next.
Notes
- Title and body must be Japanese unless AGENTS.md (or similar) requires another language.
- Prefer
gh pr create/gh pr editwith--body-filefor multi-line bodies. - Template paths:
.github/pull_request_template.mdordocs/pull_request_template.md(see Procedure if both exist). - Auto-merge or label/reviewer rules: follow project policy (e.g. only when base is
main). - Do not use
git push --forceunless policy allows--force-with-leaseafter an intentional history rewrite.
Troubleshooting
| Situation | Action |
|---|---|
| Uncommitted changes | commit-jp (or commit-and-push-jp) before PR |
Branch not on origin / push rejected |
push; if non-fast-forward, pull then push |
gh auth errors |
Report verbatim; user runs gh auth login |
No template at .github/pull_request_template.md or docs/pull_request_template.md |
Still write a clear Japanese body: summary, test plan, risks |
| PR already closed for this branch | New branch from default + cherry-pick or redo work per repo rules |
Weekly Installs
2
Repository
noblejasper/agent-skillsFirst Seen
Today
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
warp2