skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
sjunepark/agent-scripts47 installs

update-base-branch

Switch this Git worktree to its base or integration branch and fast-forward to its configured upstream. Not for merging or rebasing the base into a feature branch.

How do I install this agent skill?

npx skills add https://github.com/sjunepark/agent-scripts --skill update-base-branch
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill is a Git management utility designed to safely switch and update base branches. It includes multiple safety constraints, such as verifying clean worktrees and enforcing fast-forward-only updates. It presents a low risk of indirect prompt injection because it processes repository metadata to determine shell command execution.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Update Base Branch

Move the current worktree onto its intended base branch and update it without discarding work or guessing across ambiguous branches, remotes, or worktrees.

Protect the current worktree

Inspect the branch, status, and worktrees. If dirty, assess the target and upstream read-only, then report any ambiguity with the request to commit or stash local work. Fetch or switch only after verifying a clean worktree; never stash automatically.

Resolve the target

  1. Inspect local and remote branches and upstream configuration.
  2. Use a branch the user named. Otherwise select the current worktree's established base or integration branch when repository evidence makes it unambiguous. Treat an available dev branch as the usual default candidate, not as permission to ignore conflicting evidence.
  3. Ask the user which branch to use when the target remains ambiguous. Include the likely candidates and their upstreams.
  4. Keep the operation inside the current worktree. If the desired branch is checked out in another worktree, ask for a different worktree-specific base branch or tell the user to run the operation in the owning worktree. Do not update the other worktree implicitly.

Resolve the upstream

  1. Resolve the selected local branch's configured upstream. Do not assume a remote named origin.
  2. If the branch has no upstream, or the same branch name exists on multiple remotes without a clear choice, ask which remote branch should be authoritative.
  3. Never reset, force-switch, delete, or rewrite commits to reach the remote tip.

Update the branch

  1. Fetch only after the target branch and authoritative remote are resolved.
  2. Before switching, verify that the selected local branch is an ancestor of the fetched upstream. If it contains commits absent from the upstream, whether ahead or diverged, stop and report both sides instead of choosing a reconciliation strategy.
  3. Switch the current worktree to the selected local branch. If the user selected a remote-only branch, create its local tracking branch without overwriting an existing ref.
  4. Fast-forward the local branch to the fetched upstream. Require a fast-forward-only update.
  5. Verify that:
    • the current worktree is on the selected branch;
    • its upstream is the resolved remote branch;
    • local HEAD equals the fetched upstream tip; and
    • the worktree remains clean.

Report the branch, upstream, and resulting commit. If any assertion fails, report the exact state and do not claim completion.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/sjunepark/agent-scripts/update-base-branch">View update-base-branch on skillZs</a>