AgentSkillsCN

release

采用语义化版本控制,创建带版本号的正式发布。

SKILL.md
--- frontmatter
name: release
description: Create a versioned release with semantic versioning

Create Release

Start or finish a release with semantic versioning.

Usage

text
/gitmastery:release         # Analyze and suggest version
/gitmastery:release 1.3.0   # Specific version

Workflow

1. Analyze Commits

bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
echo "Last tag: $LAST_TAG"
git log $LAST_TAG..HEAD --oneline

2. Determine Version Bump

PatternBumpExample
BREAKING or ! suffixMAJOR1.2.3 → 2.0.0
feat:MINOR1.2.3 → 1.3.0
fix:, perf:PATCH1.2.3 → 1.2.4

3. Present Options

yaml
AskUserQuestion:
  question: |
    Ready to create release?

    Current: v1.2.1
    Commits: 6 since last release

    Changes detected:
    - 2 feat: (new features)
    - 3 fix: (bug fixes)
    - 1 docs: (documentation)

    Suggested: 1.3.0 (MINOR)

  options:
    - "1.3.0 (Recommended)" - MINOR
    - "2.0.0" - MAJOR
    - "1.2.2" - PATCH

4. Start Release

bash
git flow release start <version>

5. Update Version Files

Common files to update:

  • pyproject.toml: version = "<version>"
  • package.json: "version": "<version>"
  • CHANGELOG.md: Add version header

6. Finish Release

Use changelog content for tag message:

bash
git flow finish --tag -m "v<version>

## Added
- Feature 1
- Feature 2

## Fixed
- Bug fix 1"

7. Push

bash
git push origin main --tags
git push origin develop

Hotfix Flow

For urgent production fixes:

bash
git checkout main
git flow hotfix start <name>
# ... fix ...
git flow finish --tag