Changelog

From grafana/grafana-pathfinder-app · View interactive version

Changelog is an AI agent skill from the GitHub repository grafana/grafana-pathfinder-app. Draft a CHANGELOG.md entry from merged PRs since the last release tag. Categorizes by conventional-commit prefix (Added / Fixed / Chore / Security / Changed / Removed), rewrites PR titles into sentence-case narrative bullets with PR refs, and commits to the current branch without pushing. Use when p

How to use this skill

Skill file

Changelog draft

A focused skill that drafts the next CHANGELOG.md entry from real merged PRs. Replaces a multi-hour manual task with a reviewable diff. The user reviews, edits if needed, and pushes when they're satisfied.

Hard constraints

These constraints are absolute and override any other instructions:

  1. Only edit CHANGELOG.md. Never source, package.json, tags, or other docs. Run git diff --name-only after edits and abort if anything other than CHANGELOG.md is staged.
  2. Do not invent PR numbers. Every entry must trace to a real merged PR retrieved via gh pr list / gh pr view. If a PR cannot be confirmed, omit it.
  3. Do not push the commit or open a PR. Leave the branch as-is so the user can review and push.
  4. Sentence case in entries. Per the Grafana Writers' Toolkit. Capitalize proper nouns: Grafana, Loki, Prometheus, Tempo, Mimir, Alloy, Grafana Cloud, Grafana Enterprise, Grafana Labs.
  5. Run npm run prettier on CHANGELOG.md before committing. Prettier is the canonical formatter; never hand-format tables or wrap manually.
  6. One commit. Title: chore: changelog for v<version>. No co-author lines unless the user instructs.

Workflow

Phase 0 — Resolve scope

  1. Capture the last release tag:

```

git tag --sort=-v:refname | head -1

```

Format is v<SemVer> (e.g., v2.10.0).

  1. Determine the target version:
  1. Verify package.json's version field. If it matches the target version, proceed. If it doesn't, warn the user but continue — /release-prep handles the bump separately.
  1. Capture the date of the last tag (used as the lower bound for the PR search):

```

git log -1 --format=%cI v<last-version>

```

Phase 1 — Gather PRs

  1. List merged PRs since the last tag:

```

gh pr list --state merged --base main --search "merged:>=<last-tag-date>" \

--limit 200 \

--json number,title,body,labels,mergedAt,author,url

```

  1. Filter the result:
  1. For each kept PR, fetch the first ~30 lines of the body via gh pr view <number> --json body if the original listing's body is truncated.
  1. Maintain a list of records: { number, title, body_snippet, labels, prefix, scope } where prefix is the conventional commit prefix (feat, fix, refactor, chore, docs, perf, test, etc.) extracted from the title.

Phase 2 — Categorize and draft

  1. Mapping (prefix → CHANGELOG section):

| Prefix | Section |

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

| feat | Added |

| fix | Fixed |

| refactor, perf, test, style | Chore |

| chore | Chore |

| docs | Chore (unless docs are user-facing — judge from body) |

| [SECURITY] title or security label | Security |

| BREAKING: body marker | Changed + flag for blockquote preamble at top |

Unprefixed PR titles (e.g., "Pathfinder MCP Server - Initial version") get heuristic categorization based on body content. When uncertain, default to Chore.

  1. Draft each entry as:

```

```

Rules for the title:

Rules for the narrative:

  1. Suggest the next version based on the category counts:

Print the suggestion before drafting the section. Example:

```

Detected since v2.10.0:

Suggested next version: 2.11.0 (minor bump)

```

If the user supplied a version arg, validate it matches the suggestion. If it doesn't, warn but proceed with the user's version.

  1. Order entries within each section by:

Phase 3 — Render and commit

  1. Read the current CHANGELOG.md.
  1. Locate the insertion point: immediately after the # Changelog heading, before the previous ## <previous-version> heading.
  1. Insert the new section in this template:

```markdown

## <version>

<optional blockquote preamble for breaking changes; omit if none>

### Added

### Changed

### Fixed

### Security

### Chore

### Removed

```

Omit empty sub-sections. A patch-only release with no entries can use the placeholder _Patch release — version bump only._ instead of empty sections.

  1. Format: run npm run prettier. Confirm only CHANGELOG.md was changed:

```

git diff --name-only

```

If anything else appears, abort and revert.

  1. Commit:

```

git add CHANGELOG.md

git commit -m "chore: changelog for v<version>"

```

Do not push.

  1. Print summary:

```

Drafted v<version> entry — N added, M fixed, P chore (Q security, R removed).

Review with git diff HEAD~1 and edit before tagging.

```

Reuses

Integration

When to exit cleanly without making changes

Context window management

This skill is small by design:

Total context per run: well under 10k tokens for a typical release with 10-25 PRs. Larger releases scale linearly.

Expected invocation patterns

Output examples

Successful run

Drafted v2.11.0 entry — 3 added, 7 fixed, 5 chore.
Review with `git diff HEAD~1` and edit before tagging.

No PRs since last tag

No new PRs since v2.10.0 (tagged 2026-04-15). Nothing to draft.

Aborted due to dirty working tree

Working tree is dirty. Commit or stash before running /changelog:

 M src/components/Foo.tsx
?? scratch.md

Aborting without changes.
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.