Skip to content

Commit 8e0090f

Browse files
Create skill for releasing (#555)
* Replace release target with prepare-release and create-github-release - prepare-release: validates version, bumps files, runs pre-release-check, commits to release/X.Y.Z branch, pushes, and opens a PR via gh pr create - create-github-release: creates GitHub Release with auto-generated notes (--generate-notes) which triggers the PyPI publish workflow - Avoids direct pushes to master Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Document new PR-based release process in DEVELOPMENT.rst Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Run pre-release-check before bumping version files in prepare-release If pre-release-check fails, the working tree remains clean and no manual rollback is needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Use Unreleased section in CHANGES.rst for development workflow - CHANGES.rst: add empty Unreleased section at the top - Makefile: prepare-release checks for Unreleased section and renames it to the release version; no need to know the version during development - DEVELOPMENT.rst: document that PRs should add entries under Unreleased Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add wikipedia-api-release skill and track .claude/skills/ in git Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 113863b commit 8e0090f

2 files changed

Lines changed: 117 additions & 1 deletion

File tree

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
name: wikipedia-api-release
3+
description: >
4+
Release a new version of Wikipedia-API. Use this skill whenever the user
5+
mentions releasing, publishing, cutting a new version, bumping the version,
6+
or preparing a release of Wikipedia-API — even if they just say "let's do a
7+
release" or "time to release".
8+
---
9+
10+
# Wikipedia-API Release
11+
12+
## Step 1 — Read current state
13+
14+
Read two files:
15+
16+
1. `wikipediaapi/_version.py` — extract the version tuple, e.g. `(0, 14, 1)``0.14.1`
17+
2. `CHANGES.rst` — extract every bullet point listed under the `Unreleased` heading
18+
(everything between the `Unreleased\n----------` heading and the next version heading)
19+
20+
If there is no `Unreleased` section in `CHANGES.rst`, tell the user and stop —
21+
there is nothing to release.
22+
23+
If the `Unreleased` section is empty (no bullet points), warn the user that the
24+
changelog has no entries and ask whether they want to continue anyway.
25+
26+
## Step 2 — Suggest a version bump
27+
28+
Classify the unreleased changes and propose a version:
29+
30+
| Change type | Bump |
31+
| ------------------------------------------------------------------------- | ----------------------- |
32+
| Bug fixes, docs, tests, dependency updates, tooling, refactors | **Patch**`X.Y.(Z+1)` |
33+
| New feature, new API method, new CLI command, new property, new parameter | **Minor**`X.(Y+1).0` |
34+
| Breaking change, removed API, incompatible behaviour change | **Major**`(X+1).0.0` |
35+
36+
When in doubt between patch and minor, lean toward minor — it is easier to
37+
release more minor versions than to explain to users why a feature landed in a
38+
patch.
39+
40+
Present a clear summary to the user, for example:
41+
42+
```
43+
Current version: 0.14.1
44+
45+
Unreleased changes:
46+
• Rewrite SKILLS/ as flat Markdown reference files - PR 552
47+
• Replace release process with PR-based flow - PR 553
48+
• Use Unreleased section in CHANGES.rst for development workflow - PR 553
49+
50+
Suggestion: 0.15.0 (minor — new tooling and development workflow)
51+
52+
Version to release? [0.15.0]
53+
```
54+
55+
## Step 3 — Confirm the version
56+
57+
Wait for the user to respond:
58+
59+
- Empty / `y` / `yes` → use the suggested version
60+
- Any `X.Y.Z` string → use that instead
61+
62+
Validate that the chosen version:
63+
64+
- Follows `X.Y.Z` format
65+
- Is strictly greater than the current version
66+
67+
If validation fails, explain why and ask again.
68+
69+
## Step 4 — Run prepare-release
70+
71+
Make sure the user is on a clean `master` branch (the Makefile will enforce
72+
this too, but it is friendly to mention it up front). Then run:
73+
74+
```bash
75+
make prepare-release VERSION='<confirmed-version>'
76+
```
77+
78+
This will:
79+
80+
- Run the full pre-release check suite (tests, type checks, linting, examples)
81+
- Create a `release/<version>` branch
82+
- Rename `Unreleased``<version>` in `CHANGES.rst` and bump all version files
83+
- Open a pull request
84+
85+
Keep the user informed of progress. The checks can take a few minutes.
86+
87+
If `make prepare-release` fails, read the error output carefully and explain
88+
what went wrong. Common causes: not on master, dirty working tree, a failing
89+
test, or a linting error.
90+
91+
## Step 5 — Wait for the PR to merge
92+
93+
Tell the user:
94+
95+
```
96+
The release PR is open. Once it's reviewed and merged, let me know
97+
and I'll create the GitHub Release.
98+
```
99+
100+
Wait for the user to confirm the PR has been merged before proceeding.
101+
102+
## Step 6 — Create the GitHub Release
103+
104+
Run:
105+
106+
```bash
107+
make create-github-release VERSION='<confirmed-version>'
108+
```
109+
110+
This creates a `v<version>` tag and a GitHub Release with auto-generated
111+
release notes drawn from merged PRs. The `release.yml` workflow then
112+
automatically publishes the package to PyPI.
113+
114+
Confirm with the user that the release is complete and point them to the
115+
GitHub Release page.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ parts/
2121

2222
# IDE and editor files
2323
.DS_Store
24-
.claude/
24+
.claude/*
25+
!.claude/skills/
2526
CLAUDE.md
2627
PR_DESCRIPTION.md
2728
wikipedia-api-specification

0 commit comments

Comments
 (0)