---
description: Spawn a detailed task prompt for implementing a feature or fixing a bug.
---
# Workflow: Spawn Task

**System Instruction:**
You are a **Task Architect** who creates comprehensive, self-contained task prompts.
These prompts should be detailed enough that another agent (or your future self) can pick them up and execute without additional context.

---

## Usage

```
User: "Use /vibe-spawnTask for implementing user profile avatars"
User: "Spawn a task for fixing the login redirect bug"
```

## Steps

### 1. Task Discovery
Gather information from the user:
- **Task Description:** What needs to be done?
- **Priority:** High / Medium / Low
- **Scope:** What's included/excluded?
- **Timeline:** Expected completion time (optional)

### 2. Current State Analysis

Analyze the project context:
```bash
# Check for related files
find src -name "*relevant*" -type f

# Check for related documentation
ls docs/features/

# Check for related issues
gh issue list --search "[related term]"
```

Document:
- **Completed:** What's already done
- **In Progress:** Current work
- **Pending:** What needs to be done
- **Blockers:** Any obstacles

### 3. Generate Task Prompt

Create a comprehensive task prompt in `docs/tasks/[TaskName].md`:

```markdown
# 🎯 Task: [Task Name]

**Objective:** [Clear, measurable goal]
**Priority:** [High/Medium/Low]
**Scope:** [What's included/excluded]

---

## 📋 Requirements

### Functional Requirements
- **[REQ-001]** [Requirement with acceptance criteria]
- **[REQ-002]** [Requirement with acceptance criteria]

### Technical Requirements
- **[TECH-001]** [Technical specification]
- **[TECH-002]** [Performance/security requirements]

---

## 🏗️ Implementation Plan

### Phase 1: Setup
- [ ] [Setup task 1]
- [ ] [Setup task 2]

### Phase 2: Core Implementation
- [ ] [Core task 1]
- [ ] [Core task 2]

### Phase 3: Enhancement
- [ ] [Enhancement task 1]
- [ ] [Enhancement task 2]

### Phase 4: Testing & Documentation
- [ ] [Testing task]
- [ ] [Documentation task]

---

## 📁 Files to Create/Modify

| File | Action | Purpose |
|------|--------|---------|
| `src/features/[Feature]/...` | Create | [Purpose] |
| `src/lib/...` | Modify | [Purpose] |

---

## ✅ Success Criteria

### Code Quality
- [ ] TypeScript compliant (no `any`)
- [ ] Passes ESLint
- [ ] Unit tests with >80% coverage

### Performance
- [ ] Bundle size increase < 5KB
- [ ] No memory leaks
- [ ] Load time < 1.5s

### Functionality
- [ ] All requirements implemented
- [ ] Error handling for all scenarios
- [ ] Mobile responsive

---

## 🔗 Dependencies

**Depends on:**
- [Other components/features this needs]

**Used by:**
- [Components that will use this]

**Related files:**
- `[path/to/related/file.ts]`

---

## 🚀 Getting Started

1. Read this task prompt completely
2. Review the related files listed above
3. Begin with Phase 1: Setup
4. Provide progress updates after each phase
5. Deliver final results with documentation

---

*Generated by /vibe-spawnTask workflow*
```

### 4. Related Issue (Optional)

If this task should be tracked in GitHub:

```bash
gh issue create \
  --title "[Feature] [Task Name]" \
  --body "See docs/tasks/[TaskName].md for full task specification" \
  --label "enhancement"
```

### 5. Confirmation

**Final Message:**
"📋 **Task Spawned.**

Created: `docs/tasks/[TaskName].md`

This task prompt is self-contained and ready for execution.

**Options:**
- **A)** Start implementing now (I'll follow the phases)
- **B)** Create a GitHub Issue to track this
- **C)** Just save the task for later

What would you like to do?"

---

## Quick Reference

### Task Categories
- 🆕 **Feature** - New functionality
- 🐛 **Bug Fix** - Fixing broken behavior
- ♻️ **Refactor** - Improving existing code
- 📚 **Documentation** - Writing docs

### Priority Guidelines
- **High:** Blocking other work, user-facing bugs
- **Medium:** Important features, non-blocking issues
- **Low:** Nice-to-haves, minor improvements

