|
| 1 | +# Skill: Changelog Maintainer |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +Maintains the CHANGELOG.md for the Free Disk Space GitHub Action following [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format and Semantic Versioning. Analyzes git changes since the last documented release, categorizes them, and generates properly formatted changelog entries. |
| 6 | + |
| 7 | +## When to Use |
| 8 | + |
| 9 | +Trigger this skill when: |
| 10 | +- User asks to "update changelog", "prepare release", or "document changes" |
| 11 | +- User mentions "what changed since last release" |
| 12 | +- User requests "generate changelog entry" or "prepare version bump" |
| 13 | +- Before creating a new release tag |
| 14 | +- After a batch of commits that should be documented |
| 15 | + |
| 16 | +## IMPORTANT: Not Every Commit is Notable |
| 17 | + |
| 18 | +**Not all commits deserve a CHANGELOG entry.** The CHANGELOG documents notable changes for users/consumers of the action, not every internal commit. |
| 19 | + |
| 20 | +### Notable Changes (Include in CHANGELOG) |
| 21 | + |
| 22 | +✅ **Do include:** |
| 23 | +- New action inputs or features |
| 24 | +- New cleanup targets (packages, folders, tools) |
| 25 | +- Performance improvements with measurable impact |
| 26 | +- Bug fixes affecting action behavior |
| 27 | +- Breaking changes (removed inputs, changed defaults) |
| 28 | +- New test coverage for use cases |
| 29 | +- Compatibility changes (new Ubuntu versions, new architectures) |
| 30 | +- Dependency updates that affect behavior (rmz version bumps) |
| 31 | +- Changes to Size Savings table data |
| 32 | + |
| 33 | +❌ **Do NOT include:** |
| 34 | +- Typo fixes in comments or documentation prose |
| 35 | +- Formatting/whitespace changes in shell script |
| 36 | +- Internal refactoring without behavior change |
| 37 | +- Skill or agent configuration updates |
| 38 | +- Pre-commit hook version bumps |
| 39 | +- CI workflow reorganization without test changes |
| 40 | +- Changelog formatting fixes |
| 41 | + |
| 42 | +### When in Doubt: Ask the User |
| 43 | + |
| 44 | +If uncertain whether a change is notable, ask the user before including or excluding it from the CHANGELOG. |
| 45 | + |
| 46 | +## Workflow |
| 47 | + |
| 48 | +### 1. Determine Last Documented Version |
| 49 | + |
| 50 | +Read `README.md` and look for the most recent changelog entry: |
| 51 | + |
| 52 | +```markdown |
| 53 | +### vX.Y.Z (YYYY-MM-DD) |
| 54 | +``` |
| 55 | + |
| 56 | +Also check `VERSION` file if present, and git tags: |
| 57 | + |
| 58 | +```bash |
| 59 | +git tag --sort=-v:refname | head -5 |
| 60 | +``` |
| 61 | + |
| 62 | +### 2. Gather Changes Since Last Release |
| 63 | + |
| 64 | +```bash |
| 65 | +# Find the last tag |
| 66 | +LAST_TAG=$(git tag --sort=-v:refname | head -1) |
| 67 | + |
| 68 | +# List changed files |
| 69 | +git diff "${LAST_TAG}"..HEAD --name-status |
| 70 | + |
| 71 | +# Full diff for analysis |
| 72 | +git log "${LAST_TAG}"..HEAD --oneline |
| 73 | + |
| 74 | +# Detailed commit messages |
| 75 | +git log "${LAST_TAG}"..HEAD --pretty=format:"%h %s" |
| 76 | +``` |
| 77 | + |
| 78 | +If no tags exist, use the initial commit: |
| 79 | +```bash |
| 80 | +git log --oneline |
| 81 | +``` |
| 82 | + |
| 83 | +### 3. Categorize Changes |
| 84 | + |
| 85 | +Map each change to the appropriate category based on files affected: |
| 86 | + |
| 87 | +| File(s) Changed | Likely Category | |
| 88 | +|-----------------|----------------| |
| 89 | +| `main.sh` (new function) | **Added** — New cleanup feature | |
| 90 | +| `main.sh` (modified function) | **Changed** or **Fixed** | |
| 91 | +| `action.yaml` (new input) | **Added** — New action input | |
| 92 | +| `action.yaml` (modified input) | **Changed** — Input behavior change | |
| 93 | +| `action.yaml` (removed input) | **Removed** — BREAKING CHANGE | |
| 94 | +| `.github/workflows/testing.yaml` | **Added** or **Changed** — Test improvements | |
| 95 | +| `.github/workflows/*-template.yaml` | **Changed** — Test infrastructure | |
| 96 | +| `README.md` (size savings) | **Changed** — Updated metrics | |
| 97 | +| `README.md` (new examples) | **Added** — Documentation | |
| 98 | +| `.pre-commit-config.yaml` | Usually not notable (skip) | |
| 99 | +| `.github/agents/`, `.github/skills/` | Usually not notable (skip) | |
| 100 | + |
| 101 | +### 4. Determine Version Bump |
| 102 | + |
| 103 | +| Change Type | Version Bump | Example | |
| 104 | +|-------------|-------------|---------| |
| 105 | +| Breaking change (removed input, changed default) | **MAJOR** | v2 → v3 | |
| 106 | +| New feature (new input, new cleanup target) | **MINOR** | v3.0 → v3.1 | |
| 107 | +| Bug fix, docs, performance | **PATCH** | v3.1.0 → v3.1.1 | |
| 108 | + |
| 109 | +### 5. Generate Changelog Entry |
| 110 | + |
| 111 | +Use Keep a Changelog format with these section headers: |
| 112 | + |
| 113 | +```markdown |
| 114 | +### vX.Y.Z (YYYY-MM-DD) |
| 115 | + |
| 116 | +**Added:** |
| 117 | +- 🆕 New features, inputs, cleanup targets |
| 118 | + |
| 119 | +**Changed:** |
| 120 | +- 🔧 Modifications to existing behavior |
| 121 | + |
| 122 | +**Fixed:** |
| 123 | +- 🐛 Bug fixes |
| 124 | + |
| 125 | +**Removed:** |
| 126 | +- 🗑️ Removed features or inputs |
| 127 | + |
| 128 | +**CI/CD Improvements:** |
| 129 | +- 🧪 Test changes, workflow improvements |
| 130 | + |
| 131 | +**Documentation:** |
| 132 | +- 📝 Significant documentation updates |
| 133 | +``` |
| 134 | + |
| 135 | +Rules: |
| 136 | +- Use present tense ("Add", not "Added" in descriptions) |
| 137 | +- Start each bullet with an emoji for visual scanning |
| 138 | +- Group related changes together |
| 139 | +- Reference specific inputs, functions, or paths |
| 140 | +- For breaking changes, add migration instructions |
| 141 | +- Include the date in ISO format (YYYY-MM-DD) |
| 142 | +- Only include sections that have entries (skip empty sections) |
| 143 | + |
| 144 | +### 6. Format for CHANGELOG.md |
| 145 | + |
| 146 | +The changelog lives in `CHANGELOG.md` (root of the repository). Entries are ordered newest-first under the top-level heading. `README.md` has a `## Changelog` section with a single link to `CHANGELOG.md`. |
| 147 | + |
| 148 | +Example output: |
| 149 | + |
| 150 | +```markdown |
| 151 | +## [v3.2.0] — 2026-03-15 |
| 152 | + |
| 153 | +**Added:** |
| 154 | +- 🆕 `remove_rust` input to remove Rust toolchain (~1.5 GB on x86_64) |
| 155 | +- 🧪 UseCase test for Rust/Cargo projects |
| 156 | + |
| 157 | +**Changed:** |
| 158 | +- 🔧 Upgrade `rmz` default version from 3.1.1 to 3.2.0 |
| 159 | +- 📊 Updated Size Savings table based on Run #210 |
| 160 | + |
| 161 | +**Fixed:** |
| 162 | +- 🐛 Fix `remove_packages` validation rejecting single package names |
| 163 | + |
| 164 | +**CI/CD Improvements:** |
| 165 | +- 🧪 Add ARM64-specific package removal test |
| 166 | +- 🔧 Change linter runner to `ubuntu-slim` for faster execution |
| 167 | +``` |
| 168 | + |
| 169 | +### 7. Present to User |
| 170 | + |
| 171 | +Show the proposed changelog entry and ask for confirmation before applying. |
| 172 | + |
| 173 | +Include: |
| 174 | +1. **Version bump recommendation** (major/minor/patch) with rationale |
| 175 | +2. **Proposed changelog entry** in full markdown |
| 176 | +3. **Files to update**: README.md (changelog section), VERSION file (if exists) |
| 177 | +4. **Notable omissions**: Changes intentionally excluded and why |
| 178 | +5. **Suggested commit message** for the changelog update itself |
| 179 | + |
| 180 | +### 8. Apply Changes |
| 181 | + |
| 182 | +After user confirmation: |
| 183 | +1. Insert the new entry in `CHANGELOG.md` after the top header block, before the previous version entry |
| 184 | +2. Update VERSION file if it exists |
| 185 | +3. Suggest the git commands: |
| 186 | + |
| 187 | +```bash |
| 188 | +git add CHANGELOG.md VERSION |
| 189 | +git commit -m "docs(changelog): add vX.Y.Z release notes" |
| 190 | +``` |
| 191 | + |
| 192 | +## Edge Cases |
| 193 | + |
| 194 | +- **No notable changes**: Report "No notable changes since vX.Y.Z" and suggest skipping the release |
| 195 | +- **Only internal changes**: Report what was skipped and confirm with user |
| 196 | +- **Multiple breaking changes**: Group under single MAJOR bump, list all in changelog |
| 197 | +- **Pre-release (WIP)**: Use `### vX.Y.Z (Working in Progress)` header |
| 198 | +- **First release**: Generate complete initial changelog from repository history |
0 commit comments