From ebb5afbd571c7e4daeb46a5666c8cccfccba040b Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 25 Mar 2026 22:18:26 -0600 Subject: [PATCH] fix: use GitHub Issue Types via GraphQL instead of classification labels The forensics prompt and gh skill used --label "bug" / --label "type:feature" for issue classification, polluting the label taxonomy and leaving the Type field unset. gh issue create has no --type flag, so issue types must be set via GraphQL mutation after creation. Closes #2579 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../extensions/gsd/prompts/forensics.md | 13 ++++++++--- .../github-workflows/references/gh/SKILL.md | 23 ++++++++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/resources/extensions/gsd/prompts/forensics.md b/src/resources/extensions/gsd/prompts/forensics.md index f576d17c4..9112a773f 100644 --- a/src/resources/extensions/gsd/prompts/forensics.md +++ b/src/resources/extensions/gsd/prompts/forensics.md @@ -142,9 +142,10 @@ Then **offer GitHub issue creation**: "Would you like me to create a GitHub issu If yes, create using the `bash` tool: ```bash -gh issue create --repo gsd-build/gsd-2 \ +# Step 1: Create issue (use labels for metadata, NOT for classification — type is set via GraphQL) +ISSUE_URL=$(gh issue create --repo gsd-build/gsd-2 \ --title "..." \ - --label "bug" --label "auto-generated" \ + --label "auto-generated" \ --body "$(cat <<'EOF' ## Problem [1-2 sentence summary] @@ -169,7 +170,13 @@ gh issue create --repo gsd-build/gsd-2 \ --- *Auto-generated by `/gsd forensics`* EOF -)" +)") + +# Step 2: Set issue type via GraphQL (gh issue create has no --type flag) +ISSUE_NUM=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$') +ISSUE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issue(number:'"$ISSUE_NUM"') { id } } }' --jq '.data.repository.issue.id') +TYPE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issueTypes(first:20) { nodes { id name } } } }' --jq '.data.repository.issueTypes.nodes[] | select(.name=="Bug") | .id') +gh api graphql -f query='mutation { updateIssue(input:{id:"'"$ISSUE_ID"'",issueTypeId:"'"$TYPE_ID"'"}) { issue { number } } }' ``` ### Redaction Rules (CRITICAL) diff --git a/src/resources/skills/github-workflows/references/gh/SKILL.md b/src/resources/skills/github-workflows/references/gh/SKILL.md index 2d1f4a53d..05d40f337 100644 --- a/src/resources/skills/github-workflows/references/gh/SKILL.md +++ b/src/resources/skills/github-workflows/references/gh/SKILL.md @@ -103,9 +103,12 @@ gh issue list -R gsd-build/gsd-2 gh issue list -R gsd-build/gsd-2 --label "priority:p1" --state open # Create issue with labels and milestone +# NOTE: Do NOT use labels for issue classification (bug, feature, etc.) +# Use labels for metadata (priority, status, auto-generated) only. +# Issue classification uses GitHub Issue Types, set via GraphQL after creation. gh issue create -R gsd-build/gsd-2 \ --title "feat: add feature X" \ - --label "priority:p1" --label "type:feature" \ + --label "priority:p1" \ --milestone "v1.0" # View issue @@ -120,6 +123,24 @@ gh issue edit -R gsd-build/gsd-2 \ --remove-label "status:needs-grooming" ``` +### Issue Types (Classification) + +`gh issue create` has no `--type` flag. Issue types (Bug, Feature Request, etc.) are set via GraphQL after creation: + +```bash +# Step 1: Create the issue (returns URL) +ISSUE_URL=$(gh issue create -R gsd-build/gsd-2 \ + --title "..." --body "...") + +# Step 2: Set the issue type via GraphQL +ISSUE_NUM=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$') +ISSUE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issue(number:'"$ISSUE_NUM"') { id } } }' --jq '.data.repository.issue.id') +TYPE_ID=$(gh api graphql -f query='{ repository(owner:"gsd-build",name:"gsd-2") { issueTypes(first:20) { nodes { id name } } } }' --jq '.data.repository.issueTypes.nodes[] | select(.name=="Bug") | .id') +gh api graphql -f query='mutation { updateIssue(input:{id:"'"$ISSUE_ID"'",issueTypeId:"'"$TYPE_ID"'"}) { issue { number } } }' +``` + +Replace `"Bug"` with the appropriate type name (`"Feature Request"`, `"Task"`, etc.). + ### Labels ```bash