---
name: git-branch
description: Cleepi's branch naming convention. Shape is `<type>/<ticket>-<slug>` with ticket optional, types matching git-commit (feat/fix/chore/refactor/docs/test/style/perf/build/ci). Load when about to create a git branch, when asked about branch conventions, or when deriving a PR title from a branch name.
---

# git-branch

You are about to create a git branch or read one and turn it
into something else (a PR title, a commit message scope). Use
this convention.

## The format

```
<type>/<ticket>-<slug>
```

Where:

- `<type>` is one of the Angular set: `feat`, `fix`, `chore`,
  `refactor`, `docs`, `test`, `style`, `perf`, `build`, `ci`,
  `revert`. Same set as `git-commit`.
- `<ticket>` is the tracker id (`AC-NNN`, `LIN-NNN`,
  `DRAFT-NNN`, `gh-NN`, anything matching `[A-Z]+-[0-9]+` or
  `[a-z]+-[0-9]+`). **Optional** — skip for work too small to
  warrant a ticket.
- `<slug>` is kebab-case, ≤ ~5 words, describes the intent.

## Examples

With ticket:

```
feat/AC-123-rename-primary-button
fix/AC-456-null-deref-on-empty-jql
refactor/DRAFT-005-extract-merger
docs/AC-789-clarify-install
test/AC-321-cover-ticket-resolution
```

Without ticket (trivial work — typos, mechanical refactors,
formatting, dep bumps):

```
chore/bump-prettier
docs/fix-readme-typo
style/format-package
build/pin-pi-subagents
```

## Hard rules

- **Always start with `<type>/`.** A branch named
  `rename-button` or `AC-123-rename-button` is wrong.
- **Slug is lowercase, kebab-case.** No `camelCase`, no
  `snake_case`, no spaces, no slashes inside the slug.
- **No trailing slash, no trailing dash.**
- **No personal namespacing.** `honza/feat/...` is wrong.
  Cleepi branches belong to the repo, not the author.
- **No version numbers in the slug** unless the work *is*
  the version (e.g. `chore/release-0.2.0`).

## Anti-patterns

| Wrong | Right |
| --- | --- |
| `rename-button` | `feat/rename-button` |
| `AC-123-rename-button` | `feat/AC-123-rename-button` |
| `feat/AC-123_rename_button` | `feat/AC-123-rename-button` |
| `feat/AC-123-RenameButton` | `feat/AC-123-rename-button` |
| `honza/feat/AC-123-...` | `feat/AC-123-...` |
| `feature/AC-123-...` | `feat/AC-123-...` |
| `bugfix/AC-456-...` | `fix/AC-456-...` |

## Deriving things from the branch

The branch name encodes everything `/pr` needs to write a PR
title. Given `feat/AC-123-rename-primary-button`:

- `<type>` → `feat`
- `<ticket>` → `AC-123`
- `<slug>` → `rename-primary-button` → "rename primary button"

PR title becomes `feat(AC-123): rename primary button`. Domain
is filled by `/pr` from cwd (per `git-commit` resolution).

Without a ticket — `chore/bump-prettier` — title is
`chore(<domain>): bump prettier`.

## Tuning

Don't edit the package skill. Copy to project scope and edit
there:

```bash
cp .pi/agent/skills/git-branch/SKILL.md .pi/skills/git-branch/SKILL.md
```

Project scope wins on collision.
