Skip to content
Git Flow cover
GitFree · MIT

Git Flow

Conventional commits, PR descriptions and worktrees — with a validation gate that runs before you write history.

v1.0.0 · ~881 tokens · ⬇ 2 · Updated July 6, 2026

What it does

Unifies the three git moments that go wrong (commit message, PR description, parallel work) into one token-lean skill. Signature: a pre-commit validation gate — conventional-commit regex, diff-message match check, secret sweep on added lines, and a breaking-change detector checklist. Existing skills split this across 3+ overlapping skills with zero validation; this one gates everything.

Example uses

Commit with a validated message

Your changes are staged and you want a conventional commit whose message actually matches the diff, gated for secrets first.

I've staged the changes that add rate limiting to our public API. Run the full gate before writing history: check the staged diff for secrets and stray .env files, verify the message covers everything in the diff, then commit it as a proper conventional commit. If unrelated changes snuck in, tell me to split instead of widening the message.

Write the PR description

The branch is done and reviewers need a description they can act on — what, why, how to verify — in under 300 words.

Write the PR description for my branch feature/webhook-retries. It adds exponential backoff to failed webhook deliveries in our Rails app, with a max of 5 attempts. Use the What / Why / How to verify / Risk & rollback structure, and make the verification steps something a reviewer can actually run locally.

Set up a hotfix worktree

A production hotfix lands while you are mid-feature and you need both branches in flight without stash gymnastics.

I'm mid-refactor on feature/search-v2 and a production hotfix just came in. Set up a git worktree for a hotfix branch off main so I can work on both in parallel without stashing, and remind me of the worktree cleanup step once the hotfix merges.

Install

# 1. Create the skill folder in your Claude setup
mkdir -p ~/.claude/skills/git-flow

# 2. Download SKILL.md into it (or move the file you just downloaded)
#    → ~/.claude/skills/git-flow/SKILL.md

# 3. Claude Code auto-discovers it on next launch.

Inside the skill

SKILL.md
---
name: git-flow
description: Write conventional commit messages, PR descriptions, and manage git worktrees with a validation gate. Use when committing changes, opening or describing a pull request, splitting mixed changes, or working multiple tasks in parallel ("commit this", "write the PR description", "set up a worktree").
---

# Git Flow

One skill for the three git moments that go wrong: the commit message, the PR
description, and parallel work. Everything here is gated — validate before you
write history, because history is forever.

## Commit messages (Conventional Commits)

Format: `type(scope): subject`

- **Types**: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.
- **Subject**: imperative mood ("add", not "added"/"adds"), no trailing period,
  ≤ 72 chars. The subject answers "applying this commit will…".
- **Scope**: the module/area actually touched (optional but preferred).
- **Body** (only when the diff does not explain itself): the WHY, wrapped at 72.
  Never narrate the diff line by line.
- **Breaking change**: `type(scope)!: subject` AND a `BREAKING CHANGE:` footer
  describing the migration path.

### Validation gate — run BEFORE committing

1. Message matches:
   `^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9./-]+\))?!?: [a-z].{0,70}[^.]$`
2. **Diff–message match**: read the staged diff. If the diff contains changes the
   subject does not cover, either split the commit or widen the message. One
   commit = one logical change.
3. **Secret sweep** on the staged diff — block the commit on any hit of:
   `(api[_-]?key|secret|token|password|BEGIN [A-Z]+ PRIVATE KEY|sk-[A-Za-z0-9]{20,})`
   in ADDED lines. False positive? Rename the variable or add context — never wave it through.
4. No `.env`, credentials, or generated junk staged unintentionally
   (`git status` review is part of the gate, not optional).

### Breaking-change detector (check the diff for any of these)

- Removed or renamed: exported function, public route, CLI flag, config key.
- Changed: function signature, return shape, DB schema, response format.
- Added: required env var, required migration, minimum runtime version.
If any box ticks → the commit is `!` + BREAKING CHANGE footer, no exceptions.

## PR descriptions

Template — keep the whole thing under ~300 words:

```
## What
<one paragraph: the change, user-visible first>

## Why
<the problem or requirement this solves — link the issue>

## How to verify
<numbered steps a reviewer can actually run>

## Risk & rollback
<blast radius if wrong · how to revert (usually: revert this PR)>
```

Rules: no "misc fixes" PRs — split them. Screenshots for any UI change.
If "How to verify" is hard to write, the PR is too big.

## Worktrees (parallel work without stash hell)

When: reviewing a PR while mid-feature, hotfix during a refactor, two tasks in flight.

```
git worktree add ../repo-<task> -b <branch>   # create
git worktree list                             # audit what exists
git worktree remove ../repo-<task>            # after merge — always clean up
```

Hygiene: one branch per worktree, never two worktrees on one branch, remove the
worktree when the branch merges (stale worktrees are where confusion breeds).

## Anti-patterns

- `git commit -m "fix"` — if the subject could describe any commit, it describes none.
- Amending or force-pushing shared history.
- A PR description that restates the diff instead of the intent.
- Committing through a failing hook with `--no-verify`.

Changelog

  • v1.0.02026-07-03Initial clean-room write.

Frequently asked questions

Is Git Flow free?

Yes. Git Flow is free to download and MIT-licensed.

Where do I install Git Flow?

Place the SKILL.md file in ~/.claude/skills/git-flow/ and Claude Code auto-discovers it on next launch.

How many tokens does Git Flow use?

About 881 tokens — it is designed to be token-lean.

Anthony M. — Founder & Lead Reviewer
Anthony M.Verified Builder

We're developers and SaaS builders who use these tools daily in production. Every review comes from hands-on experience building real products — DealPropFirm, ThePlanetIndicator, PropFirmsCodes, and many more. We don't just review tools — we build and ship with them every day.

Written and tested by developers who build with these tools daily.