# {{FEATURE_NAME}} — AINative Feature PRD

**Author:** {{AUTHOR}}
**Date:** {{DATE}}
**Status:** Draft
**Issue:** #{{ISSUE_NUMBER}}
**Branch:** `feature/{{ISSUE_NUMBER}}-{{SLUG}}`

---

## 1. Overview

### What
{{FEATURE_DESCRIPTION}}

### Why
{{BUSINESS_JUSTIFICATION}}

### Who
{{TARGET_USERS}}

---

## 2. AINative Platform Context

### Services Involved
{{AINATIVE_SERVICES}}

### Existing API Endpoints (to extend or consume)
{{EXISTING_ENDPOINTS}}

### New API Endpoints Required
| Method | Path | Description |
|--------|------|-------------|
| {{METHOD}} | {{PATH}} | {{DESCRIPTION}} |

---

## 3. User Stories

{{USER_STORIES}}

---

## 4. Technical Requirements

### 4.1 API Layer
- Endpoint prefix: `/api/v1/{{PREFIX}}`
- Authentication: {{AUTH_TYPE}}
- Rate limiting: {{RATE_LIMIT}}

### 4.2 Service Layer
- Service module: `app/services/{{SERVICE_MODULE}}.py`
- Business logic: {{BUSINESS_LOGIC}}

### 4.3 Database Schema
```sql
{{SCHEMA_SQL}}
```

### 4.4 Dependencies
{{DEPENDENCIES}}

---

## 5. Architecture Compliance

- [ ] API handlers only validate + delegate (no business logic)
- [ ] All business logic in service layer
- [ ] No raw SQL in endpoints (SQLAlchemy only)
- [ ] ZeroDB for any memory/context needs
- [ ] No secrets in code
- [ ] Input validation via Pydantic models
- [ ] Rate limiting on public endpoints

---

## 6. Test Plan

### Unit Tests
{{UNIT_TESTS}}

### Integration Tests
{{INTEGRATION_TESTS}}

### Coverage Target: >= 80%

```bash
cd src/backend
python3 -m pytest tests/{{TEST_FILE}} -v --cov=app.{{MODULE}} --cov-report=term-missing
```

---

## 7. Acceptance Criteria

{{ACCEPTANCE_CRITERIA}}

---

## 8. Rollback Plan

{{ROLLBACK_PLAN}}

---

## 9. Timeline

| Phase | Duration | Deliverable |
|-------|----------|-------------|
| TDD: Write tests | {{PHASE_1}} | Failing tests |
| Implementation | {{PHASE_2}} | Green tests |
| Integration testing | {{PHASE_3}} | Verified on staging |
| Production deploy | {{PHASE_4}} | Live + monitored |

---

## 10. Open Questions

{{OPEN_QUESTIONS}}

---

*Generated by AINative PRD Generator | Refs #{{ISSUE_NUMBER}}*
