Skip to content
Back to skills

Gitflow

ASecurity

A GitFlow workflow for branches and releases, for a repository whose AGENTS.md names gitflow: start and finish a feature, bugfix, release or hotfix, bump the version on the release branch, tag `vX.Y.Z`, merge into develop and main, and publish. Use it even when the person does not say "gitflow" ("cut a release", "ship 2.1.0", "merge this to main", "tag the version", "start a feature for X"). A repository on git-workflow uses git-workflow. It covers branch names and validation, the transaction...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsgobashgit

Works with

  • vscode

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add JorgeCostaMacia/agent-harness --skill gitflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gitflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gitflow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jorgecostamacia-gitflow-agent-harness/badge)](https://www.skillsdirectory.com/skills/jorgecostamacia-gitflow-agent-harness)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gitflow
description: >-
  A GitFlow workflow for branches and releases, for a repository whose AGENTS.md
  names gitflow: start and finish a feature, bugfix, release or hotfix, bump the
  version on the release branch, tag `vX.Y.Z`, merge into develop and main, and
  publish. Use it even when the person does not say "gitflow" ("cut a release",
  "ship 2.1.0", "merge this to main", "tag the version", "start a feature for
  X"). A repository on git-workflow uses git-workflow. It covers branch names
  and validation, the transactional release and hotfix finish, default merge
  messages, commit identity, and releases that publish in tiers.
---

# GitFlow

This skill follows the [`gitflow-vscode`](https://github.com/JorgeCostaMacia/gitflow-vscode) extension. When something is not clear, its source is the reference. Follow the skill from the start of any branch or release work. Never merge `develop` into `main` outside a release finish, and never add a tag later.

> [!IMPORTANT]
> The agent prepares, and the person finishes. `agent-guards` blocks the agent from merging into `develop` or `main`, from pushing them and from deleting a tag. So the agent starts the branch, commits on it, pushes it and runs the checks before a finish. For every finish step (the merges into `develop` and `main`, the tag, the pushes, the branch deletion, and a rollback with `git tag -d` and `git reset`), it gives the person the exact commands in one block, with every value filled in, and stops.

## Before following it

- The repository's `AGENTS.md` names `gitflow`. When it names another workflow, follow that one and say so. When it names none, ask the person which workflow the repository follows.
- The main branch is `main`, or `master` where that is the one that exists.

## Branch model

| Type | Branch | Starts from | Merges into | Tag |
| --- | --- | --- | --- | --- |
| Feature | `feature/<name>-<ts>` | develop | develop | none |
| Bugfix | `bugfix/<name>-<ts>` | develop | develop | none |
| Release | `release/<version>` | develop | develop and main | `v<version>` |
| Hotfix | `hotfix/<version>` | main | develop and main | `v<version>` |

- The only branch prefixes are `feature`, `bugfix`, `release` and `hotfix`. `chore` is a type of commit message, not a branch prefix.
- A hotfix merges into `develop` even while a release branch is open, because the extension does that. When the open release branch needs the fix, merge `develop` into it by hand.

## Validation

Reject a value that is not valid. Do not correct it.

- **Name** of a feature or bugfix: a lowercase letter or digit first, then lowercase letters, digits and `. _ - /`. Uppercase letters, spaces and accents are not valid.
- **Version** of a release or hotfix: strict SemVer with three parts (`1.0.0`, optionally `1.0.0-rc.1`). The version bump goes on the `release/<version>` branch, not after the merge.
- **Tag:** `v` and the version (`2.0.4` gives `v2.0.4`). Always an annotated tag, created with `--cleanup=verbatim`. Without it, git removes the lines that start with `#` (the Markdown headings) as comments.
- If the tag already exists, locally or on origin, someone already used that version. Choose another version. Never use a version again.

## Merges

- Use `git merge --no-ff --no-edit`, so git keeps its default merge message (`Merge branch '<x>'`). Never pass `-m`: the default message keeps the titles of the GitHub Actions runs the same.
- If a merge conflicts, `git merge --abort` leaves the repository as it was.

## Feature or bugfix start

1. Validate `<name>`.
2. Check that the working tree is clean. Run `git checkout develop && git pull`.
3. Run `git checkout -b feature/<name>-<ts>`, where `<ts>` is the local time as `YYYYMMDDHHmm`. Use `bugfix/` for a bugfix.
4. Push the branch for backup: `git push -u origin <branch>` (see "Pushing").

## Feature or bugfix finish

1. Check that the working tree is clean, that the branch exists and that it is pushed.
2. Tell the person what the finish does: it merges `<branch>` into `develop`, pushes `develop`, and deletes the branch. Give them the commands to run, in this order:

   ```bash
   git checkout develop && git pull
   git merge --no-ff --no-edit <branch>
   git push origin develop
   git push origin --delete <branch>
   git branch -d <branch>
   ```

   The branch is deleted on the remote first: that removes the upstream tracking ref, so `-d` does not refuse the branch as "not merged to its upstream". If the merge conflicts, `git merge --abort` leaves `develop` as it was.
3. Stop. When the person says that it is done, check that `develop` on origin holds the merge.

## Release or hotfix start

1. Validate the version.
2. Check that the working tree is clean. For a release, run `git checkout develop && git pull && git checkout -b release/<version>`. For a hotfix, do the same from `main`.
3. Run `git push -u origin <branch>`.
4. Bump the version of every package or project on this branch, and commit. The extension does not bump the version, so this step is yours. Its `CHANGELOG.md` entry goes in the same commit: every version gets one (see the `changelog` skill).

## Release or hotfix finish

The finish merges into `develop` first, then into `main`. If any step fails, the person undoes all of them.

1. Check that the working tree is clean, that the branch is pushed, and that `v<version>` exists neither locally (`git tag -l v<version>`) nor on origin (`git ls-remote --tags origin v<version>`). Run `git pull` on `main` and on `develop`, then record their commits (`git rev-parse main develop`) for the rollback.
2. Tell the person what the finish does: it merges `<branch>` into `develop` and `main`, tags `v<version>`, pushes `main`, `develop` and the tag at once, and deletes the branch. Give them the commands to run, in this order. For a hotfix, the tag message is `Hotfix v<version>`; longer notes are possible.

   ```bash
   git checkout develop && git merge --no-ff --no-edit <branch>
   git checkout main && git merge --no-ff --no-edit <branch>
   git tag -a v<version> main --cleanup=verbatim -m "Release v<version>"
   git push --atomic origin main develop --tags
   git push origin --delete <branch>
   git branch -d <branch>
   git checkout develop
   ```

   The atomic push gives the remote all the refs or none.
3. Give them the rollback too, with the commits of step 1 filled in, for any failure (a conflict, a rejected push). They run only the lines that apply: `git merge --abort` while a merge is in progress, `git tag -d` once the tag exists. Never leave `main` half merged.

   ```bash
   git merge --abort
   git tag -d v<version>
   git checkout main && git reset --hard <main commit>
   git checkout develop && git reset --hard <develop commit>
   ```

4. Stop. When the person says that it is done, check that the tag and both branches are on origin.

## Pushing

The `gitflow-vscode` extension does the pushes itself. The agent pushes only the branch that it started (`git push -u origin <branch>`). When it cannot push even that, it does every local step, stops, and gives the person the exact command.

## Commit identity

Commit as the `git-commit` skill says, which covers the identity.

## Releases that publish in tiers

Sometimes a release cannot fit in one `release/<version>` branch. When packages depend on each other through a package registry, a dependent can only build against a version that is already published. So a set of packages in tiers (for example tier0, then tier1, then the top) must publish in separate pushes. The registry must index each tier before the next tier references it, and one release branch cannot span that time.

> [!IMPORTANT]
> When this happens, tell the person before you continue, and agree the plan with them. Never change to merges from `develop` to `main` for each tier without telling them. When you release the tiers one by one, the final tag still goes on `main` at the end. It is a normal annotated tag with an atomic push.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.