-
-
Save bopm/3a3c00ad15e34572885a52453356478a to your computer and use it in GitHub Desktop.
A Claude Code skill for interacting with GitHub issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: github-issues | |
| version: 1.0.0 | |
| description: >- | |
| Manage GitHub issues from the command line. Create, list, filter, view, close, and comment | |
| on issues. Use when user wants to "create issue", "file bug", "report issue", "list issues", | |
| "show my issues", "view issue", "close issue", or "add comment to issue". | |
| allowed-tools: Bash(gh:*), AskUserQuestion | |
| --- | |
| # GitHub Issues | |
| Interact with GitHub issues using the `gh` CLI. | |
| ## Quick Start | |
| | Action | Command | | |
| |--------|---------| | |
| | List my issues | `gh issue list --assignee @me` | | |
| | List all open | `gh issue list` | | |
| | View issue | `gh issue view 123` | | |
| | Create issue | `gh issue create --title "Title" --body "Description"` | | |
| | Create with label | `gh issue create --title "Bug" --body "Details" --label "bug"` | | |
| | Close issue | `gh issue close 123` | | |
| | Reopen issue | `gh issue reopen 123` | | |
| | Add comment | `gh issue comment 123 --body "Comment text"` | | |
| | Edit issue | `gh issue edit 123 --title "New title"` | | |
| For interactive issue creation with structured body, use the workflows below. | |
| ## Interactive Workflows | |
| ### 1. Determine Action | |
| Use `AskUserQuestion`: | |
| - **Question**: "What would you like to do with GitHub issues?" | |
| - **Header**: "Action" | |
| - **Options**: | |
| - `Create issue`: "Open a new issue with title, body, and labels" | |
| - `List issues`: "View and filter open issues" | |
| - `View issue`: "See details of a specific issue" | |
| - `Close/Comment`: "Close an issue or add a comment" | |
| --- | |
| ### 2. Create New Issue | |
| #### Step A: Get Issue Title | |
| Use `AskUserQuestion` to get the issue title: | |
| - **Question**: "What's a short, scannable title for this issue? Keep it brief (5-10 words max) - details go in the body. (Use 'Other' to type your title)" | |
| - **Header**: "Title" | |
| - **Options**: | |
| - `I'll type a title`: "Enter a concise title like 'Login button unresponsive' or 'Add dark mode support'" | |
| **Title guidelines:** | |
| - Keep titles SHORT and scannable (5-10 words max) | |
| - **Good**: "Fix broken password reset flow" | |
| - **Bad**: "When I try to reset my password and click the button nothing happens and I get an error" | |
| - The description/body is where details belong, not the title. If the user provides a long title, help them shorten it. | |
| #### Step B: Get Issue Body | |
| Use `AskUserQuestion` to gather the issue body content through a series of questions. | |
| **1. Issue Type** | |
| - **Question**: "What type of issue is this?" | |
| - **Header**: "Type" | |
| - **Options**: | |
| - `Bug`: "Something broken that needs fixing" | |
| - `Enhancement`: "Improvement to existing functionality" | |
| - `New feature`: "Brand new functionality" | |
| - `Task`: "General work item or chore" | |
| **2. Description** | |
| - **Question**: "Now provide the full details. This is where you explain context, background, and specifics that didn't fit in the title. (Use 'Other' to type your description)" | |
| - **Header**: "Description" | |
| - **Options**: | |
| - `I'll describe it in detail`: "Provide context, steps, examples, and any relevant information" | |
| (User will select "Other" to provide full description) | |
| **Description guidelines:** | |
| - This is where ALL the detail goes - be thorough. | |
| - Include context: what were you doing, what's the background? | |
| - Include specifics: error messages, URLs, versions, etc. | |
| **3. Reproduction Steps (for 'Bug' type only)** | |
| - **Question**: "Can you provide steps to reproduce this bug? (Use 'Other' to type steps)" | |
| - **Header**: "Repro steps" | |
| - **Options**: | |
| - `Provide steps`: "I'll describe how to reproduce the issue" | |
| - `Not reproducible`: "The bug is intermittent or hard to reproduce" | |
| **4. Behavior (for 'Bug' type only)** | |
| - **Question**: "What did you expect to happen vs what actually happened? (Use 'Other' to describe)" | |
| - **Header**: "Behavior" | |
| - **Options**: | |
| - `Describe behavior`: "I'll explain expected vs actual behavior" | |
| #### Step C: Get Labels (Optional) | |
| Use `AskUserQuestion` to select labels: | |
| - **Question**: "Which labels should we add? (if any)" | |
| - **Header**: "Labels" | |
| - **MultiSelect**: true | |
| - **Options**: | |
| - `bug`: "Something isn't working" | |
| - `enhancement`: "New feature or request" | |
| - `documentation`: "Improvements to docs" | |
| - `good first issue`: "Good for newcomers" | |
| #### Step D: Create the Issue | |
| Construct the issue body based on the type chosen: | |
| **For Bug reports:** | |
| ```markdown | |
| ## Description | |
| [User's description] | |
| ## Steps to Reproduce | |
| [User's reproduction steps or "Not easily reproducible"] | |
| ## Expected Behavior | |
| [What should happen] | |
| ## Actual Behavior | |
| [What actually happens] | |
| ``` | |
| **For Feature requests/Enhancements:** | |
| ```markdown | |
| ## Description | |
| [User's description] | |
| ## Use Case | |
| [Why this would be useful] | |
| ``` | |
| **For Tasks/Other:** | |
| ```markdown | |
| ## Description | |
| [User's description] | |
| ``` | |
| **Execute:** | |
| Run the command using HEREDOC to preserve formatting: | |
| ```bash | |
| gh issue create --title "[title]" --body "$(cat <<'EOF' | |
| [constructed body] | |
| EOF | |
| )" --label "[labels]" | |
| ``` | |
| **Output:** Report the issue URL back to the user. | |
| --- | |
| ### 3. List Issues | |
| #### Step A: Filter Options | |
| Use `AskUserQuestion` to determine filtering: | |
| - **Question**: "How would you like to filter issues?" | |
| - **Header**: "Filter" | |
| - **Options**: | |
| - `All open issues`: "Show all open issues" | |
| - `Assigned to me`: "Issues assigned to the current user" | |
| - `Created by me`: "Issues I created" | |
| - `With specific label`: "Filter by a label" | |
| **If 'With specific label' selected:** | |
| - **Question**: "Which label to filter by? (Use 'Other' for custom label)" | |
| - **Header**: "Label" | |
| - **Options**: `bug`, `enhancement`, `documentation` | |
| #### Step B: Execute | |
| Run the appropriate command: | |
| - All open: `gh issue list` | |
| - Assigned to me: `gh issue list --assignee @me` | |
| - Created by me: `gh issue list --author @me` | |
| - With label: `gh issue list --label "[label]"` | |
| --- | |
| ### 4. View Issue | |
| #### Step A: Get Issue Number | |
| Use `AskUserQuestion`: | |
| - **Question**: "Which issue number would you like to view? (Use 'Other' to enter the number)" | |
| - **Header**: "Issue #" | |
| - **Options**: | |
| - `Enter issue number`: "I'll type the issue number" | |
| #### Step B: Execute | |
| Run: `gh issue view [number]` | |
| Display title, body, labels, assignees, and comments. | |
| --- | |
| ### 5. Close or Comment | |
| #### Step A: Get Action Type | |
| Use `AskUserQuestion`: | |
| - **Question**: "What would you like to do?" | |
| - **Header**: "Action" | |
| - **Options**: | |
| - `Close issue`: "Mark an issue as closed" | |
| - `Add comment`: "Add a comment to an issue" | |
| - `Reopen issue`: "Reopen a closed issue" | |
| #### Step B: Get Issue Number | |
| - **Question**: "Which issue number?" | |
| - **Header**: "Issue #" | |
| - **Options**: `Enter issue number`: "I'll type the number" | |
| #### Step C: Execute | |
| | Action | Command | | |
| |--------|---------| | |
| | Close | `gh issue close [number]` | | |
| | Comment | `gh issue comment [number] --body "[text]"` | | |
| | Reopen | `gh issue reopen [number]` | | |
| For comments, ask user for comment text first. | |
| --- | |
| ## Error Handling | |
| If `gh` command fails: | |
| 1. Check auth: `gh auth status` → if not authenticated, run `gh auth login` | |
| 2. Check repo: Must be in a git repository with GitHub remote | |
| 3. Report the specific error to user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment