Skip to content

Commit ce0b687

Browse files
nanotaboadaclaude
andcommitted
chore(commands): add /prerelease, update /precommit CHANGELOG step
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d922118 commit ce0b687

File tree

2 files changed

+84
-2
lines changed

2 files changed

+84
-2
lines changed

.claude/commands/precommit.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
Run the pre-commit checklist for this project:
22

3-
1. Remind me to update `CHANGELOG.md` `[Unreleased]` section (Added / Changed / Fixed / Removed) — I must do this manually.
3+
1. Update `CHANGELOG.md` `[Unreleased]` section — add an entry under the
4+
appropriate subsection (Added / Changed / Fixed / Removed) describing the
5+
changes made, referencing the issue number.
46
2. Run `uv run flake8 .` — must pass.
57
3. Run `uv run black --check .` — must pass (run `uv run black .` to auto-fix).
68
4. Run `uv run pytest --cov=./ --cov-report=term` — all tests must pass, coverage must be ≥80%.
79

8-
Run steps 2–4, report the results clearly, then propose a branch name and commit message for my approval using the format `type(scope): description (#issue)` (max 80 chars; types: `feat` `fix` `chore` `docs` `test` `refactor` `ci` `perf`). Do not create the branch or commit until I explicitly confirm.
10+
Run steps 1–4, report the results clearly, then propose a branch name and commit message for my approval using the format `type(scope): description (#issue)` (max 80 chars; types: `feat` `fix` `chore` `docs` `test` `refactor` `ci` `perf`). Do not create the branch or commit until I explicitly confirm.

.claude/commands/prerelease.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Run the pre-release checklist for this project.
2+
3+
**Working style**: propose before acting at every step — do not commit, push,
4+
open PRs, or create tags until I explicitly confirm.
5+
6+
---
7+
8+
### Phase 1 — Determine next release
9+
10+
1. **Verify working tree**: Confirm we are on `master` with a clean working
11+
tree. Pull latest if behind remote.
12+
13+
2. **Detect current release and propose next**: Read `CHANGELOG.md` for the
14+
coach naming convention (A–Z table) and the most recent release heading.
15+
Run `git tag --sort=-v:refname` to confirm the latest tag. Then:
16+
17+
- **Next codename**: next letter in the A–Z sequence after the current one.
18+
Use lowercase with no spaces for the tag (e.g. `eriksson`);
19+
Title Case for the CHANGELOG heading (e.g. `Eriksson`).
20+
- **Version bump** — infer from `[Unreleased]`:
21+
22+
| Condition | Bump |
23+
|---|---|
24+
| Any entry marked BREAKING | MAJOR |
25+
| Entries under Added | MINOR |
26+
| Only Changed / Fixed / Removed | PATCH |
27+
28+
- If `[Unreleased]` has no entries, stop and warn — there is nothing to release.
29+
30+
Present a summary before proceeding:
31+
```
32+
Current: v2.1.0-delbosque
33+
Proposed: v2.2.0-eriksson (MINOR — new features in Added)
34+
Branch: release/v2.2.0-eriksson
35+
Tag: v2.2.0-eriksson
36+
```
37+
38+
---
39+
40+
### Phase 2 — Prepare release branch
41+
42+
3. **Create release branch**: `release/vX.Y.Z-{codename}`.
43+
44+
4. **Update CHANGELOG.md**: Move all content under `[Unreleased]` into a new
45+
versioned heading `[X.Y.Z - Codename] - {today's date}`. Replace
46+
`[Unreleased]` with a fresh empty template:
47+
48+
```markdown
49+
## [Unreleased]
50+
51+
### Added
52+
53+
### Changed
54+
55+
### Fixed
56+
57+
### Removed
58+
```
59+
60+
5. **Propose commit**: `docs(changelog): release vX.Y.Z Codename`
61+
62+
6. **After confirmation**: commit. Then run steps 2–4 of `/precommit` (linting,
63+
formatting, tests — the CHANGELOG step is already handled). Push the branch
64+
and open a PR into `master` only once all checks pass.
65+
66+
---
67+
68+
### Phase 3 — Tag and release
69+
70+
7. **Stop and wait** for confirmation that:
71+
- All CI checks have passed
72+
- CodeRabbit review comments have been addressed
73+
- The PR has been merged into `master`
74+
75+
8. **Pull `master`**, then propose the annotated tag:
76+
- Tag name: `vX.Y.Z-{codename}`
77+
- Message: `Release X.Y.Z - Codename`
78+
79+
9. **After confirmation**: create and push the tag. The CD pipeline triggers
80+
automatically.

0 commit comments

Comments
 (0)