agentleFS
Surething-ioSurething-io/cockpit/skills/new-branch/SKILL.md

new-branch

Skill44 starsChanged 8 months agoMITView on GitHub

Cut a clean new branch off the latest origin/main and verify it matches the remote.

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

  • Other versions6 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 6

    1. EverMind-AI/EverMemOS★ 14ksame name
    2. EverMind-AI/EverOS★ 14ksame name
    3. BuilderIO/agent-native★ 7.6ksame name
    4. fangyuting/skills★ 1same name
    5. khanashes/claude-skills★ 0same name
    6. longmajs/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository18 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No derivable information at all → only then ask.

    line 29
  2. Distinctive:

    No ready branch name and no derivable requirement description → ask.

    line 56
  3. Very specific:

    Start from the latest: always base on origin/main, never on a possibly stale local main.

    line 62
  4. Distinctive:

    Verify right after cutting: use rev-list to confirm actual sync.

    line 64

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

New Branch (create a branch off the latest mainline)

Branch off the latest origin/main so the starting point is clean and in sync with the remote.

Trigger

The user asks to "create a new branch / new branch / cut a branch" and wants it based on the latest mainline.

Scope (important)

This skill is only responsible for quickly creating a clean new branch, up to "verify right after cutting".

  • Do: fetch → branch from origin/main → verify sync → output confirmation.
  • Do NOT: explore / read code, spawn Explore / Plan agents, produce an implementation plan, or start writing code.

Any requirement description the user includes at trigger time (e.g. "improve the add-to-slack onboarding flow") is only used to derive the branch name / record intent, not a dev task to start here. Follow-up requirement refinement and implementation are discussed by the user in a new conversation and are out of scope for this skill.

Pre-checks

  1. Confirm the branch name (always in English, following the <type>/<short-desc> convention, e.g. feat/credit-guard, fix/stream-recovery):
    • User already gave a ready branch name → use it directly.
    • User gave a requirement sentence (e.g. "improve the add-to-slack onboarding flow") → derive an English branch name from it (e.g. feat/slack-onboarding-flow) and create it directly, no need to ask.
    • No derivable information at all → only then ask.
  2. Confirm the working tree is clean (git status). If there are uncommitted changes, stop and ask the user how to handle them; do not force-switch.

Steps

# 1. Fetch the latest remote mainline
git fetch origin main

# 2. Create and switch to the new branch off the latest origin/main
git checkout -b <branch-name> origin/main

# 3. Verify: should be 0 ahead, 0 behind
git rev-list --left-right --count origin/main...HEAD

git checkout -b <name> origin/main in one step guarantees the new branch's start = the latest remote mainline; no need to update local main first.

Verification

  • git rev-list --left-right --count origin/main...HEAD outputs 0 0 (0 ahead, 0 behind).
  • git status shows you are on the new branch with a clean working tree.

Output confirmation: branch name, current HEAD commit, and sync status against origin/main.

When to stop and ask

  • No ready branch name and no derivable requirement description → ask.
  • Uncommitted changes in the working tree → ask how to handle (stash / commit / discard); never discard on your own.
  • A branch with the same name already exists → ask whether to overwrite or rename.

Key principles

  • Start from the latest: always base on origin/main, never on a possibly stale local main.
  • Never lose changes: confirm before any operation that could lose the user's work.
  • Verify right after cutting: use rev-list to confirm actual sync; never assume.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.