---
description: Brainstorm within task constraints
argument-hint: "[task-id]"
agent: oracle
---

# Task-Bounded Brainstorm: $ARGUMENTS

## Phase 0: Task Validation (MANDATORY)

### Check Task Exists

!`TASK_DIR="@backlog/tasks/$ARGUMENTS"`
!`if [ ! -d "$TASK_DIR" ]; then echo "ERROR: Task $ARGUMENTS not found. Use /task-with-spec first"; exit 1; fi`

### Load Brainstorming Boundaries

!`echo "=== BRAINSTORM BOUNDARIES ==="`
!`grep -A 10 "Scope:" "$TASK_DIR/prd.md"`
!`grep -A 15 "Constraints:" "$TASK_DIR/spec.md"`
!`grep -A 10 "Success Criteria:" "$TASK_DIR/prd.md"`

## Phase 1: Task-Context Discovery

### Brainstorm Only Within Task Requirements

**Task Goal:** [From PRD goal section]
**Task Scope:** [From PRD scope section]
**Task Constraints:** [From spec constraints section]
**Success Criteria:** [From PRD success criteria]

### Discovery Questions (Task-Focused):

1. **Goal Clarification**: What specific aspect of task goal needs brainstorming?
2. **Scope Boundaries**: What within task scope should we explore?
3. **Constraint Challenges**: What constraints make this difficult?
4. **Success Metrics**: How do we measure success for this task?

### Forbidden Brainstorming Areas:

- ❌ Features outside PRD scope
- ❌ Approaches violating spec constraints
- ❌ Solutions not serving success criteria
- ❌ Ideas requiring forbidden dependencies

## Phase 2: Constrained Solution Exploration

### Task-Bounded Brainstorming Process

```
@oracle Brainstorm solutions for task $ARGUMENTS

ANTI-HALLUCINATION BRAINSTORM REQUIREMENTS:
1. Read $TASK_DIR/prd.md and $TASK_DIR/spec.md FIRST
2. Brainstorm only within PRD scope boundaries
3. Generate only solutions that respect spec constraints
4. Focus ideas on achieving PRD success criteria
5. Reject any approach that violates task boundaries
6. Document all brainstorming in $TASK_DIR/review.md
7. Stay within task-defined problem space

BRAINSTORM BOUNDARIES:
- Goal: [From PRD goal]
- Scope: [From PRD scope]
- Constraints: [From spec constraints]
- Success: [From PRD success criteria]

NO EXCEPTIONS: Brainstorming must serve task requirements only
```

### Solution Evaluation (Task-Aligned):

- **Feasibility**: Can this work within task constraints?
- **Scope Compliance**: Does this stay within PRD boundaries?
- **Constraint Adherence**: Does this follow spec requirements?
- **Success Alignment**: Does this achieve success criteria?

## Phase 3: Task-Focused Solution Analysis

### Brutal Honesty (Within Constraints)

For each solution, evaluate:

- **YAGNI**: Is this needed for task success?
- **KISS**: Is this the simplest approach within constraints?
- **DRY**: Does this follow task patterns without duplication?

### Rejection Criteria:

- ❌ Violates PRD scope
- ❌ Breaks spec constraints
- ❌ Doesn't achieve success criteria
- ❌ Over-engineered for task needs

### Acceptance Criteria:

- ✅ Stays within task scope
- ✅ Respects all constraints
- ✅ Achieves success criteria
- ✅ Simplest viable approach

## Phase 4: Task-Bounded Documentation

### Brainstorming Summary (Task-Only)

!`cat >> "$TASK_DIR/review.md" << EOF

## Brainstorming Session - $(date '+%Y-%m-%d')

### Task Context

**Goal**: $(grep -A 3 'Goal:' "$TASK_DIR/prd.md" | tail -1)
**Scope**: $(grep -A 3 'In-Scope:' "$TASK_DIR/prd.md" | tail -2)
**Constraints**: [From $TASK_DIR/spec.md]

### Solutions Considered

[Only solutions within task boundaries]

### Solution Analysis

[Analysis against task constraints]

### Recommended Approach

[Chosen solution that respects all boundaries]

### Rationale

[Why this solution best serves task requirements]

EOF`

## Phase 5: Task Brainstorm Completion

### Brainstorm Validation:

- [ ] All ideas stayed within task scope
- [ ] All solutions respect spec constraints
- [ ] Recommended approach achieves success criteria
- [ ] Brainstorming documented in task review

### Next Steps:

```
/research-and-implement $ARGUMENTS
# Use task-bounded brainstorming for implementation
```

---

**ANTI-HALLUCINATION: Brainstorming must serve task constraints, not creative exploration**
