Skip to content
Back to skills

Branch Manager

ASecurity

Create git branches following project patterns. Use when starting new features, bug fixes, or refactoring. Reads patterns from ai-settings.json.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
code-qualitybashrefactoringgit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill branch-manager --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Branch Manager?

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

Security grade badge for Branch Manager
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-branch-manager/badge)](https://www.skillsdirectory.com/skills/david-li0406-branch-manager)

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: branch-manager
description: Create git branches following project patterns. Use when starting new features, bug fixes, or refactoring. Reads patterns from ai-settings.json.
---

# Branch Manager Skill

You manage git branching strategy for this project.

## When to Use This Skill

- User asks to start a new feature
- User needs to fix a bug
- User plans refactoring work
- Current branch or `main` and changes are needed


```

## Branch Creation Workflow

### Step 1: Check Current Branch

```bash
git branch --show-current
```

### Step 2: Determine Branch Type

Ask the user or infer from context:
- **Feature**: New functionality, enhancement
- **Bugfix**: Fixing a reported issue
- **Refactor**: Code restructuring without behavior change
- **Hotfix**: Urgent production fix

### Step 3: Generate Branch Name

Apply the appropriate pattern:

**Feature** (no issue ID):
```bash
git checkout -b feature/short-descriptive-name
```

**Bugfix** (with issue ID):
```bash
git checkout -b bugfix/123-issue-description
```

**Refactor**:
```bash
git checkout -b feature/refactor-area-name
```

Branch naming conventions:
- Use lowercase letters
- Separate words with hyphens
- Keep descriptions short but descriptive
- For bugfixes, include issue ID if available

### Step 4: Verify Branch Creation

```bash
git status
```

Ensure:
- New branch is created
- It's based on the correct starting point
- No uncommitted changes remain on main branch

## Protection Policy

If `main_branch_protected: true`:

**ALWAYS** check if on `master` or `main`:
```bash
current_branch=$(git branch --show-current)
if [ "$current_branch" = "master" ] || [ "$current_branch" = "main" ]; then
    echo "Main branch is protected. Create a feature branch first."
fi
```

**Before ANY changes** on main:
1. Remind user to create a branch
2. Offer to create the branch automatically
3. Do NOT proceed with changes until on feature branch

## Merge Strategy

Inform user of the configured merge strategy:
- `squash_or_rebase`: Commits will be squashed or rebased when merging
- This means clean history on main branch

## Output Format

### Successful Branch Creation

```
Branch Created Successfully

Type: Feature
Name: feature/thermocalc-integration
Based on: master (commit 9e9387b)

Next steps:
1. Make your changes
2. Commit in small chunks (<=250 lines)
3. Update CHANGELOG.md before each commit
4. Request review before merging to master
```

### Protection Warning

```
Main Branch Protected

You are on 'master' branch. Direct changes are not allowed.

Shall I create a feature branch for you?
- feature/your-feature-name (recommended)
- bugfix/123-issue-name (if fixing a bug)
```

## References

See [branch_helpers.md](branch_helpers.md) for git command examples and troubleshooting.
See [templates/branch_patterns.md](templates/branch_patterns.md) for project-specific naming conventions.

Files in this skill

  • SKILL.md2.8 KB
  • templates/clarifying_questions.md1.7 KB

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…