# Skill: Create GitHub Issue

Use when you want to log a GitHub issue directly from Claude Code — without leaving
your editor or losing the context built up during a session.

## What this does

`/create-issue` reads the current session context, drafts a well-structured issue body
from what was discussed, and creates the issue via the GitHub MCP server. The more
context in the session (errors, code paths, goals), the richer the generated body.

## Usage

```
/create-issue feat: Add X
/create-issue bug: Y hangs when pipeline has no tasks
/create-issue idea: Z approach for retry backoff
/create-issue chore: update dependency X
/create-issue docs: document the 3-layer prompt system
```

If called with no arguments, the skill will prompt you for a description.

## Label mapping

| Prefix | GitHub label applied |
|--------|----------------------|
| `feat:` | `enhancement` |
| `bug:` | `bug` |
| `idea:`, `chore:`, `docs:`, or anything else | *(no label)* |

Labels must already exist in the target repo. If the label does not exist, the GitHub
API will silently ignore it. Create labels at:
`https://github.com/{owner}/{repo}/labels`

## Auto-drafted body

The skill reads the active Claude Code session and fills in:

- **Summary** — what the issue is and why it matters
- **Context** — what was tried, explored, or discussed
- **Expected behavior** — what should happen
- **Current behavior / Problem** — what happens today, or what is missing
- **Notes** — error messages, related issues, relevant file paths

You can edit the drafted body before it is submitted by asking Claude to revise it
before calling the MCP tool.

## Configuring the target repo

By default issues are created against `amonrreal/arccrew`.

To target a different repo, set `ARCCREW_GITHUB_REPO` in your environment:

```bash
# .env
ARCCREW_GITHUB_REPO=myorg/my-project
```

The value must be in `owner/repo` format.

## Requirement: GitHub MCP server

This skill uses `mcp__github-mcp-server__create_issue`. The GitHub MCP server must be
configured in Claude Code before using this skill.

Run `/configure-mcp` to set it up if you have not done so already.

The recommended transport is SSE via GitHub Copilot:

```json
{
  "github": {
    "transport": "sse",
    "url": "https://api.githubcopilot.com/mcp/",
    "headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
  }
}
```

Set `GITHUB_TOKEN` in your environment to a personal access token with `repo` scope.

## Example output

```
Issue created: #42 — feat: Add streaming SSE response support
URL: https://github.com/amonrreal/arccrew/issues/42
```

## Tips

- Run this skill right after discovering a bug or finishing a design discussion — the
  session context is freshest at that point and produces the best issue body.
- For bugs, reproduce the error in the session first so the stack trace ends up in the
  body automatically.
- For feature ideas, describe the goal and any constraints before invoking the skill —
  Claude will carry that into the issue.
- You can pass a rough description and let Claude tighten the title and body before
  creating the issue.
