# Feature Specification: {{FEATURE_NAME_TITLE}}

## 📋 Metadata

| Field | Value |
|-------|-------|
| **ID** | {{FEATURE_NAME}} |
| **Status** | Draft / In Review / Approved / In Progress / Done |
| **Created** | {{DATE}} |
| **Stack** | {{STACK}} |
| **Agents** | Core: All / Specialists: {list} |
| **Estimated Cost** | ${X}/month |

---

## 🎯 Overview

### Problem Statement
{Descreva o problema que esta feature resolve}

### Proposed Solution
{Descreva a solução em alto nível}

### Success Criteria
- [ ] {Critério 1}
- [ ] {Critério 2}
- [ ] {Critério 3}

---

## 👤 User Stories

### US001: {Título}

**Como** {tipo de usuário}
**Quero** {funcionalidade}
**Para** {benefício}

**Acceptance Criteria:**
1. {Critério 1}
2. {Critério 2}

**Edge Cases:**
- {Edge case 1}: {Como tratar}

---

## 🏗️ Technical Design

### Stack
| Component | Technology |
|-----------|------------|
| Frontend | Blazor Server |
| Backend | .NET 10 / C# 14 |
| Database | Azure SQL |
| AI | Microsoft Agent Framework (obrigatório) |

### Architecture
```
User → Blazor UI → Service → Repository → Database
                      ↓
                 AI Agent → Azure OpenAI
```

### Data Model

#### {EntityName}
| Column | Type | Constraints |
|--------|------|-------------|
| Id | int | PK, Identity |
| Name | nvarchar(200) | Required |
| CreatedAt | datetime2 | Default: GETUTCDATE() |

### Contracts
```csharp
public interface I{{FEATURE_NAME_PASCAL}}Service
{
    Task<{{FEATURE_NAME_PASCAL}}Dto> GetByIdAsync(int id);
    Task<{{FEATURE_NAME_PASCAL}}Dto> CreateAsync(Create{{FEATURE_NAME_PASCAL}}Request request);
}
```

---

## 🎨 UI/UX Design

### Wireframes
```
┌─────────────────────────────────────┐
│ {Page Title}                    [+] │
├─────────────────────────────────────┤
│ ┌─────────────────────────────────┐ │
│ │ {Item}                   [Edit] │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────┘
```

### User Flow
1. Usuário acessa página
2. Sistema carrega lista
3. Usuário clica em [+]
4. Modal de criação abre
5. Usuário salva

---

## 💰 Cost Analysis

| Resource | Tier | Monthly Cost |
|----------|------|--------------|
| Azure SQL | Free | $0 |
| Container Apps | Consumption | ~$2 |
| Azure OpenAI | gpt-4o-mini | ~$2 |
| **Total** | | **~$4** |

---

## 🔐 Security

| Action | Required Policy |
|--------|-----------------|
| View | CanView{Feature} |
| Create | CanManage{Feature} |
| Delete | CanManage{Feature} |

---

## ⚠️ Risks

| Risk | Impact | Mitigation |
|------|--------|------------|
| {Risk 1} | High | {Mitigation} |

---

## 🚫 Out of Scope

- {Item fora do escopo}

---

## ✅ Definition of Done

- [ ] Código implementado
- [ ] Testes >80% coverage
- [ ] Code review aprovado
- [ ] Deploy em staging
- [ ] Recap.md gerado
