Skill: create-ticket
Create or update a GitHub issue (feature request, bug report, or refactor task).
IMPORTANT
- Always use gh CLI to create or update tickets. Never call the GitHub API directly.
- If gh CLI is not available, abort and ask the user to install it. The user must restart the skill then.
- When any gh call fails, use AskUserQuestion to ask the user what to do (repeat, stop, do something else).
Instructions
Step 1 – Determine mode
Inspect $ARGUMENTS:
- If context contains
update and/or an issue number or GitHub issue URL → update mode.
- Otherwise → create mode.
- If create mode does not make sense based on context, use AskUserQuestion.
Step 2 – Gather information
Create mode:
- Extract issue type (
feature, bug, refactor) from $ARGUMENTS; if missing, ask the user.
- For
feature: understand the desired behaviour and why it is needed.
- For
bug: understand current vs. expected behaviour and reproduction steps.
- For
refactor: understand scope, motivation, and target state.
Update mode:
- Fetch the issue:
gh issue view <number-or-url>.
Step 3 – Research (optional)
If the issue involves a specific library, framework version, API, or configuration that you are not
fully certain about, use AskUserQuestion to ask:
"Should I search online for [topic] to get accurate details before drafting?"
If yes, use WebSearch / WebFetch to collect relevant facts and incorporate them into the draft.
Skip this step if you already have sufficient knowledge.
Step 4 – Discover issue templates
Locate the issue templates to use for structuring the issue body:
- Check the current repo — look for
.github/ISSUE_TEMPLATE/ in the git repo root.
- Check a referenced repo — if not inside a repo but a repo is referenced (via URL or gh context), attempt:
gh api repos/{owner}/{repo}/contents/.github/ISSUE_TEMPLATE --jq '.[].name'
Then fetch individual templates as needed.
- Fallback — if no templates are found by either method, use AskUserQuestion to ask the user:
- "I couldn't find issue templates in the repository. You can either:
a) Provide a link to your issue templates, or
b) Use the built-in defaults."
- If the user provides a link, fetch and parse those templates.
- If the user chooses defaults, read the matching template from
references/:
feature → references/feature-template.md
bug → references/bug-template.md
refactor → references/refactor-template.md
When repo templates are found (YAML format), extract the title prefix, labels, and every
textarea/input/dropdown field (label + description) to compose the issue body.
Step 5 – Draft
Compose the issue title and body following the discovered or default template structure.
Apply appropriate labels based on issue type.
Step 6 – Show and confirm
Present the full draft (create) or the current state + proposed changes (update) and use
AskUserQuestion: "Proceed? (yes / edit / cancel)". Apply edits and re-show if requested.
Step 7 – Create or update
Using the GitHub CLI:
Step 8 – Report
Run gh issue view <number> and show the final issue state with its URL.
1---2name: create-github-ticket3description: Create or update GitHub issues for bug reports, feature requests, and refactor tasks using the gh CLI. Use when the user wants to file a ticket, create an issue, report a bug, request a feature, plan a refactor, or update an existing GitHub issue. Also triggers for new issue, open a ticket, file a bug, feature request, create task, or mentions wanting to track work in GitHub Issues.4---56# Skill: create-ticket78Create or update a GitHub issue (feature request, bug report, or refactor task).910## IMPORTANT1112- Always use gh CLI to create or update tickets. Never call the GitHub API directly.13- If gh CLI is not available, abort and ask the user to install it. The user must restart the skill then.14- When any gh call fails, use AskUserQuestion to ask the user what to do (repeat, stop, do something else).1516## Instructions1718### Step 1 – Determine mode1920Inspect `$ARGUMENTS`:2122- If context contains `update` and/or an issue number or GitHub issue URL → **update mode**.23- Otherwise → **create mode**.24- If create mode does not make sense based on context, use AskUserQuestion.2526### Step 2 – Gather information2728**Create mode:**2930- Extract issue type (`feature`, `bug`, `refactor`) from `$ARGUMENTS`; if missing, ask the user.31- For `feature`: understand the desired behaviour and why it is needed.32- For `bug`: understand current vs. expected behaviour and reproduction steps.33- For `refactor`: understand scope, motivation, and target state.3435**Update mode:**3637- Fetch the issue: `gh issue view <number-or-url>`.3839### Step 3 – Research (optional)4041If the issue involves a specific library, framework version, API, or configuration that you are not42fully certain about, use AskUserQuestion to ask:43*"Should I search online for [topic] to get accurate details before drafting?"*44If yes, use `WebSearch` / `WebFetch` to collect relevant facts and incorporate them into the draft.45Skip this step if you already have sufficient knowledge.4647### Step 4 – Discover issue templates4849Locate the issue templates to use for structuring the issue body:50511. **Check the current repo** — look for `.github/ISSUE_TEMPLATE/` in the git repo root.522. **Check a referenced repo** — if not inside a repo but a repo is referenced (via URL or gh context), attempt:53 ```bash54 gh api repos/{owner}/{repo}/contents/.github/ISSUE_TEMPLATE --jq '.[].name'55 ```56 Then fetch individual templates as needed.573. **Fallback** — if no templates are found by either method, use AskUserQuestion to ask the user:58 - *"I couldn't find issue templates in the repository. You can either:*59 *a) Provide a link to your issue templates, or*60 *b) Use the built-in defaults."*61 - If the user provides a link, fetch and parse those templates.62 - If the user chooses defaults, read the matching template from `references/`:63 - `feature` → `references/feature-template.md`64 - `bug` → `references/bug-template.md`65 - `refactor` → `references/refactor-template.md`6667When repo templates are found (YAML format), extract the `title` prefix, `labels`, and every68`textarea`/`input`/`dropdown` field (`label` + `description`) to compose the issue body.6970### Step 5 – Draft7172Compose the issue title and body following the discovered or default template structure.73Apply appropriate labels based on issue type.7475### Step 6 – Show and confirm7677Present the full draft (create) or the current state + proposed changes (update) and use78AskUserQuestion: *"Proceed? (yes / edit / cancel)"*. Apply edits and re-show if requested.7980### Step 7 – Create or update8182Using the GitHub CLI:8384- **Create**: `gh issue create --title "<title>" --body "<body>" --label "<label>"`85- **Update** (use whichever commands apply):86 ```bash87 gh issue edit <number> --title "<title>" --body "<body>"88 gh issue edit <number> --add-label "<label>" --remove-label "<label>"89 gh issue comment <number> --body "<comment>"90 gh issue close <number>91 gh issue reopen <number>92 ```9394### Step 8 – Report9596Run `gh issue view <number>` and show the final issue state with its URL.