agentleFS
nuncaeslupusnuncaeslupus/literary-critic/.claude/skills/pypi-release/SKILL.md

pypi-release

Skill0 starsChanged 6 days agoMITView on GitHub

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.

  • Deletes or force-pushes
  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

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/json

Resolve 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:

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__)"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.