Draft a new release. Bumps version, generates CHANGELOG.md from git history, and creates a PR.
Add this skill
npx mdskills install grafana/draft-releaseDetailed release automation with clear git workflow, structured changelog generation, and PR creation steps
1---2name: draft-release3description: Draft a new release. Bumps version, generates CHANGELOG.md from git history, and creates a PR.4argument-hint: <major|minor|patch>5allowed-tools: Bash(git *), Bash(gh *), Bash(date *), Read, Write, Edit, Glob6---78# Draft Release910You are creating a new release for the mcp-grafana project. The user has provided a bump level: `major`, `minor`, or `patch`.1112## How the release pipeline works13141. This skill creates a `release/v*` branch with a CHANGELOG.md update and opens a PR152. When the PR is merged, the `auto-tag.yml` workflow automatically creates the git tag163. The tag triggers `release.yml` (goreleaser → GitHub Release + binaries) and `docker.yml` (Docker images + MCP Registry)1718Your job is step 1 only. Do NOT create tags manually.1920## Step 1: Determine the new version21221. Get the latest semver tag:23 ```24 git tag --sort=-version:refname | head -125 ```262. Parse the tag as `vMAJOR.MINOR.PATCH` and bump according to the argument:27 - `major` → increment MAJOR, reset MINOR and PATCH to 028 - `minor` → increment MINOR, reset PATCH to 029 - `patch` → increment PATCH303. The new version string is `v<MAJOR>.<MINOR>.<PATCH>` (e.g. `v0.11.0`). The previous tag is the "from" ref.3132## Step 2: Create the release branch3334```35git checkout main36git pull origin main37git checkout -b release/v<NEW_VERSION>38```3940## Step 3: Gather and categorize commits4142Run:43```44git log <PREV_TAG>..HEAD --no-merges --format="%H %s"45```4647For each commit, categorize by its conventional commit prefix:4849| Prefix | CHANGELOG Section |50|--------|------------------|51| `feat` | **Added** |52| `fix` (security-related) | **Security** |53| `fix` | **Fixed** |54| `refactor`, `perf` | **Changed** |55| `BREAKING CHANGE` or `!:` | **Removed** (or note as breaking in relevant section) |5657**Skip these commits entirely:**58- `chore(deps)` — dependency bumps59- `chore` commits that only touch CI config, GitHub Actions, or similar60- `docs` commits that only update README or non-user-facing docs61- `test` commits that only add/fix tests62- `ci` commits6364## Step 4: Write human-readable entries6566For each significant commit:67681. Read the full commit message: `git log <hash> -1 --format="%B"`692. Extract the PR number from the commit message (look for `(#NNN)` in the subject or a `PR:` line)703. Derive the repo URL: `git remote get-url origin` → extract `https://github.com/<org>/<repo>`714. Write a concise, human-readable description of the change (not just the commit subject). Focus on what the user gains.725. Format as: `- Description of the change ([#NNN](https://github.com/<org>/<repo>/pull/NNN))`7374If a commit lacks a PR number, omit the link.7576## Step 5: Write CHANGELOG.md7778The CHANGELOG follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.7980### If CHANGELOG.md already exists8182Read the existing file. Insert the new version section **after** the header block and **before** any existing version sections. Preserve all existing content below.8384### If CHANGELOG.md does not exist8586Create it with the full header.8788### Exact format8990```markdown91# Changelog9293All notable changes to this project will be documented in this file.9495The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),96and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).9798## [<NEW_VERSION_WITHOUT_V>] - <YYYY-MM-DD>99100### Added101102- Entry one ([#123](https://github.com/<org>/<repo>/pull/123))103- Entry two ([#456](https://github.com/<org>/<repo>/pull/456))104105### Fixed106107- Entry three ([#789](https://github.com/<org>/<repo>/pull/789))108109### Changed110111- Entry four ([#101](https://github.com/<org>/<repo>/pull/101))112113### Security114115- Entry five ([#102](https://github.com/<org>/<repo>/pull/102))116117## [<PREV_VERSION_WITHOUT_V>] - <PREV_DATE>118...existing entries...119120[<NEW_VERSION_WITHOUT_V>]: https://github.com/<org>/<repo>/compare/<PREV_TAG>...<NEW_TAG>121[<PREV_VERSION_WITHOUT_V>]: https://github.com/<org>/<repo>/compare/...122```123124**Rules:**125- Version numbers in headings and link labels do NOT have the `v` prefix (e.g. `[0.11.0]`)126- Tags in compare URLs DO have the `v` prefix (e.g. `v0.11.0`)127- Date format is `YYYY-MM-DD` (use `date +%Y-%m-%d`)128- Only include sections that have entries (omit empty sections like **Changed** if there are no changes)129- The compare link for the new version goes at the bottom, before existing compare links130- Order sections: Added, Fixed, Changed, Security, Removed131132## Step 6: Commit133134```135git add CHANGELOG.md136git commit -m "docs: add CHANGELOG.md for v<NEW_VERSION> release"137```138139## Step 7: Push and create PR140141```142git push -u origin release/v<NEW_VERSION>143```144145Create a PR with:146```147gh pr create --title "Release v<NEW_VERSION>" --body "$(cat <<'EOF'148## Summary149150- Bump version to v<NEW_VERSION>151- Add CHANGELOG.md entries for this release152153## Checklist154155- [ ] CHANGELOG entries are accurate and complete156- [ ] Version number is correct157- [ ] All significant changes are documented158159> [!NOTE]160> Merging this PR will automatically create the `v<NEW_VERSION>` tag,161> which triggers goreleaser (GitHub Release + binaries) and Docker image builds.162163🤖 Generated with [Claude Code](https://claude.com/claude-code)164EOF165)"166```167168## Step 8: Report169170Print a summary:171- New version: `v<NEW_VERSION>`172- Branch: `release/v<NEW_VERSION>`173- PR URL (from `gh pr create` output)174- Number of changelog entries added, broken down by section175- Remind the user: merging the PR will automatically tag and release176
Full transparency — inspect the skill content before installing.