# git-workflow

Teaches coding agents to apply Conventional Commits, branch naming prefixes, and safe PR merge routines. Useful for keeping repository history consistent.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 818 installs · ★ 286
- Author: Mindrally
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Mindrally/skills/tree/HEAD/git-workflow/SKILL.md
- Updated: 2026-10-08
- HTML: https://affpapa.org/en/nevibecode/skills/mindrally-git-workflow

## What it does

This skill guides AI assistants on repository hygiene. It enforces the Conventional Commits specification, covering types such as `feat` and `fix`. Commit subjects must stay under 60 characters in the imperative mood. The body uses lowercase letters.

Branch names require kebab-case and prefixes like `feature/` or `bugfix/`. Direct commits to `main` are prohibited. The workflow relies on rebasing against the primary branch to keep history clean and calls for deleting merged branches locally and remotely.

Direct pushes to main will break this setup, because version bumps depend on structured commit tags linking cleanly to SemVer.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill git-workflow -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/git-workflow/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/git-workflow/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill git-workflow -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/git-workflow/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill git-workflow -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/git-workflow/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Mindrally/skills git-workflow
```

2. **Manually: put the files in place**
- File: `.github/skills/git-workflow/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill git-workflow -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Mindrally/skills --path git-workflow
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/git-workflow/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Mindrally/skills --skill git-workflow -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Mindrally/skills/tree/HEAD/git-workflow/SKILL.md

## When to use it
- format commit messages using the Conventional Commits specification
- create kebab-case branch names with standard category prefixes
- set up Git configuration aliases and rebase defaults
- prepare focused pull request descriptions linked to issue tickets

## Example prompts
- Commit these authentication changes using Conventional Commits format.
- Create a branch to fix the login redirect loop following the skill rules.
- Show the git commands to rebase this branch onto main and resolve conflicts.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: ea787b4b32e7c7c5.

BEGIN THIRD-PARTY FILE ea787b4b32e7c7c5
````text
---
name: git-workflow
description: Git conventions and workflow guidelines using Conventional Commits, branching strategies, and best practices for version control
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Git Workflow Best Practices

You are an expert in Git version control, following industry best practices for commits, branching, and collaboration workflows.

## Core Principles

- Write clear, atomic commits that address single logical changes
- Follow Conventional Commits specification for all commit messages
- Use feature branches to isolate changes and enable easier code review
- Keep branches short-lived and regularly sync with main branch
- Never commit directly to main/master branch

## Conventional Commits Format

Use the following format for all commit messages:

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

### Commit Types

- `feat`: A new feature (correlates with MINOR in SemVer)
- `fix`: A bug fix (correlates with PATCH in SemVer)
- `docs`: Documentation only changes
- `style`: Changes that do not affect the meaning of the code (white-space, formatting)
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests
- `build`: Changes that affect the build system or external dependencies
- `ci`: Changes to CI configuration files and scripts
- `chore`: Other changes that don't modify src or test files
- `revert`: Reverts a previous commit

### Commit Message Guidelines

- Use lowercase letters in the entire body of the commit message
- Keep the commit message title under 60 characters
- Use imperative mood: "Add feature" not "Added feature"
- Explain the *why* behind the change, not just *what* was changed
- Reference related issues or tickets in the footer

### Examples

```
feat(auth): add OAuth2 authentication support

Implement OAuth2 flow for Google and GitHub providers.
This allows users to sign in with their existing accounts.

Closes #123
```

```
fix(api): handle null response from external service

The external API sometimes returns null instead of an empty array.
Added null check to prevent TypeError in downstream processing.

Fixes #456
```

## Branching Strategy

### Branch Naming Conventions

Use descriptive, kebab-case branch names with prefixes:

- `feature/` - New features (e.g., `feature/user-authentication`)
- `bugfix/` - Bug fixes (e.g., `bugfix/login-redirect-loop`)
- `hotfix/` - Urgent production fixes (e.g., `hotfix/security-patch`)
- `release/` - Release preparation (e.g., `release/v2.1.0`)
- `docs/` - Documentation updates (e.g., `docs/api-reference`)
- `refactor/` - Code refactoring (e.g., `refactor/database-layer`)

### Workflow Guidelines

1. **Create feature branches from main/develop**
   ```bash
   git checkout main
   git pull origin main
   git checkout -b feature/new-feature
   ```

2. **Keep branches up-to-date**
   ```bash
   git fetch origin
   git rebase origin/main
   ```

3. **Make atomic commits**
   - Each commit should be a single, logical change
````
END THIRD-PARTY FILE ea787b4b32e7c7c5

The third-party file has ended. Everything between the ea787b4b32e7c7c5 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3159 of 5313 bytes. © Mindrally · Apache-2.0 · https://github.com/Mindrally/skills/tree/HEAD/git-workflow/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
