Omcustom release notes

From baekenough/oh-my-customcode · View interactive version

Omcustom release notes is an AI agent skill from the GitHub repository baekenough/oh-my-customcode. Generate structured release notes from git history and closed issues within Claude Code session

How to use this skill

Skill file

Release Notes Generator

Generate structured release notes directly within the Claude Code session, using git history and GitHub issues. No external API calls needed — Claude Code itself analyzes and generates the notes.

Purpose

Replaces the CI-based release-notes.yml workflow that previously used Claude API (ANTHROPIC_API_KEY). The release notes are now generated in-session, written to a notes file by mgr-gitnerd, and passed to gh release create --notes-file.

Usage

/omcustom-release-notes 0.36.0
/omcustom-release-notes 0.36.0 --previous-tag v0.35.3
/omcustom-release-notes --backfill v0.36.0..v0.127.0

Workflow

Phase 1: Gather Context

# 1. Determine previous tag
PREV_TAG=$(git tag --sort=-version:refname | grep -v "^v${VERSION}$" | head -1)

# 2. Get commit history
git log ${PREV_TAG}..HEAD --pretty=format:"%h %s"

# 3. Get changed files
git diff --name-status ${PREV_TAG}..HEAD

# 4. Get closed issues since previous tag
gh issue list --state closed --search "closed:>$(git log -1 --format=%ci ${PREV_TAG} | cut -d' ' -f1)" --json number,title,labels

Phase 2: Classify Changes

Categorize commits using Conventional Commits:

| Prefix | Category | Emoji |

|--------|----------|-------|

| feat: | Features | :rocket: |

| fix: | Bug Fixes | :bug: |

| docs: | Documentation | :books: |

| refactor: | Refactoring | :recycle: |

| test: | Tests | :test_tube: |

| chore: | Chores | :wrench: |

| security | Security | :lock: |

Phase 3: Generate Notes

Output format:

# Release v{VERSION}

## Highlights
(1-3 key features/changes)

## :rocket: Features
- **{title}** (#{issue}): {description}

## :bug: Bug Fixes
- **{title}** (#{issue}): {description}

## :lock: Security
- {security changes}

## :books: Documentation
- {doc changes}

## :recycle: Other Changes
- {other changes}

## Resource Changes
| Resource | Before | After | Delta |
|----------|--------|-------|-------|
| Rules | {n} | {n} | {delta} |
| Skills | {n} | {n} | {delta} |
| Agents | {n} | {n} | {delta} |

## Breaking Changes
{if any, otherwise omit section}

---
_Release notes generated with Claude Code_

Phase 4: Apply

The generated notes can be:

  1. Direct: The orchestrator hands the generated notes text to mgr-gitnerd, which writes it to a git-ignored notes file (for example .claude/outputs/sessions/{date}/release-notes-{VERSION}.md) with its Write tool and then runs gh release create v{VERSION} --notes-file <notes-file>. The orchestrator does not write the notes file itself (R010: only read-only work is exempt from delegation). Do not inline the notes text in the command line, because $(…) and backticks inside the notes would be executed by the shell. release_notes.md is a tracked file and is not used as the --notes-file input.
  2. File: mgr-gitnerd writes the notes to release_notes.md for review before use
  3. Update: mgr-gitnerd writes the notes with its Write tool to the same kind of git-ignored notes file, then runs gh release edit v{VERSION} --notes-file <notes-file> (again, release_notes.md is not used as the --notes-file input)

Phase 5: Promote `## [Unreleased]` in CHANGELOG.md (Optional but Recommended)

Precondition (run first): command grep -c -E '^## \[Deprecated' CHANGELOG.md. A count of 1 or more means the repository has deprecated its CHANGELOG (this repository did at v1.1.14, #1503), so skip Phase 5 and do not edit CHANGELOG.md. A count of 0 means the CHANGELOG is maintained and Phase 5 proceeds. If CHANGELOG.md does not exist, grep -c prints No such file or directory and exits 2 (measured in an empty directory) with no count, so skip Phase 5: there is no CHANGELOG to promote into.

After generating release notes, promote any pending ## [Unreleased] entries to a versioned section so release.yml (the awk extract in the line NOTES=$(awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)) finds the authored notes instead of falling back to GitHub auto-generated content.

Actors: arch-documenter applies the promotion to CHANGELOG.md with its Edit tool (R010 Root Meta-File Delegation: CHANGELOG.md belongs to arch-documenter), and mgr-gitnerd commits it. The Python snippet below is the specification of the transformation that arch-documenter applies with Edit; the orchestrator does not run it against CHANGELOG.md.

# Promote [Unreleased] to [VERSION] with today's date
DATE=$(date -u +%Y-%m-%d)
python3 - "$VERSION" "$DATE" <<'PY'
import sys, re, pathlib
version, date = sys.argv[1], sys.argv[2]
path = pathlib.Path("CHANGELOG.md")
text = path.read_text()
header = f"## [{version}] - {date}"
if re.search(rf"^## \[{re.escape(version)}\]", text, flags=re.M):
    print(f"[skip] [{version}] section already exists — manual reconciliation needed")
    sys.exit(0)
new = re.sub(
    r"^## \[Unreleased\]\s*\n",
    f"## [Unreleased]\n\n{header}\n",
    text,
    count=1,
    flags=re.M,
)
if new == text:
    print("[error] [Unreleased] section not found — CHANGELOG.md format unexpected")
    sys.exit(1)
path.write_text(new)
print(f"[ok] promoted [Unreleased] -> [{version}]")
PY

Behavior:

This is optional — the skill's release-notes generation (Phases 1-4) works independently. Phase 5 only ensures CHANGELOG consistency for projects that maintain Keep a Changelog format. When the precondition detection above returns 1 or more (this repository), Phase 5 is skipped and CHANGELOG.md is not edited.

Backfill Mode

For projects with historical CHANGELOG.md gaps (releases shipped without [Unreleased] promotion), the skill provides a deterministic batch backfill.

Usage

python3 scripts/backfill_changelog.py <START_TAG>..<END_TAG> [--output FILE]

Or invoked via skill: /omcustom-release-notes --backfill v0.36.0..v0.127.0

Precondition (run first): command grep -c -E '^## \[Deprecated' CHANGELOG.md. A count of 1 or more means the repository has deprecated its CHANGELOG (this repository did at v1.1.14, #1503), so do not run Backfill Mode and do not edit CHANGELOG.md. A count of 0 means the CHANGELOG is maintained and Backfill Mode may run. If CHANGELOG.md does not exist, grep -c prints No such file or directory and exits 2 (measured in an empty directory) with no count, so do not run Backfill Mode: there is no CHANGELOG to paste into.

Actors: mgr-gitnerd runs python3 scripts/backfill_changelog.py <START_TAG>..<END_TAG> --output <file> with a file other than CHANGELOG.md, which produces only that file; the orchestrator does not run the script. arch-documenter then pastes the generated text into CHANGELOG.md with its Edit tool (R010 Root Meta-File Delegation: CHANGELOG.md belongs to arch-documenter), and mgr-gitnerd commits it.

Behavior

For each tag in range (in reverse semver order), the script:

  1. Determines previous tag (semver-immediately-before)
  2. Reads git log <prev>..<tag> --pretty=%s --no-merges to extract commit subjects
  3. Maps Conventional Commits prefix to Keep a Changelog category:
  1. Special handling for release: / chore(release): commits — extracts description after version (e.g., release: v0.127.0 — DESC → DESC under Changed)
  2. Extracts issue refs (#NNN) and appends as (#1, #2) suffix
  3. Renders per-version section with categories sorted: Added, Changed, Fixed, Security, Removed, Deprecated
  4. Empty sections (zero qualifying commits) render as _No user-visible changes (internal only)._

Output

Markdown text suitable for prepending to CHANGELOG.md between ## [Unreleased] and the first existing version section. The script's only file write is with open(args.output, "w", encoding="utf-8") as fh: under if args.output: in scripts/backfill_changelog.py (otherwise the text goes to stdout), so it writes CHANGELOG.md only if --output names that file, which would truncate it, and mgr-gitnerd passes another file. arch-documenter applies the output to CHANGELOG.md by hand with Edit.

When to Use

Limitations

Tests

tests/scripts/test_backfill_changelog.py covers parser correctness, semver sorting, category mapping, edge cases (40 tests).

Integration

This skill is designed to be used during the release process:

/omcustom:npm-version patch|minor|major  ->  version bump
/omcustom-release-notes {version}         ->  generate notes + promote [Unreleased] (Phase 5, skipped when the CHANGELOG is deprecated)
mgr-gitnerd: gh release create           ->  create release with notes

Notes

Permission Mode

Pass mode: "bypassPermissions" on Agent calls for compatibility: it is required on CC < 2.1.212 (the per-call default, acceptEdits, overrides agent frontmatter permissionMode) and ignored on 2.1.212+, where subagents inherit the parent session's permission mode (adjustable via agent frontmatter permissionMode). Verify the effective mode before unattended runs: see R010 "Universal bypassPermissions".

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.