Converts GitHub issues into standardized development branches automatically.

Install

mkdir -p .claude/skills/branch && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11077" && unzip -o skill.zip -d .claude/skills/branch && rm skill.zip

Installs to .claude/skills/branch

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

GitHub Issue URLからブランチを自動作成するスキル。「/branch https://github.com/owner/repo/issues/12345」のようにIssue URLを指定すると、Issueタイトルを要約してdev/{Issue番号}_{要約}形式のブランチ名を生成し、現在のブランチをベースに新規ブランチを作成・チェックアウトする。「ブランチ作成」「branch作成」と言われた時にも使用。
211 charsno explicit “when” trigger
Beginner

Key capabilities

  • Generate snake-case branch names
  • Create git branches
  • Sync with GitHub issues
  • Create git worktrees

How it works

It fetches the issue title via GitHub CLI, generates a formatted branch name, and creates/checks out the branch, optionally creating a worktree.

Inputs & outputs

You give it
GitHub Issue URL
You get back
New git branch

When to use branch

  • Creating new feature branches
  • Syncing development with issues
  • Automated branch naming

About this skill

🌿 ブランチ自動作成

[!IMPORTANT] このスキルは Issue URL から dev/{Issue番号}_{要約} 形式のブランチを 1 コマンドで作成する。 結果のみを簡潔に返す。途中経過は出力しない。 --worktree 指定時はブランチ作成と同時に git worktree を作成し、.claude/ を rsync で同期する。

GitHub Issue URL からブランチを作成する。

📖 使用方法

/vibecorp:branch <Issue URL>
/vibecorp:branch --worktree <Issue URL>

⚙️ オプション

オプション説明
--worktreeブランチ作成と同時に git worktree を作成し、独立したディレクトリで作業できるようにする

🔄 ワークフロー

1. Issue 情報の取得

引数から Issue URL を受け取り、Issue 番号とタイトルを取得する。

gh issue view <Issue URL> --json number,title --jq '.number,.title'

2. ブランチ名の生成

タイトルを英語の短い要約(スネークケース)に変換し、以下の形式でブランチ名を生成する。

dev/{Issue番号}_{要約}

要約ルール:

項目ルール
表記英語のスネークケース(小文字 + アンダースコア)
文字数最大 30 文字
除外絵文字・タイプ接頭辞(feat:, fix: 等)は除外する
単語数内容を端的に表す 2〜4 単語

例:

  • ✨ feat: /vibecorp:ship Issue指定からマージまでの全自動スキルdev/67_ship_auto_merge
  • 🐛 fix: mvv.md path notation inconsistencydev/41_mvv_path_fix

3. ベースブランチの最新化

git pull origin HEAD --ff-only

4. ブランチ作成

--worktree オプションの有無で分岐する。

通常モード(--worktree なし)

git checkout -b <ブランチ名>

ワークツリーモード(--worktree あり)

4a. ワークツリーディレクトリの決定

vibecorp.ymlworktree_dir を読み取る。未設定の場合はデフォルト値を使用する。

MAIN_DIR=$(git rev-parse --show-toplevel)

# vibecorp.yml の worktree_dir を読み取る(未定義なら空文字)
CONFIG_WORKTREE_DIR=$(awk '/^worktree_dir:[[:space:]]*/ { sub(/^worktree_dir:[[:space:]]*/, ""); sub(/[[:space:]]*$/, ""); print; exit }' "$MAIN_DIR/.claude/vibecorp.yml")

if [ -n "$CONFIG_WORKTREE_DIR" ]; then
  # worktree_dir が定義されている場合: 絶対パスはそのまま、相対パスはプロジェクトルート基準
  case "$CONFIG_WORKTREE_DIR" in
    /*) WORKTREE_BASE="$CONFIG_WORKTREE_DIR" ;;
    *) WORKTREE_BASE="$MAIN_DIR/$CONFIG_WORKTREE_DIR" ;;
  esac
else
  # デフォルト: ../{プロジェクト名}.worktrees
  PROJECT_NAME=$(awk '/^name:[[:space:]]*/ { sub(/^name:[[:space:]]*/, ""); sub(/[[:space:]]*$/, ""); print; exit }' "$MAIN_DIR/.claude/vibecorp.yml" | tr -cs 'A-Za-z0-9._-' '_')
  WORKTREE_BASE="${MAIN_DIR}/../${PROJECT_NAME}.worktrees"
fi
4b. ワークツリーの作成
mkdir -p "$WORKTREE_BASE"
git worktree add "$WORKTREE_BASE/<ブランチ名>" -b <ブランチ名>
4c. .claude/ の同期

メインワークツリーの .claude/ を worktree にコピーする。git 追跡状況に関わらず全ケースで同じコマンドで動作する。

rsync -a "$MAIN_DIR/.claude/" "$WORKTREE_BASE/<ブランチ名>/.claude/"

⚠️ 制約

  • jq では string interpolation \(...) を使わない — Bash 上で \ がエスケープ文字、() がサブシェルとして解釈され、意図しない展開やパースエラーを引き起こすため。必ず + で結合する。
  • コマンドをそのまま実行する2>/dev/null|| echo; echo 等のリダイレクトやフォールバックを付加しない(根拠)。
  • 既存のブランチ名と衝突する場合はユーザーに報告して停止する。

📤 返却フォーマット

通常モード

<ブランチ名>

ワークツリーモード

<ブランチ名>
worktree: <ワークツリーの絶対パス>

🔗 関連ルール

  • ブランチ命名規約: .claude/rules/workflow.md
  • プロンプト作成基準: .claude/rules/prompt-writing.md
  • マークダウン規約: .claude/rules/markdown.md
  • シェル規約: .claude/rules/shell.md

When not to use it

  • Non-GitHub repositories
  • Repositories without issue tracking

Prerequisites

GitHub CLI (gh)Git

Limitations

  • Requires GitHub CLI
  • Limited to specific branch naming format

How it compares

It automates branch naming and creation directly from issue URLs, enforcing a specific naming convention.

Compared to similar skills

branch side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
branch (this skill)02moReviewBeginner
resolve-conflicts818moReviewIntermediate
openspec-onboard106moReviewBeginner
codex-cli-bridge99moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry