Use when user asks to update changelog, update docs, review changes, or create release notes. Also use after completing a significant feature, fix, or refactor that should be documented.
Review git changes and update CHANGELOG.md and project documentation to reflect the latest work.
Run these commands to understand the current state:
git log --oneline -20 # Recent commits
git log --oneline --since="1 week ago" # Time-based range
git status # Uncommitted changes
git diff --stat # Files changed
If the user specifies a range (e.g., "since last tag", "last 5 commits"), use that instead:
# Since last tag
git log --oneline $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD
# Specific range
git log --oneline HEAD~5..HEAD
Parse each commit message for its prefix and group accordingly:
| Prefix | CHANGELOG Section | Example |
|---|---|---|
feat: | Features | feat: add dark mode toggle |
fix: | Bug Fixes | fix: resolve pagination off-by-one |
refactor: | Refactors | refactor: extract useFilters hook |
perf: | Performance | perf: memoize movie list rendering |
test: | Tests | test: add E2E tests for search |
docs: | Documentation | docs: update architecture diagram |
chore: | Chores | chore: update dependencies |
ci: | CI/CD | ci: add Playwright to GitHub Actions |
style: | Style | style: format with prettier |
Commits without a prefix: Classify by reading the diff. If it touches only config/tooling, treat as chore. If it changes behavior, determine if fix or feat fits.
Skip trivial commits: Merge commits, version bumps, "WIP", and typo fixes (unless the user explicitly asks for everything).
## [Unreleased] section### subheading (create if missing)- prefix: description (short-hash)## [Unreleased]
### Features
- feat: add dark mode toggle (a1b2c3d)
### Bug Fixes
- fix: resolve pagination off-by-one error (d4e5f6g)
Create it with this header, then add entries:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [Unreleased]
### Features
- feat: description (hash)
When the user says "release X.Y.Z" or "cut a release":
## [Unreleased] content to ## [X.Y.Z] - YYYY-MM-DD## [Unreleased] empty with no subsectionsAfter updating CHANGELOG.md, always run:
npx markdownlint CHANGELOG.md
Fix any errors before proceeding. See Markdownlint Formatting section for common rules.
Scan the changed files to decide which docs to update:
| Changed files | Doc to check | What to update |
|---|---|---|
src/components/**, src/hooks/**, src/views/** | docs/ARCHITECTURE.md | Component hierarchy, Mermaid diagrams |
src/store/**, state management | docs/ARCHITECTURE.md | State management diagram |
src/services/**, API calls | docs/ARCHITECTURE.md | Data flow diagram, API endpoints |
package.json (scripts) | docs/DEVELOPMENT.md | Running Checks section |
lefthook.yml, .prettierrc, eslint.config.js | docs/DEVELOPMENT.md | Pre-commit Hooks section |
vite.config.ts, tsconfig.json | docs/DEVELOPMENT.md | Build configuration |
| User-facing features | README.md | Features section, setup instructions |
If no relevant docs exist: Skip this step. Don't create docs that don't already exist unless the user asks.
For each doc that needs updating:
npx @probelabs/maid <file>
After making changes, report what was done:
## Changes Reviewed
**Commits analyzed:** N (from abc1234 to def5678)
**Date range:** YYYY-MM-DD to YYYY-MM-DD
### Summary by Category
| Category | Count | Key Changes |
|----------|-------|-------------|
| Features | N | feat: ..., feat: ... |
| Bug Fixes | N | fix: ... |
### Files Updated
- `CHANGELOG.md` — Added N entries under [Unreleased]
- `docs/ARCHITECTURE.md` — Updated component hierarchy
# See what changed recently
git log --oneline -10
# See files touched
git diff --stat HEAD~5..HEAD
# Check if CHANGELOG exists
cat CHANGELOG.md 2>/dev/null | head -5 || echo "No CHANGELOG"
chore: for config-only changes.CHANGELOG.md must pass npx markdownlint CHANGELOG.md. Key rules:
MD022 — Blank line after headings: Always add a blank line between a ### Heading and the first list item.
<!-- WRONG -->
### Features
- feat: something
<!-- CORRECT -->
### Features
- feat: something
MD032 — Blank line before lists: Same rule — the blank line after the heading satisfies this.
MD024 — Duplicate headings: CHANGELOG files inherently repeat section names (Features, Bug Fixes) under different dates. Disable this rule in .markdownlint.json:
{
"no-duplicate-heading": false
}
Validate after every change:
npx markdownlint CHANGELOG.md