--- name: gh-issue-report license: MIT description: > Investigate and file bug reports on GitHub repositories. Searches existing issues to avoid duplicates, checks contributing guides and issue templates, optionally confirms the bug in source code, and files a well-structured issue. Works on both local and remote repos. Triggers: "file a bug", "report issue", "is there a bug for", "check if reported", "investigate and file", "bug report on", "/gh-issue-report" argument-hint: "[] " compatibility: Requires gh CLI authenticated with repo scope metadata: author: jackchuka scope: generic layer: workflow confirms: - create GitHub issues --- # Issue Report Investigate a bug, confirm it hasn't been reported, optionally verify in source code, and file a structured issue — all in one workflow. ## Arguments - `/gh-issue-report` — interactive: asks for repo and bug description - `/gh-issue-report ` — uses arguments directly ## Phase 1: Intake 1. **Resolve target repo**: - If argument includes `owner/repo`, use it. - If the current directory is a git repo, offer it as default. - Otherwise, ask. 2. **Bug description**: If provided as argument, use it. Otherwise ask: > What bug are you seeing? Include steps to reproduce if you have them. 3. **Determine repo locality**: - Check if the repo is cloned locally (look for matching remote in `git remote -v` or check common paths). - **Local**: use file system tools (Read, Grep, Glob) for code investigation. - **Remote-only**: use `gh api` to fetch repo contents for code investigation. ## Phase 2: Search Existing Issues 4. **Search for duplicates** using multiple query strategies in parallel: ```bash gh issue list -R --state all --search "" --limit 20 ``` Run 2-3 searches with different keyword combinations extracted from the bug description (e.g., key nouns, component names, error messages). Cast a wide net. 5. **Evaluate matches**: - If a clear duplicate exists: show it to the user and ask whether to proceed or comment on the existing issue. - If partial matches exist: show them and note the differences. - If no matches: continue. ## Phase 3: Check Repo Conventions 6. **Fetch contributing guide and issue templates** in parallel: ```bash # Contributing guide gh api 'repos//contents/CONTRIBUTING.md' --jq '.content' | base64 -d # Issue templates gh api 'repos//contents/.github/ISSUE_TEMPLATE' --jq '.[].name' ``` If issue templates exist, fetch the relevant one (usually `bug_report.md` or `bug_report.yml`): ```bash gh api 'repos//contents/.github/ISSUE_TEMPLATE/