---
description: "Issue classification system and TaskProfile framework"
globs:
alwaysApply: true
---

# Issue Classification System

{{PROJECT_SHORTNAME}} uses **TaskProfile** to classify issues objectively using four dimensions.

---

## Four Dimensions (1-10 Scale)

Every issue is scored on these objective dimensions:

| Dimension | 1 (Low) | 10 (High) |
|-----------|---------|-----------|
| **Determinism** | Rule-based, mechanical | Creative judgment required |
| **Context Breadth** | Single file change | System-wide changes |
| **Verification Cost** | Instant feedback (tests) | Production-only validation |
| **Domain Knowledge** | Generic programming skills | Specialized expertise |

**Source of truth:** Dimensions are manually scored. Classification (1-10) and zone are **derived fields**.

---

## Classification Zones

**Derived from 4-dimension scores using weighted formula:**

- **1-3: ai-solo** - AI autonomous, human reviews after
- **4-6: ai-led** - AI proposes approach, human validates before execution
- **7-8: ai-assisted** - Human leads, AI assists with implementation
- **9-10: ai-limited** - Human owns, AI provides research only

---

## How AI Should Respond by Zone

### ai-solo (1-3)
- **Behavior:** Work independently with minimal confirmation
- **Process:** Implement → test → summarize
- **Human role:** Reactive review only

### ai-led (4-6)
- **Behavior:** Propose detailed approach, wait for approval
- **Process:** Analyze → propose plan → get approval → execute
- **Human role:** Validates approach before work begins

### ai-assisted (7-8)
- **Behavior:** Human leads, AI assists with specifics
- **Process:** Human designs approach → AI implements parts → human reviews
- **Human role:** Leads architecture and critical decisions

### ai-limited (9-10)
- **Behavior:** Research and suggest only, no implementation
- **Process:** Gather info → present options → human decides and implements
- **Human role:** Owns all decisions and implementation

---

## Assignment & Resources

**Resource matching based on classification thresholds:**

- **AI resources:** Handle classification 1-6 (ai-solo, ai-led)
- **Junior resources:** Handle classification 4-7 (ai-led, lower ai-assisted)
- **Expert resources:** Handle classification 7-10 (ai-assisted, ai-limited)

**Confidence scoring:**
- **High:** Task utilization ≤70% of resource max threshold
- **Medium:** Task utilization 71-90% of resource max
- **Low:** Task utilization >90% of resource max

See `scripts/utils/{{PROJECT_SHORTNAME}}/assignment-recommender.ts` for matching logic.

---

## Classification Commands

**Create TaskProfile:**
```bash
npm run profile-wizard
```

**Interactive prompts for:**
- Determinism score (1-10)
- Context breadth score (1-10)
- Verification cost score (1-10)
- Domain knowledge score (1-10)

**Auto-calculates:**
- Classification score (weighted formula)
- Classification zone
- Resource assignment recommendations

---

## Validation & Anti-Patterns

**Validator checks for:**
- ❌ Low determinism (<3) + High verification cost (>7)
- ❌ High context breadth (>8) + Low domain knowledge (<3)
- ⚠️ All dimensions within 2 points (too narrow spread)

**See:** `scripts/utils/{{PROJECT_SHORTNAME}}/task-profile.ts` for validation logic

---

## Related Files

- **TaskProfile model:** `scripts/utils/{{PROJECT_SHORTNAME}}/task-profile.ts`
- **Assignment engine:** `scripts/utils/{{PROJECT_SHORTNAME}}/assignment-recommender.ts`
- **Resource assigner:** `scripts/utils/{{PROJECT_SHORTNAME}}/resource-assigner.ts`
- **Zone utilities:** `scripts/utils/{{PROJECT_SHORTNAME}}/classification-zones.ts`
- **Spec (detailed):** `memory-bank/requirements/specs/complexity-spec.md`