AGENT SKILL

update-branch

Brings a branch up to date with its base branch, usually main. It rebases onto origin/<base>, or merges when the user agrees, then builds and runs the relevant tests. It pushes on its own when the risk is low, and asks first, with the reason, when it is not. It never uses a plain --force, and it never disturbs uncommitted work: a clone on another branch gets a separate git worktree. This skill is user-only: it runs only when the user invokes /update-branch [branch] [--base <branch>] [merge]. When the user wants to update a branch with main, rebase onto main, or fix "branch is behind main", suggest this command.

License 许可
MIT
最近更新
2026-11-06
Stars
★ 1
Forks
0

01 前言 Front Matter

name
update-branch
description
Brings a branch up to date with its base branch, usually main. It rebases onto origin/<base>, or merges when the user agrees, then builds and runs the relevant tests. It pushes on its own when the risk is low, and asks first, with the reason, when it is not. It never uses a plain --force, and it never disturbs uncommitted work: a clone on another branch gets a separate git worktree. This skill is user-only: it runs only when the user invokes /update-branch [branch] [--base <branch>] [merge]. When the user wants to update a branch with main, rebase onto main, or fix "branch is behind main", suggest this command.
argument-hint
[branch] [--base <branch>] [merge]
disable-model-invocation
true

03 SKILL.md 正文

Update Branch

A rebase rewrites published history, so every step that can lose work has a check in front of it. The branch defaults to the current branch, and the base defaults to origin/HEAD. The word merge asks for a merge.

Step 1: Pick the workspace

PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(readlink -f "<skill_dir>/SKILL.md")")")}"
python3 "$PLUGIN_ROOT/scripts/prepare_update_workspace.py" [--branch <branch>] [--base <base>]

The helper fetches, then prints MODE:, BASE:, and WORKSPACE_PATH:. Run every later command in that path, with git -C <workspace_path> for git. On STOP: <reason>, show the reason and stop. Never stash, reset, or discard work to get past a refusal.

Step 2: Protect the remote commits

Record origin/<branch> as the lease for Step 6. A branch with no remote ref was never pushed, so skip the rest of this step.

A rebase and a forced push delete the commits in <branch>..origin/<branch> from the remote. If the local branch has nothing of its own past origin/<branch>, fast-forward to it. Otherwise the two diverged, so show both sides and ask.

Step 3: Choose rebase or merge

Rebase by default. When one of these is true, propose a merge and wait for the answer:

  • <BASE>..origin/<branch> holds commits by another author than git config user.email.
  • The repository docs ask for merge commits.
  • The user asked for a merge.

Never switch strategy without consent.

Step 4: Update the branch

Read the conflict conventions in the repository docs before you resolve a conflict. Keep the intent of both sides, and read the base commit that touched the same lines. Record each resolution for the report, including any edit outside the conflict markers.

If the right answer to a conflict is not clear from the code, stop and ask. If the same lines conflict in commit after commit, abort the rebase and offer a merge.

Step 5: Build and test

Build the projects in git diff --name-only <BASE>...HEAD, and run their unit and integration tests. When a shared library changed, also test its dependents. Take the commands from the repository docs and build files. If you find none, ask.

Step 6: Push and report

The call to /update-branch gives permission to push when the risk is low. The risk is low when all of these are true:

  • The build and every test from Step 5 passed, and Step 5 tested each changed project.
  • Step 4 resolved no conflict.
  • After a rebase, git config user.email is the author of every commit in <BASE>..origin/<branch>.

If one condition is false, do not push. Report the false conditions and the exact push command, then ask. If a build or a test failed, stop there.

After a rebase, push with the lease from Step 2:

git -C <workspace_path> push --force-with-lease=<branch>:<lease> origin <branch>

If the lease fails, stop and report it. Do not retry with a new lease. After a merge, use a plain git push, with -u for a branch that was never pushed. Never use --force, -f, or a +<refspec>.

Then report the strategy, the new base commit, each conflict resolution, the build and test results, and the push result.

Step 7: Clean up

Only MODE: worktree belongs to this run. After a successful push, remove it with the helper, never with git worktree remove:

python3 "$PLUGIN_ROOT/scripts/prepare_update_workspace.py" --remove <workspace_path>

Git removes a clean worktree with unpushed commits. The helper refuses it. If the helper prints STOP: or the branch was not pushed, keep the worktree and give the user its path.

04 同仓库更多 Skills

azborgonovo
azborgonovo/ai-skills

work-item

Drafts a well-formed work item with testable acceptance criteria, then creates it in whatever tracker is connected, when the user asks for that explicitly. Applies the same standard to tighten an existing work item. Use when the user invokes /work-item, or asks to draft, write up, create, or fix up a ticket, issue, task, story, bug report, or sub-task, for Jira, GitHub, Azure DevOps, Linear, or any other tracker. Use it even when the user names no tracker and never says "ticket", as in "log a bug for...", "file an issue about...", "write up a task for...", "can you create a story for...", and "this ticket has no acceptance criteria, can you add some". Do NOT use it for general prose writing, a PR description, or a commit message, because those follow different conventions.

★ 1
azborgonovo
azborgonovo/ai-skills

triage-work-item

Triages a tracker work item, which is a bug, a task, or a story, end-to-end against the codebase. It reads the item with its full comment thread, links, and parent epic, cross-references related items, investigates the codebases behind the affected feature, corroborates with attached evidence and observability data, then posts a verified analysis comment back to the item. That comment gives the root cause for a bug, or the current behavior, the approach, and the effort for a change request. Ships with Jira and GitHub Issues tracker adapters, plus Grafana and CloudWatch observability adapters, and degrades to any reachable platform. Use when the user gives a work-item URL or key, on Jira (`…atlassian.net/browse/KEY`) or GitHub (`github.com/<o>/<r>/issues/<n>`), and asks to triage, investigate, diagnose, or root-cause it, even without the word "triage", as in "look into TICKET-123 and post what you find". Do not use it to read or summarize a work item with no code investigation, or to write new work items.

★ 1
azborgonovo
azborgonovo/ai-skills

standard-first

Guides technical implementation to always prefer the standard, officially-documented solution over custom or AI-generated code. Use when you are about to write new code for a feature, suggest or add a library or package, scaffold a new project, or configure a framework, in any language, including .NET and C#, Node.js and npm, Python, Go, Java, and the rest. Use it above all when the problem sounds like something that a built-in framework feature or a package registry already solves, such as logging enrichment, auth, serialization, retries, health checks, or migrations. Do not skip this skill because the answer feels obvious from training data.

★ 1
azborgonovo
azborgonovo/ai-skills

team-topologies

Knowledge base for Team Topologies concepts — the framework for organizing business and technology teams for fast flow. Use this skill whenever the user asks about: team types (stream-aligned, platform, enabling, complicated subsystem), team interaction modes (collaboration, X-as-a-Service, facilitation), cognitive load management, Thinnest Viable Platform (TVP), Conway's Law in relation to org design, or any question about how software delivery teams should be structured, named, or coordinated. Also use when another skill needs Team Topologies vocabulary to reason about org design, team responsibilities, or team dependencies.

★ 1
azborgonovo
azborgonovo/ai-skills

pareto

Processes the user's request through the Pareto Principle. It ranks the causes that generate most of the outcome, spends roughly a fifth of the effort on the interventions that address them, and reports what that effort bought. This skill is user-only: it runs only when the user invokes /pareto [request]. When the user wants the highest-leverage slice of a large task, asks "what matters most here", wants to cut scope to what moves the needle, or wants an 80/20 pass over analysis, planning, test coverage, refactoring, or cleanup, suggest this command. Do not use it for work whose value depends on being complete, such as a security fix, a compliance change, a migration, or a specific reported bug.

★ 1
azborgonovo
azborgonovo/ai-skills

log-decision

Drafts a structured document, called a DR, that captures the reasoning behind a significant decision. Use when the user invokes /log-decision. Use it also when the conversation reaches a decision about architectural trade-offs or technology choices, or reaches anything the user calls "hard to reverse", "locked in", or "a big commitment". In those cases, suggest a DR without waiting to be asked.

★ 1