Skip to content

Instantly share code, notes, and snippets.

@williamli
Created June 26, 2025 02:20
Show Gist options
  • Save williamli/a14ac33e519b73b2dffcec501c4cb117 to your computer and use it in GitHub Desktop.
Save williamli/a14ac33e519b73b2dffcec501c4cb117 to your computer and use it in GitHub Desktop.
CLAUDE.md instructions for Semantic Versioning & Release (summarise changes -> version bump -> update README and CHANGELOG -> commit )

Version Management & Git Workflow

Semantic Versioning

Follow semantic versioning (MAJOR.MINOR.PATCH) for all commits:

  • PATCH (0.0.X) - Bug fixes, documentation updates, minor changes
  • MINOR (0.X.0) - New features, API additions, significant enhancements
  • MAJOR (X.0.0) - Breaking changes, major architecture changes

Version Bump Process

For every commit:

  1. Determine version type based on changes:

    • Fix/docs/refactor → PATCH
    • New feature/enhancement → MINOR
    • Breaking change → MAJOR
  2. Update package.json version manually (don't use npm version to avoid auto-tags)

  3. Update package-lock.json safely:

    # Option 1: Use pnpm (recommended - more reliable)
    pnpm install
    
    # Option 2: Manual edit (be precise)
    # Only change the "version" field at the top, NOT lockfileVersion or dependency versions
    # Example: "version": "0.1.1" → "version": "0.1.2"
  4. Update documentation:

    • README.md: Update if features, installation, or usage instructions changed
    • CHANGELOG.md: Log all changes with proper semantic versioning format
  5. Commit with semantic message:

    git add package.json package-lock.json README.md CHANGELOG.md [other-files]
    git commit -m "fix: correct API endpoint validation
    
    - Add proper input validation for article refresh endpoint
    - Fix type safety issues in WordPress GraphQL client
    - Update error handling for malformed requests
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>"

CHANGELOG Format

Follow this format for CHANGELOG.md entries:

# Changelog

## [0.1.2] - 2024-06-25

### Fixed

- Correct API endpoint validation for article refresh
- Fix type safety issues in WordPress GraphQL client
- Update error handling for malformed requests

### Added

- [if any new features]

### Changed

- [if any modifications to existing features]

### Removed

- [if any features were removed]

## [0.1.1] - 2024-06-24

...

Semantic Commit Format

<type>: <description>

[optional body]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Commit Types:

  • feat: - New feature (MINOR bump)
  • fix: - Bug fix (PATCH bump)
  • docs: - Documentation changes (PATCH bump)
  • style: - Code style changes (PATCH bump)
  • refactor: - Code refactoring (PATCH bump)
  • perf: - Performance improvements (MINOR bump)
  • test: - Adding/updating tests (PATCH bump)
  • chore: - Maintenance tasks (PATCH bump)
  • BREAKING CHANGE: - Breaking changes (MAJOR bump)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment