Skip to content

AI: Add skill to construct minor release changelog#34723

Merged
JReinhold merged 6 commits into
nextfrom
jeppe/cahngelog-writing-skill
May 6, 2026
Merged

AI: Add skill to construct minor release changelog#34723
JReinhold merged 6 commits into
nextfrom
jeppe/cahngelog-writing-skill

Conversation

@JReinhold
Copy link
Copy Markdown
Contributor

@JReinhold JReinhold commented May 5, 2026

Closes #

What I did

This PR adds a skill that we can use to build the changelog entry for minor/major releases. In summary it does:

  1. Use a script to get all the changes from all the prereleases
  2. Use this list to find the 4-8 items to highlight in the changelog
  3. Use a script to write the new changelog entry with the desired highlights combined with a list of all the changes (with changes already patched filtered out)

The idea is to run this skill from the final release PR to update the changelog.

It's not perfect, here are the highlights it generated today:

Change-aware workflows, richer metadata, and smoother setup

Storybook 10.4 contains hundreds of fixes and improvements including:

  • 🤖 Agentic Setup: New CLI workflow for AI-assisted Storybook setup and recovery
  • 🔍 Change detection: Git-aware tracking for new, modified, and affected stories
  • 🚦 Smarter navigation: Status filtering plus URL-based tag filters in the sidebar
  • 🧩 React metadata: Better component analysis plus subcomponents in component manifests
  • ⚡ Vite improvements: Faster updates with hook filtering and module graph change support
  • ♿ Accessibility: Better live announcements, contrast, focus indicators, and interactions panel support

But it's probably a good enough draft for @shilman to improve.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Just run /minor-release in your prefered agent.

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Added automation to summarize prerelease entries and insert/replace stable minor/major changelog sections, with dry-run and verbose modes.
  • Documentation
    • Added end-to-end guidance for composing changelog highlights, selection rules, strict formatting and run-from-repo-root instructions.
  • Style
    • Reformatted an existing changelog line under 10.0.0 to a blockquote style (no content change).

JReinhold and others added 2 commits May 5, 2026 20:37
@JReinhold JReinhold added build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only. labels May 5, 2026
@JReinhold JReinhold requested a review from Copilot May 5, 2026 19:08
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

Adds a minor/major release workflow: new SKILL documentation, a CLI that aggregates and deduplicates prerelease changelog entries into a stable minor/major summary, and a CLI that composes and inserts the corresponding ## X.Y.0 section into CHANGELOG.md from highlights provided via stdin.

Changes

Minor Release Changelog Generation

Layer / File(s) Summary
Skill Definition
.agents/skills/minor-release/SKILL.md
New workflow doc specifying required helper scripts, run-from-repo-root guidance, prohibited file reads before running scripts, rules for selecting 4–8 highlights, and strict formatting/style requirements for highlights.
CLI Arg / Entrypoint
.agents/skills/minor-release/get-minor-changelog-summary.ts
Adds commander CLI with optional [version] and --verbose flags plus ES-module main-detection.
Parsing Utilities
.agents/skills/minor-release/get-minor-changelog-summary.ts
Adds parseChangelogSections, extractPRNumbers, and extractEntries to split changelogs into ## <version> sections, extract PR references, and list-item entries.
Data Collection & Deduplication
.agents/skills/minor-release/get-minor-changelog-summary.ts
Reads CHANGELOG.prerelease.md and CHANGELOG.md, infers/validates target stable version (patch = 0, no prerelease), collects prereleases matching ${major}.${minor}.0-*, filters PRs already present in previous-minor patch releases, deduplicates by PR while preserving unique non-PR lines, sorts, and returns { text, entryCount, resolvedVersion }.
StdIn Reader & Utilities
.agents/skills/minor-release/write-minor-changelog-section.ts
Adds readStdin() to read highlights from stdin and ES-module main-detection helper.
Section Insert/Replace
.agents/skills/minor-release/write-minor-changelog-section.ts
Implements insertOrReplaceSection(content, version, section) to replace an existing ## ${version} section up to the next ## heading or prepend the section when absent.
Composition & File Write
.agents/skills/minor-release/write-minor-changelog-section.ts
CLI reads highlights from stdin, validates optional semver version, calls getMinorChangelogSummary to resolve full entries/version, composes ## X.Y.0 section with a <details> "List of all updates" block, supports --dry-run and --verbose, prints or writes updated CHANGELOG.md.
Changelog Formatting Tweak
CHANGELOG.md
Minor formatting change: reformats an italicized developer-experience line under 10.0.0 to a Markdown blockquote, preserving content.
sequenceDiagram
    participant User as User (operator)
    participant SumCLI as get-minor-changelog-summary CLI
    participant WriteCLI as write-minor-changelog-section CLI
    participant FS as Filesystem (`CHANGELOG*.md`)
    User->>SumCLI: invoke (optionally) to preview entries OR used internally by WriteCLI
    SumCLI->>FS: read `CHANGELOG.prerelease.md` + `CHANGELOG.md`
    SumCLI->>SumCLI: parse sections, extract PRs, dedupe, return {text,entryCount,resolvedVersion}
    User->>WriteCLI: run, piping highlights via stdin (and optional version/flags)
    WriteCLI->>SumCLI: request full entries/resolved version
    WriteCLI->>FS: read `CHANGELOG.md`
    WriteCLI->>WriteCLI: compose `## X.Y.0` section with highlights + details block
    WriteCLI->>FS: write updated `CHANGELOG.md` (or print on --dry-run)
    WriteCLI->>User: output success/failure and summary
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/minor-release/get-minor-changelog-summary.ts:
- Around line 27-38: parseChangelogSections currently adds every "## " heading
as a key which can include non-semver headings and breaks downstream version
inference (used later when picking the first parsed section); update
parseChangelogSections to validate and only add keys that are valid
semver/semver-like headings (e.g., match a regex like
^v?\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$) or otherwise normalize headings to semver
before sections.set; ensure the function (parseChangelogSections) filters out
non-version headings so code that infers the target release from the first Map
key operates on actual release versions.

In @.agents/skills/minor-release/SKILL.md:
- Line 64: The fenced code blocks in SKILL.md that contain the example lines
starting with "> _Tagline phrase_", "> _Improved developer experience,
AI-assisting tools, and broader ecosystem support_", "> _Easier to setup, more
accessible to use_", and the block beginning "Storybook 10 contains one breaking
change: it's ESM-only." are missing language identifiers and trigger MD040;
update each opening triple-backtick fence for those blocks to include a language
tag (for example use ```text) so each fenced block becomes ```text ... ``` to
satisfy markdown linting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a02eab6e-638c-4c03-99d3-2c39af05026b

📥 Commits

Reviewing files that changed from the base of the PR and between 4c734c4 and 33064f5.

📒 Files selected for processing (3)
  • .agents/skills/minor-release/SKILL.md
  • .agents/skills/minor-release/get-minor-changelog-summary.ts
  • .agents/skills/minor-release/write-minor-changelog-section.ts

Comment thread .agents/skills/minor-release/get-minor-changelog-summary.ts
Comment thread .agents/skills/minor-release/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new internal agent skill (minor-release) plus helper scripts to generate and write a Storybook X.Y.0 minor/major release section into CHANGELOG.md by aggregating prerelease changelog entries, filtering already-shipped patch PRs, and combining them with human-curated highlights.

Changes:

  • Add a script to collect and de-duplicate prerelease changelog entries for a target X.Y.0, filtering PRs already shipped in previous-minor patch releases.
  • Add a script to compose and insert/replace the ## X.Y.0 section in CHANGELOG.md using highlights from stdin plus the generated full entry list.
  • Add a minor-release skill guide (SKILL.md) documenting the workflow and the desired highlights-writing style.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.agents/skills/minor-release/get-minor-changelog-summary.ts Parses prerelease + stable changelogs to build the “all updates” list with patch-backport filtering.
.agents/skills/minor-release/write-minor-changelog-section.ts Reads highlights from stdin, composes the full section, and writes/inserts it into CHANGELOG.md.
.agents/skills/minor-release/SKILL.md Documents how to run the workflow and how to write the highlights block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .agents/skills/minor-release/get-minor-changelog-summary.ts Outdated
Comment thread .agents/skills/minor-release/get-minor-changelog-summary.ts
Comment thread .agents/skills/minor-release/write-minor-changelog-section.ts Outdated
Comment thread .agents/skills/minor-release/write-minor-changelog-section.ts Outdated
Comment thread .agents/skills/minor-release/SKILL.md
Comment thread .agents/skills/minor-release/get-minor-changelog-summary.ts Outdated
Comment thread .agents/skills/minor-release/SKILL.md Outdated
Comment thread .agents/skills/minor-release/get-minor-changelog-summary.ts
Copy link
Copy Markdown
Contributor

@huang-julien huang-julien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.agents/skills/minor-release/get-minor-changelog-summary.ts (1)

29-40: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Filter and normalize section headings to semver before inserting into the map.

parseChangelogSections currently stores non-version headings/preface text too, so Line 82 can infer from an invalid key and fail the default “no version provided” path. Restrict map keys to valid semver headings (normalized) before sections.set(...).

💡 Minimal fix
 function parseChangelogSections(content: string): Map<string, string> {
   const sections = new Map<string, string>();
   const parts = content.split(/^## /m);
   for (const part of parts) {
     if (!part.trim()) {
       continue;
     }
     const newlineIdx = part.indexOf('\n');
-    const version = newlineIdx === -1 ? part.trim() : part.slice(0, newlineIdx).trim();
+    const rawHeading = newlineIdx === -1 ? part.trim() : part.slice(0, newlineIdx).trim();
     const body = newlineIdx === -1 ? '' : part.slice(newlineIdx + 1);
-    sections.set(version, body);
+    const normalized = semver.valid(rawHeading) ? semver.clean(rawHeading) : null;
+    if (!normalized) {
+      continue;
+    }
+    sections.set(normalized, body);
   }
   return sections;
 }

Also applies to: 82-95

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/minor-release/get-minor-changelog-summary.ts around lines 29
- 40, The parseChangelogSections function is adding non-version headings into
the sections Map which later breaks version lookup; update
parseChangelogSections to validate and normalize each section heading to a
proper semver before calling sections.set(version, body). Use a semver
parser/validator to accept only valid version headings (e.g., strip/normalize
leading “v”, prerelease/build metadata handling) and skip any parts that do not
parse to a legitimate semver; ensure the Map keys are the normalized semver
strings so downstream code that reads from sections (the sections Map) never
receives invalid keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.agents/skills/minor-release/get-minor-changelog-summary.ts:
- Around line 29-40: The parseChangelogSections function is adding non-version
headings into the sections Map which later breaks version lookup; update
parseChangelogSections to validate and normalize each section heading to a
proper semver before calling sections.set(version, body). Use a semver
parser/validator to accept only valid version headings (e.g., strip/normalize
leading “v”, prerelease/build metadata handling) and skip any parts that do not
parse to a legitimate semver; ensure the Map keys are the normalized semver
strings so downstream code that reads from sections (the sections Map) never
receives invalid keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8ffb8628-eab4-4872-aaca-3fd98ad1e590

📥 Commits

Reviewing files that changed from the base of the PR and between 68f4080 and 3691be3.

📒 Files selected for processing (4)
  • .agents/skills/minor-release/SKILL.md
  • .agents/skills/minor-release/get-minor-changelog-summary.ts
  • .agents/skills/minor-release/write-minor-changelog-section.ts
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

@JReinhold JReinhold merged commit c35ecf4 into next May 6, 2026
15 checks passed
@JReinhold JReinhold deleted the jeppe/cahngelog-writing-skill branch May 6, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants