Create a new GitHub issue through a brief HITL interview.
A good issue has one outcome (one merge closes it) and criteria you can verify without running the code in your head. If you can't name the artifact the implementation produces, the scope isn't clear yet.
-
Ask: "What are you trying to build or fix?"
-
Repo-fit check (skip if a target repo was specified in Phase 0) — read visible project signals:
gh repo view --json name,description
Also read the first 50 lines of CLAUDE.md if present (Read tool), and open PR titles:
gh pr list --state open --json title
If either command fails, skip the fit check and proceed silently.
Compare against the user's stated intent. If the issue clearly targets a different repo — references a component, skill, or project unambiguously scoped elsewhere (e.g., user describes a React UI feature in a CLI-only repo, or names a skill that lives in a different repo) — surface:
This looks like it belongs in `<other-repo>` — create it here anyway? (y/n)
If yes, continue without friction. If no, stop. If ambiguous, proceed silently.
-
From the response, infer a candidate title (specific, action-oriented: "Add X", "Fix Y when Z") and type (bug / feature / task / chore) before asking. Ask only when genuinely ambiguous.
-
Run a duplicate check using 2–4 key terms extracted from the inferred title:
gh issue list --search "<key terms>" --state all --json number,title,state,updatedAt
-
Scope is clear when you can name a concrete artifact the implementation produces (a flag, a command output, a visible UI change). Ask follow-ups until that artifact is nameable — one question at a time.
-
Show the recap:
Title: <title>
Type: <bug|feature|task|chore>
Scope: <one sentence>
Ask: "Does this look right?" Loop until confirmed.
-
Determine labels to apply. At minimum, apply the type label if it exists in the repo:
gh label list --json name
Match bug, enhancement, feature, task, chore against what exists. Note matching labels for step 10. If the command fails or returns empty, skip labels and note "no labels applied".
-
Use the Write tool to write the issue body to .weld/tmp/issue-body.md:
## Summary
<scope sentence>
## Acceptance Criteria
- [ ] <criterion 1>
- [ ] <criterion 2>
## Blockers
<"None" or "Depends on #N, #M">
---
*Created with [gh-weld](https://github.com/WrathZA/github-weld)*
-
Create the issue:
gh issue create --title "<title>" --body-file .weld/tmp/issue-body.md --label "<labels>"
If no matching labels exist, omit --label. If the command fails or produces no URL, surface the error and ask "(r)etry / (Q)uit?" — do not clean up until creation is confirmed.
-
Link related issues — read the issue number from the URL gh issue create printed. Extract 2–4 topic keywords from the new issue's title (favor distinctive nouns and compound terms; skip common verbs like "add", "fix", "update"). Search open issues in the target repo:
gh issue list --search "<keywords>" --state open --json number,title
Filter out the newly created issue number. If no matches remain, skip the rest of this step silently — no comment, no output. If 1–5 matches remain, include all. If more than 5, keep the 5 closest by title similarity (shared topic words, similar phrasing).
Use the Write tool to write the comment body to .weld/tmp/related-comment.md as a single line:
Related: #M (Title), #P (Title)
Post the comment on the newly created issue:
gh issue comment <N> --body-file .weld/tmp/related-comment.md
Clean up:
rm .weld/tmp/related-comment.md
-
Clean up and output the issue URL:
rm .weld/tmp/issue-body.md
Output the URL. Done.