agentleFS
camilooscargbaptistacamilooscargbaptista/cto-toolkit/git-flow/SKILL.md

git-flow

Skill9 starsChanged 8 months agoMITView on GitHub

**Git Workflow & Branching Strategy**: Helps define and follow Git branching strategies (Git Flow, GitHub Flow, Trunk-Based), write good commit messages, manage releases, and resolve merge conflicts. Use whenever the user asks about Git workflow, branching strategy, commit conventions, release management, merge conflicts, or mentions 'git flow', 'branching', 'commit message', 'conventional commits', 'release branch', 'hotfix', 'merge conflict', 'rebase', 'cherry-pick', or asks how to organize their Git workflow.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No long-lived branches ever

    line 77
  2. Distinctive:

    Use Conventional Commits for consistency and automated changelog:

    line 91
  3. Very specific:

    Follow the same Conventional Commits format: feat(scope): description

    line 159
  4. Very specific:

    Create release branch from develop: release/v1.2.0

    line 202
  5. Distinctive:

    Rule: When in doubt, talk to the other developer whose code conflicts with yours.

    line 227
  6. Distinctive:

    Use before opening a PR to create a clean, logical commit history.

    line 233

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Workflow & Branching Strategy

Help teams choose and follow the right Git workflow. The best workflow is the one your team actually follows consistently.

Branching Strategies

Git Flow (for versioned releases)

Best for: Products with scheduled releases, mobile apps, products with multiple supported versions.

main ─────────●─────────────────●─────────── (production)
              │                 │
release/1.0 ──┼──●──●──────────┘
              │  │
develop ──────┼──┼──●──●──●──●──●──●──────── (integration)
              │     │     │        │
feature/auth ─┘     │     │        │
feature/cart ───────┘     │        │
hotfix/crash ─────────────┘        │
feature/search ────────────────────┘

Branches:

  • main — Production code. Every commit is a release tag.
  • develop — Integration branch. Features merge here.
  • feature/* — New features. Branch from develop, merge to develop.
  • release/* — Release prep. Branch from develop, merge to main + develop.
  • hotfix/* — Production fixes. Branch from main, merge to main + develop.

GitHub Flow (for continuous deployment)

Best for: SaaS, web apps, teams deploying multiple times per day.

main ──●──●──●──●──●──●──●── (always deployable)
       │     │        │
       │     │        └── feat/notifications (short-lived)
       │     └── fix/login-bug
       └── feat/dashboard

Rules:

  • main is always deployable
  • Branch from main for any change
  • Open a PR, get review, merge to main
  • Deploy after merge (automated)
  • No long-lived branches

Trunk-Based Development (for high-performing teams)

Best for: Experienced teams with strong CI, feature flags, and automated testing.

main ──●──●──●──●──●──●──●── (deploy continuously)
       │  │
       └──┘ (very short-lived branches, <1 day)

Rules:

  • Everyone commits to main (or very short branches, <1 day)
  • Feature flags for incomplete features
  • Requires excellent CI/CD and test coverage
  • No long-lived branches ever

Choosing a Strategy

FactorGit FlowGitHub FlowTrunk-Based
Release cadenceScheduledContinuousContinuous
Team experienceAnyAnyHigh
CI/CD maturityLow-MediumMediumHigh
Feature flagsOptionalOptionalRequired
Code reviewOn merge to developOn PROn PR or pair

Commit Message Convention

Use Conventional Commits for consistency and automated changelog:

<type>(<scope>): <short description>

[optional body — explain WHY, not WHAT]

[optional footer — BREAKING CHANGE, issue refs]

Types

TypeWhen
featNew feature for the user
fixBug fix
docsDocumentation only
styleFormatting, no code change
refactorCode change that neither fixes nor adds
perfPerformance improvement
testAdding or fixing tests
choreBuild process, dependencies, CI
ciCI/CD configuration changes

Examples

feat(auth): add OAuth2 login with Google

Implements Google OAuth2 using authorization code flow with PKCE.
Refresh tokens are stored in httpOnly cookies.

Closes #142

---

fix(payment): prevent double-charge on retry

The payment service was not checking idempotency keys on retries,
causing duplicate charges when the client retried after a timeout.

Fixes #256

---

refactor(orders): extract pricing logic into domain service

Moved discount calculation from OrderController to PricingService
to align with Clean Architecture (business logic in domain layer).

BREAKING CHANGE: OrderDTO no longer includes calculatedDiscount field.
Clients should call GET /orders/:id/pricing instead.

Bad Commit Messages

❌ "fix bug"
❌ "update code"
❌ "WIP"
❌ "changes"
❌ "asdfgh"
❌ "fix: fix the thing that was broken"

Pull Request Guidelines

PR Title

Follow the same Conventional Commits format: feat(scope): description

PR Description Template

## What
[Brief description of the change]

## Why
[Motivation — link to issue/ticket]

## How
[Key implementation decisions, if not obvious from the code]

## Testing
[How was this tested? What scenarios were covered?]

## Screenshots
[If UI change — before/after]

## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] No breaking changes (or documented in BREAKING CHANGE)
- [ ] PR is <400 lines (split if larger)

PR Size Guidelines

  • Ideal: <200 lines changed
  • Acceptable: 200-400 lines
  • Too large: >400 lines (split into smaller PRs)
  • Large PRs get worse reviews. Small PRs merge faster.

Release Management

Semantic Versioning (SemVer)

MAJOR.MINOR.PATCH
  │     │     └── Bug fixes (backward compatible)
  │     └──────── New features (backward compatible)
  └────────────── Breaking changes

Release Checklist

  1. Create release branch from develop: release/v1.2.0
  2. Bump version numbers
  3. Update CHANGELOG.md
  4. Final QA on release branch
  5. Merge to main + tag: git tag -a v1.2.0 -m "Release v1.2.0"
  6. Merge back to develop
  7. Deploy from main

Hotfix Process

  1. Branch from main: hotfix/v1.2.1
  2. Fix the issue
  3. Bump patch version
  4. Merge to main + tag
  5. Merge to develop (don't forget!)
  6. Deploy immediately

Common Git Operations

Resolving Merge Conflicts

  1. git fetch origin
  2. git merge origin/main (or rebase)
  3. Resolve conflicts in each file
  4. git add <resolved files>
  5. git commit (or git rebase --continue)

Rule: When in doubt, talk to the other developer whose code conflicts with yours.

Interactive Rebase (cleaning up before PR)

git rebase -i HEAD~3  # Squash/reorder last 3 commits

Use before opening a PR to create a clean, logical commit history. Don't rebase commits that are already pushed and shared.

Cherry-Pick (applying specific commits)

git cherry-pick <commit-hash>  # Apply a specific fix to another branch

Common for applying hotfixes to release branches.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.