--- name: github-issue-get description: Get GitHub issue details, body text, and optional comments. Use when users want to read issue content, inspect discussion context, or fetch issue data before another change. Accept issue identifiers as a number, `#number`, or issue URL, and expand Gist-backed attachments only when that extra content is useful. --- # GitHub Issue Get Fetch the smallest issue payload that satisfies the request. ## Goal - **Outcome**: Return the issue fields the user needs (body, comments, metadata) without over-fetching. - **Safety**: Expand Gists only when useful; avoid leaking attachment contents broadly. ## Workflow 1. Parse the target issue identifier. Accept `123`, `#123`, or a full GitHub issue URL, then normalize it to the bare issue number. 2. Choose the narrowest output mode that matches the user request: - Use `--body-only` when only the issue body text is needed. - Use `--include-comments` when the user needs discussion context. - Keep the default JSON form for general inspection or downstream processing. - Read `references/output-modes.md` if you need the full mode matrix. 3. Control Gist expansion deliberately: - Keep the default expansion behavior when the issue likely references attached files and the user needs their contents. - Use `--no-expand-gist` when only issue metadata or quick inspection is needed. 4. Fetch the issue. **Illustrative (host CLI)**: ```bash agent-tools github get-issue 123 --json agent-tools github get-issue 123 --include-comments --json agent-tools github get-issue 123 --body-only ``` 5. Summarize the result for the user instead of pasting raw JSON unless they explicitly ask for the machine-readable output. 6. If Gist content is returned, surface the important attached text and note where it came from. ## Guardrails - Normalize the issue identifier before building any request. - Prefer `--body-only` for follow-on edit workflows that only need the current body text. - Prefer `--include-comments` only when the user asks for comments or discussion context. - Do not pay the cost of Gist expansion when the user only needs high-level issue metadata. - If setup, auth, or repository configuration is missing, read `references/setup.md`.