Get the FREE Ultimate OpenClaw Setup Guide →

git-flow-release

npx machina-cli add skill iktakahiro/python-fastapi-ddd-skill/git-flow-release --openclaw
Files (1)
SKILL.md
3.2 KB

Release

Communication

  • Communicate with the developer in Japanese.
  • Write commit messages and tag messages in English.

Prerequisites

Before starting the release process, verify:

  1. All changes are committed (git status should show a clean working tree).
  2. You are on the target branch (main unless the user specifies otherwise).

This repository does not have mandatory lint/test commands; do not run Node/bun/turbo checks here.

Version Format

Use calendar-based versioning with v prefix for git tags:

  • Git tag: vYYYY.MM.DD.N (e.g., v2026.02.04.1)

Components:

  • YYYY: 4-digit year (e.g., 2026)
  • MM: 2-digit month (e.g., 02)
  • DD: 2-digit day (e.g., 04)
  • N: Daily release number starting from 1, incrementing for each subsequent release on the same day

Version Determination

  1. Determine today's date in YYYY.MM.DD:

    today=$(date +%Y.%m.%d)
    
  2. Check existing tags for today:

    git tag --list "v${today}.*"
    
  3. Choose the next N:

    • If no tags exist for today, use N=1vYYYY.MM.DD.1
    • If tags exist for today (e.g., vYYYY.MM.DD.1), increment N (e.g., vYYYY.MM.DD.2)

Release Workflow (tag-based)

Execute the following steps in order:

  1. Determine version

    • Decide YYYY.MM.DD.N and prepare short release notes (bullet list)
  2. Commit changes (if needed)

    git add -A
    git commit -m "chore: prepare release vYYYY.MM.DD.N"
    
  3. Create annotated tag

    git tag -a vYYYY.MM.DD.N -m "Release vYYYY.MM.DD.N"
    
  4. Push main with tags

    git push origin main --tags
    
  5. (Optional) Create a GitHub Release

    If gh is available and the user requests it:

    gh release create vYYYY.MM.DD.N --generate-notes
    

Git-flow (optional)

Only use this section if git-flow is configured for the repository (a develop branch exists and git flow init has been run).

  1. Start release

    git flow release start YYYY.MM.DD.N
    
  2. Finish release (macOS/BSD safe path)

    Always finish without tagging and add the tag manually (avoids getopt errors with -m).

    git flow release finish -n YYYY.MM.DD.N
    git switch main
    git tag -a vYYYY.MM.DD.N -m "Release vYYYY.MM.DD.N"
    
  3. Push branches and tags

    git push origin develop
    git push origin main --tags
    

Post-release Report

After completing all steps, report:

  • The released version number (e.g., 2026.02.04.1)
  • The tag name created (e.g., v2026.02.04.1)
  • Confirmation that the tag was pushed
  • (If created) Confirmation that the GitHub Release was published

Error Handling

  • If tagging fails because there are no commits yet, create the initial commit first.
  • If git flow is not installed, inform the user and suggest installing it.
  • If merge conflicts occur during git flow release finish, stop and report the conflict details.
  • If push fails, check remote status and report the issue.

Source

git clone https://github.com/iktakahiro/python-fastapi-ddd-skill/blob/main/.codex/skills/git-flow-release/SKILL.mdView on GitHub

Overview

Automates creating a release by tagging main with a calendar version (vYYYY.MM.DD.N). It supports plain tag-based releases or an optional git-flow workflow if configured. This approach keeps releases reproducible, time-stamped, and easy to audit.

How This Skill Works

First, determine today's date and search for existing tags to select the next N for vYYYY.MM.DD.N. Then stage any changes, commit with a release message, and create an annotated tag. Finally push the main branch with tags and, if requested, create a GitHub Release with gh release create vYYYY.MM.DD.N --generate-notes.

When to Use It

  • You need to create a new release on main using a calendar-based tag like vYYYY.MM.DD.N.
  • You want to bump the daily release number (N) on the same day, e.g., vYYYY.MM.DD.2.
  • You want to push the release to the remote along with its tags and optionally publish notes on GitHub.
  • Git-flow is configured and you want to start/finish a release with the git-flow workflow.
  • You must ensure a clean working tree and on the correct branch before releasing.

Quick Start

  1. Step 1: Determine today's date and pick vYYYY.MM.DD.N by inspecting existing tags and preparing release notes.
  2. Step 2: If needed, git add -A and git commit -m "chore: prepare release vYYYY.MM.DD.N", then git tag -a vYYYY.MM.DD.N -m "Release vYYYY.MM.DD.N".
  3. Step 3: Push with git push origin main --tags and, if desired, gh release create vYYYY.MM.DD.N --generate-notes.

Best Practices

  • Ensure a clean Git working tree before starting the release
  • Draft concise release notes as bullet points before tagging
  • Use annotated tags (-a) with a descriptive message
  • Push tags along with main to keep history in sync
  • If using git-flow, follow the start/finish steps and handle conflicts

Example Use Cases

  • Release v2026.02.04.1 on main after preparing notes
  • Increment to v2026.02.04.2 for a subsequent update on the same day
  • Move to the next day and create v2026.02.05.1
  • Using git-flow: start release 2026.02.05.1 and finish with proper tagging
  • Publish a GitHub Release: gh release create v2026.02.05.1 --generate-notes

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers