generate-changelog
Skill177 starsChanged 7 months agoApache-2.0View on GitHub
Generates or updates CHANGELOG.md by analyzing git commit history between two branches, tags, or revisions in ANY git repository or folder. Use this skill whenever the user asks to create, update, generate changelog, draft release notes from git history, or compare branches/tags (e.g., "generate changelog comparing release-2026.0.0 and release-2026.1.0", "update CHANGELOG.md for the time-series-analytics folder", "what changed between v1.0.0 and main", "create release notes for this project"). The skill auto-detects folder paths, infers version numbers from branch/tag names, detects existing CHANGELOG format, and produces well-categorized entries (Added, Changed, Removed, Fixed, Security, Documentation) matching the repository's established style. Works with ANY folder structure or repository.
We split this skill into the rules it gives an agent
41 rules. 0 are common, 16 are distinctive, and 25 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
25
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
If folder_path points to the repository root, changelog generation covers the entire repository unless a narrower scope is supplied.
- Very specific: line 41
If folder_path points to a subfolder inside the repository, that subfolder becomes the default commit scope automatically.
- Very specific: line 42
If the user wants to write CHANGELOG.md in one location but scope commits to another path, call extract_commits.sh with the repository root …
- Very specific: line 46
If folder_path is not fully specified:
- Distinctive: line 48
Search by name: If user says "time-series-analytics" but relative path isn't found, search the workspace recursively for a matching folder …
- Distinctive: line 53
Resolve relative paths: If a relative path is given, resolve it from current working directory:
- Very specific: line 64
If <folder_path> is the repository root, the default scope is the full repository.
- Very specific: line 65
If <folder_path> is a repository subfolder, use that subfolder as the default scope.
- Very specific: line 66
If needed, keep both values: repo_root for git operations and scope_path for path-limited history queries.
- Very specific: line 70
If version_label is not provided, attempt to infer from target_ref:
- Very specific: line 78
From git tag: If target_ref is a tag like v2.1.0, strip the v prefix.
- Distinctive: line 80
Fallback: If inference fails, ask the user:
- Very specific: line 83
If release_date is not provided, use the commit date of the target commit.
- Very specific: line 98
If folder_path is incomplete or ambiguous, use the folder path resolution logic from the Inputs section.
- Distinctive: line 103
If this fails, inform the user the path is not a git repository or repository subfolder.
- Very specific: line 109
Treat <folder_path> as the scope when it is a subfolder.
- Very specific: line 111
Verify both base_ref and target_ref exist:
- Distinctive: line 116
If either fails, list available branches and tags:
- Very specific: line 123
If version_label is missing, apply the version inference logic from the Inputs section.
- Very specific: line 124
If release_date is missing, extract the commit date of target_ref:
- Very specific: line 132
Before categorizing commits, read the existing CHANGELOG.md (if present):
- Very specific: line 134
Check if <folder_path>/CHANGELOG.md exists.
- Distinctive: line 135
If it exists, analyze its structure:
- Distinctive: line 149
If no CHANGELOG.md exists or it has no clear structure, use the default keyword-based categorization (described in Step 4).
- Very specific: line 160
Use <folder_path> only for full-repository changelogs when it points to the repo root.
- Very specific: line 161
Use a repository subfolder as <folder_path> for folder-specific changelogs.
- Very specific: line 162
Use [scope_path] only when <folder_path> is the repo root but commit extraction should be narrowed to a different path.
- Distinctive: line 215
Write each bullet in past tense, sentence case.
- Distinctive: line 222
If CHANGELOG.md does not exist: Create it with a header + new version block:
- Distinctive: line 234
If version already exists in CHANGELOG.md: Ask the user whether to replace or skip:
- Very specific: line 237
Write to <folder_path>/CHANGELOG.md (or custom changelog_path if provided).
- Distinctive: line 254
Folder path not found: If searching for a folder name returns multiple matches or no matches, list results and ask the user to clarify …
- Very specific: line 256
Repo root vs scoped folder: If the user asks for a folder-specific changelog but gives the repository root, either resolve a narrower …
- Very specific: line 258
Detached HEAD or missing refs: If base_ref or target_ref don't exist, list available branches and tags:
- Distinctive: line 262
Ask the user to provide valid refs.
- Very specific: line 264
No commits found: If git log <base_ref>..<target_ref> returns nothing, the refs may be identical or in the wrong order.
- Distinctive: line 269
Shallow clone: If the repository is a shallow clone, commit history may be incomplete.
- Distinctive: line 274
Duplicate version in CHANGELOG.md: If the version already exists, ask the user:
- Distinctive: line 277
Empty or malformed existing CHANGELOG.md: If the existing CHANGELOG.md has no clear structure, treat it as a new file and use the default …
- Distinctive: line 279
No GitHub/remote URL: If git remote get-url origin fails or returns a non-standard URL (e.g., SSH, local path), skip reference links or ask …
- Very specific: line 290
When <repo_or_folder_path> is a subfolder, that subfolder is used as the commit scope automatically.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Changelog Generator
Generates or updates CHANGELOG.md by extracting and categorizing commits between
two git branches or tags. Follows the Keep a Changelog style
used by the current repository.
Inputs
Collect from the user (or infer from context):
| Parameter | Description | Example |
folder_path | Path to the repository root or to a folder inside the repository; a subfolder automatically scopes commit extraction to that path | /path/to/repo, microservices/time-series-analytics, ./my-project |
base_ref | Starting branch, tag, or commit | release-2026.0.0, v1.0.0, main, commit SHA |
target_ref | Ending branch, tag, or commit | release-2026.1.0, v2.0.0, develop |
version_label | Version string for CHANGELOG entry | 2026.1.0, v1.2.0 |
release_date | Release month and year (optional) | June 2026, January 2024 |
changelog_path | Output path for CHANGELOG.md | <folder_path>/CHANGELOG.md (default) |
Path Semantics
- If
folder_pathpoints to the repository root, changelog generation covers the entire repository unless a narrower scope is supplied. - If
folder_pathpoints to a subfolder inside the repository, that subfolder becomes the default commit scope automatically. - If the user wants to write
CHANGELOG.mdin one location but scope commits to another path, callextract_commits.shwith the repository root as the first argument and the scope path as the optional fourth argument.
Folder Path Resolution
If folder_path is not fully specified:
- Search by name: If user says "time-series-analytics" but relative path isn't found, search the workspace recursively for a matching folder name.
find <workspace_root> -type d -name "*time-series-analytics*" 2>/dev/null | head -1 - Resolve relative paths: If a relative path is given, resolve it from current working directory:
cd <workspace_root> && realpath <relative_path> - Validate: Confirm the folder is a git repository:
git -C <folder_path> rev-parse --is-inside-work-tree - Determine commit scope:
- If
<folder_path>is the repository root, the default scope is the full repository. - If
<folder_path>is a repository subfolder, use that subfolder as the default scope. - If needed, keep both values:
repo_rootfor git operations andscope_pathfor path-limited history queries.
- If
Version Label Inference
If version_label is not provided, attempt to infer from target_ref:
- From branch name: Extract version from naming patterns:
release-2026.1.0→2026.1release-2026.1.0→2026.1.0v1.2.0→1.2.0v2.0.0-rc1→2.0.0-rc1
- From git tag: If
target_refis a tag likev2.1.0, strip thevprefix. - Fallback: If inference fails, ask the user:
"I couldn't infer a version from
<target_ref>. What version label should I use? (e.g., 2026.1.0, v1.2.0)"
If release_date is not provided, use the commit date of the target commit.
GitHub/Remote URL Detection
git -C <folder_path> remote get-url originStrip .git suffix. Supports GitHub, GitLab, Gitea, and other hosting platforms.
Workflow
Step 1 – Resolve folder path and validate
- If
folder_pathis incomplete or ambiguous, use the folder path resolution logic from the Inputs section. - Validate the path is inside a git repository:
If this fails, inform the user the path is not a git repository or repository subfolder.git -C <folder_path> rev-parse --is-inside-work-tree - Resolve the repository root and the effective commit scope:
Treatrepo_root=$(git -C <folder_path> rev-parse --show-toplevel)<folder_path>as the scope when it is a subfolder. If<folder_path>equalsrepo_root, use the full repository unless the user supplied a narrower scope. - Verify both
base_refandtarget_refexist:
If either fails, list available branches and tags:git -C "$repo_root" rev-parse <base_ref> >/dev/null 2>&1 git -C "$repo_root" rev-parse <target_ref> >/dev/null 2>&1git -C "$repo_root" branch -a && git -C "$repo_root" tag
Step 2 – Infer version and release date
- If
version_labelis missing, apply the version inference logic from the Inputs section. - If
release_dateis missing, extract the commit date oftarget_ref:
Format as "Month Year" (e.g., "June 2026").git -C "$repo_root" log -1 --format=%cs <target_ref>
Step 3 – Detect existing CHANGELOG format
Before categorizing commits, read the existing CHANGELOG.md (if present):
- Check if
<folder_path>/CHANGELOG.mdexists. - If it exists, analyze its structure:
- Look for section headers: Scan for patterns like
## [Version],### Added,### Fixed, etc. - Infer category order: Note which sections appear and in what order.
- Detect categorization style: Is it Keep a Changelog style? Custom sections? Hybrid?
- Example inference:
→ Infer: Use# Changelog ## [2.0.0] ### Added ### Changed ### FixedAdded,Changed,Fixed(no Security, Documentation, Removed)
- Look for section headers: Scan for patterns like
- If no CHANGELOG.md exists or it has no clear structure, use the default keyword-based categorization (described in Step 4).
Step 4 – Extract and categorize commits
Get the commit list between base and target refs:
bash .github/skills/generate-changelog/scripts/extract_commits.sh \ <folder_path> <base_ref> <target_ref> [scope_path]Usage notes:
- Use
<folder_path>only for full-repository changelogs when it points to the repo root. - Use a repository subfolder as
<folder_path>for folder-specific changelogs. - Use
[scope_path]only when<folder_path>is the repo root but commit extraction should be narrowed to a different path.
- Use
- For each commit, classify into a section based on the detected format from Step 3.
If using default keyword-based categorization, apply these rules in order (first match wins):
Section Keywords / patterns (case-insensitive) Security security,cve,vulnerability,bump,trivy,patch,upgrade(dependency)Fixed fix,fixed,repair,resolve,hotfix,revertAdded add,added,new,introduce,enable,support,feature,implementRemoved remove,removed,delete,deleted,drop,deprecatDocumentation doc,docs,documentation,readme,changelog,typo,spellingChanged everything else [!TIP] If a commit is ambiguous, prefer the section that better serves the reader. Merge commits and automated bot commits (e.g., Dependabot) should go in Security or Changed as appropriate.
- Also collect PR numbers referenced in commit messages (pattern
(#\d+)or#\d+).
Step 5 – Format the entry
Format reference: See
references/changelog-format.mdfor the exact CHANGELOG structure and style template used by this repository.
Format the new version block using the detected CHANGELOG style from Step 3:
If Keep a Changelog or similar style:
## [<version>] - <release_date>
### Added
- Feature one ([#123])
- Feature two ([abc1234])
### Changed
- Behavior updated ([#124])
### Fixed
- Bug resolved ([#125])
### Security
- Vulnerability patched ([#126])
[#123]: <repo_url>/pull/123
[#124]: <repo_url>/pull/124
[#125]: <repo_url>/pull/125
[#126]: <repo_url>/pull/126
[abc1234]: <repo_url>/commit/abc1234If custom sections detected: Match the detected sections and order.
Formatting rules:
- Write each bullet in past tense, sentence case.
- Append PR/commit reference at the end:
([#NN])for PRs,([hash])for commits. - Omit sections with no entries.
- Include reference links at the bottom of the block.
Step 6 – Write or update CHANGELOG.md
- If CHANGELOG.md does not exist: Create it with a header + new version block:
# Changelog All notable changes to this project will be documented in this file. ## [<version>] - <release_date> ... - If CHANGELOG.md exists: Insert the new version block immediately after the introductory paragraph (or after
# Changelogheader) and before any existing## [...]sections. Preserve all existing content exactly. - If version already exists in CHANGELOG.md: Ask the user whether to replace or skip:
"Version
<version>already exists in CHANGELOG.md. Replace it, append a new entry, or skip?" - Write to
<folder_path>/CHANGELOG.md(or customchangelog_pathif provided).
Step 7 – Confirm output
Print a summary:
Changelog generated: <folder_path>/CHANGELOG.md
Version: <version> (<release_date>)
Commits processed: <count>
Added: N | Changed: N | Fixed: N | Security: N | Documentation: N | Removed: N
Comparison: <base_ref>...<target_ref>
Repository: <repo_url>Edge cases
- Folder path not found: If searching for a folder name returns multiple matches or no matches, list results and ask the user to clarify which one to use.
- Repo root vs scoped folder: If the user asks for a folder-specific changelog but gives the repository root, either resolve a narrower folder path or call
extract_commits.sh <repo_root> <base_ref> <target_ref> <scope_path>explicitly. - Detached HEAD or missing refs: If
base_refortarget_refdon't exist, list available branches and tags:
Ask the user to provide valid refs.git -C "$repo_root" branch -a && git -C "$repo_root" tag - No commits found: If
git log <base_ref>..<target_ref>returns nothing, the refs may be identical or in the wrong order. Suggest:- Running
git fetch --allto ensure all remote branches are available - Reversing the ref order if needed
- Confirming the refs point to different commits
- Running
- Shallow clone: If the repository is a shallow clone, commit history may be incomplete. Suggest running:
git -C "$repo_root" fetch --unshallow - Duplicate version in CHANGELOG.md: If the version already exists, ask the user:
"Version
<version>is already in CHANGELOG.md. Should I replace it, append a new entry, or skip?" - Empty or malformed existing CHANGELOG.md: If the existing CHANGELOG.md has no clear structure, treat it as a new file and use the default keyword-based categorization. Warn the user that the new entry may not match the existing format.
- No GitHub/remote URL: If
git remote get-url originfails or returns a non-standard URL (e.g., SSH, local path), skip reference links or ask the user for the repository URL.
Script reference
The helper script supports both repository-wide and folder-scoped extraction:
bash .github/skills/generate-changelog/scripts/extract_commits.sh <repo_or_folder_path> <base_ref> <target_ref> [scope_path]<repo_or_folder_path>may be the repository root or a subfolder inside the repository.- When
<repo_or_folder_path>is a subfolder, that subfolder is used as the commit scope automatically. [scope_path]is optional and is only needed when the first argument is the repository root but a narrower commit scope is desired.
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- danbooru/danbooru★ 2.8ksame name
- deepsense-ai/ragbits★ 1.7ksame name
- maslennikov-ig/claude-code-orchestrator-kit★ 248same name
- microsoft/dbt-fabricspark★ 71same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- generate-release-notesSkill
- security-reviewSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

