@itz4blitz/agentful 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/architect.md +446 -0
- package/.claude/agents/backend.md +251 -0
- package/.claude/agents/fixer.md +263 -0
- package/.claude/agents/frontend.md +351 -0
- package/.claude/agents/orchestrator.md +1139 -0
- package/.claude/agents/reviewer.md +332 -0
- package/.claude/agents/tester.md +319 -0
- package/.claude/commands/agentful-decide.md +139 -0
- package/.claude/commands/agentful-start.md +180 -0
- package/.claude/commands/agentful-status.md +96 -0
- package/.claude/commands/agentful-validate.md +105 -0
- package/.claude/product/CHANGES.md +276 -0
- package/.claude/product/EXAMPLES.md +610 -0
- package/.claude/product/README.md +312 -0
- package/.claude/product/index.md +152 -0
- package/.claude/settings.json +63 -0
- package/.claude/skills/product-tracking/SKILL.md +654 -0
- package/.claude/skills/validation/SKILL.md +271 -0
- package/LICENSE +21 -0
- package/README.md +335 -0
- package/bin/cli.js +580 -0
- package/package.json +42 -0
- package/template/CLAUDE.md +197 -0
- package/template/PRODUCT.md +496 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Agentful Product Development
|
|
2
|
+
|
|
3
|
+
This project uses **Agentful** for autonomous product development.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. Edit `PRODUCT.md` with your product requirements
|
|
8
|
+
2. Run: `claude`
|
|
9
|
+
3. Type: `/agentful-start`
|
|
10
|
+
|
|
11
|
+
That's it. Agentful will begin autonomous development.
|
|
12
|
+
|
|
13
|
+
## For 24/7 Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
claude --dangerously-skip-permissions
|
|
17
|
+
/ralph-loop "/agentful-start" --max-iterations 50 --completion-promise "AGENTFUL_COMPLETE"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
| Command | Description |
|
|
23
|
+
|---------|-------------|
|
|
24
|
+
| `/agentful-start` | Begin or resume autonomous development |
|
|
25
|
+
| `/agentful-status` | Check current progress |
|
|
26
|
+
| `/agentful-decide` | Answer pending decisions |
|
|
27
|
+
| `/agentful-validate` | Run all quality checks |
|
|
28
|
+
|
|
29
|
+
## Agents
|
|
30
|
+
|
|
31
|
+
Agentful uses specialized agents that work together:
|
|
32
|
+
|
|
33
|
+
| Agent | Purpose |
|
|
34
|
+
|-------|---------|
|
|
35
|
+
| `orchestrator` | Coordinates all work, never codes directly |
|
|
36
|
+
| `architect` | Analyzes tech stack and generates specialized agents |
|
|
37
|
+
| `backend` | Services, repositories, controllers, APIs |
|
|
38
|
+
| `frontend` | Components, pages, hooks, styling |
|
|
39
|
+
| `tester` | Unit, integration, E2E tests |
|
|
40
|
+
| `reviewer` | Code review, dead code detection, quality gates |
|
|
41
|
+
| `fixer` | Fixes validation failures automatically |
|
|
42
|
+
|
|
43
|
+
## State Files
|
|
44
|
+
|
|
45
|
+
Progress is tracked in `.agentful/`:
|
|
46
|
+
|
|
47
|
+
- `state.json` - Current work state and phase
|
|
48
|
+
- `completion.json` - Feature completion percentages and quality gates
|
|
49
|
+
- `decisions.json` - Pending and resolved decisions
|
|
50
|
+
- `last-validation.json` - Most recent validation report
|
|
51
|
+
|
|
52
|
+
## Product Specification
|
|
53
|
+
|
|
54
|
+
Your product is defined in `PRODUCT.md`. This file contains:
|
|
55
|
+
|
|
56
|
+
- Overview and goals
|
|
57
|
+
- Tech stack decisions
|
|
58
|
+
- Feature list with priorities
|
|
59
|
+
- Acceptance criteria
|
|
60
|
+
- Architecture notes
|
|
61
|
+
|
|
62
|
+
## How It Works
|
|
63
|
+
|
|
64
|
+
```mermaid
|
|
65
|
+
flowchart LR
|
|
66
|
+
Start([🚀 Initialize<br/>npx agentful init]) --> Define[📝 Define Product<br/>Edit PRODUCT.md]
|
|
67
|
+
Define --> Build[⚡ Start Building<br/>/agentful-start]
|
|
68
|
+
Build --> Loop{🔄 24/7 Development Loop}
|
|
69
|
+
|
|
70
|
+
Loop --> Spec[📋 Your Specs<br/>PRODUCT.md]
|
|
71
|
+
Loop --> Tech[🛠️ Tech Stack<br/>Auto-detected]
|
|
72
|
+
Loop --> Dev[🤖 Autonomous Development]
|
|
73
|
+
Loop --> Complete[✅ 100% Complete]
|
|
74
|
+
|
|
75
|
+
Spec --> Agents[Specialized Agents]
|
|
76
|
+
Tech --> Agents
|
|
77
|
+
Agents --> Dev
|
|
78
|
+
Dev --> Validate[Quality Gates]
|
|
79
|
+
Validate -->|❌ Fix| Dev
|
|
80
|
+
Validate -->|✅ Pass| Update[Update Progress]
|
|
81
|
+
Update --> Check{Done?}
|
|
82
|
+
Check -->|No| Loop
|
|
83
|
+
Check -->|Yes| Complete([🎉 Complete!])
|
|
84
|
+
|
|
85
|
+
style Start fill:#10b981,stroke:#059669,color:#fff
|
|
86
|
+
style Define fill:#3b82f6,stroke:#2563eb,color:#fff
|
|
87
|
+
style Build fill:#8b5cf6,stroke:#7c3aed,color:#fff
|
|
88
|
+
style Loop fill:#f59e0b,stroke:#d97706,color:#fff
|
|
89
|
+
style Agents fill:#06b6d4,stroke:#0891b2,color:#fff
|
|
90
|
+
style Dev fill:#ec4899,stroke:#db2777,color:#fff
|
|
91
|
+
style Validate fill:#f97316,stroke:#ea580c,color:#fff
|
|
92
|
+
style Update fill:#84cc16,stroke:#65a30d,color:#fff
|
|
93
|
+
style Complete fill:#10b981,stroke:#059669,color:#fff
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
1. **Initialization** - Architect analyzes PRODUCT.md and generates tech-specific agents
|
|
97
|
+
2. **Planning** - Orchestrator reads state and picks next priority task
|
|
98
|
+
3. **Implementation** - Specialist agents implement features
|
|
99
|
+
4. **Validation** - Reviewer runs quality checks
|
|
100
|
+
5. **Fixing** - Fixer resolves any issues found
|
|
101
|
+
6. **Iteration** - Loop continues until 100% complete
|
|
102
|
+
|
|
103
|
+
## Quality Gates
|
|
104
|
+
|
|
105
|
+
Code must pass all gates before completion:
|
|
106
|
+
|
|
107
|
+
- ✅ All tests passing
|
|
108
|
+
- ✅ No TypeScript errors
|
|
109
|
+
- ✅ No dead code (unused exports, files, dependencies)
|
|
110
|
+
- ✅ Test coverage ≥ 80%
|
|
111
|
+
- ✅ No security issues
|
|
112
|
+
|
|
113
|
+
## Decision Handling
|
|
114
|
+
|
|
115
|
+
When Agentful needs your input:
|
|
116
|
+
|
|
117
|
+
1. Question is added to `decisions.json`
|
|
118
|
+
2. Development continues on unblocked features
|
|
119
|
+
3. Run `/agentful-decide` to answer
|
|
120
|
+
4. Agentful resumes blocked work
|
|
121
|
+
|
|
122
|
+
## Tech Stack Auto-Detection
|
|
123
|
+
|
|
124
|
+
Agentful automatically detects your tech stack from:
|
|
125
|
+
- `PRODUCT.md` - Explicit tech stack section
|
|
126
|
+
- `package.json` - Dependencies and frameworks
|
|
127
|
+
- Existing code - File patterns and imports
|
|
128
|
+
|
|
129
|
+
It then generates specialized agents for your specific stack.
|
|
130
|
+
|
|
131
|
+
## Example Flow
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
You: /agentful-start
|
|
135
|
+
|
|
136
|
+
Agentful: Detected Next.js + TypeScript + Prisma + Tailwind
|
|
137
|
+
→ Generated nextjs-agent, prisma-agent, tailwind-agent
|
|
138
|
+
|
|
139
|
+
Agentful: Starting work on authentication (priority: CRITICAL)
|
|
140
|
+
→ @backend implementing JWT service
|
|
141
|
+
→ @backend implementing login API route
|
|
142
|
+
→ @frontend creating login page
|
|
143
|
+
→ @tester writing auth tests
|
|
144
|
+
|
|
145
|
+
Agentful: Running validation...
|
|
146
|
+
→ TypeScript: ✅
|
|
147
|
+
→ Lint: ✅
|
|
148
|
+
→ Tests: ✅
|
|
149
|
+
→ Coverage: 82% ✅
|
|
150
|
+
→ Dead code: ✅
|
|
151
|
+
→ Security: ✅
|
|
152
|
+
|
|
153
|
+
Agentful: Authentication complete (100%)
|
|
154
|
+
Next: User profile feature...
|
|
155
|
+
|
|
156
|
+
[Continues 24/7 until complete]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Customization
|
|
160
|
+
|
|
161
|
+
All agents and commands can be customized in `.claude/`:
|
|
162
|
+
|
|
163
|
+
- `.claude/agents/` - Add or modify agents
|
|
164
|
+
- `.claude/commands/` - Add or modify commands
|
|
165
|
+
- `.claude/skills/` - Add domain-specific skills
|
|
166
|
+
|
|
167
|
+
## Getting Help
|
|
168
|
+
|
|
169
|
+
If Agentful gets stuck:
|
|
170
|
+
|
|
171
|
+
1. Run `/agentful-status` to see current state
|
|
172
|
+
2. Check `PRODUCT.md` for unclear requirements
|
|
173
|
+
3. Run `/agentful-decide` if decisions are pending
|
|
174
|
+
4. Run `/agentful-validate` to check for issues
|
|
175
|
+
|
|
176
|
+
## Architecture
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
.your-project/
|
|
180
|
+
├── PRODUCT.md # Your product spec (you edit this)
|
|
181
|
+
├── CLAUDE.md # This file
|
|
182
|
+
├── .claude/ # Agentful configuration
|
|
183
|
+
│ ├── agents/ # Specialized agents
|
|
184
|
+
│ ├── commands/ # Slash commands
|
|
185
|
+
│ ├── skills/ # Domain skills
|
|
186
|
+
│ └── settings.json # Hooks and permissions
|
|
187
|
+
├── .agentful/ # Runtime state (gitignored)
|
|
188
|
+
│ ├── state.json
|
|
189
|
+
│ ├── completion.json
|
|
190
|
+
│ ├── decisions.json
|
|
191
|
+
│ └── architecture.json
|
|
192
|
+
└── src/ # Your code (generated by Agentful)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
**Agentful** - Autonomous product development with Claude Code
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
# Product Specification
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
[Describe what you're building in 2-3 sentences]
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
> A task management application that helps teams collaborate on projects. Users can create projects, add tasks with deadlines, assign team members, and track progress with real-time updates.
|
|
9
|
+
|
|
10
|
+
## Goals
|
|
11
|
+
|
|
12
|
+
- [ ] [Primary goal 1]
|
|
13
|
+
- [ ] [Primary goal 2]
|
|
14
|
+
- [ ] [Primary goal 3]
|
|
15
|
+
|
|
16
|
+
## Tech Stack
|
|
17
|
+
|
|
18
|
+
### Frontend
|
|
19
|
+
- **Framework**: [Next.js 14 / React + Vite / Vue + Nuxt / SvelteKit]
|
|
20
|
+
- **Language**: [TypeScript / JavaScript]
|
|
21
|
+
- **Styling**: [Tailwind CSS / CSS Modules / styled-components / shadcn/ui]
|
|
22
|
+
- **State Management**: [Zustand / Context API / Redux / Jotai]
|
|
23
|
+
|
|
24
|
+
### Backend
|
|
25
|
+
- **Runtime**: [Node.js / Bun / Deno]
|
|
26
|
+
- **Framework**: [Next.js API Routes / Express / Fastify / NestJS / Hono]
|
|
27
|
+
- **Language**: [TypeScript / JavaScript]
|
|
28
|
+
|
|
29
|
+
### Database
|
|
30
|
+
- **Database**: [PostgreSQL / MySQL / SQLite / MongoDB / PlanetScale]
|
|
31
|
+
- **ORM**: [Prisma / Drizzle / TypeORM / Mongoose]
|
|
32
|
+
|
|
33
|
+
### Authentication
|
|
34
|
+
- **Method**: [JWT / NextAuth / Clerk / Auth0 / Lucia]
|
|
35
|
+
|
|
36
|
+
### Testing
|
|
37
|
+
- **Unit**: [Vitest / Jest]
|
|
38
|
+
- **E2E**: [Playwright / Cypress]
|
|
39
|
+
|
|
40
|
+
### Deployment
|
|
41
|
+
- **Hosting**: [Vercel / Netlify / Railway / Fly.io]
|
|
42
|
+
|
|
43
|
+
## Product Structure
|
|
44
|
+
|
|
45
|
+
This product is organized into **domains**, which contain **features**, which break down into **subtasks**.
|
|
46
|
+
|
|
47
|
+
### Hierarchical Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Product
|
|
51
|
+
└── Domain (e.g., authentication)
|
|
52
|
+
└── Feature (e.g., login)
|
|
53
|
+
└── Subtask (e.g., create login form)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Definitions**:
|
|
57
|
+
- **Domain**: A major functional area (e.g., authentication, purchasing, user-management)
|
|
58
|
+
- **Feature**: A specific capability within a domain (e.g., login, registration, password-reset)
|
|
59
|
+
- **Subtask**: An implementable unit of work (e.g., create UI form, implement API endpoint)
|
|
60
|
+
|
|
61
|
+
**Priority Levels**:
|
|
62
|
+
- `CRITICAL` - Must have for MVP, blocks other features
|
|
63
|
+
- `HIGH` - Important for MVP, should include
|
|
64
|
+
- `MEDIUM` - Nice to have if time permits
|
|
65
|
+
- `LOW` - Future enhancement, not for MVP
|
|
66
|
+
|
|
67
|
+
**Status Tracking**:
|
|
68
|
+
- `pending` - Not started
|
|
69
|
+
- `in-progress` - Currently being worked on
|
|
70
|
+
- `complete` - Done and tested
|
|
71
|
+
- `blocked` - Waiting for decision or dependency
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Domain: Authentication
|
|
76
|
+
|
|
77
|
+
### Feature: User Registration - CRITICAL
|
|
78
|
+
**Description**: Allow new users to create accounts
|
|
79
|
+
|
|
80
|
+
**Subtasks**:
|
|
81
|
+
|
|
82
|
+
#### 1. Create registration form UI - CRITICAL
|
|
83
|
+
**Status**: pending
|
|
84
|
+
|
|
85
|
+
**Acceptance Criteria**:
|
|
86
|
+
- [ ] Form includes email, password, and confirm password fields
|
|
87
|
+
- [ ] Email validation with regex pattern
|
|
88
|
+
- [ ] Password minimum 8 characters with requirements shown
|
|
89
|
+
- [ ] Password match validation
|
|
90
|
+
- [ ] Submit button disabled until all valid
|
|
91
|
+
- [ ] Loading state during submission
|
|
92
|
+
- [ ] Error messages display inline
|
|
93
|
+
- [ ] Responsive design (mobile and desktop)
|
|
94
|
+
|
|
95
|
+
**User Stories**:
|
|
96
|
+
- As a new user, I want to create an account with email and password so that I can access the application
|
|
97
|
+
|
|
98
|
+
**Technical Notes**:
|
|
99
|
+
- Use React Hook Form or similar
|
|
100
|
+
- Zod validation schema
|
|
101
|
+
- Tailwind CSS for styling
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
#### 2. Implement registration API endpoint - CRITICAL
|
|
106
|
+
**Status**: pending
|
|
107
|
+
|
|
108
|
+
**Acceptance Criteria**:
|
|
109
|
+
- [ ] POST /api/auth/register endpoint created
|
|
110
|
+
- [ ] Validates email format and uniqueness
|
|
111
|
+
- [ ] Hashes password using bcrypt (cost factor 10)
|
|
112
|
+
- [ ] Creates user in database
|
|
113
|
+
- [ ] Returns 201 on success with user object (excluding password)
|
|
114
|
+
- [ ] Returns 400 for validation errors with specific messages
|
|
115
|
+
- [ ] Returns 409 if email already exists
|
|
116
|
+
- [ ] Rate limited to 5 requests per minute per IP
|
|
117
|
+
|
|
118
|
+
**Technical Notes**:
|
|
119
|
+
- Use Prisma/Drizzle for database operations
|
|
120
|
+
- Implement rate limiting middleware
|
|
121
|
+
- Log registration attempts for monitoring
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Feature: User Login - CRITICAL
|
|
126
|
+
**Description**: Allow existing users to authenticate
|
|
127
|
+
|
|
128
|
+
**Subtasks**:
|
|
129
|
+
|
|
130
|
+
#### 1. Create login form UI - CRITICAL
|
|
131
|
+
**Status**: pending
|
|
132
|
+
|
|
133
|
+
**Acceptance Criteria**:
|
|
134
|
+
- [ ] Form includes email and password fields
|
|
135
|
+
- [ ] "Remember me" checkbox
|
|
136
|
+
- [ ] "Forgot password" link
|
|
137
|
+
- [ ] Link to registration page
|
|
138
|
+
- [ ] Client-side validation before submission
|
|
139
|
+
- [ ] Loading state during authentication
|
|
140
|
+
- [ ] Clear error messages (invalid credentials, account locked, etc.)
|
|
141
|
+
|
|
142
|
+
**User Stories**:
|
|
143
|
+
- As a returning user, I want to log in with my credentials so that I can access my account
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
#### 2. Implement login API endpoint - CRITICAL
|
|
148
|
+
**Status**: pending
|
|
149
|
+
|
|
150
|
+
**Acceptance Criteria**:
|
|
151
|
+
- [ ] POST /api/auth/login endpoint created
|
|
152
|
+
- [ ] Verifies email exists in database
|
|
153
|
+
- [ ] Compares hashed password using bcrypt
|
|
154
|
+
- [ ] Generates JWT token with 7-day expiration
|
|
155
|
+
- [ ] Sets httpOnly cookie with token
|
|
156
|
+
- [ ] Returns 200 with user object on success
|
|
157
|
+
- [ ] Returns 401 for invalid credentials
|
|
158
|
+
- [ ] Implements account lockout after 5 failed attempts
|
|
159
|
+
- [ ] Rate limited to 10 requests per minute
|
|
160
|
+
|
|
161
|
+
**Technical Notes**:
|
|
162
|
+
- Use jose or jsonwebtoken for JWT
|
|
163
|
+
- Store failed attempts in Redis or database
|
|
164
|
+
- Set secure cookie flags: httpOnly, secure, sameSite
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Feature: Password Reset - HIGH
|
|
169
|
+
**Description**: Allow users to reset forgotten passwords
|
|
170
|
+
|
|
171
|
+
**Subtasks**:
|
|
172
|
+
|
|
173
|
+
#### 1. Create forgot password form - HIGH
|
|
174
|
+
**Status**: pending
|
|
175
|
+
|
|
176
|
+
**Acceptance Criteria**:
|
|
177
|
+
- [ ] Single email input field
|
|
178
|
+
- [ ] Submit button to send reset link
|
|
179
|
+
- [ ] Success message: "If email exists, reset link sent"
|
|
180
|
+
- [ ] Rate limited to 3 requests per hour
|
|
181
|
+
|
|
182
|
+
**User Stories**:
|
|
183
|
+
- As a user, I want to request a password reset email so that I can regain access to my account
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
#### 2. Implement password reset email flow - HIGH
|
|
188
|
+
**Status**: pending
|
|
189
|
+
|
|
190
|
+
**Acceptance Criteria**:
|
|
191
|
+
- [ ] Generates secure reset token (UUID, expires in 1 hour)
|
|
192
|
+
- [ ] Stores token in database with expiration
|
|
193
|
+
- [ ] Sends email with reset link containing token
|
|
194
|
+
- [ ] Validates token on reset attempt
|
|
195
|
+
- [ ] Updates password after validation
|
|
196
|
+
- [ ] Invalidates token after use
|
|
197
|
+
- [ ] Uses transaction for database updates
|
|
198
|
+
|
|
199
|
+
**Technical Notes**:
|
|
200
|
+
- Use Resend, SendGrid, or AWS SES for emails
|
|
201
|
+
- Store hashed token in database
|
|
202
|
+
- Background job for email sending
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Domain: Purchasing
|
|
207
|
+
|
|
208
|
+
### Feature: Product Catalog - CRITICAL
|
|
209
|
+
**Description**: Display and browse available products
|
|
210
|
+
|
|
211
|
+
**Subtasks**:
|
|
212
|
+
|
|
213
|
+
#### 1. Create product listing page - CRITICAL
|
|
214
|
+
**Status**: pending
|
|
215
|
+
|
|
216
|
+
**Acceptance Criteria**:
|
|
217
|
+
- [ ] Grid layout showing product cards
|
|
218
|
+
- [ ] Each card displays: image, name, price, short description
|
|
219
|
+
- [ ] Pagination or infinite scroll (20 items per page)
|
|
220
|
+
- [ ] Loading skeleton while fetching
|
|
221
|
+
- [ ] Empty state message when no products
|
|
222
|
+
- [ ] Clicking card navigates to product detail page
|
|
223
|
+
- [ ] Mobile-responsive (1 column) and desktop (3-4 columns)
|
|
224
|
+
|
|
225
|
+
**User Stories**:
|
|
226
|
+
- As a customer, I want to browse products so that I can see what's available
|
|
227
|
+
|
|
228
|
+
**Technical Notes**:
|
|
229
|
+
- Use virtual scrolling for performance
|
|
230
|
+
- Cache product list for 5 minutes
|
|
231
|
+
- Lazy load images
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
#### 2. Implement product API endpoints - CRITICAL
|
|
236
|
+
**Status**: pending
|
|
237
|
+
|
|
238
|
+
**Acceptance Criteria**:
|
|
239
|
+
- [ ] GET /api/products endpoint with pagination (page, limit)
|
|
240
|
+
- [ ] Supports filtering by category, price range
|
|
241
|
+
- [ ] Supports sorting by name, price, date
|
|
242
|
+
- [ ] Returns 200 with products array and metadata
|
|
243
|
+
- [ ] Returns 400 for invalid query parameters
|
|
244
|
+
- [ ] Response time < 200ms p95
|
|
245
|
+
|
|
246
|
+
**Technical Notes**:
|
|
247
|
+
- Use database indexes on category and price
|
|
248
|
+
- Implement query validation schema
|
|
249
|
+
- Cache popular queries
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### Feature: Shopping Cart - HIGH
|
|
254
|
+
**Description**: Allow users to manage cart items
|
|
255
|
+
|
|
256
|
+
**Subtasks**:
|
|
257
|
+
|
|
258
|
+
#### 1. Create cart UI components - HIGH
|
|
259
|
+
**Status**: pending
|
|
260
|
+
|
|
261
|
+
**Acceptance Criteria**:
|
|
262
|
+
- [ ] Cart icon in header showing item count badge
|
|
263
|
+
- [ ] Cart drawer/modal for quick access
|
|
264
|
+
- [ ] Full cart page with item list
|
|
265
|
+
- [ ] Each item shows: image, name, price, quantity controls
|
|
266
|
+
- [ ] Remove item button with confirmation
|
|
267
|
+
- [ ] Subtotal calculation
|
|
268
|
+
- [ ] "Checkout" button
|
|
269
|
+
- [ ] Empty cart state with call-to-action
|
|
270
|
+
|
|
271
|
+
**User Stories**:
|
|
272
|
+
- As a customer, I want to view and edit my cart so that I can review items before purchase
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
#### 2. Implement cart state management - HIGH
|
|
277
|
+
**Status**: pending
|
|
278
|
+
|
|
279
|
+
**Acceptance Criteria**:
|
|
280
|
+
- [ ] Cart persisted in localStorage
|
|
281
|
+
- [ ] Sync cart state across tabs (storage event listener)
|
|
282
|
+
- [ ] Add to cart action (with quantity)
|
|
283
|
+
- [ ] Remove from cart action
|
|
284
|
+
- [ ] Update quantity action
|
|
285
|
+
- [ ] Clear cart action
|
|
286
|
+
- [ ] Calculate totals (subtotal, tax, shipping)
|
|
287
|
+
- [ ] Merge guest cart with user cart on login
|
|
288
|
+
|
|
289
|
+
**Technical Notes**:
|
|
290
|
+
- Use Zustand or Redux for state
|
|
291
|
+
- Debounce localStorage writes
|
|
292
|
+
- Validate cart integrity on load
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Domain: User Management
|
|
297
|
+
|
|
298
|
+
### Feature: User Profile - HIGH
|
|
299
|
+
**Description**: Allow users to view and edit their profile
|
|
300
|
+
|
|
301
|
+
**Subtasks**:
|
|
302
|
+
|
|
303
|
+
#### 1. Create profile page UI - HIGH
|
|
304
|
+
**Status**: pending
|
|
305
|
+
|
|
306
|
+
**Acceptance Criteria**:
|
|
307
|
+
- [ ] Display user information: name, email, avatar
|
|
308
|
+
- [ ] Editable fields: name, bio, location
|
|
309
|
+
- [ ] Avatar upload with preview
|
|
310
|
+
- [ ] Save button with loading state
|
|
311
|
+
- [ ] Success notification on save
|
|
312
|
+
- [ ] "Change password" section
|
|
313
|
+
- [ ] "Delete account" danger zone
|
|
314
|
+
|
|
315
|
+
**User Stories**:
|
|
316
|
+
- As a user, I want to edit my profile so that I can keep my information up to date
|
|
317
|
+
|
|
318
|
+
**Technical Notes**:
|
|
319
|
+
- Use file upload API for avatar (max 2MB, images only)
|
|
320
|
+
- Client-side image optimization before upload
|
|
321
|
+
- Confirmation modal for account deletion
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
#### 2. Implement profile API endpoints - HIGH
|
|
326
|
+
**Status**: pending
|
|
327
|
+
|
|
328
|
+
**Acceptance Criteria**:
|
|
329
|
+
- [ ] GET /api/user/profile - Returns current user profile
|
|
330
|
+
- [ ] PATCH /api/user/profile - Updates profile fields
|
|
331
|
+
- [ ] POST /api/user/avatar - Uploads avatar image
|
|
332
|
+
- [ ] DELETE /api/user/account - Deletes account (requires confirmation)
|
|
333
|
+
- [ ] All endpoints require authentication
|
|
334
|
+
- [ ] Returns 401 if not authenticated
|
|
335
|
+
- [ ] Validates file type and size for avatar
|
|
336
|
+
|
|
337
|
+
**Technical Notes**:
|
|
338
|
+
- Use S3 or Cloudflare R2 for image storage
|
|
339
|
+
- Generate unique filename for avatars
|
|
340
|
+
- Soft delete for user accounts
|
|
341
|
+
- Log all profile changes
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Feature: User Roles - MEDIUM
|
|
346
|
+
**Description**: Implement role-based access control
|
|
347
|
+
|
|
348
|
+
**Subtasks**:
|
|
349
|
+
|
|
350
|
+
#### 1. Define role system - MEDIUM
|
|
351
|
+
**Status**: pending
|
|
352
|
+
|
|
353
|
+
**Acceptance Criteria**:
|
|
354
|
+
- [ ] Database schema for roles (user, admin, moderator)
|
|
355
|
+
- [ ] User-role many-to-many relationship
|
|
356
|
+
- [ ] Seed default roles in database
|
|
357
|
+
- [ ] Utility function to check user role
|
|
358
|
+
- [ ] Middleware to protect routes by role
|
|
359
|
+
- [ ] Type definitions for role-based permissions
|
|
360
|
+
|
|
361
|
+
**User Stories**:
|
|
362
|
+
- As an admin, I want to have elevated permissions so that I can manage the application
|
|
363
|
+
- As a developer, I want role-based access control so that I can secure sensitive features
|
|
364
|
+
|
|
365
|
+
**Technical Notes**:
|
|
366
|
+
- Use enum for role names
|
|
367
|
+
- Cache user roles in JWT for fast access
|
|
368
|
+
- Create RBAC policy definitions
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
#### 2. Implement role-based UI - MEDIUM
|
|
373
|
+
**Status**: pending
|
|
374
|
+
|
|
375
|
+
**Acceptance Criteria**:
|
|
376
|
+
- [ ] Admin dashboard visible only to admins
|
|
377
|
+
- [ ] User management page for admins
|
|
378
|
+
- [ ] Role assignment interface
|
|
379
|
+
- [ ] Permission checks on client side (UI only)
|
|
380
|
+
- [ ] Graceful fallback for unauthorized access
|
|
381
|
+
|
|
382
|
+
**User Stories**:
|
|
383
|
+
- As an admin, I want to manage user roles so that I can control access
|
|
384
|
+
|
|
385
|
+
**Technical Notes**:
|
|
386
|
+
- Server-side validation is the source of truth
|
|
387
|
+
- Client-side checks only for UI/UX
|
|
388
|
+
- Log all role changes
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Architecture Notes
|
|
393
|
+
|
|
394
|
+
### Folder Structure (Optional)
|
|
395
|
+
|
|
396
|
+
If you have a preferred structure:
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
src/
|
|
400
|
+
├── app/ # Next.js app router
|
|
401
|
+
├── components/ # React components
|
|
402
|
+
│ ├── auth/ # Authentication components
|
|
403
|
+
│ ├── product/ # Product components
|
|
404
|
+
│ └── cart/ # Cart components
|
|
405
|
+
├── lib/ # Utilities
|
|
406
|
+
├── hooks/ # Custom hooks
|
|
407
|
+
└── styles/ # Global styles
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Design Patterns
|
|
411
|
+
|
|
412
|
+
- [Any specific patterns to use]
|
|
413
|
+
- [Any patterns to avoid]
|
|
414
|
+
|
|
415
|
+
### Constraints
|
|
416
|
+
|
|
417
|
+
- [Performance requirements]
|
|
418
|
+
- [Accessibility requirements]
|
|
419
|
+
- [Browser support requirements]
|
|
420
|
+
|
|
421
|
+
## Third-Party Integrations (Optional)
|
|
422
|
+
|
|
423
|
+
- [API 1]: [Purpose]
|
|
424
|
+
- [API 2]: [Purpose]
|
|
425
|
+
|
|
426
|
+
## Out of Scope (for MVP)
|
|
427
|
+
|
|
428
|
+
List what you're explicitly NOT building:
|
|
429
|
+
|
|
430
|
+
- [Feature X] - Will add in v2
|
|
431
|
+
- [Feature Y] - Out of scope
|
|
432
|
+
- [Feature Z] - Not needed
|
|
433
|
+
|
|
434
|
+
## Success Criteria
|
|
435
|
+
|
|
436
|
+
The product is complete when:
|
|
437
|
+
|
|
438
|
+
1. [All CRITICAL features implemented and tested]
|
|
439
|
+
2. [All HIGH priority features implemented or documented]
|
|
440
|
+
3. [All tests passing with 80%+ coverage]
|
|
441
|
+
4. [No TypeScript errors]
|
|
442
|
+
5. [No security vulnerabilities]
|
|
443
|
+
6. [Deployed to production]
|
|
444
|
+
|
|
445
|
+
## Notes
|
|
446
|
+
|
|
447
|
+
[Any additional context, links, or documentation]
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## Template Guide
|
|
452
|
+
|
|
453
|
+
### How to Use This Template
|
|
454
|
+
|
|
455
|
+
1. **Keep the structure**: Maintain the domains → features → subtasks hierarchy
|
|
456
|
+
2. **Be specific**: Write detailed acceptance criteria for each subtask
|
|
457
|
+
3. **Think sequentially**: Order subtasks in implementation order
|
|
458
|
+
4. **Set priorities**: Use CRITICAL/HIGH/MEDIUM/LOW to guide development
|
|
459
|
+
5. **Track progress**: Update status as features are complete
|
|
460
|
+
|
|
461
|
+
### Example Domain Breakdown
|
|
462
|
+
|
|
463
|
+
```
|
|
464
|
+
Authentication (Domain)
|
|
465
|
+
├── User Registration (Feature)
|
|
466
|
+
│ ├── Create registration form UI (Subtask) - CRITICAL
|
|
467
|
+
│ └── Implement registration API endpoint (Subtask) - CRITICAL
|
|
468
|
+
├── User Login (Feature)
|
|
469
|
+
│ ├── Create login form UI (Subtask) - CRITICAL
|
|
470
|
+
│ └── Implement login API endpoint (Subtask) - CRITICAL
|
|
471
|
+
└── Password Reset (Feature)
|
|
472
|
+
├── Create forgot password form (Subtask) - HIGH
|
|
473
|
+
└── Implement password reset email flow (Subtask) - HIGH
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Acceptance Criteria Format
|
|
477
|
+
|
|
478
|
+
Each subtask should have:
|
|
479
|
+
- **Status**: pending → in-progress → complete (or blocked)
|
|
480
|
+
- **Checkbox list**: [ ] Specific, testable requirements
|
|
481
|
+
- **User stories**: As a [role], I want [feature] so that [benefit]
|
|
482
|
+
- **Technical notes**: Implementation details and constraints
|
|
483
|
+
|
|
484
|
+
### Why This Structure Works
|
|
485
|
+
|
|
486
|
+
- **Domains** organize work by functional area
|
|
487
|
+
- **Features** break domains into user-facing capabilities
|
|
488
|
+
- **Subtasks** create implementable units that can be completed in one session
|
|
489
|
+
- **Priorities** ensure MVP features are built first
|
|
490
|
+
- **Status tracking** enables autonomous development loops
|
|
491
|
+
|
|
492
|
+
**Tip**: The more detailed your PRODUCT.md, the better Agentful can understand what to build. Include:
|
|
493
|
+
- Clear acceptance criteria with checkboxes
|
|
494
|
+
- User stories for context
|
|
495
|
+
- Technical constraints and notes
|
|
496
|
+
- Examples when helpful
|