/lorenzh:using-gh-restfrom lorenzh
GitHub REST fallback when gh porcelain fails with projectCards on repos with Projects (classic) data. Use when gh issue view, gh issue edit, gh pr view, gh pr edit or gh pr create fails with a GraphQL error naming projectCards or "Projects (classic) is being deprecated".
Ships in lorenzh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Do GitHub issue and pull request work through gh api when the porcelain commands fail with projectCards.
Switch to REST at the first projectCards error and read back every write. A retry hits the same deprecated GraphQL field, and an unread write can report a state that GitHub has not reached yet.
gh issue view, gh issue view --comments, gh issue edit, gh pr view, gh pr edit and gh pr create ask GraphQL for projectCards. On a repo with Projects (classic) data they fail with GraphQL: Projects (classic) is being deprecated ... (repository.issue.projectCards). The same call fails again on every retry.
After the first such error, run every further issue and PR call of the session through gh api (step 2). Calls that name their fields with --json often still work (gh issue view <n> --json title,body,comments); use them when they do.
Done when no gh issue|pr view|edit|create call that already failed with projectCards runs again, and the next call is a gh api call.
references/commands.md has the full table with one command per task: read issue and comments, create issue, labels, milestone, close, create PR, edit PR body, title and base, checks and head SHA, merge, comment. Placeholders {owner} and {repo} expand inside a git checkout; outside one, write owner/repo.
Three rules decide most calls:
-F sends typed values and files, -f sends strings. Use -F milestone=12, -F milestone=null and -F body=@file; use -f title='...' and -f 'labels[]=bug'. -f body=@file would post the text @file.gh issue edit --help; if it has no --remove-milestone, use -F milestone=null. A guessed flag fails and costs a round trip.issues/<n>; title, body, base and merge go through pulls/<n>.Read one value with --jq: gh api repos/{owner}/{repo}/pulls/<n> --jq .head.sha.
Done when the call is a gh api command from the table with --jq selecting only the value the next step needs.
Write the body of one PR or issue to its own private file, for example $(mktemp -d)/pr-<n>.md, and pass it with -F body=@<file>. A shared body.md gets overwritten by the next PR's text; the wrong body then ships and its closing keywords close the wrong issues.
After the edit, read the body back and compare it:
gh api repos/{owner}/{repo}/pulls/<n> --jq .body | diff - "$f" && echo same
Done when the diff is empty for the file that belongs to this PR or issue.
State on GitHub lags for a few seconds after a write, the milestone most often. Re-read the field with --jq and report it as applied only when the read shows it:
gh api repos/{owner}/{repo}/issues/<n> --jq '[.state,.state_reason,.milestone.number,([.labels[].name]|join(","))]|@tsv'
If the value is still the old one, wait 5 seconds and read again, up to three times (both tunable defaults); then report the mismatch instead of the change.
Done when each reported change comes from a read that came after the write.
After a push, the checks API still returns the previous head's runs for a short time. Compare the SHA you pushed with the one the API returns before reading checks:
pushed=$(git rev-parse HEAD)
timeout 5m bash -c 'until [ "$(gh api repos/{owner}/{repo}/pulls/<n> --jq .head.sha)" = "'"$pushed"'" ]; do sleep 5; done' \
|| { echo "head never reached $pushed"; exit 1; }
gh api --paginate repos/{owner}/{repo}/commits/$pushed/check-runs --jq '.check_runs[]|[.name,.status,.conclusion]|@tsv'
5m and sleep 5 are tunable defaults. Use a CI-wait skill or tool if available. Otherwise poll checks for $pushed every 10 seconds for at most 30 minutes (tunable defaults). Keep long waits in a background job with its ID and log path. Check actual job state before reporting. On failure or timeout, stop dependent work and report the last status. If failure output is empty, read raw job logs. Compare failed tests with the diff and recent default-branch runs. Run the failed test locally 5 times (tunable). For an unrelated failure or transient timeout, rerun only failed jobs once with a deadline. Report a second failure with its log. Never report a timeout as success. The run list is empty until the workflow starts; an empty list is not a pass.
Done when every check line you report belongs to $pushed and every required check shows conclusion success.
If a merge-coordination skill or tool is available, use it. Immediately before each merge, request the user's explicit OK naming the PR, checked head SHA and check results. Batch approval does not cover a changed head. The merge must name that SHA. When gh pr merge fails with projectCards, send the REST form. $pushed is the SHA checked in step 5 and named in the OK request:
gh api -X PUT repos/{owner}/{repo}/pulls/<n>/merge -f merge_method=squash -f sha="$pushed"
HTTP 409 means the head moved after the OK: the new head needs its own checks and its own OK. merge_method is merge, squash or rebase; use the way the repo merges.
Done when the response shows "merged": true.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lorenzh/skills --plugin lorenzh27 skills in this plugin
/checking-before-publishingPrivacy check for anything about to go public. Use when about to post an issue or PR comment, opening a PR, committing, pushing, publishing a release, blog post or README, or sharing screenshots, GIFs, videos or terminal recordings; when relaying a subagent's text to a public place; or when the user asks to "check for private data", "scrub" or "redact" something before sharing./cloning-voices-with-kittenttsVoice cloning with KittenTTS 2 from a short recording and text. Use when users say "kitten tts", "Stimme klonen", "clone my voice", "sprich diesen Text mit meiner Stimme", or "text to speech with my voice" and want a speech WAV.
/competing-implementationsImplementation competition for one task. Use when the user asks to have two agents compete on a change, wants competing implementations, asks to compare implementations and ship the winner, or asks for competing implementations on several dependent issues in waves./creating-worktreesGit worktree setup and cleanup for isolated parallel work. Use when the user asks to "work in a worktree", wants an isolated workspace or a parallel branch checkout, is about to execute an implementation plan that should not touch the current checkout, asks how to install dependencies or copy .env files into a worktree, wants a coding agent or sandbox to work in one, or asks to remove or clean up a worktree, or when worktrees fill the disk (ENOSPC, "No space left on device")./cutting-releasesRelease workflow from version bump to verified install. Use when the user asks to "cut a release", "release x.y.z", "ship a new version" or publish to npm or another registry, or when a release was tagged but the package, the back-merge to main or the installed version still needs checking./directing-videosVideo directing workflow for demos, screencasts, terminal tours, tutorials, launch videos and short films. Use when the user asks to plan, script, storyboard or direct a video, wants a "tour of all features", a demo or launch video, asks how long or how paced a video should be, or asks whether a recorded cut is ready to publish.