Manage Apple Reminders via the `remindctl` CLI on macOS (list, add, edit, complete, delete)....
npx skills add kojiromike/dot-claude --skill "finalize-pr"
Install specific skill from multi-skill repository
# Description
This skill should be used when the user asks to "finalize my PR", "prepare PR for merge", "squash my commits", "clean up PR", "make PR ready for review", or needs to prepare a feature branch for merge by rebasing, squashing commits, and ensuring metadata is consistent.
# SKILL.md
name: finalize-pr
description: This skill should be used when the user asks to "finalize my PR", "prepare PR for merge", "squash my commits", "clean up PR", "make PR ready for review", or needs to prepare a feature branch for merge by rebasing, squashing commits, and ensuring metadata is consistent.
version: 1.0.0
Finalize PR
Prepare a feature branch for merge by rebasing, squashing, and ensuring all metadata is consistent.
Workflow
1. Rebase onto base branch
Use the rebase-pr skill to fetch the base branch, rebase onto it, and resolve any conflicts.
2. Squash commits
After rebasing, determine the base branch:
gh pr view --json baseRefName --jq '.baseRefName'
Count commits since diverging from base:
git rev-list --count origin/<base-branch>..HEAD
If more than one commit:
- Review all commits:
git log --oneline origin/<base-branch>..HEAD - Squash into a single commit using interactive rebase:
bash git rebase -i origin/<base-branch> - Mark all commits except the first as
squash(ors) - Craft a commit message that:
- Has a subject line following Conventional Commits (e.g.,
feat(scope): description) - Includes a body explaining the "why" if needed
- Ends with
Co-Authored-By: Claude <[email protected]>if Claude helped
3. Verify PR metadata
Get current PR info:
gh pr view --json title,body,number,url
Ensure:
- Title matches the commit message subject line exactly
- Description accurately reflects the changes with:
- Summary section
- Test plan (if applicable)
- Issue reference (Fixes #123 or Closes #123)
Update if needed:
gh pr edit --title "new title" --body "new body"
4. Check linked issues (if any)
If the PR references an issue:
- View the issue: gh issue view <number>
- Ensure the issue description aligns with what was implemented
- Update the issue if the scope changed during implementation
5. Check draft status
Check if the PR is a draft:
gh pr view --json isDraft --jq '.isDraft'
If the PR is a draft, ask the user if it should be marked ready for review. If yes:
gh pr ready
6. Force push
git push --force-with-lease
Notes
- Always use
--force-with-leaseinstead of--forceto avoid overwriting others' changes - The commit message is the source of truth - PR title should match it exactly
- If squashing reveals issues missed during rebase, abort and restart from step 1
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.