home / skills / terrylica / cc-skills / issue-create

This skill creates well-formatted GitHub issues with AI-driven label suggestions, type detection, and templates to save time and improve consistency.

npx playbooks add skill terrylica/cc-skills --skill issue-create

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
5.3 KB
---
name: issue-create
description: Create GitHub issues with AI labeling. TRIGGERS - create issue, file bug, feature request, gh issue create.
allowed-tools: Read, Bash, Grep, Glob
---

# Issue Create Skill

Create well-formatted GitHub issues with intelligent automation including AI-powered label suggestions, content type detection, template formatting, and related issue linking.

## When to Use This Skill

Use this skill when:

- Creating bug reports, feature requests, questions, or documentation issues
- Need AI-powered label suggestions from repository's existing taxonomy
- Want automatic duplicate detection and related issue linking
- Need consistent issue formatting across different repositories

## Invocation

**Slash command**: `/gh-tools:issue-create`

**Natural language triggers**:

- "Create an issue about..."
- "File a bug for..."
- "Submit a feature request..."
- "Report this problem to..."
- "Post an issue on GitHub..."

## Features

### 1. Repository Detection

- Auto-detects repository from current git directory
- Supports explicit `--repo owner/repo` flag
- Checks permissions before attempting to create

### 2. Content Type Detection

- AI-powered detection (gpt-4.1 via gh-models)
- Fallback to keyword matching
- Types: Bug, Feature, Question, Documentation

### 3. Title Extraction

- Extracts informative title from content
- Adds type prefix (Bug:, Feature:, etc.)
- **Maximizes GitHub's 256-character limit** for informative titles

### 4. Template Formatting

- Auto-selects template based on content type
- Bug: Steps to reproduce, Expected/Actual behavior
- Feature: Use case, Proposed solution
- Question: Context, What was tried
- Documentation: Location, Suggested change

### 5. Label Suggestion

- Fetches repository's existing labels
- AI suggests 2-4 relevant labels
- Only suggests labels that exist (taxonomy-aware)
- 24-hour cache for performance

### 6. Related Issues

- Searches for similar issues
- Links related issues in body
- Warns about potential duplicates

### 7. Preview & Confirm

- Full preview before creation
- Dry-run mode available
- Edit option for modifications

## Usage Examples

### Basic Usage

```bash
# From within a git repository
bun ~/eon/cc-skills/plugins/gh-tools/scripts/issue-create.ts \
  --body "Login page crashes when using special characters in password"
```

### With Explicit Repository

```bash
bun ~/eon/cc-skills/plugins/gh-tools/scripts/issue-create.ts \
  --repo owner/repo \
  --body "Feature: Add dark mode support for better accessibility"
```

### Dry Run (Preview Only)

```bash
bun ~/eon/cc-skills/plugins/gh-tools/scripts/issue-create.ts \
  --repo owner/repo \
  --body "Bug: API returns 500 error" \
  --dry-run
```

### With Custom Title and Labels

```bash
bun ~/eon/cc-skills/plugins/gh-tools/scripts/issue-create.ts \
  --repo owner/repo \
  --title "Bug: Login fails with OAuth" \
  --body "Detailed description..." \
  --labels "bug,authentication"
```

### Disable AI Features

```bash
bun ~/eon/cc-skills/plugins/gh-tools/scripts/issue-create.ts \
  --body "Question: How to configure..." \
  --no-ai
```

## CLI Options

| Option      | Short | Description                     |
| ----------- | ----- | ------------------------------- |
| `--repo`    | `-r`  | Repository in owner/repo format |
| `--body`    | `-b`  | Issue body content (required)   |
| `--title`   | `-t`  | Issue title (optional)          |
| `--labels`  | `-l`  | Comma-separated labels          |
| `--dry-run` |       | Preview without creating        |
| `--no-ai`   |       | Disable AI features             |
| `--verbose` | `-v`  | Enable verbose output           |
| `--help`    | `-h`  | Show help                       |

## Dependencies

- `gh` CLI (required) - GitHub CLI tool
- `gh-models` extension (optional) - Enables AI features

### Installing gh-models

```bash
gh extension install github/gh-models
```

## Permission Handling

| Level       | Behavior                                |
| ----------- | --------------------------------------- |
| WRITE/ADMIN | Full functionality                      |
| TRIAGE      | Can apply labels                        |
| READ        | Shows formatted content for manual copy |
| NONE        | Suggests fork workflow                  |

## Logging

Logs to: `~/.claude/logs/gh-issue-create.jsonl`

Events logged:

- `preflight` - Initial checks
- `type_detected` - Content type detection
- `labels_suggested` - Label suggestions
- `related_found` - Related issues search
- `issue_created` - Successful creation
- `dry_run` - Dry run completion

## Hook Compliance

This skill uses `--body-file` pattern for issue creation, complying with the `gh-issue-body-file-guard.mjs` hook that blocks inline `--body` to prevent silent failures.

## Related Documentation

- [Content Types Reference](./references/content-types.md)
- [Label Strategy Reference](./references/label-strategy.md)
- [AI Prompts Reference](./references/ai-prompts.md)

## Troubleshooting

### "No repository context"

Run from a git directory or use `--repo owner/repo` flag.

### Labels not suggested

- Check if gh-models is installed: `gh extension list`
- Verify repository has labels: `gh label list --repo owner/repo`
- Check label cache: `ls ~/.cache/gh-issue-skill/labels/`

### AI features not working

Install gh-models extension:

```bash
gh extension install github/gh-models
```

Overview

This skill creates well-formatted GitHub issues with AI-assisted labeling, content type detection, template selection, and related-issue linking. It runs from the repository context or an explicit owner/repo flag and offers preview, dry-run, and edit before final creation. The tool respects repository labels and permission levels while caching label data for faster suggestions.

How this skill works

The skill inspects the provided issue body or repository files to detect content type (Bug, Feature, Question, Documentation) using an AI model with keyword fallback. It extracts a concise title, chooses the appropriate issue template, fetches existing repository labels, and suggests 2–4 applicable labels drawn only from the repo's taxonomy. It also searches for similar issues, links related items in the draft, and offers a full preview or dry-run before creating the issue via the GitHub CLI.

When to use it

  • Filing bug reports, feature requests, questions, or documentation fixes from a local repo
  • When you want consistent issue formatting across repositories
  • When you need AI-suggested labels constrained to the repo's existing taxonomy
  • Before creating issues to detect duplicates or related work
  • When you want a reviewable preview or dry-run before pushing to GitHub

Best practices

  • Run from the repository git directory or pass --repo owner/repo to ensure correct context
  • Provide a clear --body (or body-file) and allow the AI to suggest an improved title
  • Use dry-run to review auto-populated template sections and related-issue links
  • Trust suggested labels but edit when repository conventions differ
  • Install the gh-models extension to enable AI-powered features; add --no-ai to skip them

Example use cases

  • Quickly turn an error log or stack trace into a structured bug report with reproduction steps
  • Submit a feature request with use case and proposed solution prefilled using the Feature template
  • Run a dry-run to preview an issue that links potential duplicates before creating it
  • Create a documentation change issue that points to the exact file and suggested edits
  • Auto-suggest labels from the repo taxonomy to speed triage and keep labeling consistent

FAQ

What happens if I don't have permission to create issues?

The skill checks permission level and will show a formatted preview for manual copy if you only have read access. It suggests a fork workflow when no write permissions exist.

How does label suggestion avoid inventing new labels?

The tool fetches the repo's existing labels and only returns 2–4 suggestions chosen by AI from that set; a 24-hour cache improves performance.