Skip to main content
skill CX Codex

create-branch · tartinerlabs — Claude Code skill: what it does, how to install

Creates git branches with naming validation and connects them to GitHub or GitLab issues automatically. Helps start new feature work cleanly.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tartinerlabs/skills --skill create-branch -a claude-code
Open on GitHub

What create-branch does

The skill handles git branch creation directly through the agent. It inspects git remote get-url origin to detect your hosting platform. If you provide a GitHub issue number, it runs gh issue develop <number> -c to link the branch to the issue immediately. On GitLab, it includes the issue number in the branch name so merge requests link up properly.

Next, it checks the branch name against naming rules and scans for duplicates locally and remotely. Branches start from main, master, or current HEAD. When work builds on an unmerged pull request, the skill branches from the active branch instead, keeping the diff clean for stacked reviews. It can also push to origin.

Linking issues requires gh or glab installed and authenticated on your machine. Without those CLI tools, remote issue association fails.

What it helps with

  • check new git branch names for rules and duplicate refs
  • create linked branches for GitHub issues using the gh CLI
  • format GitLab branch names to link issues with merge requests
  • branch off unmerged pull requests to build stacked diffs

Example prompts for the agent

  • Create a branch for issue 42 and link it
  • Branch on top of this current PR for the next feature part
  • Check out a new bugfix branch for the auth timeout

How to install create-branch

1Skills CLI (Vercel)

npx skills add tartinerlabs/skills --skill create-branch -a claude-code

2Manually: put the files in place

~/.claude/skills/create-branch/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-branch/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about create-branch

How to install create-branch in Claude Code?

Run npx skills add tartinerlabs/skills --skill create-branch -a claude-code. The file will be written to ~/.claude/skills/create-branch/SKILL.md.

What does create-branch do?

It validates git branch names, prevents duplicate branch errors, and checks out the new branch. It also links work to issues on GitHub or GitLab when an issue number is provided.

What external tools does create-branch require?

It requires git on your path. Linking branches to issues also requires the gh tool for GitHub or glab for GitLab.

Source text

SKILL.md · MIT
---
name: create-branch
description: Use when creating a branch, starting work on an issue, or checking out a new feature branch. Validates branch naming and links to GitHub issues automatically.
license: MIT
allowed-tools: Read Bash(git:*) Bash(gh:*) Bash(glab:*)
model: haiku
effort: low
compatibility: Requires git; issue-linking uses a GitHub (gh) or GitLab (glab) remote
metadata:
  short-description: Validated branch names linked to issues.
---

You create and checkout git branches with validation.

## Rules Overview

| Rule | Impact | File |
|------|--------|------|
| Branch naming | HIGH | `rules/branch-naming.md` |
| Prefix detection | MEDIUM | `rules/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>`

© tartinerlabs · MIT · tartinerlabs/skills

Similar skills

All skills for Git and GitHub →

create-branch by other authors comes first.

From the same set12

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor