Prepare Release
Prepare a release by gathering all changes since the last tag, updating the changelog, and auditing documentation.
Workflow Overview
- Gather changes -- Identify last tag, collect commits and diffs
- Update CHANGELOG.md -- Categorize changes, infer version, write entry
- Audit documentation -- Check every doc file for staleness
- Apply doc updates -- Fix identified issues
Phase 1: Gather Changes
Identify the last git tag:
git describe --tags --abbrev=0
Collect all commits between that tag and HEAD:
git log --oneline <last-tag>..HEAD
Get the diff stats:
git diff --stat <last-tag>..HEAD
For each commit, read the full commit message and the diff to understand the actual change -- commit subjects alone are insufficient. Use git show <sha> for commits that look significant. Pay particular attention to:
- Changes to
api/v1alpha1/ (CRD changes, potential breaking changes)
- New files (potential new features)
- Deleted files (potential breaking changes or cleanup)
- Changes to container args, env vars, probes (behavioral changes)
- Changes to
pkg/webhook/ (admission logic changes)
- Changes to
config/ (RBAC, CRD schema, monitoring rules)
Build a categorized list of changes. See changelog-format.md for the section ordering and formatting rules.
Separate observer changes from operator changes. The observer (tools/observer/) is a standalone diagnostic tool, not part of the operator itself. When categorizing changes:
- Changes under
tools/observer/ (code, docs, skills, fixtures) go into a separate Observer subsection at the end of the changelog entry
- Only operator-level changes (CRD, controllers, webhook, config, pkg/) are listed in the main sections (Features, Bug Fixes, etc.)
- Observer changes must NOT influence version inference -- see Phase 2
Phase 2: Update CHANGELOG.md
Read changelog-format.md for the exact format conventions.
Infer the next version from operator-only changes (exclude observer). See the detailed rules in changelog-format.md, but the key litmus test is:
- Does this release give users a new knob they can turn, a new resource they can create, or a new operational workflow they couldn't do before? -> MINOR
- Does it only make existing behavior more reliable, correct, validated, or hardened? -> PATCH
Write the new changelog entry at the top of the file (after the header, before the previous version). Include:
- Version and date header
- Previous release reference
- One-paragraph summary of the release theme
- Stats line (commit count, files changed, insertions)
- Categorized change sections (omit empty sections)
Distinguish Improvements from Bug Fixes. Changes that enhance existing behavior -- performance gains, reliability hardening (e.g., adding health probes), validation tightening, operational polish -- go into ### Improvements, NOT ### Bug Fixes. Reserve Bug Fixes for things that were genuinely broken. See changelog-format.md for section ordering.
Proceed directly to Phase 3 without stopping. If the user wants to adjust the version or changelog entry, that is a trivial change afterwards.
Phase 3: Audit Documentation
This is the most important phase. Read doc-inventory.md for the complete file inventory.
3a. Change-Driven Audit
For each code change identified in Phase 1, cross-reference the "Related Code" column in the doc inventory to identify which docs might need updating. For each affected doc:
- Read the doc file
- Check if the documented behavior still matches the code after the changes
- Flag any stale content, missing references to new features, or incorrect descriptions
3b. Full Staleness Scan
Independently of the code changes, scan every documentation file listed in the inventory for general staleness. For each file:
- Read the doc file
- Spot-check key claims against the current codebase (e.g., file paths, function names, CRD fields, controller names, command examples)
- Flag anything outdated, even if unrelated to the changes since the last tag
Common staleness patterns to look for:
- References to deleted files or renamed packages
- CRD fields that were added/removed but not reflected in docs
- Makefile targets that changed
- Controller behavior that evolved (phases, conditions, events)
- Container args or env vars that changed
- Alert rules or metrics that were added/removed/renamed
- Sample YAML that no longer matches the current CRD schema
3c. Report Findings
Present a summary table to the user:
| File |
Status |
Action Needed |
README.md |
Current |
-- |
docs/storage.md |
Stale |
Section on PVC deletion references old behavior |
docs/development/phase-lifecycle.md |
Missing content |
New degraded phase not documented |
Include both change-driven findings (3a) and staleness findings (3b) in the table.
Phase 4: Apply Documentation Updates
For each item flagged in Phase 3, make the fix:
- Update stale content to match current code
- Add missing documentation for new features
- Remove references to deleted features
- Fix incorrect file paths, function names, or examples
Present a summary of all documentation changes to the user.
Important Rules
- Do NOT commit or stage any files. The user will review and commit manually.
- Do NOT modify
CLAUDE.md or anything under agent-docs/ -- these are not part of the project docs.
- Do NOT skip Phase 3b (full staleness scan). Even if no code changed, docs can drift.
- When in doubt about whether a doc is stale, read the actual source code to verify.
- Clean up after yourself -- do not leave scratch files or temporary outputs.
1---2name: prepare-release3description: Prepare a release by analyzing all changes since the last git tag, updating CHANGELOG.md with categorized entries, inferring the next semantic version, and auditing all documentation for staleness or missing content. Triggered by requests like "prepare release", "bump version", "update changelog", "release prep", "version bump", or "prepare changelog".4---56# Prepare Release78Prepare a release by gathering all changes since the last tag, updating the changelog, and auditing documentation.910## Workflow Overview11121. **Gather changes** -- Identify last tag, collect commits and diffs132. **Update CHANGELOG.md** -- Categorize changes, infer version, write entry143. **Audit documentation** -- Check every doc file for staleness154. **Apply doc updates** -- Fix identified issues1617## Phase 1: Gather Changes18191. Identify the last git tag:20 ```bash21 git describe --tags --abbrev=022 ```23242. Collect all commits between that tag and HEAD:25 ```bash26 git log --oneline <last-tag>..HEAD27 ```28293. Get the diff stats:30 ```bash31 git diff --stat <last-tag>..HEAD32 ```33344. For each commit, read the full commit message and the diff to understand the actual change -- commit subjects alone are insufficient. Use `git show <sha>` for commits that look significant. Pay particular attention to:35 - Changes to `api/v1alpha1/` (CRD changes, potential breaking changes)36 - New files (potential new features)37 - Deleted files (potential breaking changes or cleanup)38 - Changes to container args, env vars, probes (behavioral changes)39 - Changes to `pkg/webhook/` (admission logic changes)40 - Changes to `config/` (RBAC, CRD schema, monitoring rules)41425. Build a categorized list of changes. See [changelog-format.md](references/changelog-format.md) for the section ordering and formatting rules.43446. **Separate observer changes from operator changes.** The observer (`tools/observer/`) is a standalone diagnostic tool, not part of the operator itself. When categorizing changes:45 - Changes under `tools/observer/` (code, docs, skills, fixtures) go into a separate **Observer** subsection at the end of the changelog entry46 - Only operator-level changes (CRD, controllers, webhook, config, pkg/) are listed in the main sections (Features, Bug Fixes, etc.)47 - Observer changes must NOT influence version inference -- see Phase 24849## Phase 2: Update CHANGELOG.md50511. Read [changelog-format.md](references/changelog-format.md) for the exact format conventions.52532. **Infer the next version** from **operator-only** changes (exclude observer). See the detailed rules in [changelog-format.md](references/changelog-format.md), but the key litmus test is:54 - Does this release give users a **new knob they can turn**, a **new resource they can create**, or a **new operational workflow** they couldn't do before? -> MINOR55 - Does it only make existing behavior more reliable, correct, validated, or hardened? -> PATCH56573. Write the new changelog entry at the top of the file (after the header, before the previous version). Include:58 - Version and date header59 - Previous release reference60 - One-paragraph summary of the release theme61 - Stats line (commit count, files changed, insertions)62 - Categorized change sections (omit empty sections)63644. **Distinguish Improvements from Bug Fixes.** Changes that enhance existing behavior -- performance gains, reliability hardening (e.g., adding health probes), validation tightening, operational polish -- go into `### Improvements`, NOT `### Bug Fixes`. Reserve Bug Fixes for things that were genuinely broken. See [changelog-format.md](references/changelog-format.md) for section ordering.65665. Proceed directly to Phase 3 without stopping. If the user wants to adjust the version or changelog entry, that is a trivial change afterwards.6768## Phase 3: Audit Documentation6970This is the most important phase. Read [doc-inventory.md](references/doc-inventory.md) for the complete file inventory.7172### 3a. Change-Driven Audit7374For each code change identified in Phase 1, cross-reference the "Related Code" column in the doc inventory to identify which docs might need updating. For each affected doc:75761. Read the doc file772. Check if the documented behavior still matches the code after the changes783. Flag any stale content, missing references to new features, or incorrect descriptions7980### 3b. Full Staleness Scan8182Independently of the code changes, scan every documentation file listed in the inventory for general staleness. For each file:83841. Read the doc file852. Spot-check key claims against the current codebase (e.g., file paths, function names, CRD fields, controller names, command examples)863. Flag anything outdated, even if unrelated to the changes since the last tag8788Common staleness patterns to look for:89- References to deleted files or renamed packages90- CRD fields that were added/removed but not reflected in docs91- Makefile targets that changed92- Controller behavior that evolved (phases, conditions, events)93- Container args or env vars that changed94- Alert rules or metrics that were added/removed/renamed95- Sample YAML that no longer matches the current CRD schema9697### 3c. Report Findings9899Present a summary table to the user:100101| File | Status | Action Needed |102|:---|:---|:---|103| `README.md` | Current | -- |104| `docs/storage.md` | Stale | Section on PVC deletion references old behavior |105| `docs/development/phase-lifecycle.md` | Missing content | New degraded phase not documented |106107Include both change-driven findings (3a) and staleness findings (3b) in the table.108109## Phase 4: Apply Documentation Updates1101111. For each item flagged in Phase 3, make the fix:112 - Update stale content to match current code113 - Add missing documentation for new features114 - Remove references to deleted features115 - Fix incorrect file paths, function names, or examples1161172. Present a summary of all documentation changes to the user.118119## Important Rules120121- Do NOT commit or stage any files. The user will review and commit manually.122- Do NOT modify `CLAUDE.md` or anything under `agent-docs/` -- these are not part of the project docs.123- Do NOT skip Phase 3b (full staleness scan). Even if no code changed, docs can drift.124- When in doubt about whether a doc is stale, read the actual source code to verify.125- Clean up after yourself -- do not leave scratch files or temporary outputs.