File size: 2,474 Bytes
4aec5bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Product Requirements Document: [Project Name]

> **AI Context**: This document is the PRIMARY source of truth for the AI agent. Read this BEFORE writing any code.

## 1. Introduction
- **Purpose**: [One sentence describing what this project does]
- **Target Users**: [Who will use this?]
- **Status**: Draft | In Development | Production Ready

## 2. Goals & Objectives
- [ ] Functional goal 1: [e.g., "Users can authenticate with email/password"]
- [ ] Functional goal 2: [e.g., "API response time < 200ms p95"]
- [ ] Functional goal 3: [e.g., "Support 10k concurrent users"]

## 3. Tech Stack
| Layer | Technology | Version |
|-------|-----------|---------|
| Frontend | [e.g., React, Vue, vanilla JS] | |
| Backend | [e.g., FastAPI, Node.js, Django] | |
| Database | [e.g., PostgreSQL, SQLite, MongoDB] | |
| Auth | [e.g., JWT, OAuth2, Session] | |
| Testing | [e.g., pytest, Jest, Vitest] | |
| Deployment | [e.g., Docker, Vercel, HF Spaces] | |

## 4. Features & Functionality

### Feature 1: [Feature Name]
- **Description**: [What it does in 1-2 sentences]
- **User Story**: As a [role], I want [goal], so that [benefit]
- **Acceptance Criteria**:
  - [ ] Criterion 1
  - [ ] Criterion 2
- **API/Interface**: [Endpoint or component signature]
- **Edge Cases**: [Error conditions, validation rules]

### Feature 2: [Feature Name]
- [Repeat structure]

## 5. Data Models
```
Entity: User
- id: UUID (primary key)
- email: string (unique, validated)
- password_hash: string (bcrypt)
- created_at: datetime
- updated_at: datetime

Entity: [Next Entity]
- ...
```

## 6. API Specification

### Endpoint: POST /api/v1/[resource]
- **Description**: [What it does]
- **Request Body**:
  ```json
  {
    "field": "type // description"
  }
  ```
- **Response 200**:
  ```json
  {
    "id": "uuid",
    "field": "value"
  }
  ```
- **Response 400/401/404/500**: [Error response schema]
- **Auth Required**: Yes/No
- **Rate Limit**: [If applicable]

## 7. Non-Functional Requirements
- **Performance**: [e.g., p95 latency < 200ms]
- **Security**: [e.g., OWASP Top 10 compliance, input sanitization]
- **Scalability**: [e.g., horizontal scaling strategy]
- **Accessibility**: [e.g., WCAG 2.1 AA]
- **Browser Support**: [e.g., Chrome 110+, Firefox 120+]

## 8. Constraints & Assumptions
- [Assumption 1: e.g., "Users have modern browsers"]
- [Constraint 1: e.g., "Must run on single VPS with 2GB RAM"]

## 9. Open Questions
- [Question the AI should clarify before implementing]