Catalogue / pypi-release
pypi-release
MITSignedRuns the PyPI release runbook — build, twine check, version bump, tag, upload. Use when the user wants a Python package published. Not for project scaffolding.--- name: pypi-release description: Runs the PyPI release runbook — build, twine check, version bump, tag, upload. Use when the user wants a Python package published. Not for project scaffolding. argument-hint: "--tag vX.Y.Z" user-invocable: true metadata: section: python ---
pypi-release
Takes a Python package from a clean working tree to a published PyPI release: pre-flight, build, check, rehearse, tag, upload, verify.
CANARY: pypi-release-loaded-2026-06-04-ea39c2b5-820c8d070baea5a5
When to load
Load when a package is being published to PyPI or TestPyPI. Pre-merge production sign-off (compatibility, observability, rollback) belongs to the ship skill; the two compose.
Load automated release when the project should publish from CI on a version bump instead of by hand (setting up or fixing a release.yml, trusted publishing, an approval gate) — it holds the workflow, the owner's one-time setup, and when to prefer it over this runbook.
Step 1 — Pre-flight
From the project root:
python3 "${CLAUDE_SKILL_DIR}/scripts/validate_release.py" --tag vX.Y.Z
curl -s -o /dev/null -w "%{http_code}\n" https://pypi.org/pypi/PKG/X.Y.Z/jsonResolve every mismatch first: version_consistent: false means pyproject.toml and __version__ disagree (dynamic = ["version"] with hatch-vcs removes the second string); tag_matches_version: false means the tag does not match the code; dist.stale lists old artifacts. The curl should print 404 — a 200 means the version exists, and PyPI never accepts a re-upload of a name==version, even after a yank, so bump instead.
Step 2 — Clean build and check
rm -rf dist/ # twine uploads everything in dist/, old builds included uv build uvx twine check dist/*
Step 3 — Rehearse on TestPyPI
Rendering and metadata problems only show after upload, and a real upload spends the version, so rehearse first:
uvx twine upload --repository testpypi dist/* uv run --with PKG --index-url https://test.pypi.org/simple/ \ --extra-index-url https://pypi.org/simple/ python -c "import PKG; print(PKG.__version__)"
The extra index supplies dependencies TestPyPI rarely hosts.
Step 4 — Tag, publish, verify
Tag immediately before uploading, so a failed upload leaves at most a tag to move rather than a mismatch with PyPI:
PyPI never accepts a re-upload and a pushed tag is public, so stop here and get the user's explicit go-ahead for this version, whatever autonomy says.
git tag vX.Y.Z && git push origin vX.Y.Z uvx twine upload dist/* uv run --with PKG==X.Y.Z python -c "import PKG; print(PKG.__version__)"
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 2.7 kB | 487b6ff35c5d |
| SKILVAULT_SOURCE.json | 1.5 kB | 84e203155bfd |
| THIRD_PARTY_NOTICES.md | 1.1 kB | 6139d641c9a6 |
| evals/loading_verification.json | 668 B | 220b241f2f73 |
| references/automated-release.md | 7.9 kB | 513c0d77dfc1 |
| scripts/validate_release.py | 5.5 kB | 35ee3e1e24d7 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 47b135f39834 | 2 Dec 2026 |
Locking a skill to one version needs Pro.