issue-publish
Create or edit a GitHub issue with `gh` from the reviewed draft at `.github/drafts/issue-draft.md`. Use only when that draft exists and the user asks to publish, open, or file it — typically handed of
SKILL.md.claude/skills/issue-publish/SKILL.md
GitHubIssue Publish
Publish the issue draft by running the steps below in order.
Hard limits
- GitHub issue writes only, and only
gh issue create/gh issue edit. Never comment, close, or reopen an issue. - No git or codebase changes of any kind — the draft included. The only file you may write is the temporary body file in step 8.
- Read-only
ghfor every precondition.
Read the draft
- Read
.github/drafts/issue-draft.md. If it is missing, stop and tell the user to rungithub-issue-creatorfirst. - Parse the front-matter:
title,labels. Everything after the closing---is the body. Use these values verbatim — never rewrite them.
Precondition
- Confirm the repo is reachable and
ghis authenticated:gh repo view. If it fails, stop and tell the user to check the repo or rungh auth login.
Create vs edit
- Create unless the user named an existing issue number to update.
- Edit only when the user gave an issue number. First confirm it exists with
gh issue view <number>; if that fails, stop rather than create a new issue by mistake.
Labels
- Fetch the repo's labels once:
gh label list --json name --limit 500. - Every label the draft names must already exist. If any is missing, stop, list the missing names, and tell the user to run
/label-setup— never create labels.
Assemble, confirm, run
- Write the body to a temporary file outside the repo with
mktemp. Pass it as--body-file. - Assemble the exact command. Apply the constant the draft does not carry:
--assignee @meon create.- Create:
gh issue create --title "<title>" --body-file <tmpfile> \ --assignee @me --label "<label>" # repeat --label per label - Edit (assignee is not re-applied; add labels without removing any):
gh issue edit <number> --title "<title>" --body-file <tmpfile> \ --add-label "<label>" # repeat --add-label per label
- Create:
- Show the assembled command(s) in full and ask once for approval. Run nothing until the user approves.
- On approval, run the command, then delete the temporary body file. Report the issue URL
ghprints.