Claude-skill-registry accept-pr
Land one PR end-to-end (changelog + thanks, lint, merge, back to main).
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/accept-pr" ~/.claude/skills/majiayu000-claude-skill-registry-accept-pr && rm -rf "$T"
manifest:
skills/data/accept-pr/SKILL.mdsource content
Accept PR
Input: PR number or URL (required). Default merge mode: rebase.
- Guardrails
- Must end on
(or repo default branch if nomain
).main
clean before/after. No uncommitted changes.git status -sb- If PR is draft, has conflicts, or base branch !=
: stop + ask.main - If PR is from a fork and you can’t push: stop + ask.
- Capture context
START_BRANCH="$(git branch --show-current)"gh pr view <PR> --json number,title,author,baseRefName,headRefName,isDraft,mergeable,maintainerCanModify- Skim:
andgh pr view <PR> --commentsgh pr diff <PR>
- Checkout + suggested fixes
gh pr checkout <PR>- Apply fixes (and tests if needed). Keep edits minimal; follow repo conventions.
- Ensure change/feature/regression is well-tested. If no tests exist, do the manual checks the repo expects and note it.
- Commit with explicit paths (no
), then push:git add .git push origin HEAD
- Changelog (and thank contributor)
- Edit
(or project changelog file).CHANGELOG.md - Add entry under the top “Unreleased”/latest section (match existing style).
- Include PR + thanks, e.g.:
- <short change> (#<num>) — thanks @<author> - Commit + push changelog if it changed.
- Lint
- Run repo linter/gate (prefer existing scripts; fix until green).
- If there’s no obvious lint target, search:
rg -n "lint|biome|eslint|swiftlint|ruff" package.json Makefile scripts -S
- Merge (then delete PR branch)
- Prefer rebase merge:
gh pr merge <PR> --rebase --delete-branch - If rebase is disallowed, fallback to repo preference (
or--merge
).--squash
- Sync
+ exit cleanmain
git checkout main || git checkout "$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"git pull --ff-only- Verify merged:
gh pr view <PR> --json mergedAt,mergeCommit
(clean) + ensure you’re ongit status -sb
.main