Issue Task

Create GitHub issues using templates with automatic project assignment

practical-stack 4 updated 6mo ago
Claude CodeGeneric
View source ↗
---
description: "Create GitHub issues using templates with automatic project assignment"
argument-hint: "[template-type] [issue-title]"
allowed-tools:
  - Bash
  - Read
  - Glob
  - Grep
---

# Issue Task Command

Create a new GitHub issue with comprehensive context gathering, requirement analysis, and solution design. This command guides you through a structured input process and enhances your input with AI-powered codebase analysis.

## Usage

/issue-task [template-type]


Or simply:

/issue-task


**Note**: This command no longer accepts issue title as an argument. The title will be auto-generated based on your requirement input.

## Available Templates

The following issue templates are available in `.github/ISSUE_TEMPLATE/`:

- `feat` - Add a new feature or enhancement
- `fix` - Fix a bug or issue
- `doc` - Add or update project documentation
- `config` - Add or update project configuration, dependencies, or tooling
- `refactor` - Refactor existing code for better maintainability or performance
- `agent` - Add or update agent rules, commands, or automation
- `bug` - Create a bug report to help us improve
- `test` - Add or improve tests
- `perf` - Improve performance

## Workflow

### 1. Determine Template Type
- If `$1` (first argument) is provided and matches a template type, use it
- Otherwise, ask the user to select from available templates

### 2. Collect User Input (Prompt-based)

Collect user input through interactive prompts with a structure **tailored to the issue type**.

**Template sections by type:**

| Type | Section 3 | Section 4 | Notes |
|------|-----------|-----------|-------|
| feat, config, agent | Solution | Test Plan | Standard structure |
| fix | Solution | Test Plan | With bug-specific guidance |
| doc | Content Outline | Verification | Documentation-specific |
| test | Test Scope | Verification | Test-specific |
| perf | Solution | Verification | Performance-specific |
| refactor | Solution | Verification | Refactoring-specific |

**All types share:** Context (REQUIRED), Requirement (REQUIRED), Reference (auto-generated)

**Prompt sequence:**

#### Prompt 1: Context (REQUIRED for all types)
**Prompt text varies by type:**

- **feat, config, agent, perf, refactor, fix**: "Describe the background: Why is this needed? What is the current situation?"
- **doc**: "Why is this documentation needed? What's missing or unclear?"
- **test**: "Why are these tests needed? What's currently untested?"

**Validation:**
- Must be non-empty and not just whitespace
- If validation fails, show: "Context is required and cannot be empty. Please provide input:"
- Re-prompt until valid input is provided

#### Prompt 2: Requirement (REQUIRED for all types)
**Prompt text varies by type:**

- **feat, config, agent, perf, refactor**: "Describe what needs to be done and the expected outcome:"
- **doc**: "What documentation needs to be created/updated?"
- **test**: "What needs to be tested?"
- **fix**: "What needs to be fixed?"

**Validation:**
- Must be non-empty and not just whitespace
- If validation fails, show: "Requirement is required and cannot be empty. Please provide input:"
- Re-prompt until valid input is provided

#### Prompt 3: Type-specific optional section
**Prompt text varies by type:**

- **feat, config, agent**: "If you have ideas about how to solve this, describe the approach: (Enter to skip)"
- **doc**: "Describe the document structure, sections, topics to cover: (Enter to skip)"
- **test**: "Describe test types (Unit/Integration/E2E/Performance), scope, coverage goals: (Enter to skip)"
- **perf, refactor**: "If you have ideas about how to solve this, describe the approach: (Enter to skip)"
- **fix**: "If you know the root cause and fix approach, describe it: (Enter to skip)"

**Handling:**
- Optional - if user presses Enter without text, store as empty
- No validation required

#### Prompt 4: Type-specific optional section
**Prompt text varies by type:**

- **feat, config, agent**: "How should this be tested or validated? (Enter to skip)"
- **doc**: "How to verify documentation accuracy? Examples tested? Consistency checks? (Enter to skip)"
- **test**: "How to verify tests are working? Coverage metrics? (Enter to skip)"
- **perf, refactor**: "How should this be verified? (Enter to skip)"
- **fix**: "How should this be tested or validated? (Enter to skip)"

**Handling:**
- Optional - if user presses Enter without text, store as empty
- No validation required

**Implementation steps:**
- Present prompts sequentially based on the issue type (see table above)
- For each prompt, wait for user input
- For required prompts (Context, Requirement): validate non-empty, re-prompt if validation fails
- For optional prompts: allow Enter to skip, store as empty if skipped
- Store all responses for later use in issue body generation

### 3. AI Context Gathering and Enhancement

After collecting user input, enhance it with AI analysis:

**Context Gathering:**
- Use `Read`, `Glob`, `Grep` to search for related code based on user's Context and Requirement
- Look for:
  - Related files or modules mentioned in the user input
  - Similar patterns or existing implementations
  - Dependencies or components that might be affected
  - Relevant configuration files or documentation

**Content Enhancement:**
- Analyze gathered context and present findings to the user
- If the Solution section is empty or brief, suggest approaches based on:
  - Existing patterns found in the codebase
  - Similar features or components
  - Best practices observed in the project
- Present the enhanced content with clearly marked AI additions
- Ask user: "I've gathered additional context from the codebase. Here's what I found: [summary]. Would you like me to add this to the issue? Any changes needed?"
- Allow user to approve, modify, or reject the AI enhancements
- Iterate until user is satisfied

### 4. Generate Issue Title

Based on the Requirement section, generate a concise, descriptive title:

**Ti

Maintain Issue Task?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Issue Task on getagentictools](https://getagentictools.com/loops/practical-stack-issue-task-command?ref=badge)