Analyze git branches and generate structured MR/PR descriptions with domain-based change categorization — bug fixes, enhancements, technical debt, documentation, testing, build/CI, and non-functional changes. Use when preparing merge request descriptions, pull request bodies, writing changelogs from git diffs, documenting branch changes, or generating release notes. Works with GitHub and GitLab without requiring JIRA or issue tracker integration.
Generate comprehensive, business-focused merge request descriptions by analyzing git changes. This skill adapts the structured analysis approach from JIRA release notes to work purely with git data.
# Analyze current branch against main
/create-merge-request-changelog
# Analyze specific branch
/create-merge-request-changelog feature/new-auth
# Analyze specific branch against custom target
/create-merge-request-changelog feature/new-auth develop
# Analyze specific commit range
/create-merge-request-changelog abc123f def456gRun the Python CLI to gather commits, diffs, and statistics:
uv run scripts/analyze_git_changes.py [base_ref] [head_ref] --output-dir /tmp/mr-analysisExamples:
# Current branch vs main (default)
uv run scripts/analyze_git_changes.py
# Specific branch vs develop
uv run scripts/analyze_git_changes.py develop feature/new-auth
# Specific commit range
uv run scripts/analyze_git_changes.py abc123f def456g
# Custom output directory
uv run scripts/analyze_git_changes.py main HEAD --output-dir ./analysis-outputOutput files created:
commits_oneline.txt - Concise commit listcommits_detailed.txt - Full commit messages with metadatachanges.diff - Complete unified diffchanges_stat.txt - Diffstat summarychanged_files.txt - File list with change status (A/M/D)changes_numstat.txt - Per-file line changessummary.json - Machine-readable statisticsUse the GitLab CLI integration to fetch existing MR data:
uv run scripts/fetch_gitlab_mr.py <mr-id> --output /tmp/mr-data.jsonExamples:
# By MR ID
uv run scripts/fetch_gitlab_mr.py 123
# By !notation
uv run scripts/fetch_gitlab_mr.py !123
# By full URL
uv run scripts/fetch_gitlab_mr.py https://gitlab.com/org/project/-/merge_requests/123
# Without diff (faster)
uv run scripts/fetch_gitlab_mr.py 123 --no-diff
# Custom output file
uv run scripts/fetch_gitlab_mr.py 123 --output ./mr-metadata.jsonOutput: JSON file with MR metadata, commits, and diffs
Load the analysis prompts and use them to categorize changes:
references/analysis_prompts.mdThe AI analysis will:
Use the Python formatter to generate polished markdown from AI analysis:
uv run scripts/format_mr_description.py <analysis-json> --output /tmp/mr-description.mdExamples:
# With markdown preview (default)
python scripts/format_mr_description.py analysis.json
# Without preview
python scripts/format_mr_description.py analysis.json --no-preview
# Custom output file
python scripts/format_mr_description.py analysis.json --output ./MR_DESCRIPTION.md
# With custom title
python scripts/format_mr_description.py analysis.json --title "feat: Add authentication system"The formatter automatically:
references/output_template.mdThe final MR description is ready to:
Integration examples:
# GitLab MR creation
python scripts/format_mr_description.py analysis.json --output /tmp/mr.md --no-preview
glab mr create --fill --description "$(cat /tmp/mr.md)"
# GitHub PR creation
python scripts/format_mr_description.py analysis.json --output /tmp/pr.md --no-preview
gh pr create --fill --body-file /tmp/pr.md
# Copy to clipboard (macOS)
python scripts/format_mr_description.py analysis.json --no-preview --output - | pbcopy
# Copy to clipboard (Linux)
python scripts/format_mr_description.py analysis.json --no-preview --output - | xclip -selection clipboardIndicators:
What to capture:
Indicators:
What to capture:
Indicators:
What to capture:
Indicators:
*.md, *.rst, README, docs/What to capture:
Indicators:
test_*.py, *.spec.js, tests/, __tests__/What to capture:
Indicators:
.github/workflows/, .gitlab-ci.yml, Dockerfile, build scriptsWhat to capture:
Indicators:
What to capture:
Automatically detect and highlight breaking changes:
Detection patterns:
Required information:
Map files to logical components for better organization:
{
"src/auth/*": "Authentication",
"src/api/*": "API Layer",
"src/database/*": "Data Layer",
"tests/*": "Test Suite",
"docs/*": "Documentation"
}The skill automatically recognizes conventional commit prefixes:
fix: → Bug Fixesfeat: → Enhancementsrefactor: → Technical Debtdocs: → Documentationtest: → Testingchore: → Non-Functionalci: → Build & CIperf: → Performance (Enhancement with perf tag)style: → Non-Functional (formatting)Use with GitLab or GitHub CLI tools:
# Generate description and create GitLab MR
/create-merge-request-changelog
# ... Copy output to clipboard ...
glab mr create --fill --description "$(pbpaste)"
# Generate description and create GitHub PR
/create-merge-request-changelog
# ... Save output to file ...
gh pr create --fill --body-file /tmp/mr-description.md# feat: Add user authentication with JWT and refresh tokens
## Summary
This merge request implements a complete user authentication system using JWT tokens with refresh token rotation. The implementation includes password hashing with bcrypt, token expiration handling, and secure session management.
## Statistics
- **Commits**: 12
- **Files Changed**: 18
- **Lines Added**: 1,247
- **Lines Deleted**: 89
## Changes by Category
### ✨ Enhancements
- **JWT-based authentication system with refresh token rotation**
- **Feature:** Complete authentication flow with access tokens (15min) and refresh tokens (7 days)
- **Benefits:** Secure, stateless authentication with automatic token refresh for better UX
- **Usage:** POST /api/auth/login with credentials, use returned access token in Authorization header
- **Files:** `src/auth/jwt_service.py`, `src/auth/token_store.py`, `src/api/auth_routes.py`
- **Technical Details:** Uses RS256 algorithm, tokens stored in Redis, automatic cleanup of expired tokens
- **Password strength validation and bcrypt hashing**
- **Feature:** Enforces strong passwords (min 12 chars, mixed case, numbers, symbols) with bcrypt hashing
- **Benefits:** Prevents weak passwords and protects against rainbow table attacks
- **Usage:** Automatic validation on user registration and password changes
- **Files:** `src/auth/password_validator.py`, `src/models/user.py`
### 🧪 Testing
- **Comprehensive authentication test suite**: Added 47 unit tests and 12 integration tests covering all auth flows
- **Type:** unit, integration
- **Files:** `tests/unit/test_jwt_service.py`, `tests/integration/test_auth_flow.py`
### 📚 Documentation
- **Authentication API documentation with examples**: Complete API docs with curl examples and error codes
- **Location:** `docs/api/authentication.md`, added to main README
- **Importance:** Enables developers to integrate authentication without trial-and-error
## Components Affected
- **Authentication**: Complete new authentication system
- **API Layer**: New /api/auth endpoints
- **User Model**: Added password hashing and token tracking
- **Database**: New refresh_tokens table
## Breaking Changes ⚠️
- **User model now requires password hashing**
- **Migration:** Run `python scripts/migrate_passwords.py` to hash existing plaintext passwords
- **Affected:** `src/models/user.py`, all user creation code
- **Commits:** abc123f, def456g
---
*Generated by Claude Code `/create-merge-request-changelog` skill*Check:
Solution:
git rev-parse --git-dir # Verify git repo
git branch -a | grep <branch-name> # Verify branch exists
git log <base>..<head> # Verify commits existSolution: Use filters to focus analysis:
# Exclude generated files
git diff <base>..<head> -- . ':(exclude)dist/*' ':(exclude)*.lock'Solution: The analysis is based on patterns - you can:
# 1. Extract git data
python scripts/analyze_git_changes.py main feature/auth-system --output-dir /tmp/analysis
# 2. Analyze with AI (using prompts from references/analysis_prompts.md)
# - Read commits and diffs from /tmp/analysis
# - Categorize changes using the primary analysis prompt
# - Save categorized JSON to /tmp/analysis/categorized.json
# 3. Format into MR description
python scripts/format_mr_description.py /tmp/analysis/categorized.json --output /tmp/mr-desc.md
# 4. Create GitLab MR
glab mr create --fill --description "$(cat /tmp/mr-desc.md)"# 1. Fetch existing MR data
python scripts/fetch_gitlab_mr.py 123 --output /tmp/mr-data.json
# 2. Analyze with AI (enhance existing description)
# - Read MR metadata from /tmp/mr-data.json
# - Re-analyze commits/diffs with updated prompts
# - Save enhanced JSON to /tmp/enhanced.json
# 3. Format improved description
python scripts/format_mr_description.py /tmp/enhanced.json --output /tmp/updated-mr.md
# 4. Update MR description
glab mr update 123 --description "$(cat /tmp/updated-mr.md)"# Quick preview without saving files
python scripts/analyze_git_changes.py | \
python scripts/format_mr_description.py --previewExtracts git data between two references.
Usage: python scripts/analyze_git_changes.py [BASE_REF] [HEAD_REF] [OPTIONS]
Options:
--output-dir PATH: Output directory (default: current directory)Defaults: BASE_REF=main, HEAD_REF=HEAD
Fetches GitLab MR data using the python-gitlab API.
Usage: python scripts/fetch_gitlab_mr.py MR_ID [OPTIONS]
Options:
--output PATH: Output JSON file (default: stdout)--no-diff: Skip diff fetching (faster)MR ID formats: 123, !123, or full URL
Formats AI analysis into markdown MR description.
Usage: python scripts/format_mr_description.py ANALYSIS_JSON [OPTIONS]
Options:
--output PATH: Output file (default: stdout, - for explicit stdout)--title TEXT: Custom MR title--no-preview: Skip markdown preview--max-files INT: Max files to show per change (default: 5)Extracts git data between two references.
Usage: python scripts/analyze_git_changes.py [BASE_REF] [HEAD_REF] [OPTIONS]
Options:
--output-dir PATH: Output directory (default: current directory)Defaults: BASE_REF=main, HEAD_REF=HEAD
Fetches GitLab MR data using the python-gitlab API.
Usage: python scripts/fetch_gitlab_mr.py MR_ID [OPTIONS]
Options:
--output PATH: Output JSON file (default: stdout)--no-diff: Skip diff fetching (faster)MR ID formats: 123, !123, or full URL
Formats AI analysis into markdown MR description.
Usage: python scripts/format_mr_description.py ANALYSIS_JSON [OPTIONS]
Options:
--output PATH: Output file (default: stdout, - for explicit stdout)--title TEXT: Custom MR title--no-preview: Skip markdown preview--max-files INT: Max files to show per change (default: 5)Use the /daily-releases skill to create AI-analyzed GitHub Releases for every day with commits. It uses this skill's analyze_git_changes.py, analysis_prompts.md, and format_mr_description.py as the rendering pipeline.
3e0b2af
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.