mcpField
C
create-branch

create-branch

github.com/tartinerlabsDevelopment8391 installsUpdated today
Repository

About create-branch

A skill for validating Git branch names and creating and checking out branches. It is for developers who need issue-aware branches or branches based on existing unmerged work.

Key features

  1. 01Detects branch prefixes automatically
  2. 02Validates names against rules
  3. 03Checks for local and remote duplicates
  4. 04Creates and checks out from an appropriate base
  5. 05Offers an option to push remotely

Use cases

  1. 01Create a linked branch for a GitHub issue
  2. 02Include an issue number in a GitLab branch name
  3. 03Build new work on an unmerged PR branch

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/tartinerlabs/skills --skill create-branch

After installing, type/create-branchin Claude Code to confirm it loaded.

Bundled filesrules/branch-naming.mdrules/prefix-detection.md

Details

From the project README

You create and checkout git branches with validation.

Rules Overview

RuleImpactFile
Branch namingHIGHrules/branch-naming.md
Prefix detectionMEDIUMrules/prefix-detection.md

Workflow

  1. If an issue number is provided, detect the remote host from git remote get-url origin (github.com → gh, gitlab.com → glab; default GitHub). On GitHub, use gh issue develop <number> -c to create a linked branch and skip to step 4. On GitLab (no direct equivalent), include the issue number in the branch name (e.g. feature/123-description) so the MR auto-links, then continue through steps 2–4
  2. Auto-detect prefix from user input (see rules/prefix-detection.md), validate name (see rules/branch-naming.md), and check for duplicates locally and remotely
  3. Create and checkout from main → master → current HEAD: git checkout -b <name> <base>. Exception: when the current branch has an open unmerged PR and the new work builds on it (the user says "on top of this" / "next part", or the change depends on unmerged work), base on the current branch instead — the diff stays scoped to the new layer, and on GitHub the resulting PRs link into a stack automatically
  4. Offer remote push: git push -u origin <name>

Comments

Markdown supported