Create or update GitHub Pull Requests with the gh CLI, including deciding whether to create a new PR or only push based on existing PR merge status. Use when the user asks to open/create/edit a PR, generate a PR body/template, or says 'PRを出して/PR作成/gh pr'. Defaults: base=develop, head=current branch (same-branch only; never create/switch branches).
/plugin marketplace add akiojin/skills/plugin install github@akiojin-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/pr-body-template.mdCreate or update GitHub Pull Requests with the gh CLI using a detailed body template and strict same-branch rules.
gh pr list --head <head> --state all --json number,state,mergedAt,updatedAt,url,titlemergedAt is null) → push only and finish (do not create a new PR).
mergedAt.Confirm repo + branches
git rev-parse --show-toplevelgit rev-parse --abbrev-ref HEADdevelop unless user specifies.Check existing PR for head branch
mergedAt as the source of truth for "merged".Ensure the head branch is pushed
git push -u origin <head>git pushCollect PR inputs (for new PR or explicit update)
Build PR body from template
references/pr-body-template.md and fill placeholders.Create or update the PR
gh pr create -B <base> -H <head> --title "<title>" --body-file <file>gh pr edit <number> --title "<title>" --body-file <file>Return PR URL
gh pr view <number> --json url -q .urlhead=$(git rev-parse --abbrev-ref HEAD)
base=develop
# Check existing PRs for the head branch
pr_count=$(gh pr list --head "$head" --state all --json number -q 'length')
unmerged_count=$(gh pr list --head "$head" --state all --json mergedAt -q 'map(select(.mergedAt == null)) | length')
if [ "$pr_count" -eq 0 ]; then
action=create
elif [ "$unmerged_count" -gt 0 ]; then
action=push_only
else
action=create
fi
# Create PR body from template (edit as needed)
cat > /tmp/pr-body.md <<'BODY'
## Summary
- TODO (one-sentence outcome)
- TODO (user-visible change, if any)
## Context
- TODO (why this PR is needed)
- TODO (background, ticket, or incident link)
## Changes
- TODO (key changes, bullets)
- TODO (notable refactors or cleanup)
## Testing
- TODO (commands run)
- TODO (manual steps, if any)
## Risk / Impact
- TODO (areas impacted)
- TODO (rollback plan / mitigation)
## Deployment
- TODO (steps, flags, or "none")
## Screenshots
- TODO (UI changes only)
## Related Issues / Links
- TODO (issues, specs, docs)
## Checklist
- [ ] Tests added/updated
- [ ] Lint/format checked
- [ ] Docs updated
- [ ] Migration/backfill plan included (if needed)
- [ ] Monitoring/alerts updated (if needed)
## Notes
- TODO (optional)
BODY
# Create new PR
# gh pr create -B "$base" -H "$head" --title "..." --body-file /tmp/pr-body.md
references/pr-body-template.md: PR body templateCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.