Use when user wants to build a PyPI wheel from an existing compiled afm binary and publish to PyPI. Covers staging assets, building the wheel, and providing the uv publish command. Only for official stable releases, not nightly builds.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Use when user wants to build a PyPI wheel from an existing compiled afm binary and publish to PyPI. Covers staging assets, building the wheel, and providing the uv publish command. Only for official stable releases, not nightly builds.
user_invocable
true
AFM Release Wheel
Build a PyPI-distributable wheel from an existing compiled afm binary and provide the publish command.
Only official stable releases can be published to PyPI. Nightly builds are NOT distributed via pip.
Usage
/afm-release-wheel — build wheel from existing release binary
/afm-release-wheel 0.9.7 — build wheel and set version
Instructions
Step 1: Ask Target Registry
The maintainer has a TestPyPI account set up (separate login from production PyPI, 2FA + API token). So TestPyPI validation is always available — default to recommending it for any first upload of a new version before production. The token is supplied at publish time (--token, UV_PUBLISH_TOKEN, or ~/.pypirc); don't assume it's hardcoded anywhere.
Use AskUserQuestion:
Question: "Which PyPI registry should this wheel target?"
Options:
"TestPyPI (Recommended for first-time validation)" — publish to https://test.pypi.org
"PyPI Production" — publish to https://pypi.org (official release)
Save the choice for Step 5.
Step 2: Determine Version
If version was provided as argument, use it. Otherwise read current version:
# Metallib
METALLIB="$(dirname "$BIN")/AFMKit_AFMKitMLX.bundle/default.metallib"test -f "$METALLIB" && echo"Metallib: OK ($(ls -lh "$METALLIB" | awk '{print $5}'))" || echo"WARNING: No metallib found"# WebUI (MANDATORY)test -f Resources/webui/index.html.gz && echo"WebUI: OK" || echo"FATAL: WebUI MISSING — run /build-afm first"# Info.plist embedded with NSSpeechRecognitionUsageDescription (MANDATORY for macOS 26)# Wheel users get a crash on `afm speech` / POST /v1/audio/transcriptions / chat input_audio# if the binary doesn't have this key embedded. See Sources/AFMCLI/Info.plist +# Package.swift -Xlinker -sectcreate flags.if otool -l "$BIN" | grep -q '__info_plist' && strings "$BIN" | grep -q 'NSSpeechRecognitionUsageDescription'; thenecho"Info.plist: OK (NSSpeechRecognitionUsageDescription embedded)"elseecho"FATAL: Info.plist missing or NSSpeechRecognitionUsageDescription not embedded — run /build-afm to rebuild"fi
If binary is missing, STOP and tell user to run /build-afm first.
If WebUI is missing, STOP — the -w flag won't work without it. Run /build-afm to rebuild with webui.
If Info.plist check fails, STOP — shipping a wheel without the embedded Info.plist means every pip user that calls Speech Recognition gets a SIGABRT on macOS 26. Run /build-afm (which now enforces this).
Step 4: Stage Assets and Build Wheel
Stage compiled artifacts into macafm/ for wheel bundling, build, then clean: