sync-mainlisted
Install: claude install-skill SrdjanCoric/skills
# Sync Main
Treat explicit invocation as authorization to merge the verified PR. Do not ask for another routine
merge confirmation. Stop when local state is unsafe, the PR is ambiguous, CI is not green, or
repository merge requirements are unmet.
## 1. Protect local state
Run `git status --porcelain`. Before merging or switching branches, determine whether uncommitted
changes would be overwritten or stranded. If so, ask the user whether to commit, stash, or abort.
Do not merge remotely until local state is safe for the full workflow.
Record the starting branch and any supplied PR identity, expected head branch, and expected head
SHA.
## 2. Resolve and verify the PR
Use a PR URL or number supplied by the user or caller. If none is supplied and the starting branch
is not `main`, resolve the open or already merged PR for that exact branch. Do not guess between
multiple PRs. If no PR can be resolved, skip remote merge and perform only the requested local
synchronization and safe cleanup.
Verify that:
- the PR is either open and not a draft, or already merged and eligible for restart-safe
synchronization and closeout;
- its base is `main`, unless the user explicitly chose another base;
- its head branch and SHA match supplied expectations;
- every required CI check passed for the current head;
- no check is pending, queued, failed, or unexpectedly cancelled;
- review and branch-protection requirements are satisfied;
- for an open PR, the hosting provider reports it as me