fix(skill): repair three broken commands in the release skill - #104
Merged
Conversation
All three fail as written; each failure and each replacement was verified against the live repo, where release-please PR #81 (chore(main): release 3.0.0) is currently open. 1. PR discovery returned zero results while the PR existed. `--search 'chore(main): release in:title'` -> 0 hits: GitHub's search parser drops the `chore(main):` prefix. Replaced with a --jq filter matching either signal (the release-please--* head branch or the title prefix), so a change to either still finds the PR. This bug's failure mode is the dangerous kind: "filter is broken" and "no release PR exists" are indistinguishable from the caller's side, and the skill's instruction on that branch is to STOP -- so it silently strands a real release. Added a guard clause to sanity-check with a bare `gh pr list --state open` before concluding nothing is there. 2. `gh pr diff <n> -- pyproject.toml CHANGELOG.md` fails outright: "accepts at most 1 arg(s), received 3". gh pr diff has no pathspec support. Replaced with `gh api repos/{owner}/{repo}/pulls/<n>/files` filtered by filename (gh expands the {owner}/{repo} placeholders). Added a pointer to read the BREAKING CHANGES block, since that is what drove #81 to 3.0.0. 3. `gh run watch` with no argument fails outside a TTY ("run ID required when not running interactively"), and the skill runs it non-interactively. Both occurrences now resolve the run id via `gh run list --limit 1` first; the dev-build block reuses that id for the following `gh run download` instead of a <run-id> placeholder. Also tightened the RC lane's revert, which used `git checkout pyproject.toml uv.lock` -- a discard-without-looking on two files contributors commonly edit. It was safe only by virtue of the clean-tree precondition four steps upstream, with a full test run in between. Now: assert both files are unmodified before the bump, and at revert time print the diff and require it to be only the version bump before `git restore --source=HEAD --worktree`. If anything else appears, stop -- discarding it destroys unrecoverable work. Verified: the two rewritten gh commands run verbatim against #81 and return the expected output; the guard and restore were exercised in a throwaway git repo (silent on clean, STOP on dirty, restore returns the file to HEAD). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER1fspJAScAo1o4jGdjuJE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While answering "how do I test a build before cutting a version", I ran the
releaseskill's own commands against the repo. Three of them fail as written. Each failure and each replacement is verified against the live repo, where release-please PR #81 (chore(main): release 3.0.0) is currently open.1. PR discovery returned zero results while the PR existed
GitHub's search parser drops the
chore(main):prefix. Replaced with a--jqfilter matching either signal — therelease-please--*head branch or the title prefix — so a change to either still finds the PR.This bug's failure mode is the dangerous kind. "Filter is broken" and "no release PR exists" are indistinguishable from the caller's side, and the skill's instruction on that branch is to stop. As written it silently strands a real release and reports the opposite. Added a guard clause: sanity-check with a bare
gh pr list --state openbefore concluding nothing is there.2.
gh pr diffhas no pathspec supportgh pr diff 81 -- pyproject.toml CHANGELOG.md # accepts at most 1 arg(s), received 3Replaced with
gh api repos/{owner}/{repo}/pulls/<n>/filesfiltered by filename (ghexpands the{owner}/{repo}placeholders — verified). Added a pointer to read the⚠ BREAKING CHANGESblock, since that is what drove #81 to a major bump.3.
gh run watchneeds an explicit run id outside a TTYgh run watch # run ID required when not running interactivelyThe skill runs it non-interactively, so it never worked there. Both occurrences now resolve the run id via
gh run list --limit 1first; the dev-build block reuses that id for the followinggh run downloadinstead of leaving a<run-id>placeholder.Also: tightened the RC lane's revert
Step 5 discarded the version bump with
git checkout pyproject.toml uv.lock— a discard-without-looking on two files contributors commonly edit. It was safe only by virtue of the clean-tree precondition four steps upstream, with a full test run in between.Now it asserts both files are unmodified before the bump, and at revert time prints the diff and requires it to be only the version bump before running
git restore --source=HEAD --worktree. If anything else appears, stop — discarding it destroys unrecoverable work.Verification
ghcommands run verbatim against chore(main): release 3.0.0 #81 and return the expected output (PR row;version = "2.2.0"→"3.0.0"plus the changelog patch).gh run watchwith no args reproduced asrun ID required when not running interactively.STOPon a dirty one, andgit restore --source=HEAD --worktreereturns the file to HEAD and leaves the tree clean.Skill documentation only — no source, dependency, or CI changes. Nothing here touches the wheel.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ER1fspJAScAo1o4jGdjuJE