From sentinel
Force-push a branch and all its downstream branches to origin. Auto-detects the downstream tree and skips branches already up-to-date. Triggers on: force push downstream, push chain, push all branches.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sentinel:force-push-downstreamThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Force-push a branch and all its downstream branches to their respective remotes.
Force-push a branch and all its downstream branches to their respective remotes. Skips branches whose local and remote tips already match.
starting-branch (optional) -- The branch to start from. Defaults to the
current branch if not specified.Examples:
/force-push-downstream -- push current branch + all downstream/force-push-downstream feature-auth -- push from that branch downgit branch --show-currentgit status --shortIf an argument was provided, use it as the starting branch. Otherwise use the current branch.
git branch --show-current
Detect all downstream branches by examining local branch tracking relationships,
using the same method as rebase-downstream:
# List all local branches with their upstream tracking branches
git for-each-ref --format='%(refname:short) %(upstream:short)' refs/heads/
From this output, build a parent-child tree:
B is a child of branch A if B's upstream tracking ref is A
(or origin/A).If a branch tracks origin/<same-name> (i.e., it tracks itself on the
remote), it is NOT a child -- it is an independent branch.
The push list is: the starting branch itself, followed by every downstream branch in tree order (from the chain detection output).
Display the branches that will be pushed:
Force push plan:
feature-auth
-> feature-auth-ui
-> feature-auth-tests
-> feature-auth-api
For each branch, check if it is already up-to-date with origin:
# Get local and remote SHAs
local_sha=$(git rev-parse <branch>)
remote_sha=$(git rev-parse origin/<branch> 2>/dev/null || echo "none")
If local_sha == remote_sha, mark as (up-to-date, will skip). If the remote
branch doesn't exist, mark as (new, will push). Otherwise mark as
(diverged, will force-push).
Ask the user to confirm before pushing.
For each branch in the push list:
Skip if up-to-date: If local SHA matches origin SHA, print skip message and move on.
Force push:
git push --force-with-lease origin <branch>
Use --force-with-lease for safety -- it fails if someone else pushed to the
remote since our last fetch, preventing accidental overwrites of others'
work.
If the remote branch doesn't exist (first push), use:
git push -u origin <branch>
Report result: Print success/failure for each branch.
After all pushes complete, show a summary:
Force push results:
[ok] feature-auth (pushed)
[--] feature-auth-ui (skipped, up-to-date)
[ok] feature-auth-tests (pushed)
[ok] feature-auth-api (pushed, new)
[!!] feature-auth-docs (failed: ...)
--force-with-lease instead of --force for safetyGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub luciferdono/sentinel