# Git Branch

> Create Git branches with automatic type detection and project-specific naming conventions. Use when asked to "create a branch", "make a new branch", "create branch for changes", or when ready to organize code changes into a new branch. Supports feat, fix, docs, refactor, test, build, ci, chore, revert, and perf branch types with automatic type selection based on changed file patterns.

- **Type:** Skill
- **Install:** `agentstack add skill-puku0x-agent-skills-test-git-branch`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [puku0x](https://agentstack.voostack.com/s/puku0x)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [puku0x](https://github.com/puku0x)
- **Source:** https://github.com/puku0x/agent-skills-test/tree/main/.github/skills/git-branch

## Install

```sh
agentstack add skill-puku0x-agent-skills-test-git-branch
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Git Branch Skill

This skill guides the creation of Git branches with project-specific naming conventions.

## When to Use

Use this skill when:

- You have made changes to the codebase and need to create a new branch for those changes.
- You want to ensure that the branch name follows the project's naming conventions.

## Instructions

### Step 1: Check staged changes

Use the following command to view staged changes:

```bash
git diff --staged
```

**Important** If there are staged changes, proceed to the next step.

If there are no staged changes, check unstaged changes with:

```bash
git diff --name-only
```

### Step 2: Determine branch type and description

The format for branch names is:

```
-
```

- If there are only staged changes, base the branch name on the staged changes.
- If there are only unstaged changes, base the branch name on the unstaged changes.
- If there are both staged and unstaged changes, base the branch name on the staged changes.

**type** is determined based on the patterns of the changed files:

- `feat-`: New features or changes to existing features
- `fix-`: Bug fixes
- `refactor-`: Refactoring (changes that do not add features or fix bugs)
- `test-`: Adding or modifying tests (e.g., changes to `*.spec.*` or `*.spec.*.snap` files)
- `docs-`: Documentation-only changes (e.g., changes to `*.md` files)
- `ci-`: CI-related changes (e.g., changes to files in `.github/workflows/*` or `.github/actions/*`)
- `chore-`: Other changes (e.g., changes to `*.json`, configuration files like `*.config.js`, `.gitignore`, etc.)
- `revert-`: Reverting previous commits
- `build-`: Changes related to the build system or external dependencies
- `perf-`: Performance improvements

**description** should concisely describe the changes made, using hyphens to separate words.

## Step 3: Create the branch

Use `git switch -c` to create and switch to the new branch.

Example:

```bash
git switch -c feat-user-authentication
```

> [!NOTE]
>
> When the name of the branch already exists, append a unique suffix to the branch name to avoid conflicts. For example, if `feat-user-authentication` already exists, create `feat-user-authentication-1`, `feat-user-authentication-2`, etc.

## References

- [branch-name.md](./references/branch-name.md)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [puku0x](https://github.com/puku0x)
- **Source:** [puku0x/agent-skills-test](https://github.com/puku0x/agent-skills-test)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-puku0x-agent-skills-test-git-branch
- Seller: https://agentstack.voostack.com/s/puku0x
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
