home / skills / tkersey / dotfiles / fin
This skill finalizes a GitHub PR end-to-end by updating branches, monitoring checks, squash-merging, and cleaning local/remote state.
npx playbooks add skill tkersey/dotfiles --skill finReview the files below or copy the command above to add this skill to your agents.
---
name: fin
description: "Finalize GitHub PRs end-to-end: update branch/PR, monitor CI until green, squash-merge, and clean up local/remote state. Use when asked to $fin or to finish/land/merge/close a PR, watch checks or runs, squash-merge, delete the branch, and sync local state."
---
# Fin
## Overview
Finish a PR end-to-end: push updates, watch checks, squash-merge, and clean up state.
## Workflow
1) Identify the PR and target branch.
- Use `gh pr view` (current branch) or `gh pr list` to locate it.
2) Update the PR.
- Ensure the branch is up to date, run required checks, and push:
- `git status`, fix issues, then `git push`.
3) Monitor checks until green.
- Use `gh pr checks --watch` or `gh run watch <run-id>`.
- If checks fail, fix, push, and re-watch.
4) Squash-merge the PR.
- Prefer `gh pr merge --squash --delete-branch` unless repo policy dictates otherwise.
- If approvals are missing, request them before merging.
5) Clean up local state.
- Fetch the updated mainline, switch to it, and delete the merged branch.
## Guardrails
- Do not merge if required checks or approvals are missing.
- Keep the merge method aligned with repo policy.
- If any step is blocked, state the blocker and required next action.
This skill finalizes GitHub pull requests end-to-end: it updates the branch, monitors CI until checks pass, performs a squash-merge, and cleans up both remote and local state. It automates the checklist you follow when asked to finish, land, merge, or close a PR. Use it to ensure merges respect required checks and repo policies while keeping your local repository tidy.
The skill locates the PR (current branch or from a list), ensures the branch is up to date, and pushes any last changes. It then watches CI checks or specific workflow runs until they turn green, prompting for fixes if they fail. Once checks and approvals satisfy repo rules, it performs a squash-merge and deletes the feature branch remotely, then fetches and syncs your local mainline and removes the local branch.
What if required checks are missing or failing?
Do not merge. Report the failing checks, apply fixes or request necessary changes, push updates, and re-watch until checks pass.
Can the merge method be changed?
Yes—use the repository's policy as the source of truth. The default preferred method is squash; switch to merge or rebase if policy requires it.