GH Issue Workflow
Scope
Use this skill for Motoki0705/tennis-lab issue creation and maintenance via gh CLI and REST API.
Defaults and fixed values
- •Repo:
Motoki0705/tennis-lab - •Project (Projects v2):
- •Title:
prj-tennis-lab - •Number:
3 - •Project ID:
PVT_kwHOB-BMQ84BKNof
- •Title:
- •Status field ID:
PVTSSF_lAHOB-BMQ84BKNofzg6JZvQ - •Status options:
- •Backlog:
f75ad846 - •Ready:
61e4505c - •In progress:
47fc9ee4 - •In review:
df73e18b - •Done:
98236657
- •Backlog:
Labels in this repo (from gh label list)
- •
bug: use for defects or regressions. - •
documentation: use for docs-only changes. - •
duplicate: use when the issue already exists elsewhere. - •
enhancement: use for new features or improvements. - •
good first issue: use for newcomer-friendly, well-scoped tasks. - •
help wanted: use when extra help is explicitly desired. - •
invalid: use when the report is not actionable or incorrect. - •
question: use when more information is required. - •
wontfix: use when the issue will not be addressed. - •
research: use for investigation or exploratory tasks.
Create an issue (standard)
- •Compose title/body using the repo conventions.
- •Create with explicit flags:
bash
gh issue create --repo Motoki0705/tennis-lab \ --title "<Title>" \ --body "<Body>" \ --label "<label>" \ --label "<label>" \ --assignee "@me" \ --project "prj-tennis-lab"
Add to project by URL (fallback)
Use when --project title resolution is ambiguous.
bash
gh project item-add 3 --owner Motoki0705 --url "<issue_url>"
Set project Status
- •Get the item ID with
gh project item-listand match by issue URL/number. - •Edit the Status field with
--project-id(not--owner).
bash
gh project item-edit --project-id PVT_kwHOB-BMQ84BKNof \ --id "<ITEM_ID>" \ --field-id PVTSSF_lAHOB-BMQ84BKNofzg6JZvQ \ --single-select-option-id "<STATUS_OPTION_ID>"
Dependencies (blocked by)
The REST API requires the issue id (not issue number). Use -F to preserve integer type.
bash
blocking_id=$(gh api repos/Motoki0705/tennis-lab/issues/<BLOCKING_NUMBER> --jq .id) gh api -X POST repos/Motoki0705/tennis-lab/issues/<BLOCKED_NUMBER>/dependencies/blocked_by \ -F issue_id="$blocking_id"
Handling newlines in issue body
When passing multi-line text to --body, write actual newlines directly in the string:
bash
gh issue create --repo Motoki0705/tennis-lab \ --title "Example" \ --body "First line Second line Third line"
⚠️ Common mistake: Do NOT use "...\n..." or '...\n...' as the \n will appear literally in the issue body, breaking Markdown formatting.
Common gotchas
- •
gh issue createdoes not support--json; capture URL from stdout. - •Use repeated
--labelflags (avoid comma lists). - •
gh issue edituses--add-assignee/--remove-assignee. - •
gh project item-editdoes not accept--owner; must use--project-id. - •Dependencies require Issues write permission in the token.