kiro-agent-team 1.0.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/.kiro/README.md +228 -0
- package/.kiro/agents/backend-engineer.json +6 -0
- package/.kiro/agents/backend-engineer.md +643 -0
- package/.kiro/agents/database-specialist.json +6 -0
- package/.kiro/agents/database-specialist.md +390 -0
- package/.kiro/agents/development-logger.json +6 -0
- package/.kiro/agents/development-logger.md +265 -0
- package/.kiro/agents/devops-engineer.json +6 -0
- package/.kiro/agents/devops-engineer.md +287 -0
- package/.kiro/agents/frontend-architect.json +6 -0
- package/.kiro/agents/frontend-architect.md +1032 -0
- package/.kiro/agents/hooks/backend-engineer-hooks.yaml +540 -0
- package/.kiro/agents/hooks/database-specialist-hooks.yaml +488 -0
- package/.kiro/agents/hooks/development-logger-hooks.yaml +361 -0
- package/.kiro/agents/hooks/devops-engineer-hooks.yaml +345 -0
- package/.kiro/agents/hooks/frontend-architect-hooks.yaml +521 -0
- package/.kiro/agents/hooks/project-manager-hooks.yaml +513 -0
- package/.kiro/agents/hooks/security-specialist-hooks.yaml +358 -0
- package/.kiro/agents/hooks/test-orchestrator-hooks.yaml +380 -0
- package/.kiro/agents/hooks/ui-ux-designer-hooks.yaml +353 -0
- package/.kiro/agents/project-manager.json +6 -0
- package/.kiro/agents/project-manager.md +344 -0
- package/.kiro/agents/prompts/backend-engineer-system.md +815 -0
- package/.kiro/agents/prompts/database-specialist-system.md +332 -0
- package/.kiro/agents/prompts/development-logger-system.md +232 -0
- package/.kiro/agents/prompts/devops-engineer-system.md +260 -0
- package/.kiro/agents/prompts/frontend-architect-system.md +305 -0
- package/.kiro/agents/prompts/project-manager-system.md +285 -0
- package/.kiro/agents/prompts/security-specialist-system.md +231 -0
- package/.kiro/agents/prompts/test-orchestrator-system.md +214 -0
- package/.kiro/agents/prompts/ui-ux-designer-system.md +270 -0
- package/.kiro/agents/security-specialist.json +6 -0
- package/.kiro/agents/security-specialist.md +277 -0
- package/.kiro/agents/test-orchestrator.json +6 -0
- package/.kiro/agents/test-orchestrator.md +266 -0
- package/.kiro/agents/ui-ux-designer.json +6 -0
- package/.kiro/agents/ui-ux-designer.md +284 -0
- package/.kiro/devlog/00-START-HERE.md +444 -0
- package/.kiro/devlog/COMPLETE-WORKFLOW.md +553 -0
- package/.kiro/devlog/DEVLOG-INTEGRATION.md +413 -0
- package/.kiro/devlog/DEVLOG-PROCESS-FLOWS.md +484 -0
- package/.kiro/devlog/DEVLOG-QUICK-REF.md +299 -0
- package/.kiro/devlog/DEVLOG.md +22 -0
- package/.kiro/devlog/IMPLEMENTATION-COMPLETE.txt +434 -0
- package/.kiro/devlog/IMPLEMENTATION-SUMMARY.md +358 -0
- package/.kiro/devlog/README.md +363 -0
- package/.kiro/devlog/devlog-update.bat +136 -0
- package/.kiro/devlog/devlog-update.sh +275 -0
- package/.kiro/devlog/feature-completion-hook.bat +78 -0
- package/.kiro/devlog/feature-completion-hook.sh +84 -0
- package/.kiro/documentation/cli.md +31 -0
- package/.kiro/documentation/docs_cli.md +41 -0
- package/.kiro/documentation/docs_cli_authentication.md +43 -0
- package/.kiro/documentation/docs_cli_autocomplete.md +132 -0
- package/.kiro/documentation/docs_cli_billing.md +31 -0
- package/.kiro/documentation/docs_cli_billing_contact-support.md +43 -0
- package/.kiro/documentation/docs_cli_billing_managing-taxes.md +67 -0
- package/.kiro/documentation/docs_cli_billing_related-questions.md +49 -0
- package/.kiro/documentation/docs_cli_billing_subscription-portal.md +31 -0
- package/.kiro/documentation/docs_cli_chat.md +84 -0
- package/.kiro/documentation/docs_cli_chat_configuration.md +40 -0
- package/.kiro/documentation/docs_cli_chat_context.md +258 -0
- package/.kiro/documentation/docs_cli_chat_git-aware-selection.md +41 -0
- package/.kiro/documentation/docs_cli_chat_images.md +53 -0
- package/.kiro/documentation/docs_cli_chat_manage-prompts.md +216 -0
- package/.kiro/documentation/docs_cli_chat_model-selection.md +153 -0
- package/.kiro/documentation/docs_cli_chat_permissions.md +68 -0
- package/.kiro/documentation/docs_cli_chat_planning-agent.md +230 -0
- package/.kiro/documentation/docs_cli_chat_responding.md +123 -0
- package/.kiro/documentation/docs_cli_chat_security.md +87 -0
- package/.kiro/documentation/docs_cli_chat_subagents.md +77 -0
- package/.kiro/documentation/docs_cli_code-intelligence.md +251 -0
- package/.kiro/documentation/docs_cli_custom-agents.md +37 -0
- package/.kiro/documentation/docs_cli_custom-agents_configuration-reference.md +941 -0
- package/.kiro/documentation/docs_cli_custom-agents_creating.md +93 -0
- package/.kiro/documentation/docs_cli_custom-agents_examples.md +360 -0
- package/.kiro/documentation/docs_cli_custom-agents_troubleshooting.md +180 -0
- package/.kiro/documentation/docs_cli_enterprise_billing.md +33 -0
- package/.kiro/documentation/docs_cli_enterprise_concepts.md +34 -0
- package/.kiro/documentation/docs_cli_enterprise_getting-started.md +19 -0
- package/.kiro/documentation/docs_cli_enterprise_iam.md +251 -0
- package/.kiro/documentation/docs_cli_enterprise_monitor-and-track.md +15 -0
- package/.kiro/documentation/docs_cli_enterprise_monitor-and-track_dashboard.md +62 -0
- package/.kiro/documentation/docs_cli_enterprise_monitor-and-track_prompt-logging.md +165 -0
- package/.kiro/documentation/docs_cli_enterprise_monitor-and-track_user-activity.md +123 -0
- package/.kiro/documentation/docs_cli_enterprise_settings.md +15 -0
- package/.kiro/documentation/docs_cli_enterprise_subscribe.md +36 -0
- package/.kiro/documentation/docs_cli_enterprise_subscription-management.md +55 -0
- package/.kiro/documentation/docs_cli_enterprise_supported-regions.md +39 -0
- package/.kiro/documentation/docs_cli_experimental.md +282 -0
- package/.kiro/documentation/docs_cli_experimental_checkpointing.md +439 -0
- package/.kiro/documentation/docs_cli_experimental_delegate.md +422 -0
- package/.kiro/documentation/docs_cli_experimental_knowledge-management.md +449 -0
- package/.kiro/documentation/docs_cli_experimental_tangent-mode.md +357 -0
- package/.kiro/documentation/docs_cli_experimental_thinking.md +331 -0
- package/.kiro/documentation/docs_cli_experimental_todo-lists.md +385 -0
- package/.kiro/documentation/docs_cli_hooks.md +207 -0
- package/.kiro/documentation/docs_cli_installation.md +235 -0
- package/.kiro/documentation/docs_cli_mcp.md +106 -0
- package/.kiro/documentation/docs_cli_mcp_configuration.md +294 -0
- package/.kiro/documentation/docs_cli_mcp_examples.md +273 -0
- package/.kiro/documentation/docs_cli_mcp_governance.md +436 -0
- package/.kiro/documentation/docs_cli_mcp_security.md +77 -0
- package/.kiro/documentation/docs_cli_migrating-from-q.md +129 -0
- package/.kiro/documentation/docs_cli_privacy-and-security.md +83 -0
- package/.kiro/documentation/docs_cli_privacy-and-security_compliance-validation.md +17 -0
- package/.kiro/documentation/docs_cli_privacy-and-security_data-protection.md +104 -0
- package/.kiro/documentation/docs_cli_privacy-and-security_firewalls.md +26 -0
- package/.kiro/documentation/docs_cli_privacy-and-security_infrastructure-security.md +10 -0
- package/.kiro/documentation/docs_cli_privacy-and-security_vpc-endpoints.md +41 -0
- package/.kiro/documentation/docs_cli_reference_built-in-tools.md +624 -0
- package/.kiro/documentation/docs_cli_reference_cli-commands.md +689 -0
- package/.kiro/documentation/docs_cli_reference_settings.md +294 -0
- package/.kiro/documentation/docs_cli_reference_slash-commands.md +559 -0
- package/.kiro/documentation/docs_cli_steering.md +84 -0
- package/.kiro/guides/AGENT_WORKFLOW_GUIDE.md +294 -0
- package/.kiro/guides/DEVLOG.md +882 -0
- package/.kiro/guides/IMPLEMENTATION_EXAMPLES.md +611 -0
- package/.kiro/guides/PIV Loop.md +122 -0
- package/.kiro/guides/PIV Loop.png +0 -0
- package/.kiro/guides/PIVLoop.png +0 -0
- package/.kiro/guides/QUICK_REFERENCE.md +202 -0
- package/.kiro/guides/README.md +149 -0
- package/.kiro/guides/advanced-patterns.md +514 -0
- package/.kiro/guides/agent-coordination.md +434 -0
- package/.kiro/guides/core-workflows.md +409 -0
- package/.kiro/guides/emergency-procedures.md +414 -0
- package/.kiro/guides/project-evaluation.md +534 -0
- package/.kiro/guides/quality-assurance.md +431 -0
- package/.kiro/guides/quick-start.md +235 -0
- package/.kiro/guides/troubleshooting.md +575 -0
- package/.kiro/guides/walkthroughs.md +711 -0
- package/.kiro/prompts/add-to-devlog.md +263 -0
- package/.kiro/prompts/code-review-fix.md +18 -0
- package/.kiro/prompts/code-review-hackathon.md +167 -0
- package/.kiro/prompts/code-review-security.md +454 -0
- package/.kiro/prompts/code-review.md +113 -0
- package/.kiro/prompts/create-prd.md +151 -0
- package/.kiro/prompts/execute-backend.md +257 -0
- package/.kiro/prompts/execute-frontend.md +438 -0
- package/.kiro/prompts/execute-logging.md +491 -0
- package/.kiro/prompts/execute-security.md +482 -0
- package/.kiro/prompts/execute-testing.md +528 -0
- package/.kiro/prompts/execute.md +101 -0
- package/.kiro/prompts/execution-report.md +72 -0
- package/.kiro/prompts/implement-fix.md +228 -0
- package/.kiro/prompts/plan-feature.md +433 -0
- package/.kiro/prompts/prime.md +73 -0
- package/.kiro/prompts/quality-metrics.md +622 -0
- package/.kiro/prompts/quickstart.md +318 -0
- package/.kiro/prompts/rca.md +220 -0
- package/.kiro/prompts/system-review.md +189 -0
- package/README.md +32 -0
- package/bin/cli.js +97 -0
- package/package.json +33 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Execute: Backend Development
|
|
2
|
+
|
|
3
|
+
## Backend-Specific Implementation Framework
|
|
4
|
+
|
|
5
|
+
This specialized execution framework is optimized for backend development tasks, focusing on API design, business logic implementation, and system integration.
|
|
6
|
+
|
|
7
|
+
## Backend Development Process
|
|
8
|
+
|
|
9
|
+
### Phase 1: Requirements Analysis
|
|
10
|
+
**Backend-Specific Analysis:**
|
|
11
|
+
- API endpoint specifications and data contracts
|
|
12
|
+
- Business logic requirements and validation rules
|
|
13
|
+
- Database integration and query patterns
|
|
14
|
+
- Authentication and authorization requirements
|
|
15
|
+
- Performance and scalability considerations
|
|
16
|
+
- Security requirements and compliance needs
|
|
17
|
+
|
|
18
|
+
**Questions to Address:**
|
|
19
|
+
- What API endpoints need to be implemented?
|
|
20
|
+
- What business rules and validation logic are required?
|
|
21
|
+
- How should data be structured and validated?
|
|
22
|
+
- What authentication/authorization patterns are needed?
|
|
23
|
+
- What are the performance requirements?
|
|
24
|
+
- What security measures must be implemented?
|
|
25
|
+
|
|
26
|
+
### Phase 2: Architecture Design
|
|
27
|
+
**Backend Architecture Planning:**
|
|
28
|
+
- API design patterns (REST, GraphQL, RPC)
|
|
29
|
+
- Service layer architecture and separation of concerns
|
|
30
|
+
- Database schema design and ORM integration
|
|
31
|
+
- Middleware stack and request/response handling
|
|
32
|
+
- Error handling and logging strategies
|
|
33
|
+
- Testing strategy for business logic and APIs
|
|
34
|
+
|
|
35
|
+
**Design Decisions:**
|
|
36
|
+
- Choose appropriate design patterns for business logic
|
|
37
|
+
- Define clear API contracts and data models
|
|
38
|
+
- Plan database interactions and transaction handling
|
|
39
|
+
- Design authentication and authorization flows
|
|
40
|
+
- Establish error handling and validation patterns
|
|
41
|
+
|
|
42
|
+
### Phase 3: Implementation
|
|
43
|
+
**Systematic Backend Implementation:**
|
|
44
|
+
|
|
45
|
+
#### API Layer Implementation
|
|
46
|
+
```typescript
|
|
47
|
+
// Example API endpoint structure
|
|
48
|
+
router.post('/api/users', [
|
|
49
|
+
authMiddleware,
|
|
50
|
+
validateUserInput,
|
|
51
|
+
async (req: Request, res: Response) => {
|
|
52
|
+
try {
|
|
53
|
+
const userData = req.body;
|
|
54
|
+
const user = await userService.createUser(userData);
|
|
55
|
+
res.status(201).json({ success: true, data: user });
|
|
56
|
+
} catch (error) {
|
|
57
|
+
handleApiError(error, res);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Service Layer Implementation
|
|
64
|
+
```typescript
|
|
65
|
+
// Business logic in service layer
|
|
66
|
+
export class UserService {
|
|
67
|
+
async createUser(userData: CreateUserDto): Promise<User> {
|
|
68
|
+
// Validate business rules
|
|
69
|
+
await this.validateUserData(userData);
|
|
70
|
+
|
|
71
|
+
// Hash password securely
|
|
72
|
+
const hashedPassword = await bcrypt.hash(userData.password, 12);
|
|
73
|
+
|
|
74
|
+
// Create user with transaction
|
|
75
|
+
return await this.db.transaction(async (tx) => {
|
|
76
|
+
const user = await tx.user.create({
|
|
77
|
+
data: { ...userData, password: hashedPassword }
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Create related records
|
|
81
|
+
await this.createUserProfile(tx, user.id);
|
|
82
|
+
|
|
83
|
+
return user;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Data Validation Implementation
|
|
90
|
+
```typescript
|
|
91
|
+
// Input validation with Zod
|
|
92
|
+
const CreateUserSchema = z.object({
|
|
93
|
+
email: z.string().email(),
|
|
94
|
+
password: z.string().min(8).regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/),
|
|
95
|
+
name: z.string().min(2).max(100),
|
|
96
|
+
role: z.enum(['user', 'admin']).default('user')
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export const validateUserInput = (req: Request, res: Response, next: NextFunction) => {
|
|
100
|
+
try {
|
|
101
|
+
req.body = CreateUserSchema.parse(req.body);
|
|
102
|
+
next();
|
|
103
|
+
} catch (error) {
|
|
104
|
+
res.status(400).json({ error: 'Invalid input data', details: error.errors });
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Phase 4: Security Implementation
|
|
110
|
+
**Backend Security Measures:**
|
|
111
|
+
- Input validation and sanitization
|
|
112
|
+
- SQL injection prevention with parameterized queries
|
|
113
|
+
- Authentication token management (JWT)
|
|
114
|
+
- Authorization middleware and role-based access
|
|
115
|
+
- Rate limiting and DDoS protection
|
|
116
|
+
- Security headers and CORS configuration
|
|
117
|
+
|
|
118
|
+
**Security Checklist:**
|
|
119
|
+
- [ ] All inputs validated and sanitized
|
|
120
|
+
- [ ] SQL injection prevention implemented
|
|
121
|
+
- [ ] Authentication properly secured
|
|
122
|
+
- [ ] Authorization checks on all protected endpoints
|
|
123
|
+
- [ ] Rate limiting configured
|
|
124
|
+
- [ ] Security headers implemented
|
|
125
|
+
- [ ] Sensitive data properly encrypted
|
|
126
|
+
- [ ] Error messages don't leak sensitive information
|
|
127
|
+
|
|
128
|
+
### Phase 5: Testing Implementation
|
|
129
|
+
**Backend Testing Strategy:**
|
|
130
|
+
- Unit tests for business logic and services
|
|
131
|
+
- Integration tests for API endpoints
|
|
132
|
+
- Database integration tests with test containers
|
|
133
|
+
- Authentication and authorization tests
|
|
134
|
+
- Error handling and edge case tests
|
|
135
|
+
- Performance tests for critical endpoints
|
|
136
|
+
|
|
137
|
+
**Testing Examples:**
|
|
138
|
+
```typescript
|
|
139
|
+
// Unit test for service layer
|
|
140
|
+
describe('UserService', () => {
|
|
141
|
+
it('should create user with hashed password', async () => {
|
|
142
|
+
const userData = { email: 'test@example.com', password: 'Password123', name: 'Test User' };
|
|
143
|
+
const user = await userService.createUser(userData);
|
|
144
|
+
|
|
145
|
+
expect(user.email).toBe(userData.email);
|
|
146
|
+
expect(user.password).not.toBe(userData.password); // Should be hashed
|
|
147
|
+
expect(await bcrypt.compare(userData.password, user.password)).toBe(true);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Integration test for API endpoint
|
|
152
|
+
describe('POST /api/users', () => {
|
|
153
|
+
it('should create user and return 201', async () => {
|
|
154
|
+
const userData = { email: 'test@example.com', password: 'Password123', name: 'Test User' };
|
|
155
|
+
|
|
156
|
+
const response = await request(app)
|
|
157
|
+
.post('/api/users')
|
|
158
|
+
.send(userData)
|
|
159
|
+
.expect(201);
|
|
160
|
+
|
|
161
|
+
expect(response.body.success).toBe(true);
|
|
162
|
+
expect(response.body.data.email).toBe(userData.email);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Phase 6: Performance Optimization
|
|
168
|
+
**Backend Performance Considerations:**
|
|
169
|
+
- Database query optimization and indexing
|
|
170
|
+
- Caching strategies (Redis, in-memory)
|
|
171
|
+
- Connection pooling and resource management
|
|
172
|
+
- Async/await patterns for non-blocking operations
|
|
173
|
+
- Response compression and optimization
|
|
174
|
+
- Monitoring and profiling integration
|
|
175
|
+
|
|
176
|
+
### Phase 7: Documentation
|
|
177
|
+
**Backend Documentation Requirements:**
|
|
178
|
+
- API documentation (OpenAPI/Swagger)
|
|
179
|
+
- Business logic documentation
|
|
180
|
+
- Database schema documentation
|
|
181
|
+
- Authentication and authorization guides
|
|
182
|
+
- Deployment and configuration guides
|
|
183
|
+
- Error handling and troubleshooting guides
|
|
184
|
+
|
|
185
|
+
## Backend-Specific Validation Checklist
|
|
186
|
+
|
|
187
|
+
### API Design Validation
|
|
188
|
+
- [ ] RESTful design principles followed
|
|
189
|
+
- [ ] Consistent naming conventions used
|
|
190
|
+
- [ ] Proper HTTP status codes implemented
|
|
191
|
+
- [ ] Error responses standardized
|
|
192
|
+
- [ ] API versioning strategy implemented
|
|
193
|
+
- [ ] Rate limiting configured appropriately
|
|
194
|
+
|
|
195
|
+
### Business Logic Validation
|
|
196
|
+
- [ ] Business rules properly implemented
|
|
197
|
+
- [ ] Data validation comprehensive
|
|
198
|
+
- [ ] Transaction handling correct
|
|
199
|
+
- [ ] Error handling robust
|
|
200
|
+
- [ ] Logging adequate for debugging
|
|
201
|
+
- [ ] Performance optimized
|
|
202
|
+
|
|
203
|
+
### Security Validation
|
|
204
|
+
- [ ] Authentication properly implemented
|
|
205
|
+
- [ ] Authorization checks comprehensive
|
|
206
|
+
- [ ] Input validation prevents injection attacks
|
|
207
|
+
- [ ] Sensitive data properly protected
|
|
208
|
+
- [ ] Security headers configured
|
|
209
|
+
- [ ] CORS properly configured
|
|
210
|
+
|
|
211
|
+
### Database Integration Validation
|
|
212
|
+
- [ ] Database queries optimized
|
|
213
|
+
- [ ] Transactions used appropriately
|
|
214
|
+
- [ ] Connection pooling configured
|
|
215
|
+
- [ ] Migration scripts tested
|
|
216
|
+
- [ ] Backup and recovery tested
|
|
217
|
+
- [ ] Data integrity maintained
|
|
218
|
+
|
|
219
|
+
### Testing Validation
|
|
220
|
+
- [ ] Unit tests cover business logic
|
|
221
|
+
- [ ] Integration tests cover API endpoints
|
|
222
|
+
- [ ] Database tests use proper isolation
|
|
223
|
+
- [ ] Authentication tests comprehensive
|
|
224
|
+
- [ ] Error handling tests complete
|
|
225
|
+
- [ ] Performance tests for critical paths
|
|
226
|
+
|
|
227
|
+
## Backend Implementation Success Criteria
|
|
228
|
+
|
|
229
|
+
### Functionality
|
|
230
|
+
- All API endpoints work as specified
|
|
231
|
+
- Business logic correctly implements requirements
|
|
232
|
+
- Data validation prevents invalid states
|
|
233
|
+
- Error handling provides useful feedback
|
|
234
|
+
- Authentication and authorization work correctly
|
|
235
|
+
|
|
236
|
+
### Performance
|
|
237
|
+
- API response times meet requirements
|
|
238
|
+
- Database queries are optimized
|
|
239
|
+
- Memory usage is reasonable
|
|
240
|
+
- CPU usage is efficient
|
|
241
|
+
- Concurrent request handling works properly
|
|
242
|
+
|
|
243
|
+
### Security
|
|
244
|
+
- No security vulnerabilities detected
|
|
245
|
+
- Authentication cannot be bypassed
|
|
246
|
+
- Authorization prevents unauthorized access
|
|
247
|
+
- Input validation prevents attacks
|
|
248
|
+
- Sensitive data is properly protected
|
|
249
|
+
|
|
250
|
+
### Maintainability
|
|
251
|
+
- Code is well-structured and readable
|
|
252
|
+
- Business logic is properly separated
|
|
253
|
+
- Dependencies are managed correctly
|
|
254
|
+
- Documentation is comprehensive
|
|
255
|
+
- Tests provide good coverage
|
|
256
|
+
|
|
257
|
+
This backend-specific execution framework ensures systematic, secure, and performant API development with comprehensive validation and testing.
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
# Execute: Frontend Development
|
|
2
|
+
|
|
3
|
+
## Frontend-Specific Implementation Framework
|
|
4
|
+
|
|
5
|
+
This specialized execution framework is optimized for frontend development tasks, focusing on user interface implementation, user experience optimization, and client-side functionality.
|
|
6
|
+
|
|
7
|
+
## Frontend Development Process
|
|
8
|
+
|
|
9
|
+
### Phase 1: Requirements Analysis
|
|
10
|
+
**Frontend-Specific Analysis:**
|
|
11
|
+
- User interface specifications and design requirements
|
|
12
|
+
- User experience goals and interaction patterns
|
|
13
|
+
- Component architecture and reusability needs
|
|
14
|
+
- State management requirements and data flow
|
|
15
|
+
- Performance requirements and optimization needs
|
|
16
|
+
- Accessibility requirements and compliance standards
|
|
17
|
+
|
|
18
|
+
**Questions to Address:**
|
|
19
|
+
- What UI components need to be implemented?
|
|
20
|
+
- What user interactions and workflows are required?
|
|
21
|
+
- How should application state be managed?
|
|
22
|
+
- What are the performance and accessibility requirements?
|
|
23
|
+
- What devices and browsers need to be supported?
|
|
24
|
+
- How should the frontend integrate with backend APIs?
|
|
25
|
+
|
|
26
|
+
### Phase 2: Architecture Design
|
|
27
|
+
**Frontend Architecture Planning:**
|
|
28
|
+
- Component hierarchy and atomic design principles
|
|
29
|
+
- State management strategy (Redux, Context, local state)
|
|
30
|
+
- Routing and navigation structure
|
|
31
|
+
- API integration patterns and data fetching
|
|
32
|
+
- Styling approach and design system integration
|
|
33
|
+
- Testing strategy for components and user interactions
|
|
34
|
+
|
|
35
|
+
**Design Decisions:**
|
|
36
|
+
- Choose appropriate component patterns and composition
|
|
37
|
+
- Define state management architecture and data flow
|
|
38
|
+
- Plan API integration and error handling strategies
|
|
39
|
+
- Establish styling patterns and design system usage
|
|
40
|
+
- Design responsive layouts and mobile-first approach
|
|
41
|
+
|
|
42
|
+
### Phase 3: Implementation
|
|
43
|
+
**Systematic Frontend Implementation:**
|
|
44
|
+
|
|
45
|
+
#### Component Implementation
|
|
46
|
+
```typescript
|
|
47
|
+
// Example component with TypeScript and accessibility
|
|
48
|
+
interface TaskCardProps {
|
|
49
|
+
task: Task;
|
|
50
|
+
onUpdate: (task: Task) => void;
|
|
51
|
+
onDelete: (id: string) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const TaskCard: React.FC<TaskCardProps> = ({ task, onUpdate, onDelete }) => {
|
|
55
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
className="bg-white rounded-lg shadow-md p-4 hover:shadow-lg transition-shadow"
|
|
60
|
+
role="article"
|
|
61
|
+
aria-labelledby={`task-title-${task.id}`}
|
|
62
|
+
>
|
|
63
|
+
<h3
|
|
64
|
+
id={`task-title-${task.id}`}
|
|
65
|
+
className="text-lg font-semibold text-gray-900"
|
|
66
|
+
>
|
|
67
|
+
{task.title}
|
|
68
|
+
</h3>
|
|
69
|
+
|
|
70
|
+
<p className="text-gray-600 mt-2">{task.description}</p>
|
|
71
|
+
|
|
72
|
+
<div className="flex justify-between items-center mt-4">
|
|
73
|
+
<span
|
|
74
|
+
className={`px-2 py-1 rounded text-sm ${getStatusColor(task.status)}`}
|
|
75
|
+
aria-label={`Status: ${task.status}`}
|
|
76
|
+
>
|
|
77
|
+
{task.status}
|
|
78
|
+
</span>
|
|
79
|
+
|
|
80
|
+
<div className="flex gap-2">
|
|
81
|
+
<button
|
|
82
|
+
onClick={() => setIsEditing(true)}
|
|
83
|
+
className="text-blue-600 hover:text-blue-800 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
84
|
+
aria-label={`Edit task: ${task.title}`}
|
|
85
|
+
>
|
|
86
|
+
Edit
|
|
87
|
+
</button>
|
|
88
|
+
<button
|
|
89
|
+
onClick={() => onDelete(task.id)}
|
|
90
|
+
className="text-red-600 hover:text-red-800 focus:outline-none focus:ring-2 focus:ring-red-500"
|
|
91
|
+
aria-label={`Delete task: ${task.title}`}
|
|
92
|
+
>
|
|
93
|
+
Delete
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### State Management Implementation
|
|
103
|
+
```typescript
|
|
104
|
+
// Redux Toolkit slice for task management
|
|
105
|
+
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
|
|
106
|
+
|
|
107
|
+
export const fetchTasks = createAsyncThunk(
|
|
108
|
+
'tasks/fetchTasks',
|
|
109
|
+
async (_, { rejectWithValue }) => {
|
|
110
|
+
try {
|
|
111
|
+
const response = await api.get('/tasks');
|
|
112
|
+
return response.data;
|
|
113
|
+
} catch (error) {
|
|
114
|
+
return rejectWithValue(error.response?.data || 'Failed to fetch tasks');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const tasksSlice = createSlice({
|
|
120
|
+
name: 'tasks',
|
|
121
|
+
initialState: {
|
|
122
|
+
items: [] as Task[],
|
|
123
|
+
loading: false,
|
|
124
|
+
error: null as string | null,
|
|
125
|
+
},
|
|
126
|
+
reducers: {
|
|
127
|
+
addTask: (state, action) => {
|
|
128
|
+
state.items.push(action.payload);
|
|
129
|
+
},
|
|
130
|
+
updateTask: (state, action) => {
|
|
131
|
+
const index = state.items.findIndex(task => task.id === action.payload.id);
|
|
132
|
+
if (index !== -1) {
|
|
133
|
+
state.items[index] = action.payload;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
removeTask: (state, action) => {
|
|
137
|
+
state.items = state.items.filter(task => task.id !== action.payload);
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
extraReducers: (builder) => {
|
|
141
|
+
builder
|
|
142
|
+
.addCase(fetchTasks.pending, (state) => {
|
|
143
|
+
state.loading = true;
|
|
144
|
+
state.error = null;
|
|
145
|
+
})
|
|
146
|
+
.addCase(fetchTasks.fulfilled, (state, action) => {
|
|
147
|
+
state.loading = false;
|
|
148
|
+
state.items = action.payload;
|
|
149
|
+
})
|
|
150
|
+
.addCase(fetchTasks.rejected, (state, action) => {
|
|
151
|
+
state.loading = false;
|
|
152
|
+
state.error = action.payload as string;
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### API Integration Implementation
|
|
159
|
+
```typescript
|
|
160
|
+
// RTK Query API integration
|
|
161
|
+
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
|
162
|
+
|
|
163
|
+
export const tasksApi = createApi({
|
|
164
|
+
reducerPath: 'tasksApi',
|
|
165
|
+
baseQuery: fetchBaseQuery({
|
|
166
|
+
baseUrl: '/api',
|
|
167
|
+
prepareHeaders: (headers, { getState }) => {
|
|
168
|
+
const token = (getState() as RootState).auth.token;
|
|
169
|
+
if (token) {
|
|
170
|
+
headers.set('authorization', `Bearer ${token}`);
|
|
171
|
+
}
|
|
172
|
+
return headers;
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
tagTypes: ['Task'],
|
|
176
|
+
endpoints: (builder) => ({
|
|
177
|
+
getTasks: builder.query<Task[], void>({
|
|
178
|
+
query: () => 'tasks',
|
|
179
|
+
providesTags: ['Task'],
|
|
180
|
+
}),
|
|
181
|
+
createTask: builder.mutation<Task, Partial<Task>>({
|
|
182
|
+
query: (newTask) => ({
|
|
183
|
+
url: 'tasks',
|
|
184
|
+
method: 'POST',
|
|
185
|
+
body: newTask,
|
|
186
|
+
}),
|
|
187
|
+
invalidatesTags: ['Task'],
|
|
188
|
+
}),
|
|
189
|
+
updateTask: builder.mutation<Task, { id: string; updates: Partial<Task> }>({
|
|
190
|
+
query: ({ id, updates }) => ({
|
|
191
|
+
url: `tasks/${id}`,
|
|
192
|
+
method: 'PATCH',
|
|
193
|
+
body: updates,
|
|
194
|
+
}),
|
|
195
|
+
invalidatesTags: ['Task'],
|
|
196
|
+
}),
|
|
197
|
+
}),
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Phase 4: Accessibility Implementation
|
|
202
|
+
**Frontend Accessibility Measures:**
|
|
203
|
+
- Semantic HTML structure and ARIA attributes
|
|
204
|
+
- Keyboard navigation and focus management
|
|
205
|
+
- Screen reader compatibility and announcements
|
|
206
|
+
- Color contrast and visual accessibility
|
|
207
|
+
- Touch target sizing for mobile devices
|
|
208
|
+
- Error messaging and form validation accessibility
|
|
209
|
+
|
|
210
|
+
**Accessibility Checklist:**
|
|
211
|
+
- [ ] Semantic HTML elements used appropriately
|
|
212
|
+
- [ ] ARIA attributes added where needed
|
|
213
|
+
- [ ] Keyboard navigation works for all interactions
|
|
214
|
+
- [ ] Focus indicators are visible and clear
|
|
215
|
+
- [ ] Color contrast meets WCAG standards
|
|
216
|
+
- [ ] Images have appropriate alt text
|
|
217
|
+
- [ ] Forms have proper labels and error messages
|
|
218
|
+
- [ ] Screen reader announcements are helpful
|
|
219
|
+
|
|
220
|
+
### Phase 5: Responsive Design Implementation
|
|
221
|
+
**Mobile-First Responsive Design:**
|
|
222
|
+
- Flexible grid systems and layout patterns
|
|
223
|
+
- Responsive typography and spacing
|
|
224
|
+
- Touch-friendly interaction design
|
|
225
|
+
- Performance optimization for mobile devices
|
|
226
|
+
- Progressive enhancement for larger screens
|
|
227
|
+
|
|
228
|
+
**Responsive Implementation:**
|
|
229
|
+
```css
|
|
230
|
+
/* Mobile-first responsive design */
|
|
231
|
+
.task-grid {
|
|
232
|
+
display: grid;
|
|
233
|
+
grid-template-columns: 1fr;
|
|
234
|
+
gap: 1rem;
|
|
235
|
+
padding: 1rem;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@media (min-width: 768px) {
|
|
239
|
+
.task-grid {
|
|
240
|
+
grid-template-columns: repeat(2, 1fr);
|
|
241
|
+
gap: 1.5rem;
|
|
242
|
+
padding: 1.5rem;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@media (min-width: 1024px) {
|
|
247
|
+
.task-grid {
|
|
248
|
+
grid-template-columns: repeat(3, 1fr);
|
|
249
|
+
gap: 2rem;
|
|
250
|
+
padding: 2rem;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Touch-friendly button sizing */
|
|
255
|
+
.touch-target {
|
|
256
|
+
min-height: 44px;
|
|
257
|
+
min-width: 44px;
|
|
258
|
+
padding: 0.75rem 1rem;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Phase 6: Testing Implementation
|
|
263
|
+
**Frontend Testing Strategy:**
|
|
264
|
+
- Unit tests for component logic and utilities
|
|
265
|
+
- Integration tests for component interactions
|
|
266
|
+
- Accessibility tests with jest-axe
|
|
267
|
+
- Visual regression tests with Storybook
|
|
268
|
+
- End-to-end tests for user workflows
|
|
269
|
+
- Performance tests for critical rendering paths
|
|
270
|
+
|
|
271
|
+
**Testing Examples:**
|
|
272
|
+
```typescript
|
|
273
|
+
// Component unit test
|
|
274
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
275
|
+
import { TaskCard } from './TaskCard';
|
|
276
|
+
|
|
277
|
+
describe('TaskCard', () => {
|
|
278
|
+
const mockTask = {
|
|
279
|
+
id: '1',
|
|
280
|
+
title: 'Test Task',
|
|
281
|
+
description: 'Test Description',
|
|
282
|
+
status: 'todo' as const,
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
it('renders task information correctly', () => {
|
|
286
|
+
render(<TaskCard task={mockTask} onUpdate={jest.fn()} onDelete={jest.fn()} />);
|
|
287
|
+
|
|
288
|
+
expect(screen.getByText('Test Task')).toBeInTheDocument();
|
|
289
|
+
expect(screen.getByText('Test Description')).toBeInTheDocument();
|
|
290
|
+
expect(screen.getByText('todo')).toBeInTheDocument();
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('calls onDelete when delete button is clicked', () => {
|
|
294
|
+
const onDelete = jest.fn();
|
|
295
|
+
render(<TaskCard task={mockTask} onUpdate={jest.fn()} onDelete={onDelete} />);
|
|
296
|
+
|
|
297
|
+
fireEvent.click(screen.getByLabelText('Delete task: Test Task'));
|
|
298
|
+
expect(onDelete).toHaveBeenCalledWith('1');
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Accessibility test
|
|
303
|
+
import { axe, toHaveNoViolations } from 'jest-axe';
|
|
304
|
+
|
|
305
|
+
expect.extend(toHaveNoViolations);
|
|
306
|
+
|
|
307
|
+
it('should not have accessibility violations', async () => {
|
|
308
|
+
const { container } = render(<TaskCard task={mockTask} onUpdate={jest.fn()} onDelete={jest.fn()} />);
|
|
309
|
+
const results = await axe(container);
|
|
310
|
+
expect(results).toHaveNoViolations();
|
|
311
|
+
});
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Phase 7: Performance Optimization
|
|
315
|
+
**Frontend Performance Considerations:**
|
|
316
|
+
- Code splitting and lazy loading
|
|
317
|
+
- Image optimization and lazy loading
|
|
318
|
+
- Bundle size optimization and tree shaking
|
|
319
|
+
- Memoization and re-render optimization
|
|
320
|
+
- Caching strategies for API data
|
|
321
|
+
- Core Web Vitals optimization
|
|
322
|
+
|
|
323
|
+
**Performance Implementation:**
|
|
324
|
+
```typescript
|
|
325
|
+
// Code splitting with React.lazy
|
|
326
|
+
const TaskModal = React.lazy(() => import('./TaskModal'));
|
|
327
|
+
|
|
328
|
+
// Memoization for expensive calculations
|
|
329
|
+
const TaskList = React.memo(({ tasks, filter }) => {
|
|
330
|
+
const filteredTasks = useMemo(() => {
|
|
331
|
+
return tasks.filter(task =>
|
|
332
|
+
filter === 'all' || task.status === filter
|
|
333
|
+
);
|
|
334
|
+
}, [tasks, filter]);
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
<div className="task-list">
|
|
338
|
+
{filteredTasks.map(task => (
|
|
339
|
+
<TaskCard key={task.id} task={task} />
|
|
340
|
+
))}
|
|
341
|
+
</div>
|
|
342
|
+
);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Image optimization
|
|
346
|
+
const OptimizedImage = ({ src, alt, ...props }) => (
|
|
347
|
+
<img
|
|
348
|
+
src={src}
|
|
349
|
+
alt={alt}
|
|
350
|
+
loading="lazy"
|
|
351
|
+
decoding="async"
|
|
352
|
+
{...props}
|
|
353
|
+
/>
|
|
354
|
+
);
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Phase 8: Documentation
|
|
358
|
+
**Frontend Documentation Requirements:**
|
|
359
|
+
- Component documentation with Storybook
|
|
360
|
+
- State management patterns and data flow
|
|
361
|
+
- API integration patterns and error handling
|
|
362
|
+
- Accessibility implementation guide
|
|
363
|
+
- Responsive design patterns and breakpoints
|
|
364
|
+
- Performance optimization techniques
|
|
365
|
+
|
|
366
|
+
## Frontend-Specific Validation Checklist
|
|
367
|
+
|
|
368
|
+
### User Interface Validation
|
|
369
|
+
- [ ] Components render correctly across browsers
|
|
370
|
+
- [ ] Responsive design works on all target devices
|
|
371
|
+
- [ ] Interactive elements provide appropriate feedback
|
|
372
|
+
- [ ] Loading states and error handling implemented
|
|
373
|
+
- [ ] Design system patterns followed consistently
|
|
374
|
+
- [ ] Typography and spacing follow design guidelines
|
|
375
|
+
|
|
376
|
+
### User Experience Validation
|
|
377
|
+
- [ ] User workflows are intuitive and efficient
|
|
378
|
+
- [ ] Navigation is clear and consistent
|
|
379
|
+
- [ ] Form validation provides helpful feedback
|
|
380
|
+
- [ ] Error messages are user-friendly
|
|
381
|
+
- [ ] Performance meets user expectations
|
|
382
|
+
- [ ] Accessibility supports all users
|
|
383
|
+
|
|
384
|
+
### Technical Validation
|
|
385
|
+
- [ ] State management is predictable and debuggable
|
|
386
|
+
- [ ] API integration handles all error scenarios
|
|
387
|
+
- [ ] Component architecture is maintainable
|
|
388
|
+
- [ ] Code splitting optimizes bundle size
|
|
389
|
+
- [ ] TypeScript types are comprehensive
|
|
390
|
+
- [ ] Testing coverage is adequate
|
|
391
|
+
|
|
392
|
+
### Performance Validation
|
|
393
|
+
- [ ] Initial page load is under 3 seconds
|
|
394
|
+
- [ ] Largest Contentful Paint is under 2.5 seconds
|
|
395
|
+
- [ ] First Input Delay is under 100ms
|
|
396
|
+
- [ ] Cumulative Layout Shift is under 0.1
|
|
397
|
+
- [ ] Bundle size is optimized
|
|
398
|
+
- [ ] Images are properly optimized
|
|
399
|
+
|
|
400
|
+
### Accessibility Validation
|
|
401
|
+
- [ ] WCAG 2.1 AA compliance achieved
|
|
402
|
+
- [ ] Keyboard navigation works completely
|
|
403
|
+
- [ ] Screen reader compatibility verified
|
|
404
|
+
- [ ] Color contrast meets standards
|
|
405
|
+
- [ ] Focus management is appropriate
|
|
406
|
+
- [ ] Error announcements are helpful
|
|
407
|
+
|
|
408
|
+
## Frontend Implementation Success Criteria
|
|
409
|
+
|
|
410
|
+
### Functionality
|
|
411
|
+
- All UI components work as designed
|
|
412
|
+
- User interactions behave as expected
|
|
413
|
+
- State management maintains data consistency
|
|
414
|
+
- API integration handles all scenarios correctly
|
|
415
|
+
- Error handling provides useful feedback
|
|
416
|
+
|
|
417
|
+
### User Experience
|
|
418
|
+
- Interface is intuitive and easy to use
|
|
419
|
+
- Performance meets user expectations
|
|
420
|
+
- Responsive design works on all devices
|
|
421
|
+
- Accessibility supports diverse users
|
|
422
|
+
- Visual design is polished and consistent
|
|
423
|
+
|
|
424
|
+
### Technical Quality
|
|
425
|
+
- Code is well-structured and maintainable
|
|
426
|
+
- Components are reusable and composable
|
|
427
|
+
- State management is predictable
|
|
428
|
+
- Testing provides confidence in changes
|
|
429
|
+
- Performance is optimized for target devices
|
|
430
|
+
|
|
431
|
+
### Standards Compliance
|
|
432
|
+
- Accessibility standards are met
|
|
433
|
+
- Browser compatibility is ensured
|
|
434
|
+
- Performance benchmarks are achieved
|
|
435
|
+
- Code quality standards are followed
|
|
436
|
+
- Design system patterns are implemented
|
|
437
|
+
|
|
438
|
+
This frontend-specific execution framework ensures systematic, accessible, and performant user interface development with comprehensive validation and testing.
|