Skip to content
Back to skills

Creating Git Branch

ASecurity

Git リポジトリの慣習に則って新しいブランチを作成します。ユーザーがブランチの作成を求めたときや、エージェントがブランチを作成するときに必ず使用してください。

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsbashgit

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill creating-git-branch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Creating Git Branch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Creating Git Branch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-creating-git-branch/badge)](https://www.skillsdirectory.com/skills/majiayu000-creating-git-branch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: personal-creating-git-branch
description: Git リポジトリの慣習に則って新しいブランチを作成します。ユーザーがブランチの作成を求めたときや、エージェントがブランチを作成するときに必ず使用してください。
allowed-tools: Bash(git branch:*), Bash(grep:*), Bash(head:*), Bash(sed:*), Bash(cut:*), Bash(sort:*), Bash(xargs:*)
---

# Git ブランチ作成

## 前提

`README.md` やメモリファイル(`AGENTS.md` や `CLAUDE.md` など)にブランチ名の規約がある場合、それに従う。

以下のワークフローは、明確な規約がない場合に実行します。

## ワークフロー

### 1. 情報収集

既存のブランチ名を取得:

```bash
git branch --sort=-committerdate | grep -v -E '^\*?\s*(main|master)\s*$' | head -10
```

### 2. 判定

#### スタイル判定

既存ブランチから以下を判定します。

- **シンプル形式**: `add-feature`、`fix-bug` などスラッシュなし
- **プレフィックス付き**: `feature/xxx`、`fix/xxx` などスラッシュを含む

##### 例外

- 複数スタイルが混在する場合、最も使用頻度の高いスタイルを採用
- 既存ブランチがない場合は、どのスタイルを使用するかユーザーに確認

#### プレフィックス判定

プレフィックス付きスタイルの場合、以下のコマンドでプレフィックス一覧を取得します:

```bash
git branch --all | head -100 | grep -v -E 'HEAD|main\s*$|master\s*$' | sed -E 's/^\*?\s*//; s|remotes/origin/||' | grep '/' | cut -d'/' -f1 | sort -u | xargs | sed 's/ /, /g'
```

### 3. ブランチ名生成

判定したスタイルに基づき、2〜5 単語程度のブランチ名を生成します。

- 動詞始まり(`add`、`update`、`fix`、`remove` など)
- ハイフン区切り
- 変更内容を簡潔に表現

### 4. ブランチ作成

生成されたブランチ名を表示し、ブランチを作成します。

```bash
git switch -c <branch-name>
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.