| name | analyse-issue |
| description | Analyze a GitHub issue from an issue URL or number. |
Analyse Issue
Overview
Fetch the issue details, verify repo alignment, and inspect the local codebase to confirm or refute the reported problem. Provide an evidence-backed analysis with clear next steps.
Workflow
1) Parse the issue input
- If input is a GitHub issue URL, extract owner/repo and issue number.
- If input is just a number, assume the current repo unless the user specifies another repo.
- If the provider is not GitHub or is unclear, ask for clarification before proceeding.
2) Verify local repo matches the issue
- Ensure the current directory is inside a git repo (
git rev-parse --show-toplevel).
- Identify the target remote (prefer
origin); normalize SSH/HTTPS to owner/repo.
- If the issue URL repo does not match the local
owner/repo, stop and ask the user to switch directories or confirm the target repo.
- If no remote or multiple candidates exist, ask the user which repo to use.
3) Fetch issue content
Prefer gh when available:
gh issue view <num> --json title,body,labels,comments,author,createdAt,updatedAt
- If URL provided, run against that repo:
gh issue view <num> -R owner/repo --json ...
Fallbacks:
gh api repos/{owner}/{repo}/issues/{num} and .../comments if you need more fields.
- If
gh is unavailable but GITHUB_TOKEN exists, use curl with the GitHub API.
- If neither works, ask the user to paste the issue content.