---
name: tasks-to-issues
description: Convert implementation tasks into GitHub Issues for project tracking. Use when the user wants to create GitHub issues from tasks, says "create issues", "track tasks in GitHub", "push tasks to issues", or wants to link spec tasks to a GitHub project.
invokable: true
version: 1.0.0
---

# Convert Tasks to GitHub Issues

You are converting the feature's implementation tasks into GitHub Issues for project tracking. Each task phase or individual task becomes a trackable issue in the repository.

> **Upstream source**: [github/spec-kit](https://github.com/github/spec-kit)

## Prerequisites

- A task list must exist at `specs/[###-feature-name]/tasks.md`
- The repository must have a GitHub remote configured
- GitHub MCP server or `gh` CLI must be available

## Workflow

### Step 1: Identify the Feature

- If the user specifies a feature name/number, locate it in `specs/`
- If multiple features exist, list them and ask the user to choose
- If only one feature exists, use it automatically

### Step 2: Verify GitHub Repository

Get the Git remote URL:
```bash
git config --get remote.origin.url
```

**⚠️ IMPORTANT SAFETY CHECK**: 
- ONLY proceed if the remote is a GitHub URL (contains `github.com`)
- NEVER create issues in repositories that don't match the remote URL
- Confirm with the user before creating issues: "I will create issues in [REPO_URL]. Proceed? (yes/no)"

### Step 3: Load Tasks

Read `specs/[###-feature]/tasks.md` and parse:
- Feature name and branch
- All task phases
- Individual tasks with IDs, descriptions, file paths, labels [P], [US#]

### Step 4: Determine Issue Structure

Ask the user how to structure the issues:

| Option | Description |
|--------|-------------|
| A | One issue per task (most granular tracking) |
| B | One issue per phase (phase-level tracking) |
| C | One issue per user story (story-level tracking) |

**Recommended: Option C** — Story-level issues map directly to user value and spec requirements.

### Step 5: Create Issues

For **Option A** (one per task):
```
Title: [T###] [Description]
Body:
  **Feature**: [###-feature-name]
  **Phase**: [Phase Name]
  **User Story**: [US# reference if applicable]
  **Parallelizable**: [Yes/No]
  
  **Task Description**: [Full task description including file path]
  
  **References**:
  - Spec: `specs/[###-feature]/spec.md`
  - Plan: `specs/[###-feature]/plan.md`
  - Tasks: `specs/[###-feature]/tasks.md`
Labels: spec-kit, [phase-name], [US# if applicable]
```

For **Option B** (one per phase):
```
Title: [Feature Name]: [Phase Name]
Body:
  **Feature**: [###-feature-name]
  **Phase**: [Phase Name]
  
  ## Tasks
  [Copy all tasks from the phase as a task list]
  - [ ] T### [description]
  - [ ] T### [description]
  
  **References**:
  - Spec: `specs/[###-feature]/spec.md`
  - Tasks: `specs/[###-feature]/tasks.md`
Labels: spec-kit, [phase-name]
```

For **Option C** (one per user story):
```
Title: [Feature Name]: [User Story Title] (P[priority])
Body:
  **Feature**: [###-feature-name]
  **User Story**: US[N] - [title]
  **Priority**: P[N]
  **Independent Test**: [From spec.md]
  
  ## Context
  [User story description from spec.md]
  
  ## Acceptance Criteria
  [Acceptance scenarios from spec.md]
  
  ## Implementation Tasks
  [All tasks tagged with [US#] as a task list]
  - [ ] T### [description]
  - [ ] T### [description]
  
  ## References
  - Spec: `specs/[###-feature]/spec.md`
  - Plan: `specs/[###-feature]/plan.md`
  - Tasks: `specs/[###-feature]/tasks.md`
Labels: spec-kit, user-story, priority-p[N]
```

### Step 6: Create Foundation/Setup Issues

Regardless of the chosen option, also create issues for shared phases (Setup and Foundational):
```
Title: [Feature Name]: Setup & Foundation
Body:
  **Feature**: [###-feature-name]
  **Note**: These tasks MUST be completed before any user story work begins.
  
  ## Setup Tasks
  [Phase 1 tasks]
  
  ## Foundational Tasks
  [Phase 2 tasks]
  
Labels: spec-kit, foundation
```

### Step 7: Output Summary

```
GitHub Issues Created: [count] issues in [REPO]

  Issues:
    #[N]: [Feature Name]: Setup & Foundation
    #[N]: [Feature Name]: [User Story/Phase/Task]
    ...

  Labels Used: [list of labels]

  Note: To track implementation progress, check off task items in:
    - The GitHub issues (using issue task lists)
    - The spec tasks file: specs/[###-feature]/tasks.md
```

## Important Rules

- **Never create issues in the wrong repository** — always verify the GitHub remote matches
- **Always confirm with the user** before creating issues
- Issues should link back to spec files for context
- Use consistent labels across all issues for the same feature
- If `gh` CLI is available, use it: `gh issue create --title "..." --body "..." --label "..."`
- If GitHub MCP is available, use the `issue_write` tool
- If neither is available, output the issue content as Markdown that the user can paste manually
