cloud-native-ref: Skill for Claude Code

.agents/skills/sync-branch/SKILL.md

sync-branch is a skill for Claude Code from Smana/cloud-native-ref. It costs 95 tokens per session (978 once invoked), scanned A, original, Apache-2.0.

A Git workflow guide that updates your working branch with the latest changes from the remote main branch before review or delivery. Rebasing reapplies your changes on top of that newer history.

In plain words
What is it for?
Use it to fetch the remote branch, check that the working tree is safe, and rebase before pushing, reviewing, or opening a pull request.
Why use it?
It prevents reviews and pull requests from being based on an outdated comparison. It also exposes merge conflicts before they reach the final merge.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is Smana/cloud-native-ref's own configuration. It tells Claude Code how to work on cloud-native-ref itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cloud-native-ref configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Smana/cloud-native-ref. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Smana/cloud-native-ref/main/.agents/skills/sync-branch/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Smana/cloud-native-ref

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sync-branch

README.md
[![agentmods](https://agentmods.dev/badge/skills/smana/cloud-native-ref/sync-branch/github.svg)](https://agentmods.dev/skills/smana/cloud-native-ref/sync-branch)
Your own site
<a href="https://agentmods.dev/skills/smana/cloud-native-ref/sync-branch"><img src="https://agentmods.dev/badge/skills/smana/cloud-native-ref/sync-branch/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sync-branch

Your own site · 80×15
<a href="https://agentmods.dev/skills/smana/cloud-native-ref/sync-branch"><img src="https://agentmods.dev/badge/skills/smana/cloud-native-ref/sync-branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 978 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.00978
Opus 5.5 $0.00038 $0.00391
Sonnet 5.5 $0.00019 $0.00196
Haiku 4.5 $0.00010 $0.00098

Measured 1mo ago against content hash a0ac9c75171e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sync-branch scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/sync-branch/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sync branch onto origin/main

A branch that is behind origin/main produces a diff that no longer describes what will merge. Reviews read the wrong merge base, CI passes against code nobody will ship, and conflicts surface at merge time instead of now.

Run this before every review, push and PR — not only when a conflict is suspected.

1. Refuse the unsafe cases

Stop and report, do not proceed, when any of these hold:

Condition Check Why
On the base branch itself git branch --show-current is main nothing to rebase
Uncommitted changes git status --porcelain is non-empty a rebase would strand them. Commit first — ship-it does this before calling you
Rebase already running test -d "$(git rev-parse --git-path rebase-merge)", same for rebase-apply finish or abort it first

Resolve that third one through git rev-parse --git-path, never as a literal .git/…. In a worktree .git is a file, not a directory — it holds gitdir: …/.git/worktrees/<name> — so a literal path can never match and the guard silently passes. This repo mandates a worktree for every change, which would make the check dead everywhere it matters.

2. Fetch, then compare

The fetch is the point. Comparing against a local origin/main that was last updated hours ago reports "up to date" on a branch that is not.

BASE="${BASE:-main}"
git fetch origin "$BASE"

if git merge-base --is-ancestor "origin/$BASE" HEAD; then
  echo "up to date with origin/$BASE"
else
  echo "behind origin/$BASE by $(git rev-list --count HEAD..origin/$BASE) commit(s)"
fi

When the branch is already up to date, say so and stop. Do not rebase for the sake of it — a no-op rebase still rewrites committer dates and invalidates anyone's local copy.

3. Rebase

git rebase "origin/$BASE"

On conflict, resolve one file at a time and preserve intent from both sides:

git status --short | grep '^UU'   # conflicted files
# edit, then:
git add <file>
git rebase --continue

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 94 lines · 95 tokens per session scan A a0ac9c75171e

Subscribe to this mod's changes

sync-branch is a skill published in the GitHub repository Smana/cloud-native-ref (104 stars, last pushed today), licensed Apache-2.0. It adds 95 tokens to every session and 978 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-18.