Skip to content
Agentmart
Submit a tool

git-branch

Use before the first file edit of any task in a Git repository, to choose or create the right branch — a new branch for new work, the existing branch for a…

Skill by DavidTsao1992

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/davidtsao1992-git-branch

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use before the first file edit of any task in a Git repository, to choose or create the right branch — a new branch for new work, the existing branch for a fix to unmerged work — while checking for squash-merged branches, dirty trees, approved PRs and shared history.

Use cases: writing, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/git-branch

What's inside

Skill name
git-branch
Description
Use before the first file edit of any task in a Git repository, to choose or create the right branch — a new branch for new work, the existing branch for a fix to unmerged work — while checking for squash-merged branches, dirty trees, approved PRs and shared history.
License
MIT
Instructions
38 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • reference.md

SKILL.md (first lines)

# Git Branch Selection

Decide which branch to work on before writing any code. Deciding after committing means
rewriting history to fix it.

1. **Establish the real state.** A stale local view is the most common cause of a wrong call:

   ```bash
   git fetch origin --prune
   git status --short --branch     # dirty files, ahead/behind, detached HEAD
   git branch -vv                  # local branches and their upstreams
   git worktree list               # is the branch checked out elsewhere?
   gh pr status                    # PRs for the current branch, if gh is available
   ```

2. **Route the task.** Three cases only:
   - **New development** → a new branch off the latest default branch, never on an unrelated
     feature branch or on the default branch itself:
     `git checkout -b <type>/<short-slug> origin/<default-branch>`. Get the default branch from
     `gh repo view --json defaultBranchRef -q .defaultBranchRef.name` rather than assuming `main`,
     and follow the naming already in `git branch -r`.
   - **A fix to work that is still unmerged** → stay on that branch and add commits; its PR
     updates on push. Don't open a second branch to patch a first unless asked for a stacked PR.
   - **A bug that exists independently of the unmerged work** → a new branch off the default
     branch. If the bug reproduces on the default branch, it isn't part of that feature.

3. **Before reusing a branch, check the risks** in [reference.md](reference.md): squash- or
   rebase-merged branches that still look live, approved PRs, dirty trees, detached HEAD, shared
   branches, non-default bases, branches behind their base, and worktrees.

4. **Never** stash, discard, rebase, amend published commits, or force-push without the user's
   explicit say-so. If the right branch is genuinely ambiguous, ask — branching costs nothing,
   committing to the wrong branch is expensive to undo.

5. **Report** in one or two lines before starting: the branch, whether it was created or reused,
   its base, and any risk that applied and how it was resolved.

From DavidTsao1992/neko-skill, MIT.

Signals

Stars
0
Forks
0
Open issues
2
Last commit (this folder)
Oct 18, 2026 (12 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from DavidTsao1992

Cite this page

git-branch skill. Agent Mart. https://agentmart.dev/skills/davidtsao1992-git-branch (last updated 2026-10-24)