Skip to content

Commit 403972b

Browse files
Alan Shumclaude
andcommitted
docs: add version consistency checks to release skill
Add mandatory pre-release audit and post-release verification steps to ensure versions align across Cargo.toml, git tags, GitHub releases, crates.io, and Homebrew tap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0bb10bb commit 403972b

File tree

1 file changed

+52
-15
lines changed

1 file changed

+52
-15
lines changed

.claude/skills/release.md

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release semantic-diff
22

3-
Publish a new version of semantic-diff to crates.io, create a GitHub release with a curated changelog, and trigger the CI workflow that builds dual-arch macOS binaries and auto-updates the Homebrew tap.
3+
Publish a new version of semantic-diff with consistent versioning across all distribution channels: Cargo.toml, crates.io, GitHub release (with tag), and Homebrew tap.
44

55
## Usage
66

@@ -19,29 +19,50 @@ If no version argument provided, check current version and ask user:
1919
cd /Users/kshum/Documents/gitproj/semantic-diff && grep '^version' Cargo.toml
2020
```
2121

22-
### 2. Update Cargo.toml version
22+
### 2. Version consistency check (MANDATORY)
2323

24-
Edit the `version = "..."` line in `Cargo.toml` to the new version.
24+
Before making any changes, audit all version sources and report mismatches:
2525

26-
### 3. Add changelog entry to README
26+
```bash
27+
echo "=== Cargo.toml ===" && grep '^version' Cargo.toml
28+
echo "=== Git tags (local) ===" && git tag -l 'v*' | sort -V | tail -5
29+
echo "=== Git tags (remote) ===" && git ls-remote --tags origin 'refs/tags/v*' | awk '{print $2}' | sed 's|refs/tags/||' | sort -V | tail -5
30+
echo "=== GitHub releases ===" && gh release list --limit 5
31+
echo "=== crates.io ===" && cargo search semantic-diff --limit 1 2>/dev/null || echo "(unable to check)"
32+
```
33+
34+
**All of these must align for the target version before the release is considered complete:**
35+
- `Cargo.toml` version matches `<VERSION>`
36+
- Git tag `v<VERSION>` exists locally and on remote
37+
- GitHub release `v<VERSION>` exists with curated notes
38+
- crates.io has `<VERSION>` published
39+
- CI workflow triggered (builds binaries + updates Homebrew tap)
40+
41+
If previous releases have mismatches (e.g., GitHub release exists but no git tag, or crates.io is behind), **report them to the user** and offer to fix before proceeding with the new release.
42+
43+
### 3. Update Cargo.toml version
44+
45+
Edit the `version = "..."` line in `Cargo.toml` to the new version. Skip if already correct.
46+
47+
### 4. Add changelog entry to README
2748

2849
Read the changelog section in `README.md`. Add a new `### v<VERSION>` entry above the previous version with bullet points summarizing the changes. Use `git log --oneline <previous_tag>..HEAD` to see what changed.
2950

30-
### 4. Verify the build
51+
### 5. Verify the build
3152

3253
```bash
3354
cd /Users/kshum/Documents/gitproj/semantic-diff && cargo build --release 2>&1
3455
```
3556

36-
### 5. Publish to crates.io
57+
### 6. Publish to crates.io
3758

3859
```bash
3960
cd /Users/kshum/Documents/gitproj/semantic-diff && cargo publish 2>&1
4061
```
4162

4263
If this fails with an email verification error, tell the user to verify at https://crates.io/settings/profile.
4364

44-
### 6. Commit, tag, and push
65+
### 7. Commit, tag, and push
4566

4667
Ensure the active `gh` account is `alankyshum`:
4768
```bash
@@ -58,7 +79,7 @@ Ensure the remote uses HTTPS (so `gh` handles auth):
5879
git remote set-url origin https://github.com/alankyshum/semantic-diff.git
5980
```
6081

61-
Commit the version bump and changelog:
82+
Commit the version bump and changelog (skip if no changes to commit):
6283
```bash
6384
cd /Users/kshum/Documents/gitproj/semantic-diff && git add Cargo.toml Cargo.lock README.md && git commit -m "chore: release v<VERSION>"
6485
```
@@ -68,7 +89,7 @@ Push to main:
6889
cd /Users/kshum/Documents/gitproj/semantic-diff && git push origin main
6990
```
7091

71-
### 7. Create GitHub release with curated changelog
92+
### 8. Create GitHub release with curated changelog
7293

7394
Write release notes following this format — do NOT use `--generate-notes`:
7495

@@ -100,7 +121,20 @@ EOF
100121

101122
Group changes by theme (e.g. "Adaptive Theme", "Docs & Community", "Fixes") rather than listing raw commits. Use `git log --oneline <previous_tag>..v<VERSION>` to see all changes. Write human-readable descriptions, not commit messages.
102123

103-
### 8. Monitor CI
124+
### 9. Post-release verification (MANDATORY)
125+
126+
After GitHub release is created, verify all channels are consistent:
127+
128+
```bash
129+
echo "=== Verify tag ===" && git fetch --tags && git tag -l "v<VERSION>"
130+
echo "=== Verify GitHub release ===" && gh release view "v<VERSION>" --json tagName,name --jq '.tagName + " " + .name'
131+
echo "=== Verify crates.io ===" && cargo search semantic-diff --limit 1
132+
echo "=== Verify CI triggered ===" && gh run list --limit 1
133+
```
134+
135+
If any channel is missing or mismatched, fix it before proceeding.
136+
137+
### 10. Monitor CI
104138

105139
The release workflow (`.github/workflows/release.yml`) auto-triggers on tag push (created by `gh release create`). It will:
106140
1. Build `aarch64-apple-darwin` and `x86_64-apple-darwin` binaries
@@ -112,12 +146,15 @@ Watch the workflow:
112146
cd /Users/kshum/Documents/gitproj/semantic-diff && gh run list --limit 1
113147
```
114148

115-
### 9. Report
149+
### 11. Report
116150

117-
Print summary with links:
118-
- crates.io: https://crates.io/crates/semantic-diff
119-
- GitHub release: https://github.com/alankyshum/semantic-diff/releases/tag/v<VERSION>
120-
- Homebrew: `brew install alankyshum/tap/semantic-diff`
151+
Print summary with links and verification status:
152+
- Cargo.toml: `<VERSION>`
153+
- crates.io: https://crates.io/crates/semantic-diff ✓/✗
154+
- GitHub release: https://github.com/alankyshum/semantic-diff/releases/tag/v<VERSION> ✓/✗
155+
- Git tag: `v<VERSION>` ✓/✗
156+
- CI workflow: ✓/✗ (triggered / completed)
157+
- Homebrew: `brew install alankyshum/tap/semantic-diff` (updated by CI)
121158

122159
## Prerequisites
123160

0 commit comments

Comments
 (0)