Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. Download free →
CLSkills
Git & Version Controlbeginner

Changelog Generator

Share

Generate CHANGELOG.md from git history using conventional commits

Works with OpenClaude

You are a Git changelog automation expert. The user wants to generate a CHANGELOG.md file from git history by parsing conventional commits.

What to check first

  • Verify your git repository uses conventional commits (format: type(scope): message)
  • Check if you have git log access and proper commit history
  • Confirm the repository has tags or version markers you want to group by
  • Look for existing CHANGELOG.md to understand the format you're extending

Steps

  1. Run git log --oneline --all to inspect your recent commits and verify they follow conventional commit format (feat:, fix:, docs:, refactor:, etc.)
  2. Identify your starting point: run git tag -l to see existing version tags, or use git rev-list --count HEAD to get total commits
  3. Create a changelog generator script that uses git log --format with a custom delimiter to parse commits by type and scope
  4. Run git log --pretty=format:%B with a filter to extract conventional commit messages since the last tag using git log <last-tag>..HEAD
  5. Group commits by type (feat, fix, docs, refactor, perf, etc.) and sort them into changelog sections
  6. Generate markdown sections with ## [version] headers, subsections like ### Features, ### Bug Fixes, and commit entries
  7. Prepend new entries to existing CHANGELOG.md or create a new file, preserving git history
  8. Verify the output is valid markdown by checking that all headers, lists, and links are properly formatted

Code

#!/bin/bash
# Generate CHANGELOG.md from conventional commits

CHANGELOG="CHANGELOG.md"
TEMP_CHANGELOG="CHANGELOG.md.tmp"

# Get the last tag, or use the beginning of history
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
  COMMIT_RANGE="HEAD"
else
  COMMIT_RANGE="$LAST_TAG..HEAD"
fi

# Initialize temp file with header
{
  echo "# Changelog"
  echo ""
  echo "All notable changes to this project are documented in this file."
  echo ""
  
  # Get current version from tag or use date
  VERSION=$(git describe --tags --abbrev=0 2>/dev/null || date +%Y.%m.%d)
  DATE=$(git log -1 --format=%ai $COMMIT_RANGE | cut -d' ' -f1)
  
  if [ -n "$(git rev-list $COMMIT_RANGE 2>/dev/null)" ]; then
    echo "## [$VERSION] - $DATE"
    echo ""
    
    # Extract and group conventional commits
    FEATURES=$(git log $COMMIT_RANGE --pretty=format:"%B" | grep -E "^feat(\(.+\))?:" | sed 's/^feat

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
gitchangelogdocumentation

Install command:

curl -o ~/.claude/skills/changelog-generator.md https://claude-skills-hub.vercel.app/skills/git/changelog-generator.md

Related Git & Version Control Skills

Other Claude Code skills in the same category — free to download.

Want a Git & Version Control skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.