GitHub issue creation: full repo resolution + batch setup
Use when asked to add one or more issues to a GitHub repo, especially when the user gives only a short repo name and wants several related issues created quickly.
Why this exists
Two practical gotchas came up in live use:
gh ... --repo requires the full OWNER/REPO form, not just the repo name.
- For multi-issue requests, it is safer to draft structured body files, create the issues, then immediately verify titles, URLs, labels, and body content rather than assuming creation succeeded exactly as intended.
Workflow
Resolve the repository identity first.
- If the user gives only
repo-name, run:
gh repo view repo-name --json nameWithOwner,url,description
- Then use the returned
OWNER/REPO string for all subsequent commands.
Check for likely duplicates before creating anything.
- Search issue titles/bodies with key terms from the request.
- Example:
gh issue list --repo OWNER/REPO --state all --limit 100 --search 'keyword1 OR keyword2 OR keyword3'
Inspect available labels.
- Example:
gh label list --repo OWNER/REPO --limit 200
- Reuse the closest existing labels instead of inventing new ones unless explicitly asked.
Draft each issue body in a separate temp markdown file.
- Include:
- objective
- scope / questions to answer
- deliverables
- constraints / framing
- This avoids shell quoting problems and makes edits easy.
Create the issues.
- Example:
gh issue create --repo OWNER/REPO --title '...' --body-file /tmp/file.md --label enhancement
If one issue is the umbrella/meta issue, edit it after creation to link the child issue numbers.
- This is often easier than guessing future issue numbers ahead of time.
If you need to post a follow-up comment linking the newly created issues back to a parent/umbrella issue, resolve the issue numbers first and only then write/post the comment body.
- Safe pattern:
- create the issues and capture their numeric IDs
- write the comment/body file with the real issue numbers already substituted
- post with
--body-file
- Do not leave literal placeholders like
#${NEW_NUM} in the file you send to gh issue comment.
- If a placeholder leaks into a posted comment, immediately add a correction comment with the real issue numbers.
Verify every created issue immediately.
- Use:
gh issue view N --repo OWNER/REPO --json number,title,url,labels,body
- Confirm:
- title matches intent
- correct labels applied
- body rendered correctly
- URLs/issue numbers recorded
When posting follow-up comments that mention newly created issue numbers, render placeholders before posting.
- Do NOT leave shell placeholders like
#${NEW_NUM} inside a heredoc/body file and assume later interpolation will happen automatically.
- Safe pattern:
- create the new issue
- capture the numeric id
- write the final body file with the concrete number already substituted
- then post with
gh issue comment --body-file ...
- If a placeholder accidentally lands in a comment, immediately post a correction comment with the exact issue numbers.
Scope / authorization guard fallback
If live gh issue create is blocked by a repo-specific guard, missing active scope, or authorization precondition, do not bypass it and do not stop with only prose. Prepare a durable issue packet instead:
- write one Markdown file containing all issue bodies;
- write a verified creation script that performs duplicate checks, creates issues, links umbrella/children, and verifies created issue metadata;
- run
bash -n on the script;
- document the exact unblock step and command to run once scope is active;
- report that live creation is blocked, not completed.
This preserves momentum while respecting repo gates.
Critical gotcha
gh --repo does NOT accept a bare repo name.
Incorrect:
gh issue list --repo achantas-data
Typical failure:
expected the "[HOST/]OWNER/REPO" format
Correct:
gh issue list --repo vamseeachanta/achantas-data
Good fit
- user says "add issues to repo X"
- repo may not be cloned locally
- need to create multiple related research/planning issues
- want fast, low-risk GitHub issue setup with verification
Verification checklist
- repo resolved to full
OWNER/REPO
- duplicate search run
- labels inspected
- issue bodies stored in files
- all issue URLs captured
- umbrella issue updated with child references if applicable
- final
gh issue view verification performed
1---2name: gh-issue-creation-full-repo-and-batch-setup-23description: Create multiple related GitHub issues safely by resolving full OWNER/REPO, checking duplicates and labels first, and verifying each created issue.4license: MIT5---67# GitHub issue creation: full repo resolution + batch setup89Use when asked to add one or more issues to a GitHub repo, especially when the user gives only a short repo name and wants several related issues created quickly.1011## Why this exists1213Two practical gotchas came up in live use:141. `gh ... --repo` requires the full `OWNER/REPO` form, not just the repo name.152. For multi-issue requests, it is safer to draft structured body files, create the issues, then immediately verify titles, URLs, labels, and body content rather than assuming creation succeeded exactly as intended.1617## Workflow18191. Resolve the repository identity first.20 - If the user gives only `repo-name`, run:21 - `gh repo view repo-name --json nameWithOwner,url,description`22 - Then use the returned `OWNER/REPO` string for all subsequent commands.23242. Check for likely duplicates before creating anything.25 - Search issue titles/bodies with key terms from the request.26 - Example:27 - `gh issue list --repo OWNER/REPO --state all --limit 100 --search 'keyword1 OR keyword2 OR keyword3'`28293. Inspect available labels.30 - Example:31 - `gh label list --repo OWNER/REPO --limit 200`32 - Reuse the closest existing labels instead of inventing new ones unless explicitly asked.33344. Draft each issue body in a separate temp markdown file.35 - Include:36 - objective37 - scope / questions to answer38 - deliverables39 - constraints / framing40 - This avoids shell quoting problems and makes edits easy.41425. Create the issues.43 - Example:44 - `gh issue create --repo OWNER/REPO --title '...' --body-file /tmp/file.md --label enhancement`45466. If one issue is the umbrella/meta issue, edit it after creation to link the child issue numbers.47 - This is often easier than guessing future issue numbers ahead of time.48497. If you need to post a follow-up comment linking the newly created issues back to a parent/umbrella issue, resolve the issue numbers first and only then write/post the comment body.50 - Safe pattern:51 1. create the issues and capture their numeric IDs52 2. write the comment/body file with the real issue numbers already substituted53 3. post with `--body-file`54 - Do not leave literal placeholders like `#${NEW_NUM}` in the file you send to `gh issue comment`.55 - If a placeholder leaks into a posted comment, immediately add a correction comment with the real issue numbers.56577. Verify every created issue immediately.58 - Use:59 - `gh issue view N --repo OWNER/REPO --json number,title,url,labels,body`60 - Confirm:61 - title matches intent62 - correct labels applied63 - body rendered correctly64 - URLs/issue numbers recorded65668. When posting follow-up comments that mention newly created issue numbers, render placeholders before posting.67 - Do NOT leave shell placeholders like `#${NEW_NUM}` inside a heredoc/body file and assume later interpolation will happen automatically.68 - Safe pattern:69 - create the new issue70 - capture the numeric id71 - write the final body file with the concrete number already substituted72 - then post with `gh issue comment --body-file ...`73 - If a placeholder accidentally lands in a comment, immediately post a correction comment with the exact issue numbers.7475## Scope / authorization guard fallback7677If live `gh issue create` is blocked by a repo-specific guard, missing active scope, or authorization precondition, do not bypass it and do not stop with only prose. Prepare a durable issue packet instead:78791. write one Markdown file containing all issue bodies;802. write a verified creation script that performs duplicate checks, creates issues, links umbrella/children, and verifies created issue metadata;813. run `bash -n` on the script;824. document the exact unblock step and command to run once scope is active;835. report that live creation is blocked, not completed.8485This preserves momentum while respecting repo gates.8687## Critical gotcha888990`gh --repo` does NOT accept a bare repo name.9192Incorrect:93```bash94gh issue list --repo achantas-data95```9697Typical failure:98```text99expected the "[HOST/]OWNER/REPO" format100```101102Correct:103```bash104gh issue list --repo vamseeachanta/achantas-data105```106107## Good fit108109- user says "add issues to repo X"110- repo may not be cloned locally111- need to create multiple related research/planning issues112- want fast, low-risk GitHub issue setup with verification113114## Verification checklist115116- repo resolved to full `OWNER/REPO`117- duplicate search run118- labels inspected119- issue bodies stored in files120- all issue URLs captured121- umbrella issue updated with child references if applicable122- final `gh issue view` verification performed