Create Draft Release Notes
Overview
Create a GitHub draft release, organize the generated notes by conventional commit type, and save the organized body back to the draft. Preserve each release note item exactly; only split accidentally joined bullets, move bullets into sections, and adjust headings.
Draft Release Workflow
Input: a release tag/title such as v2.0.6. If title and tag differ, ask for the tag.
Resolve repo as <owner>/<repo>.
Prefer an explicit repo from the user. Otherwise infer the current project's main GitHub repository from project metadata or the current GitHub remote. For npm projects, package.json repository is a useful signal; in monorepos, inspect the package or project being released rather than assuming the workspace root. Ignore subdirectory metadata such as repository.directory because GitHub releases are repository-level. If the repo is ambiguous, ask.
Set variables:
repo="<owner>/<repo>"
release_tag="v2.0.6"
release_title="$release_tag"
Verify access and ensure the release does not already exist:
gh auth status
gh repo view "$repo" --json nameWithOwner --jq '.nameWithOwner'
gh release view "$release_tag" -R "$repo" --json tagName,isDraft,url
If the release exists, stop unless the user explicitly asked to update that draft.
Infer the previous tag:
previous_tag="$(gh release list -R "$repo" --exclude-drafts --exclude-pre-releases --limit 1 --json tagName --jq '.[0].tagName')"
gh release list -R "$repo" --exclude-drafts --exclude-pre-releases --limit 5
Ask for confirmation if the previous tag is missing, surprising, or part of a non-standard range.
Before creating anything, state the repo and range: previous_tag -> release_tag. If the user did not explicitly ask to create the draft in this turn, ask for confirmation.
Create the draft with GitHub-generated notes:
gh release create "$release_tag" -R "$repo" --draft --generate-notes --notes-start-tag "$previous_tag" --title "$release_title"
Add --verify-tag when the release must use an existing remote tag.
Organize and save the draft body:
tmp_dir="$(mktemp -d)"
gh release view "$release_tag" -R "$repo" --json body --jq '.body' > "$tmp_dir/generated.md"
node .agents/skills/create-draft-release-notes/scripts/create-draft-release-notes.mjs "$tmp_dir/generated.md" > "$tmp_dir/organized.md"
gh release edit "$release_tag" -R "$repo" --draft --title "$release_title" --notes-file "$tmp_dir/organized.md"
Return the draft URL:
gh release view "$release_tag" -R "$repo" --json url --jq '.url'
Markdown-Only Workflow
Use this when the user provides generated release note Markdown and only wants it organized:
node .agents/skills/create-draft-release-notes/scripts/create-draft-release-notes.mjs release-notes.md
Omit the file path to read from stdin. Review that every original item still appears once and non-item sections remain.
Categories
Emit non-empty sections in this order:
### Breaking Changes 🍭
### New Features 🎉
### Performance 🚀
### Bug Fixes 🐞
### Refactor 🔨
### Document 📖
### Other Changes
Classify by the item prefix:
- Breaking Changes:
type!: or type(scope)!:, plus breaking: / break:.
- New Features:
feat: / feat(scope):, plus feature:.
- Performance:
perf:.
- Bug Fixes:
fix:.
- Refactor:
refactor:.
- Document:
docs: / docs(scope):, plus doc:.
- Other Changes: everything else.
Keep each category in generated top-to-bottom order.
Preservation Rules
- Do not rewrite bullet text, authors, URLs, PR numbers, package names, scopes, punctuation, or casing.
- Do not drop comments,
**Full Changelog**, or other non-item sections.
- Do not add commentary to the release note itself.
- Do not emit empty category sections.
Resources
scripts/create-draft-release-notes.mjs: deterministic formatter for generated release note Markdown.
Source: web-infra-dev/rspack — distributed by TomeVault.
1---2name: create-draft-release-notes-23description: Create or update draft GitHub releases for the current project's main GitHub repository, then organize GitHub-generated release notes into user-friendly sections without rewriting release note items. Use for preparing, formatting, categorizing, creating, or updating GitHub release notes or draft releases. Use when this capability is needed.4---56# Create Draft Release Notes78## Overview910Create a GitHub draft release, organize the generated notes by conventional commit type, and save the organized body back to the draft. Preserve each release note item exactly; only split accidentally joined bullets, move bullets into sections, and adjust headings.1112## Draft Release Workflow1314Input: a release tag/title such as `v2.0.6`. If title and tag differ, ask for the tag.15161. Resolve `repo` as `<owner>/<repo>`.17 Prefer an explicit repo from the user. Otherwise infer the current project's main GitHub repository from project metadata or the current GitHub remote. For npm projects, `package.json` `repository` is a useful signal; in monorepos, inspect the package or project being released rather than assuming the workspace root. Ignore subdirectory metadata such as `repository.directory` because GitHub releases are repository-level. If the repo is ambiguous, ask.18192. Set variables:2021 ```bash22 repo="<owner>/<repo>"23 release_tag="v2.0.6"24 release_title="$release_tag"25 ```26273. Verify access and ensure the release does not already exist:2829 ```bash30 gh auth status31 gh repo view "$repo" --json nameWithOwner --jq '.nameWithOwner'32 gh release view "$release_tag" -R "$repo" --json tagName,isDraft,url33 ```3435 If the release exists, stop unless the user explicitly asked to update that draft.36374. Infer the previous tag:3839 ```bash40 previous_tag="$(gh release list -R "$repo" --exclude-drafts --exclude-pre-releases --limit 1 --json tagName --jq '.[0].tagName')"41 gh release list -R "$repo" --exclude-drafts --exclude-pre-releases --limit 542 ```4344 Ask for confirmation if the previous tag is missing, surprising, or part of a non-standard range.45465. Before creating anything, state the repo and range: `previous_tag -> release_tag`. If the user did not explicitly ask to create the draft in this turn, ask for confirmation.47486. Create the draft with GitHub-generated notes:4950 ```bash51 gh release create "$release_tag" -R "$repo" --draft --generate-notes --notes-start-tag "$previous_tag" --title "$release_title"52 ```5354 Add `--verify-tag` when the release must use an existing remote tag.55567. Organize and save the draft body:5758 ```bash59 tmp_dir="$(mktemp -d)"60 gh release view "$release_tag" -R "$repo" --json body --jq '.body' > "$tmp_dir/generated.md"61 node .agents/skills/create-draft-release-notes/scripts/create-draft-release-notes.mjs "$tmp_dir/generated.md" > "$tmp_dir/organized.md"62 gh release edit "$release_tag" -R "$repo" --draft --title "$release_title" --notes-file "$tmp_dir/organized.md"63 ```64658. Return the draft URL:6667 ```bash68 gh release view "$release_tag" -R "$repo" --json url --jq '.url'69 ```7071## Markdown-Only Workflow7273Use this when the user provides generated release note Markdown and only wants it organized:7475```bash76node .agents/skills/create-draft-release-notes/scripts/create-draft-release-notes.mjs release-notes.md77```7879Omit the file path to read from stdin. Review that every original item still appears once and non-item sections remain.8081## Categories8283Emit non-empty sections in this order:84851. `### Breaking Changes 🍭`862. `### New Features 🎉`873. `### Performance 🚀`884. `### Bug Fixes 🐞`895. `### Refactor 🔨`906. `### Document 📖`917. `### Other Changes`9293Classify by the item prefix:9495- Breaking Changes: `type!:` or `type(scope)!:`, plus `breaking:` / `break:`.96- New Features: `feat:` / `feat(scope):`, plus `feature:`.97- Performance: `perf:`.98- Bug Fixes: `fix:`.99- Refactor: `refactor:`.100- Document: `docs:` / `docs(scope):`, plus `doc:`.101- Other Changes: everything else.102103Keep each category in generated top-to-bottom order.104105## Preservation Rules106107- Do not rewrite bullet text, authors, URLs, PR numbers, package names, scopes, punctuation, or casing.108- Do not drop comments, `**Full Changelog**`, or other non-item sections.109- Do not add commentary to the release note itself.110- Do not emit empty category sections.111112## Resources113114- `scripts/create-draft-release-notes.mjs`: deterministic formatter for generated release note Markdown.115116---117> Source: [web-infra-dev/rspack](https://github.com/web-infra-dev/rspack) — distributed by [TomeVault](https://tomevault.io).118<!-- tomevault:4.0:skill_md:2026-06-24 -->