git-pr-createlisted
Install: claude install-skill pivoshenko/pivoshenko.ai
# Create PR
Open GitHub PR for current branch. No confirm.
## Flow
1. Base: user names one -> use it. Else detect: `git symbolic-ref --short refs/remotes/origin/HEAD` -> strip the `origin/`; ref missing -> `git remote set-head origin -a`, re-read; no remote -> `main`, fall back `master`. Why -> a wrong base makes the PR diff include commits that aren't yours
2. `git fetch origin <base>`. Why -> everything below compares against `origin/<base>`, not the local ref: the local base is often stale or absent entirely (`git-branch-create` branches off `origin/<base>` without ever creating it), so a local-ref diff either errors or replays commits already merged
3. Parallel:
- `git status`
- `git branch --show-current`
- `git log origin/<base>..HEAD --oneline`
- `git diff origin/<base>...HEAD`
- linked issue, three sources, merged and deduped: the branch link `git config --get branch.$(git branch --show-current).issue` (`git-issue-start` records it there), the branch's commit footers `git log origin/<base>..HEAD --format=%B | grep -oiE '(closes|fixes|resolves) #[0-9]+'`, and a trailing ticket id on the branch name (`git-branch-create`'s optional `-PROJ-123` suffix). Why -> `git-issue-start` opens the branch from an issue and `git-commit` writes the closing trailer, so the number is already on the branch; nobody retypes it
- exactly 1 distinct issue -> fill the `Resolves:` line with it
- more than 1 -> first fills `Resolves:`, the rest become `Refs: #<n>` li