skills/syncing-main-branch/SKILL.md
Switch a clean Git worktree to the local main branch and fast-forward it from its configured upstream. Use only when the user explicitly invokes $syncing-main-branch or names syncing-main-branch; never auto-activate from ordinary requests to switch branches, return after a merge, pull, update, or sync a repository.
npx skillsauth add narumiruna/agent-skills syncing-main-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill only after explicit invocation. Switch to main, update it without creating a merge commit, and preserve the branch, commits, and local files being left.
Inspect before mutating:
git status --porcelain=v1 --untracked-files=all
git status --short --branch
git symbolic-ref --quiet --short HEAD
Stop if tracked or untracked changes exist. Report them; do not stash, commit, discard, or carry them onto main automatically.
If the symbolic-ref check fails, record git rev-parse HEAD and inspect containing refs with git for-each-ref --format='%(refname)' --contains=HEAD refs/heads refs/tags refs/remotes, then stop. Do not leave a detached commit reachable only through reflog; ask whether to preserve it with a branch or tag before switching.
Resolve main.
refs/heads/main exists locally, use it.main is absent and exactly one intended remote-tracking main is clear from repository context, create it with git switch --no-overwrite-ignore --track -c main <remote>/main.main does not exist, or another worktree already has it checked out, stop and report the specific blocker. Do not substitute master, bypass worktree protection, or invent a remote.Switch when not already on main, protecting ignored local files from branch collisions:
git switch --no-overwrite-ignore main
Verify that main tracks the intended <remote>/main. Fetch that remote without updating the worktree, then fast-forward with ignored-file overwrite protection:
upstream_remote=$(git config --get branch.main.remote)
git rev-parse --abbrev-ref 'main@{upstream}'
git fetch "$upstream_remote"
git merge --ff-only --no-overwrite-ignore 'main@{upstream}'
If the branch has diverged, the upstream is missing or unexpected, authentication fails, an ignored path would be overwritten, or the update cannot fast-forward, stop. Do not rebase, reset, force, delete ignored files, or change upstream configuration without a separate request.
Verify and report:
git status --short --branch
git log -1 --oneline --decorate
Confirm the active branch, whether it advanced, and whether it matches its upstream. Do not delete the previous feature branch.
--force, automatic stashing, hard reset, or branch deletion.development
Score or compare one or more agent skills across trigger clarity, workflow actionability, safety boundaries, verification rigor, incremental knowledge value, and leanness. Use only when the user explicitly asks for ratings, numerical quality scores, rubric-based scorecards, or scored comparisons; use creating-agent-skills for unscored reviews or revisions.
development
Assess or improve an existing codebase's architecture when the user asks about module boundaries, coupling, scattered ownership, testability, change locality, deep modules, seams, or behavior-preserving structural refactoring. Use for cross-module design rather than ordinary diff review or a confirmed edge-case bug fix.
development
Perform read-only security audits, vulnerability assessments, or threat-focused reviews of diffs, pull requests, code paths, or explicitly scoped repositories when security is the primary objective or acceptance criterion. Use reviewing-code for ordinary review with baseline security coverage and hardening-code-paths for fixing confirmed findings.
development
Run iterative multi-reviewer panels over a code diff, verify their findings, apply explicitly authorized fixes, and re-review the updated change until it passes or reaches a stopping condition. Use when the user asks for a panel loop, multi-model code-review consensus, or a review-fix-re-review cycle.