branch
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.zipInstalls 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作成」と言われた時にも使用。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
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 inconsistency→dev/41_mvv_path_fix
3. ベースブランチの最新化
git pull origin HEAD --ff-only
4. ブランチ作成
--worktree オプションの有無で分岐する。
通常モード(--worktree なし)
git checkout -b <ブランチ名>
ワークツリーモード(--worktree あり)
4a. ワークツリーディレクトリの決定
vibecorp.yml の worktree_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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| branch (this skill) | 0 | 2mo | Review | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by hirokimry
View all by hirokimry →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.