/agentspec:github-post-issuefrom agentspec
Publishes drafted issues or ADRs to a GitHub repository via gh with guardrails: duplicate detection, self-containment lint, template conformance, and label validation. Also curates the board by closing superseded issues and managing parent/sub-issue relationships.
Ships in agentspec. 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.
Publish a drafted issue or ADR to GitHub via gh, with guardrails, and curate the board safely — one responsibility: hygienic mutation of the issue board. Authoring happens upstream (github-cr-issue / github-cr-adr); this skill is the gh write with checks around it, so nothing malformed, duplicated, or context-leaking reaches the public board. The recommended label taxonomy and its design rationale live in references/label-scheme.md.
Use when:
.claude/sdd/drafts/.Skip if:
github-cr-issue / github-cr-adr first, then come back here.gh issue list, gh issue view) — reads need no guardrails.Resolve the target dynamically so the skill works in whatever repository it is installed in:
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) # preferred
[ -z "$REPO" ] && REPO=$(git remote get-url origin | sed -E 's#(git@|https://)github.com[:/]##; s#\.git$##') # fallback — normalize the remote URL to owner/repo
Pass --repo "$REPO" on every gh command below. A hardcoded repo writes to the wrong board the day this skill runs in a different checkout.
Before anything else, run gh auth status — this skill writes to the repository, and an authentication failure discovered at gh issue create, after the pre-flight gate has passed, strands the publish halfway. If it fails, stop and tell the user what to fix (gh auth login, or a token with repo scope).
Accept either form:
.claude/sdd/drafts/<type>-<slug>.md, produced by github-cr-issue or github-cr-adr. Preferred, because the draft is reviewable and diffable before it goes public.--body-file) applies.Always publish the body with --body-file <draft> — inline --body strings mangle long markdown, since quoting, backticks, and newlines survive a file but not a shell argument.
gh issue createRun four checks, in this order. Every finding gets a verdict:
| Verdict | Meaning |
|---|---|
| BLOCKER | Do not publish until fixed. |
| IMPORTANT | Warn the user; publish only with their explicit ack. |
| NIT | Note it and proceed. |
A publish happens only with zero BLOCKERs.
| # | Check | How | Failure → verdict |
|---|---|---|---|
| 1 | Dedup (open + closed) | gh issue list --repo "$REPO" --search "<topic terms>" --state all | Open issue already covers it → BLOCKER · overlap with a closed issue → IMPORTANT |
| 2 | Self-containment lint | Read the draft as a stranger with zero shared context | Leaked local paths, private-session references, internal codenames, or a #NN that is not a real issue → BLOCKER · vague but resolvable phrasing → NIT |
| 3 | Template conformance | Compare against the type's drafting template | Missing sections or acceptance criteria → IMPORTANT · missing [TYPE] title prefix → IMPORTANT · a Labels: line in the body → BLOCKER (remove it, then proceed) |
| 4 | Label validation | gh label list --repo "$REPO" | Intended label missing from the repo → BLOCKER until the user decides: create, substitute, or drop |
Why each check exists, in one clause:
Labels: line — consistent structure keeps issues scannable, and labels belong on the issue object; a prose copy drifts from the real labels immediately.gh label create. Never auto-create a label and never apply a phantom one — silent board mutation is exactly what this gate prevents.Gate. Run the pre-flight above. Fix every BLOCKER, get explicit ack on each IMPORTANT, note NITs.
Create.
gh issue create --repo "$REPO" --title "[TYPE] <title>" --body-file <draft.md>
Capture the returned URL and issue number <n>.
Labels — apply only labels validated in gate check 4:
gh issue edit <n> --repo "$REPO" --add-label "type:<x>,priority:<p>"
Add blocked / needs-decision only while actually true — a stale status flag misleads everyone who filters by it.
Ownership = assignee, not a label. When someone is actually going to work the issue:
gh issue edit <n> --repo "$REPO" --add-assignee <github-handle>
Infer the assignee's GitHub handle from context — the user's request, git log, existing issues — or ask. Never guess a handle.
Parent / sub-issue = native relationship. Attach a task, bug, or spike under its parent feature or component issue using GitHub's sub-issue feature (the UI, or the sub-issue GraphQL mutations via gh api). Never write Parent: #42 in the body — prose relationships never update and do not render as a tree.
Receipt, then draft cleanup. Print the issue URL as the receipt. On success, delete the draft file: the published issue is now canonical and re-fetchable (gh issue view <n> --repo "$REPO"), so a lingering local draft is drift waiting to happen. If the publish failed, keep the draft — it is the only copy.
An ADR publishes exactly like an issue, plus the type:adr label. ADR numbers are sequential from 1 (ADR-001, ADR-002, …) and the live board is the allocator: the next number is computed from the highest one already published, at publish time — never at draft time, where parallel drafts would collide. Enforce it immediately after gh issue create:
Create from the draft as usual (a placeholder title like [ADR-XXX] <title> is fine at this point) → GitHub returns issue number <n>.
Find the highest ADR number on the board — search all states, because rejected and superseded ADRs keep their numbers forever:
gh issue list --repo "$REPO" --search "[ADR-" --state all --limit 200 --json title \
-q '.[].title' | grep -oE '\[ADR-[0-9]+\]' | grep -oE '[0-9]+' | sort -n | tail -1
The next number is that value plus one (zero-padded to three digits, e.g. ADR-005); if the search returns nothing, this is ADR-001.
Retitle with the real number:
gh issue edit <n> --repo "$REPO" --title "[ADR-<next>] <title>"
Before retitling, re-run the search once — if another ADR claimed the number in the meantime (two publishes racing), take the new max plus one.
If the published body still contains an ADR-XXX placeholder, replace it: fetch the body (gh issue view <n> --repo "$REPO" --json body -q .body), substitute ADR-XXX with ADR-<next>, write the result to a file, and push it back:
gh issue edit <n> --repo "$REPO" --body-file <updated.md>
Receipt + draft cleanup, exactly as in the publish flow.
A Rejected ADR is closed, never deleted — it stays on record so the idea is not re-litigated from scratch.
Close > delete. Deleting is permanent, admin-only, and destroys history and cross-references; closing as not-planned or duplicate keeps the trail searchable. Even for pure noise, closing is the safer default.
Superseded / duplicate — close with a one-line pointer to the canonical issue; the pointer is what keeps the trail navigable:
gh issue close <n> --repo "$REPO" --reason "not planned" \
--comment "Superseded by #<canonical> — <one-line reason>."
Relabel / re-triage — gh issue edit <n> --repo "$REPO" --add-label … --remove-label …; validate any label you add (gate check 4) first.
Rejected ADRs — close with a comment recording the rejection reason; keep the title and label intact so the record stays findable.
DO
--repo "$REPO" on every command — the skill must work in any repository.--body-file.DON'T
Parent: #42 or a Labels: line in the body.references/label-scheme.md — recommended label taxonomy and the design rules behind it: status-is-not-a-type, ownership-by-assignee, grouping-by-sub-issues, and the drift rule.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
github-issues, issue-publishing, board-curation, adr, gh-cli
npx claudepluginhub luanmorenommaciel/agentspec --plugin agentspec16 skills in this plugin
/agent-routerIntelligent agent routing -- automatically matches tasks to the best specialist agent based on file patterns, intent keywords, and domain context. Loaded every session to give Claude explicit routing rules for all 58 AgentSpec agents./component-modelDecides where new logic lives in the component model — agent, skill, command, KB, or
template — and how to keep components in their layer, routing each decision to the
right authoring resource and running the fat-to-thin refactor when a component has
outgrown its layer. Loaded by the authoring flows (create-skill, create-agent,
kb-build, create-kb) as their layer-decision gate. Use for "should this be an agent
or a skill", "where does this logic go", adding a new component, "this agent is too
big", or restructuring/refactoring an agent into skills. Do not use to author the
chosen component itself — that is create-skill, create-agent, or /create-kb.
/data-engineering-guideData engineering expertise for pipelines, schemas, data quality, SQL, lakehouse, and streaming.
Use PROACTIVELY when the user discusses data pipelines, ETL/ELT, schema design, dimensional modeling,
data quality checks, SQL optimization, dbt models, Spark jobs, Airflow DAGs, streaming pipelines,
lakehouse architecture, or data contracts.
/excalidraw-diagramCreate Excalidraw diagram JSON files that make visual arguments. Use when the user wants to visualize workflows, architectures, or concepts./github-cr-adrDrafts an Architecture Decision Record (ADR) for the current repository: searches existing GitHub issues for duplicates first, applies a worthiness gate, then drafts from the context/decision/alternatives/consequences template with the standard status lifecycle, ready for publication as a GitHub issue. Use when the user asks to "create an ADR", "draft an ADR", "new ADR", "document an architecture decision", or to formalize an architecturally significant, hard-to-reverse technical choice. Do not use for routine feature or bug tracking — use `github-cr-issue`; publishing a drafted ADR to GitHub is `github-post-issue`.
/github-cr-issueDrafts the body of a well-formed, self-contained GitHub issue for the current repository from a per-type template — feature, component, task, bug, or spike — searching existing issues for duplicates before any drafting, and saving the result as an ephemeral draft ready for review and publication. Use when the user wants to create, draft, or write an issue, or asks for a feature, component, task, bug, or spike issue, or wants to turn an idea, defect report, or investigation into a tracked GitHub issue. For epic-scale initiatives it drafts a parent issue plus child issues joined by native GitHub relationships instead of an epic document. Do not use for architecture decisions — use `github-cr-adr`; to publish a draft to GitHub use `github-post-issue`.
Other plugins' skills for the same job