| name | publish-python |
| description | Prepares and triggers a new Python package release: runs cleanup, validates semantic versioning, updates pyproject.toml and docs, builds with uv, creates a GitHub release, and monitors the publishing workflow. Supports patch/minor/major auto-increment. Use when the user wants to cut a release, bump the version, or publish a new Python package version. |
| allowed-tools | ["Bash","Read","Edit","Grep","Glob"] |
| disable-model-invocation | true |
| user-invocable | true |
| argument-hint | <version|patch|minor|major> |
Prepare and trigger a new release for version: $ARGUMENTS
Follow these steps:
Output Format: Use clear section headers, timestamps for each step, and progress indicators for release operations.
Tool Validation: First verify that required tools are installed (uv, gh, git) and the project has proper release configuration.
Version Validation: Validate that the provided version follows semantic versioning format (e.g., 1.2.3, 1.0.0-alpha.1).
- Run cleanup first: Execute all cleanup steps (linting, formatting, type checking)
- Version increment options: Support auto-increment with 'patch', 'minor', or 'major' keywords instead of explicit version numbers
- Update pyproject.toml: Update the version field in pyproject.toml with the new version number
- Update version in docs: Update all references to the next version based on the provided version number
- Check version: Verify version in pyproject.toml and init.py match the target version and are greater than the current version
- Build test: Run
uv build to ensure the package builds correctly
- Create release: Use
gh release create with the appropriate version tag and release notes
- Monitor: Track the publishing workflow with
gh run list to ensure it completes successfully
Error Handling: If any step fails, attempt to fix the issue automatically. If unable to fix, report the specific error and suggested solutions before proceeding.