specweave 0.23.14 → 0.23.16
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.md +55 -0
- package/dist/src/core/spec-detector.d.ts +5 -0
- package/dist/src/core/spec-detector.d.ts.map +1 -1
- package/dist/src/core/spec-detector.js +91 -33
- package/dist/src/core/spec-detector.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave-github/.claude-plugin/plugin.json +15 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +16 -0
- package/plugins/specweave-github/hooks/post-task-completion.sh +53 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +24 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +0 -626
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +0 -208
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
- package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +0 -1010
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-cost-optimizer/skills/cost-optimizer/SKILL.md +0 -190
- package/plugins/specweave-docs/.claude-plugin/plugin.json +0 -19
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +0 -613
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/README.md +0 -264
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +0 -439
- package/plugins/specweave-docs/skills/spec-driven-debugging/README.md +0 -479
- package/plugins/specweave-docs/skills/spec-driven-debugging/SKILL.md +0 -652
- package/plugins/specweave-figma/.claude-plugin/.mcp.json +0 -12
- package/plugins/specweave-figma/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-figma/ARCHITECTURE.md +0 -453
- package/plugins/specweave-figma/README.md +0 -728
- package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +0 -632
- package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +0 -29
- package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +0 -27
- package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +0 -28
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +0 -21
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +0 -107
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +0 -177
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +0 -176
- package/plugins/specweave-testing/.claude-plugin/plugin.json +0 -20
- package/plugins/specweave-testing/skills/e2e-playwright/README.md +0 -506
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +0 -457
- package/plugins/specweave-testing/skills/e2e-playwright/execute.js +0 -373
- package/plugins/specweave-testing/skills/e2e-playwright/lib/utils.js +0 -514
- package/plugins/specweave-testing/skills/e2e-playwright/package.json +0 -33
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +0 -19
- package/plugins/specweave-tooling/skills/skill-creator/LICENSE.txt +0 -202
- package/plugins/specweave-tooling/skills/skill-creator/SKILL.md +0 -209
- package/plugins/specweave-tooling/skills/skill-creator/scripts/init_skill.py +0 -303
- package/plugins/specweave-tooling/skills/skill-creator/scripts/package_skill.py +0 -110
- package/plugins/specweave-tooling/skills/skill-creator/scripts/quick_validate.py +0 -65
- package/plugins/specweave-tooling/skills/skill-router/SKILL.md +0 -479
- package/plugins/specweave-ui/.claude-plugin/plugin.json +0 -26
- package/plugins/specweave-ui/.mcp.json +0 -10
- package/plugins/specweave-ui/README.md +0 -492
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +0 -676
package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js
DELETED
|
@@ -1,1149 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* BMAD Template Generator
|
|
5
|
-
*
|
|
6
|
-
* Generates starter templates for BMAD documents
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
|
|
12
|
-
const TEMPLATES = {
|
|
13
|
-
prd: {
|
|
14
|
-
name: 'Product Requirements Document (PRD)',
|
|
15
|
-
filename: 'docs/prd.md',
|
|
16
|
-
content: `# Product Requirements Document (PRD)
|
|
17
|
-
|
|
18
|
-
## Project Overview
|
|
19
|
-
|
|
20
|
-
**Project Name:** [Your Project Name]
|
|
21
|
-
**Version:** 1.0
|
|
22
|
-
**Date:** ${new Date().toISOString().split('T')[0]}
|
|
23
|
-
**Product Manager:** [Name]
|
|
24
|
-
**Status:** Draft
|
|
25
|
-
|
|
26
|
-
### Executive Summary
|
|
27
|
-
|
|
28
|
-
[Brief overview of the product - what it is, why it exists, and what problem it solves]
|
|
29
|
-
|
|
30
|
-
### Goals and Objectives
|
|
31
|
-
|
|
32
|
-
1. [Primary goal]
|
|
33
|
-
2. [Secondary goal]
|
|
34
|
-
3. [Additional objectives]
|
|
35
|
-
|
|
36
|
-
## Target Audience
|
|
37
|
-
|
|
38
|
-
### Primary Users
|
|
39
|
-
- [User persona 1]: [Description]
|
|
40
|
-
- [User persona 2]: [Description]
|
|
41
|
-
|
|
42
|
-
### Secondary Users
|
|
43
|
-
- [Stakeholder type]: [Description]
|
|
44
|
-
|
|
45
|
-
## Functional Requirements
|
|
46
|
-
|
|
47
|
-
### Core Features
|
|
48
|
-
|
|
49
|
-
#### Feature 1: [Feature Name]
|
|
50
|
-
**Description:** [What this feature does]
|
|
51
|
-
**Priority:** [High/Medium/Low]
|
|
52
|
-
**User Story:** As a [user type], I want to [action] so that [benefit]
|
|
53
|
-
|
|
54
|
-
**Acceptance Criteria:**
|
|
55
|
-
- [ ] [Criterion 1]
|
|
56
|
-
- [ ] [Criterion 2]
|
|
57
|
-
- [ ] [Criterion 3]
|
|
58
|
-
|
|
59
|
-
#### Feature 2: [Feature Name]
|
|
60
|
-
**Description:** [What this feature does]
|
|
61
|
-
**Priority:** [High/Medium/Low]
|
|
62
|
-
**User Story:** As a [user type], I want to [action] so that [benefit]
|
|
63
|
-
|
|
64
|
-
**Acceptance Criteria:**
|
|
65
|
-
- [ ] [Criterion 1]
|
|
66
|
-
- [ ] [Criterion 2]
|
|
67
|
-
|
|
68
|
-
## Non-Functional Requirements
|
|
69
|
-
|
|
70
|
-
### Performance
|
|
71
|
-
- [Performance requirement 1]
|
|
72
|
-
- [Performance requirement 2]
|
|
73
|
-
|
|
74
|
-
### Security
|
|
75
|
-
- [Security requirement 1]
|
|
76
|
-
- [Security requirement 2]
|
|
77
|
-
|
|
78
|
-
### Scalability
|
|
79
|
-
- [Scalability requirement 1]
|
|
80
|
-
|
|
81
|
-
### Reliability
|
|
82
|
-
- [Reliability requirement 1]
|
|
83
|
-
|
|
84
|
-
### Usability
|
|
85
|
-
- [Usability requirement 1]
|
|
86
|
-
|
|
87
|
-
### Maintainability
|
|
88
|
-
- [Maintainability requirement 1]
|
|
89
|
-
|
|
90
|
-
## Epics
|
|
91
|
-
|
|
92
|
-
### Epic 1: [Epic Name]
|
|
93
|
-
**Description:** [High-level description of this epic]
|
|
94
|
-
|
|
95
|
-
**User Stories:**
|
|
96
|
-
1. As a [user], I want to [action] so that [benefit]
|
|
97
|
-
2. As a [user], I want to [action] so that [benefit]
|
|
98
|
-
|
|
99
|
-
### Epic 2: [Epic Name]
|
|
100
|
-
**Description:** [High-level description of this epic]
|
|
101
|
-
|
|
102
|
-
**User Stories:**
|
|
103
|
-
1. As a [user], I want to [action] so that [benefit]
|
|
104
|
-
2. As a [user], I want to [action] so that [benefit]
|
|
105
|
-
|
|
106
|
-
## User Stories
|
|
107
|
-
|
|
108
|
-
### Story 1: [Story Title]
|
|
109
|
-
**Epic:** [Parent Epic]
|
|
110
|
-
**Priority:** P0/P1/P2
|
|
111
|
-
**Story Points:** [Estimate]
|
|
112
|
-
|
|
113
|
-
**Description:**
|
|
114
|
-
As a [user type]
|
|
115
|
-
I want to [action]
|
|
116
|
-
So that [benefit]
|
|
117
|
-
|
|
118
|
-
**Acceptance Criteria:**
|
|
119
|
-
- [ ] Given [context], when [action], then [outcome]
|
|
120
|
-
- [ ] Given [context], when [action], then [outcome]
|
|
121
|
-
|
|
122
|
-
**Technical Notes:**
|
|
123
|
-
- [Technical consideration 1]
|
|
124
|
-
- [Technical consideration 2]
|
|
125
|
-
|
|
126
|
-
## Dependencies
|
|
127
|
-
|
|
128
|
-
### External Dependencies
|
|
129
|
-
- [Dependency 1]: [Description]
|
|
130
|
-
- [Dependency 2]: [Description]
|
|
131
|
-
|
|
132
|
-
### Internal Dependencies
|
|
133
|
-
- [Team/Component dependency]
|
|
134
|
-
|
|
135
|
-
## Timeline
|
|
136
|
-
|
|
137
|
-
### Phase 1: [Phase Name]
|
|
138
|
-
- Duration: [Timeframe]
|
|
139
|
-
- Deliverables: [What will be completed]
|
|
140
|
-
|
|
141
|
-
### Phase 2: [Phase Name]
|
|
142
|
-
- Duration: [Timeframe]
|
|
143
|
-
- Deliverables: [What will be completed]
|
|
144
|
-
|
|
145
|
-
## Success Metrics
|
|
146
|
-
|
|
147
|
-
### Key Performance Indicators (KPIs)
|
|
148
|
-
1. [Metric 1]: [Target]
|
|
149
|
-
2. [Metric 2]: [Target]
|
|
150
|
-
3. [Metric 3]: [Target]
|
|
151
|
-
|
|
152
|
-
### Success Criteria
|
|
153
|
-
- [ ] [Success criterion 1]
|
|
154
|
-
- [ ] [Success criterion 2]
|
|
155
|
-
- [ ] [Success criterion 3]
|
|
156
|
-
|
|
157
|
-
## Risks and Mitigation
|
|
158
|
-
|
|
159
|
-
### Risk 1: [Risk Description]
|
|
160
|
-
- **Probability:** [High/Medium/Low]
|
|
161
|
-
- **Impact:** [High/Medium/Low]
|
|
162
|
-
- **Mitigation:** [How to address]
|
|
163
|
-
|
|
164
|
-
### Risk 2: [Risk Description]
|
|
165
|
-
- **Probability:** [High/Medium/Low]
|
|
166
|
-
- **Impact:** [High/Medium/Low]
|
|
167
|
-
- **Mitigation:** [How to address]
|
|
168
|
-
|
|
169
|
-
## Open Questions
|
|
170
|
-
|
|
171
|
-
1. [Question 1]
|
|
172
|
-
2. [Question 2]
|
|
173
|
-
|
|
174
|
-
## Appendix
|
|
175
|
-
|
|
176
|
-
### Glossary
|
|
177
|
-
- **[Term 1]:** [Definition]
|
|
178
|
-
- **[Term 2]:** [Definition]
|
|
179
|
-
|
|
180
|
-
### References
|
|
181
|
-
- [Reference 1]
|
|
182
|
-
- [Reference 2]
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
**Document History:**
|
|
187
|
-
- ${new Date().toISOString().split('T')[0]}: Initial draft
|
|
188
|
-
`
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
architecture: {
|
|
192
|
-
name: 'Architecture Document',
|
|
193
|
-
filename: 'docs/architecture.md',
|
|
194
|
-
content: `# System Architecture Document
|
|
195
|
-
|
|
196
|
-
## Project Information
|
|
197
|
-
|
|
198
|
-
**Project Name:** [Your Project Name]
|
|
199
|
-
**Version:** 1.0
|
|
200
|
-
**Date:** ${new Date().toISOString().split('T')[0]}
|
|
201
|
-
**Architect:** [Name]
|
|
202
|
-
**Status:** Draft
|
|
203
|
-
|
|
204
|
-
## Executive Summary
|
|
205
|
-
|
|
206
|
-
[High-level overview of the system architecture and key design decisions]
|
|
207
|
-
|
|
208
|
-
## Architecture Overview
|
|
209
|
-
|
|
210
|
-
### System Context
|
|
211
|
-
|
|
212
|
-
[Describe how this system fits into the larger ecosystem - external systems, users, integrations]
|
|
213
|
-
|
|
214
|
-
### Architectural Style
|
|
215
|
-
|
|
216
|
-
**Pattern:** [e.g., Microservices, Monolithic, Serverless, Event-Driven, etc.]
|
|
217
|
-
|
|
218
|
-
**Rationale:** [Why this architectural style was chosen]
|
|
219
|
-
|
|
220
|
-
## Technology Stack
|
|
221
|
-
|
|
222
|
-
### Frontend
|
|
223
|
-
- **Framework:** [e.g., React, Vue, Angular]
|
|
224
|
-
- **Language:** [e.g., TypeScript, JavaScript]
|
|
225
|
-
- **Build Tool:** [e.g., Vite, Webpack]
|
|
226
|
-
- **State Management:** [e.g., Redux, Zustand, Context API]
|
|
227
|
-
- **UI Library:** [e.g., Material-UI, Tailwind CSS]
|
|
228
|
-
|
|
229
|
-
### Backend
|
|
230
|
-
- **Framework:** [e.g., Express, FastAPI, Django]
|
|
231
|
-
- **Language:** [e.g., Node.js, Python, Go]
|
|
232
|
-
- **Runtime:** [e.g., Node.js v20+, Python 3.11+]
|
|
233
|
-
- **API Style:** [e.g., REST, GraphQL, gRPC]
|
|
234
|
-
|
|
235
|
-
### Database
|
|
236
|
-
- **Primary Database:** [e.g., PostgreSQL, MongoDB]
|
|
237
|
-
- **Caching Layer:** [e.g., Redis, Memcached]
|
|
238
|
-
- **Search Engine:** [e.g., Elasticsearch] (if applicable)
|
|
239
|
-
|
|
240
|
-
### Infrastructure
|
|
241
|
-
- **Hosting:** [e.g., AWS, GCP, Azure, Vercel]
|
|
242
|
-
- **Container Orchestration:** [e.g., Kubernetes, Docker Compose]
|
|
243
|
-
- **CI/CD:** [e.g., GitHub Actions, GitLab CI]
|
|
244
|
-
- **Monitoring:** [e.g., Datadog, New Relic, Prometheus]
|
|
245
|
-
|
|
246
|
-
### Authentication & Security
|
|
247
|
-
- **Auth Method:** [e.g., JWT, OAuth 2.0, Session-based]
|
|
248
|
-
- **Identity Provider:** [e.g., Auth0, Cognito, custom]
|
|
249
|
-
- **Secrets Management:** [e.g., AWS Secrets Manager, HashiCorp Vault]
|
|
250
|
-
|
|
251
|
-
## System Components
|
|
252
|
-
|
|
253
|
-
### Component 1: [Component Name]
|
|
254
|
-
|
|
255
|
-
**Purpose:** [What this component does]
|
|
256
|
-
|
|
257
|
-
**Responsibilities:**
|
|
258
|
-
- [Responsibility 1]
|
|
259
|
-
- [Responsibility 2]
|
|
260
|
-
|
|
261
|
-
**Technology:** [Technologies used]
|
|
262
|
-
|
|
263
|
-
**Interfaces:**
|
|
264
|
-
- [API endpoints or communication methods]
|
|
265
|
-
|
|
266
|
-
**Dependencies:**
|
|
267
|
-
- [Other components or services this depends on]
|
|
268
|
-
|
|
269
|
-
### Component 2: [Component Name]
|
|
270
|
-
|
|
271
|
-
**Purpose:** [What this component does]
|
|
272
|
-
|
|
273
|
-
**Responsibilities:**
|
|
274
|
-
- [Responsibility 1]
|
|
275
|
-
- [Responsibility 2]
|
|
276
|
-
|
|
277
|
-
**Technology:** [Technologies used]
|
|
278
|
-
|
|
279
|
-
## Data Architecture
|
|
280
|
-
|
|
281
|
-
### Data Models
|
|
282
|
-
|
|
283
|
-
#### Entity 1: [Entity Name]
|
|
284
|
-
|
|
285
|
-
\`\`\`
|
|
286
|
-
{
|
|
287
|
-
"id": "uuid",
|
|
288
|
-
"field1": "type",
|
|
289
|
-
"field2": "type",
|
|
290
|
-
"createdAt": "timestamp",
|
|
291
|
-
"updatedAt": "timestamp"
|
|
292
|
-
}
|
|
293
|
-
\`\`\`
|
|
294
|
-
|
|
295
|
-
#### Entity 2: [Entity Name]
|
|
296
|
-
|
|
297
|
-
\`\`\`
|
|
298
|
-
{
|
|
299
|
-
"id": "uuid",
|
|
300
|
-
"field1": "type",
|
|
301
|
-
"field2": "type"
|
|
302
|
-
}
|
|
303
|
-
\`\`\`
|
|
304
|
-
|
|
305
|
-
### Database Schema
|
|
306
|
-
|
|
307
|
-
[Describe tables, relationships, indexes, constraints]
|
|
308
|
-
|
|
309
|
-
### Data Flow
|
|
310
|
-
|
|
311
|
-
1. [Step 1 of data flow]
|
|
312
|
-
2. [Step 2 of data flow]
|
|
313
|
-
3. [Step 3 of data flow]
|
|
314
|
-
|
|
315
|
-
## API Design
|
|
316
|
-
|
|
317
|
-
### REST API Endpoints
|
|
318
|
-
|
|
319
|
-
#### User Management
|
|
320
|
-
|
|
321
|
-
\`\`\`
|
|
322
|
-
POST /api/v1/users Create user
|
|
323
|
-
GET /api/v1/users/:id Get user by ID
|
|
324
|
-
PUT /api/v1/users/:id Update user
|
|
325
|
-
DELETE /api/v1/users/:id Delete user
|
|
326
|
-
GET /api/v1/users List users
|
|
327
|
-
\`\`\`
|
|
328
|
-
|
|
329
|
-
#### [Other Resource]
|
|
330
|
-
|
|
331
|
-
\`\`\`
|
|
332
|
-
POST /api/v1/[resource] Create
|
|
333
|
-
GET /api/v1/[resource]/:id Get by ID
|
|
334
|
-
PUT /api/v1/[resource]/:id Update
|
|
335
|
-
DELETE /api/v1/[resource]/:id Delete
|
|
336
|
-
GET /api/v1/[resource] List
|
|
337
|
-
\`\`\`
|
|
338
|
-
|
|
339
|
-
### API Authentication
|
|
340
|
-
|
|
341
|
-
- **Method:** [JWT bearer token, API keys, etc.]
|
|
342
|
-
- **Token Expiration:** [e.g., 1 hour]
|
|
343
|
-
- **Refresh Strategy:** [How tokens are refreshed]
|
|
344
|
-
|
|
345
|
-
### Error Handling
|
|
346
|
-
|
|
347
|
-
\`\`\`json
|
|
348
|
-
{
|
|
349
|
-
"error": {
|
|
350
|
-
"code": "ERROR_CODE",
|
|
351
|
-
"message": "Human readable message",
|
|
352
|
-
"details": {}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
\`\`\`
|
|
356
|
-
|
|
357
|
-
## Security Architecture
|
|
358
|
-
|
|
359
|
-
### Authentication Flow
|
|
360
|
-
1. [Step 1]
|
|
361
|
-
2. [Step 2]
|
|
362
|
-
3. [Step 3]
|
|
363
|
-
|
|
364
|
-
### Authorization Model
|
|
365
|
-
- **Model:** [e.g., RBAC, ABAC, ACL]
|
|
366
|
-
- **Roles:** [List of roles and permissions]
|
|
367
|
-
|
|
368
|
-
### Security Measures
|
|
369
|
-
- [ ] HTTPS/TLS encryption
|
|
370
|
-
- [ ] Input validation and sanitization
|
|
371
|
-
- [ ] SQL injection prevention
|
|
372
|
-
- [ ] XSS protection
|
|
373
|
-
- [ ] CSRF protection
|
|
374
|
-
- [ ] Rate limiting
|
|
375
|
-
- [ ] Password hashing (bcrypt/argon2)
|
|
376
|
-
- [ ] Secrets management
|
|
377
|
-
- [ ] Security headers
|
|
378
|
-
- [ ] API authentication
|
|
379
|
-
- [ ] Audit logging
|
|
380
|
-
|
|
381
|
-
## Deployment Architecture
|
|
382
|
-
|
|
383
|
-
### Environments
|
|
384
|
-
|
|
385
|
-
#### Development
|
|
386
|
-
- **URL:** [dev.example.com]
|
|
387
|
-
- **Purpose:** [Development and testing]
|
|
388
|
-
|
|
389
|
-
#### Staging
|
|
390
|
-
- **URL:** [staging.example.com]
|
|
391
|
-
- **Purpose:** [Pre-production testing]
|
|
392
|
-
|
|
393
|
-
#### Production
|
|
394
|
-
- **URL:** [example.com]
|
|
395
|
-
- **Purpose:** [Live production system]
|
|
396
|
-
|
|
397
|
-
### Deployment Strategy
|
|
398
|
-
|
|
399
|
-
**Approach:** [e.g., Blue-Green, Canary, Rolling]
|
|
400
|
-
|
|
401
|
-
**Process:**
|
|
402
|
-
1. [Step 1]
|
|
403
|
-
2. [Step 2]
|
|
404
|
-
3. [Step 3]
|
|
405
|
-
|
|
406
|
-
### Scaling Strategy
|
|
407
|
-
|
|
408
|
-
- **Horizontal Scaling:** [How and when to scale out]
|
|
409
|
-
- **Vertical Scaling:** [Resource limits and upgrades]
|
|
410
|
-
- **Auto-scaling Rules:** [CPU, memory, request thresholds]
|
|
411
|
-
|
|
412
|
-
## Performance Considerations
|
|
413
|
-
|
|
414
|
-
### Optimization Strategies
|
|
415
|
-
- [Strategy 1: e.g., Database indexing]
|
|
416
|
-
- [Strategy 2: e.g., Caching frequently accessed data]
|
|
417
|
-
- [Strategy 3: e.g., CDN for static assets]
|
|
418
|
-
|
|
419
|
-
### Performance Targets
|
|
420
|
-
- **API Response Time:** [e.g., <200ms for 95th percentile]
|
|
421
|
-
- **Page Load Time:** [e.g., <2s for First Contentful Paint]
|
|
422
|
-
- **Throughput:** [e.g., 1000 requests/second]
|
|
423
|
-
- **Concurrent Users:** [e.g., 10,000 concurrent users]
|
|
424
|
-
|
|
425
|
-
## Monitoring and Observability
|
|
426
|
-
|
|
427
|
-
### Metrics
|
|
428
|
-
- [Metric 1: e.g., Request rate]
|
|
429
|
-
- [Metric 2: e.g., Error rate]
|
|
430
|
-
- [Metric 3: e.g., Response time]
|
|
431
|
-
|
|
432
|
-
### Logging
|
|
433
|
-
- **Log Aggregation:** [Tool/service]
|
|
434
|
-
- **Log Retention:** [Duration]
|
|
435
|
-
- **Log Levels:** [DEBUG, INFO, WARN, ERROR]
|
|
436
|
-
|
|
437
|
-
### Alerting
|
|
438
|
-
- [Alert 1: Condition and notification]
|
|
439
|
-
- [Alert 2: Condition and notification]
|
|
440
|
-
|
|
441
|
-
## Disaster Recovery
|
|
442
|
-
|
|
443
|
-
### Backup Strategy
|
|
444
|
-
- **Frequency:** [e.g., Daily automated backups]
|
|
445
|
-
- **Retention:** [e.g., 30 days]
|
|
446
|
-
- **Storage:** [Where backups are stored]
|
|
447
|
-
|
|
448
|
-
### Recovery Procedures
|
|
449
|
-
1. [Step 1]
|
|
450
|
-
2. [Step 2]
|
|
451
|
-
3. [Step 3]
|
|
452
|
-
|
|
453
|
-
### RTO and RPO
|
|
454
|
-
- **Recovery Time Objective (RTO):** [e.g., 4 hours]
|
|
455
|
-
- **Recovery Point Objective (RPO):** [e.g., 1 hour]
|
|
456
|
-
|
|
457
|
-
## Design Patterns
|
|
458
|
-
|
|
459
|
-
### Pattern 1: [Pattern Name]
|
|
460
|
-
- **Use Case:** [When this pattern is used]
|
|
461
|
-
- **Implementation:** [How it's implemented]
|
|
462
|
-
|
|
463
|
-
### Pattern 2: [Pattern Name]
|
|
464
|
-
- **Use Case:** [When this pattern is used]
|
|
465
|
-
- **Implementation:** [How it's implemented]
|
|
466
|
-
|
|
467
|
-
## Technical Debt and Future Considerations
|
|
468
|
-
|
|
469
|
-
### Known Technical Debt
|
|
470
|
-
1. [Item 1: Description and plan to address]
|
|
471
|
-
2. [Item 2: Description and plan to address]
|
|
472
|
-
|
|
473
|
-
### Future Enhancements
|
|
474
|
-
1. [Enhancement 1]
|
|
475
|
-
2. [Enhancement 2]
|
|
476
|
-
|
|
477
|
-
## Dependencies and Integrations
|
|
478
|
-
|
|
479
|
-
### External Services
|
|
480
|
-
- **[Service 1]:** [Purpose and integration details]
|
|
481
|
-
- **[Service 2]:** [Purpose and integration details]
|
|
482
|
-
|
|
483
|
-
### Third-Party Libraries
|
|
484
|
-
- [Library 1]: [Version and purpose]
|
|
485
|
-
- [Library 2]: [Version and purpose]
|
|
486
|
-
|
|
487
|
-
## Coding Standards
|
|
488
|
-
|
|
489
|
-
### Code Style
|
|
490
|
-
- **Linting:** [e.g., ESLint, Pylint]
|
|
491
|
-
- **Formatting:** [e.g., Prettier, Black]
|
|
492
|
-
- **Style Guide:** [Reference to style guide]
|
|
493
|
-
|
|
494
|
-
### Testing Standards
|
|
495
|
-
- **Unit Test Coverage:** [e.g., 80% minimum]
|
|
496
|
-
- **Integration Tests:** [Requirements]
|
|
497
|
-
- **E2E Tests:** [Critical paths to test]
|
|
498
|
-
|
|
499
|
-
### Code Review Process
|
|
500
|
-
1. [Step 1]
|
|
501
|
-
2. [Step 2]
|
|
502
|
-
3. [Step 3]
|
|
503
|
-
|
|
504
|
-
## Appendix
|
|
505
|
-
|
|
506
|
-
### Glossary
|
|
507
|
-
- **[Term 1]:** [Definition]
|
|
508
|
-
- **[Term 2]:** [Definition]
|
|
509
|
-
|
|
510
|
-
### References
|
|
511
|
-
- [Architecture decision record 1]
|
|
512
|
-
- [External documentation]
|
|
513
|
-
|
|
514
|
-
### Diagrams
|
|
515
|
-
[Links to architecture diagrams - consider using Mermaid, PlantUML, or C4]
|
|
516
|
-
|
|
517
|
-
---
|
|
518
|
-
|
|
519
|
-
**Document History:**
|
|
520
|
-
- ${new Date().toISOString().split('T')[0]}: Initial draft
|
|
521
|
-
`
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
story: {
|
|
525
|
-
name: 'User Story',
|
|
526
|
-
filename: 'docs/stories/story-template.md',
|
|
527
|
-
content: `# User Story: [Story Title]
|
|
528
|
-
|
|
529
|
-
**Story ID:** [e.g., US-001]
|
|
530
|
-
**Epic:** [Parent Epic Name]
|
|
531
|
-
**Priority:** [P0/P1/P2]
|
|
532
|
-
**Status:** [Draft/In Progress/Review/Complete]
|
|
533
|
-
**Story Points:** [Estimate]
|
|
534
|
-
**Assigned To:** [Developer name or @dev]
|
|
535
|
-
**Created:** ${new Date().toISOString().split('T')[0]}
|
|
536
|
-
|
|
537
|
-
## Story Description
|
|
538
|
-
|
|
539
|
-
**As a** [user type/role]
|
|
540
|
-
**I want to** [action/feature]
|
|
541
|
-
**So that** [benefit/value]
|
|
542
|
-
|
|
543
|
-
## Context
|
|
544
|
-
|
|
545
|
-
[Provide background information about why this story is needed and how it fits into the larger product vision]
|
|
546
|
-
|
|
547
|
-
## Acceptance Criteria
|
|
548
|
-
|
|
549
|
-
### Functional Requirements
|
|
550
|
-
- [ ] **AC1:** Given [context], when [action], then [expected outcome]
|
|
551
|
-
- [ ] **AC2:** Given [context], when [action], then [expected outcome]
|
|
552
|
-
- [ ] **AC3:** Given [context], when [action], then [expected outcome]
|
|
553
|
-
|
|
554
|
-
### Non-Functional Requirements
|
|
555
|
-
- [ ] **NFR1:** [Performance requirement, e.g., "Response time < 200ms"]
|
|
556
|
-
- [ ] **NFR2:** [Security requirement]
|
|
557
|
-
- [ ] **NFR3:** [Accessibility requirement]
|
|
558
|
-
|
|
559
|
-
### Quality Criteria
|
|
560
|
-
- [ ] Unit tests written and passing (coverage ≥ 80%)
|
|
561
|
-
- [ ] Integration tests cover main workflows
|
|
562
|
-
- [ ] Code reviewed and approved
|
|
563
|
-
- [ ] Documentation updated
|
|
564
|
-
- [ ] No critical or high-severity issues
|
|
565
|
-
|
|
566
|
-
## Technical Details
|
|
567
|
-
|
|
568
|
-
### Architectural Context
|
|
569
|
-
|
|
570
|
-
[Reference relevant sections from architecture.md]
|
|
571
|
-
|
|
572
|
-
**Components Affected:**
|
|
573
|
-
- [Component 1]: [What changes]
|
|
574
|
-
- [Component 2]: [What changes]
|
|
575
|
-
|
|
576
|
-
**Dependencies:**
|
|
577
|
-
- [Dependency 1]: [Description]
|
|
578
|
-
- [Dependency 2]: [Description]
|
|
579
|
-
|
|
580
|
-
### Implementation Approach
|
|
581
|
-
|
|
582
|
-
1. [Step 1: What to implement]
|
|
583
|
-
2. [Step 2: What to implement]
|
|
584
|
-
3. [Step 3: What to implement]
|
|
585
|
-
|
|
586
|
-
### Database Changes
|
|
587
|
-
|
|
588
|
-
\`\`\`sql
|
|
589
|
-
-- New tables, columns, or migrations needed
|
|
590
|
-
[SQL schema changes if applicable]
|
|
591
|
-
\`\`\`
|
|
592
|
-
|
|
593
|
-
### API Changes
|
|
594
|
-
|
|
595
|
-
\`\`\`
|
|
596
|
-
[New or modified API endpoints]
|
|
597
|
-
POST /api/v1/[resource]
|
|
598
|
-
GET /api/v1/[resource]/:id
|
|
599
|
-
\`\`\`
|
|
600
|
-
|
|
601
|
-
### Files to Modify
|
|
602
|
-
|
|
603
|
-
- [ ] \`src/components/[ComponentName].tsx\`
|
|
604
|
-
- [ ] \`src/services/[ServiceName].ts\`
|
|
605
|
-
- [ ] \`src/api/[EndpointName].ts\`
|
|
606
|
-
- [ ] \`tests/[TestFile].test.ts\`
|
|
607
|
-
|
|
608
|
-
## Testing Strategy
|
|
609
|
-
|
|
610
|
-
### Unit Tests
|
|
611
|
-
- [ ] Test [functionality 1]
|
|
612
|
-
- [ ] Test [functionality 2]
|
|
613
|
-
- [ ] Test error handling
|
|
614
|
-
- [ ] Test edge cases
|
|
615
|
-
|
|
616
|
-
### Integration Tests
|
|
617
|
-
- [ ] Test [workflow 1]
|
|
618
|
-
- [ ] Test [workflow 2]
|
|
619
|
-
|
|
620
|
-
### Manual Testing Checklist
|
|
621
|
-
- [ ] [Manual test step 1]
|
|
622
|
-
- [ ] [Manual test step 2]
|
|
623
|
-
- [ ] Test in different browsers
|
|
624
|
-
- [ ] Test responsive design
|
|
625
|
-
|
|
626
|
-
## Risk Assessment
|
|
627
|
-
|
|
628
|
-
**Risk Level:** [Low/Medium/High]
|
|
629
|
-
|
|
630
|
-
### Identified Risks
|
|
631
|
-
1. **[Risk 1]:** [Description]
|
|
632
|
-
- **Mitigation:** [How to address]
|
|
633
|
-
|
|
634
|
-
2. **[Risk 2]:** [Description]
|
|
635
|
-
- **Mitigation:** [How to address]
|
|
636
|
-
|
|
637
|
-
## Design/UI Considerations
|
|
638
|
-
|
|
639
|
-
[Any UI mockups, wireframes, or design system references]
|
|
640
|
-
|
|
641
|
-
**Design Files:** [Link to Figma/design files]
|
|
642
|
-
|
|
643
|
-
## Related Stories
|
|
644
|
-
|
|
645
|
-
- **Depends On:** [Story IDs that must be completed first]
|
|
646
|
-
- **Related To:** [Related story IDs]
|
|
647
|
-
- **Blocks:** [Story IDs that are blocked by this one]
|
|
648
|
-
|
|
649
|
-
## QA Notes
|
|
650
|
-
|
|
651
|
-
### Risk Profile
|
|
652
|
-
[Results from @qa *risk assessment]
|
|
653
|
-
|
|
654
|
-
### Test Design
|
|
655
|
-
[Results from @qa *design assessment]
|
|
656
|
-
|
|
657
|
-
### Traceability Matrix
|
|
658
|
-
[Results from @qa *trace assessment]
|
|
659
|
-
|
|
660
|
-
## Development Notes
|
|
661
|
-
|
|
662
|
-
### Implementation Progress
|
|
663
|
-
- [Date]: [What was implemented]
|
|
664
|
-
- [Date]: [What was implemented]
|
|
665
|
-
|
|
666
|
-
### Blockers
|
|
667
|
-
- [Blocker description and status]
|
|
668
|
-
|
|
669
|
-
### Questions
|
|
670
|
-
1. [Question 1]
|
|
671
|
-
2. [Question 2]
|
|
672
|
-
|
|
673
|
-
## Review Checklist
|
|
674
|
-
|
|
675
|
-
### Code Review
|
|
676
|
-
- [ ] Code follows project style guide
|
|
677
|
-
- [ ] No hardcoded credentials or sensitive data
|
|
678
|
-
- [ ] Error handling is appropriate
|
|
679
|
-
- [ ] Code is well-commented
|
|
680
|
-
- [ ] No console.logs or debug code
|
|
681
|
-
- [ ] Performance considerations addressed
|
|
682
|
-
|
|
683
|
-
### QA Review
|
|
684
|
-
- [ ] All acceptance criteria met
|
|
685
|
-
- [ ] All tests passing
|
|
686
|
-
- [ ] No regression issues
|
|
687
|
-
- [ ] Documentation complete
|
|
688
|
-
- [ ] Ready for deployment
|
|
689
|
-
|
|
690
|
-
## Definition of Done
|
|
691
|
-
|
|
692
|
-
- [ ] All acceptance criteria met
|
|
693
|
-
- [ ] Unit tests written and passing
|
|
694
|
-
- [ ] Integration tests passing
|
|
695
|
-
- [ ] Code reviewed and approved
|
|
696
|
-
- [ ] QA review completed (@qa *review)
|
|
697
|
-
- [ ] Documentation updated
|
|
698
|
-
- [ ] No critical/high bugs
|
|
699
|
-
- [ ] Merged to main branch
|
|
700
|
-
- [ ] Deployed to staging
|
|
701
|
-
- [ ] Product owner approval
|
|
702
|
-
|
|
703
|
-
---
|
|
704
|
-
|
|
705
|
-
**Story History:**
|
|
706
|
-
- ${new Date().toISOString().split('T')[0]}: Story created
|
|
707
|
-
`
|
|
708
|
-
},
|
|
709
|
-
|
|
710
|
-
'technical-preferences': {
|
|
711
|
-
name: 'Technical Preferences',
|
|
712
|
-
filename: '.bmad-core/data/technical-preferences.md',
|
|
713
|
-
content: `# Technical Preferences
|
|
714
|
-
|
|
715
|
-
**Project:** [Your Project Name]
|
|
716
|
-
**Last Updated:** ${new Date().toISOString().split('T')[0]}
|
|
717
|
-
|
|
718
|
-
## Overview
|
|
719
|
-
|
|
720
|
-
This document defines the technical preferences, standards, and conventions for this project. All agents (PM, Architect, Developer, QA) reference this document to ensure consistency in technology choices, design patterns, and implementation approaches.
|
|
721
|
-
|
|
722
|
-
## Technology Stack
|
|
723
|
-
|
|
724
|
-
### Frontend
|
|
725
|
-
|
|
726
|
-
**Framework:** [e.g., React 18+]
|
|
727
|
-
**Language:** [e.g., TypeScript 5.0+]
|
|
728
|
-
**Build Tool:** [e.g., Vite]
|
|
729
|
-
**Package Manager:** [e.g., npm, pnpm, yarn]
|
|
730
|
-
|
|
731
|
-
**State Management:**
|
|
732
|
-
- Preferred: [e.g., Zustand for simple state, Redux Toolkit for complex]
|
|
733
|
-
- Avoid: [e.g., Context API for large state trees]
|
|
734
|
-
|
|
735
|
-
**Styling:**
|
|
736
|
-
- Primary: [e.g., Tailwind CSS]
|
|
737
|
-
- Component Library: [e.g., shadcn/ui, Material-UI]
|
|
738
|
-
- Avoid: [e.g., Inline styles, CSS-in-JS unless necessary]
|
|
739
|
-
|
|
740
|
-
**Routing:** [e.g., React Router v6]
|
|
741
|
-
|
|
742
|
-
### Backend
|
|
743
|
-
|
|
744
|
-
**Framework:** [e.g., Express.js]
|
|
745
|
-
**Language:** [e.g., TypeScript/Node.js 20+]
|
|
746
|
-
**API Style:** [e.g., RESTful APIs]
|
|
747
|
-
|
|
748
|
-
**Validation:** [e.g., Zod for schema validation]
|
|
749
|
-
**Authentication:** [e.g., JWT with refresh tokens]
|
|
750
|
-
|
|
751
|
-
### Database
|
|
752
|
-
|
|
753
|
-
**Primary Database:** [e.g., PostgreSQL 15+]
|
|
754
|
-
**ORM/Query Builder:** [e.g., Prisma, TypeORM, Drizzle]
|
|
755
|
-
**Migrations:** [e.g., Prisma Migrate, Knex.js]
|
|
756
|
-
|
|
757
|
-
**Caching:** [e.g., Redis for session and data caching]
|
|
758
|
-
|
|
759
|
-
### Testing
|
|
760
|
-
|
|
761
|
-
**Unit Testing:** [e.g., Vitest]
|
|
762
|
-
**Integration Testing:** [e.g., Supertest for API tests]
|
|
763
|
-
**E2E Testing:** [e.g., Playwright]
|
|
764
|
-
**Test Coverage:** Minimum 80% for critical paths
|
|
765
|
-
|
|
766
|
-
### DevOps & Infrastructure
|
|
767
|
-
|
|
768
|
-
**Hosting:** [e.g., Vercel for frontend, Railway for backend]
|
|
769
|
-
**Container:** [e.g., Docker]
|
|
770
|
-
**CI/CD:** [e.g., GitHub Actions]
|
|
771
|
-
**Monitoring:** [e.g., Sentry for errors, Vercel Analytics]
|
|
772
|
-
|
|
773
|
-
## Design Patterns & Principles
|
|
774
|
-
|
|
775
|
-
### Architecture Patterns
|
|
776
|
-
|
|
777
|
-
**Preferred:**
|
|
778
|
-
- [e.g., Clean Architecture / Hexagonal Architecture]
|
|
779
|
-
- [e.g., Repository Pattern for data access]
|
|
780
|
-
- [e.g., Service Layer for business logic]
|
|
781
|
-
|
|
782
|
-
**Avoid:**
|
|
783
|
-
- [e.g., God objects / Large monolithic modules]
|
|
784
|
-
- [e.g., Tight coupling between layers]
|
|
785
|
-
|
|
786
|
-
### Code Organization
|
|
787
|
-
|
|
788
|
-
**Folder Structure:**
|
|
789
|
-
\`\`\`
|
|
790
|
-
src/
|
|
791
|
-
components/ # React components
|
|
792
|
-
services/ # Business logic services
|
|
793
|
-
api/ # API routes or client
|
|
794
|
-
types/ # TypeScript type definitions
|
|
795
|
-
utils/ # Utility functions
|
|
796
|
-
hooks/ # Custom React hooks
|
|
797
|
-
tests/ # Test files
|
|
798
|
-
\`\`\`
|
|
799
|
-
|
|
800
|
-
**Naming Conventions:**
|
|
801
|
-
- Components: PascalCase (e.g., \`UserProfile.tsx\`)
|
|
802
|
-
- Functions: camelCase (e.g., \`getUserById\`)
|
|
803
|
-
- Constants: UPPER_SNAKE_CASE (e.g., \`API_BASE_URL\`)
|
|
804
|
-
- Types/Interfaces: PascalCase with \`I\` prefix for interfaces (e.g., \`IUser\`) OR just PascalCase without prefix
|
|
805
|
-
|
|
806
|
-
### Error Handling
|
|
807
|
-
|
|
808
|
-
**Frontend:**
|
|
809
|
-
- Use Error Boundaries for React component errors
|
|
810
|
-
- Toast notifications for user-facing errors
|
|
811
|
-
- Detailed logging to monitoring service
|
|
812
|
-
|
|
813
|
-
**Backend:**
|
|
814
|
-
- Centralized error handling middleware
|
|
815
|
-
- Structured error responses with error codes
|
|
816
|
-
- Never expose stack traces in production
|
|
817
|
-
|
|
818
|
-
**Error Response Format:**
|
|
819
|
-
\`\`\`json
|
|
820
|
-
{
|
|
821
|
-
"error": {
|
|
822
|
-
"code": "VALIDATION_ERROR",
|
|
823
|
-
"message": "Invalid input data",
|
|
824
|
-
"details": {
|
|
825
|
-
"field": "email",
|
|
826
|
-
"issue": "Invalid email format"
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
\`\`\`
|
|
831
|
-
|
|
832
|
-
### Async Handling
|
|
833
|
-
|
|
834
|
-
**Preferred:** async/await
|
|
835
|
-
**Avoid:** Callback hell, excessive .then() chains
|
|
836
|
-
|
|
837
|
-
### Type Safety
|
|
838
|
-
|
|
839
|
-
**TypeScript Strictness:**
|
|
840
|
-
- \`strict: true\`
|
|
841
|
-
- \`noImplicitAny: true\`
|
|
842
|
-
- \`strictNullChecks: true\`
|
|
843
|
-
|
|
844
|
-
**Avoid:**
|
|
845
|
-
- \`any\` type (use \`unknown\` instead)
|
|
846
|
-
- Type assertions unless absolutely necessary
|
|
847
|
-
- Suppressing TypeScript errors with @ts-ignore
|
|
848
|
-
|
|
849
|
-
## API Conventions
|
|
850
|
-
|
|
851
|
-
### REST API Design
|
|
852
|
-
|
|
853
|
-
**URL Structure:**
|
|
854
|
-
- Use nouns for resources: \`/api/v1/users\` not \`/api/v1/getUsers\`
|
|
855
|
-
- Use HTTP methods correctly: GET, POST, PUT, DELETE, PATCH
|
|
856
|
-
- Version your APIs: \`/api/v1/...\`
|
|
857
|
-
|
|
858
|
-
**Status Codes:**
|
|
859
|
-
- 200: Success
|
|
860
|
-
- 201: Created
|
|
861
|
-
- 204: No Content
|
|
862
|
-
- 400: Bad Request
|
|
863
|
-
- 401: Unauthorized
|
|
864
|
-
- 403: Forbidden
|
|
865
|
-
- 404: Not Found
|
|
866
|
-
- 500: Internal Server Error
|
|
867
|
-
|
|
868
|
-
**Response Format:**
|
|
869
|
-
\`\`\`json
|
|
870
|
-
{
|
|
871
|
-
"data": { ... },
|
|
872
|
-
"meta": {
|
|
873
|
-
"timestamp": "2024-01-01T00:00:00Z",
|
|
874
|
-
"requestId": "uuid"
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
\`\`\`
|
|
878
|
-
|
|
879
|
-
### Pagination
|
|
880
|
-
|
|
881
|
-
**Preferred Approach:** Cursor-based pagination for scalability
|
|
882
|
-
**Alternative:** Offset-based for simple use cases
|
|
883
|
-
|
|
884
|
-
\`\`\`
|
|
885
|
-
GET /api/v1/users?cursor=xyz&limit=20
|
|
886
|
-
\`\`\`
|
|
887
|
-
|
|
888
|
-
## Security Standards
|
|
889
|
-
|
|
890
|
-
### Authentication & Authorization
|
|
891
|
-
|
|
892
|
-
- Use JWT with short expiration (15 min access, 7 day refresh)
|
|
893
|
-
- Store tokens securely (httpOnly cookies for refresh tokens)
|
|
894
|
-
- Implement CSRF protection
|
|
895
|
-
- Use secure password hashing (bcrypt, argon2)
|
|
896
|
-
|
|
897
|
-
### Data Validation
|
|
898
|
-
|
|
899
|
-
- Validate all user input on both client and server
|
|
900
|
-
- Use schema validation (Zod, Joi)
|
|
901
|
-
- Sanitize inputs to prevent XSS/SQL injection
|
|
902
|
-
|
|
903
|
-
### Secrets Management
|
|
904
|
-
|
|
905
|
-
- Never commit secrets to version control
|
|
906
|
-
- Use environment variables
|
|
907
|
-
- Use secrets manager for production (AWS Secrets Manager, etc.)
|
|
908
|
-
|
|
909
|
-
## Performance Standards
|
|
910
|
-
|
|
911
|
-
### Frontend Performance
|
|
912
|
-
|
|
913
|
-
- Code splitting and lazy loading for routes
|
|
914
|
-
- Optimize images (WebP format, lazy loading)
|
|
915
|
-
- Minimize bundle size (tree-shaking, dynamic imports)
|
|
916
|
-
- Use React.memo for expensive components
|
|
917
|
-
- Debounce/throttle event handlers
|
|
918
|
-
|
|
919
|
-
**Targets:**
|
|
920
|
-
- First Contentful Paint: < 1.5s
|
|
921
|
-
- Time to Interactive: < 3s
|
|
922
|
-
- Lighthouse Score: > 90
|
|
923
|
-
|
|
924
|
-
### Backend Performance
|
|
925
|
-
|
|
926
|
-
- Database indexing for frequently queried fields
|
|
927
|
-
- Implement caching for expensive operations
|
|
928
|
-
- Use connection pooling
|
|
929
|
-
- Implement rate limiting
|
|
930
|
-
|
|
931
|
-
**Targets:**
|
|
932
|
-
- API response time: < 200ms (95th percentile)
|
|
933
|
-
- Database query time: < 100ms
|
|
934
|
-
|
|
935
|
-
## Code Quality Standards
|
|
936
|
-
|
|
937
|
-
### Linting & Formatting
|
|
938
|
-
|
|
939
|
-
**Linter:** [e.g., ESLint with recommended rules]
|
|
940
|
-
**Formatter:** [e.g., Prettier]
|
|
941
|
-
**Pre-commit Hooks:** [e.g., Husky + lint-staged]
|
|
942
|
-
|
|
943
|
-
### Code Review Guidelines
|
|
944
|
-
|
|
945
|
-
**Required:**
|
|
946
|
-
- All code must be reviewed before merging
|
|
947
|
-
- At least one approval required
|
|
948
|
-
- All tests must pass
|
|
949
|
-
- No linting errors
|
|
950
|
-
|
|
951
|
-
**Review Checklist:**
|
|
952
|
-
- Code follows style guide
|
|
953
|
-
- Tests are comprehensive
|
|
954
|
-
- No performance issues
|
|
955
|
-
- Error handling is appropriate
|
|
956
|
-
- Documentation is updated
|
|
957
|
-
|
|
958
|
-
### Documentation Standards
|
|
959
|
-
|
|
960
|
-
- Document all public APIs
|
|
961
|
-
- Use JSDoc/TSDoc for functions
|
|
962
|
-
- README for each major module
|
|
963
|
-
- Keep architecture docs updated
|
|
964
|
-
|
|
965
|
-
## Commit Conventions
|
|
966
|
-
|
|
967
|
-
**Format:** [e.g., Conventional Commits]
|
|
968
|
-
|
|
969
|
-
\`\`\`
|
|
970
|
-
feat: add user authentication
|
|
971
|
-
fix: resolve login redirect issue
|
|
972
|
-
docs: update API documentation
|
|
973
|
-
refactor: simplify user service
|
|
974
|
-
test: add tests for user validation
|
|
975
|
-
\`\`\`
|
|
976
|
-
|
|
977
|
-
## Dependency Management
|
|
978
|
-
|
|
979
|
-
### Adding Dependencies
|
|
980
|
-
|
|
981
|
-
**Before adding:**
|
|
982
|
-
1. Check if functionality can be achieved with existing dependencies
|
|
983
|
-
2. Evaluate package: maintenance, size, security
|
|
984
|
-
3. Prefer packages with TypeScript support
|
|
985
|
-
|
|
986
|
-
**Avoid:**
|
|
987
|
-
- Abandoned packages (last update > 2 years)
|
|
988
|
-
- Packages with known security vulnerabilities
|
|
989
|
-
- Bloated packages for simple functionality
|
|
990
|
-
|
|
991
|
-
### Version Management
|
|
992
|
-
|
|
993
|
-
- Use exact versions or minor updates (~)
|
|
994
|
-
- Regular dependency audits
|
|
995
|
-
- Update dependencies in controlled batches
|
|
996
|
-
|
|
997
|
-
## Accessibility Standards
|
|
998
|
-
|
|
999
|
-
**Required:**
|
|
1000
|
-
- Semantic HTML
|
|
1001
|
-
- ARIA labels where necessary
|
|
1002
|
-
- Keyboard navigation support
|
|
1003
|
-
- Color contrast ratios (WCAG AA minimum)
|
|
1004
|
-
- Screen reader testing for critical paths
|
|
1005
|
-
|
|
1006
|
-
## Browser & Device Support
|
|
1007
|
-
|
|
1008
|
-
**Browsers:**
|
|
1009
|
-
- Chrome (last 2 versions)
|
|
1010
|
-
- Firefox (last 2 versions)
|
|
1011
|
-
- Safari (last 2 versions)
|
|
1012
|
-
- Edge (last 2 versions)
|
|
1013
|
-
|
|
1014
|
-
**Devices:**
|
|
1015
|
-
- Desktop: 1920x1080 and down to 1366x768
|
|
1016
|
-
- Tablet: iPad and equivalents
|
|
1017
|
-
- Mobile: iOS Safari, Chrome Android
|
|
1018
|
-
|
|
1019
|
-
**Responsive Breakpoints:**
|
|
1020
|
-
- Mobile: < 640px
|
|
1021
|
-
- Tablet: 640px - 1024px
|
|
1022
|
-
- Desktop: > 1024px
|
|
1023
|
-
|
|
1024
|
-
## Environment Variables
|
|
1025
|
-
|
|
1026
|
-
**Naming Convention:**
|
|
1027
|
-
- Prefix with project identifier: \`MYAPP_\`
|
|
1028
|
-
- All uppercase with underscores
|
|
1029
|
-
- Group by category
|
|
1030
|
-
|
|
1031
|
-
**Example:**
|
|
1032
|
-
\`\`\`
|
|
1033
|
-
MYAPP_DATABASE_URL=
|
|
1034
|
-
MYAPP_API_KEY=
|
|
1035
|
-
MYAPP_REDIS_URL=
|
|
1036
|
-
\`\`\`
|
|
1037
|
-
|
|
1038
|
-
## When to Deviate
|
|
1039
|
-
|
|
1040
|
-
These preferences are guidelines, not rigid rules. Deviate when:
|
|
1041
|
-
- Clear technical benefit
|
|
1042
|
-
- Well-documented reason
|
|
1043
|
-
- Team consensus
|
|
1044
|
-
- Documented in architecture decision record (ADR)
|
|
1045
|
-
|
|
1046
|
-
## Updates
|
|
1047
|
-
|
|
1048
|
-
This document should be reviewed and updated:
|
|
1049
|
-
- When adopting new technologies
|
|
1050
|
-
- After major architectural changes
|
|
1051
|
-
- Quarterly review for relevance
|
|
1052
|
-
|
|
1053
|
-
---
|
|
1054
|
-
|
|
1055
|
-
**Changelog:**
|
|
1056
|
-
- ${new Date().toISOString().split('T')[0]}: Initial preferences defined
|
|
1057
|
-
`
|
|
1058
|
-
}
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
class TemplateGenerator {
|
|
1062
|
-
constructor() {
|
|
1063
|
-
this.projectRoot = process.cwd();
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
ensureDirectory(filePath) {
|
|
1067
|
-
const dir = path.dirname(filePath);
|
|
1068
|
-
if (!fs.existsSync(dir)) {
|
|
1069
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
1070
|
-
console.log(` Created directory: ${dir}`);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
generateTemplate(templateKey, options = {}) {
|
|
1075
|
-
const template = TEMPLATES[templateKey];
|
|
1076
|
-
|
|
1077
|
-
if (!template) {
|
|
1078
|
-
console.error(`\n❌ Error: Template '${templateKey}' not found.`);
|
|
1079
|
-
console.log('\nAvailable templates:');
|
|
1080
|
-
Object.keys(TEMPLATES).forEach(key => {
|
|
1081
|
-
console.log(` - ${key}: ${TEMPLATES[key].name}`);
|
|
1082
|
-
});
|
|
1083
|
-
return false;
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
const outputPath = options.output || path.join(this.projectRoot, template.filename);
|
|
1087
|
-
const fullPath = path.resolve(outputPath);
|
|
1088
|
-
|
|
1089
|
-
// Check if file exists
|
|
1090
|
-
if (fs.existsSync(fullPath) && !options.force) {
|
|
1091
|
-
console.log(`\n⚠️ File already exists: ${fullPath}`);
|
|
1092
|
-
console.log(' Use --force to overwrite');
|
|
1093
|
-
return false;
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
// Ensure directory exists
|
|
1097
|
-
this.ensureDirectory(fullPath);
|
|
1098
|
-
|
|
1099
|
-
// Write file
|
|
1100
|
-
fs.writeFileSync(fullPath, template.content);
|
|
1101
|
-
|
|
1102
|
-
console.log(`\n✅ Generated: ${template.name}`);
|
|
1103
|
-
console.log(` Location: ${fullPath}`);
|
|
1104
|
-
console.log(` Size: ${(template.content.length / 1024).toFixed(1)}KB\n`);
|
|
1105
|
-
|
|
1106
|
-
return true;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
listTemplates() {
|
|
1110
|
-
console.log('\n═══════════════════════════════════════════════════════');
|
|
1111
|
-
console.log(' AVAILABLE BMAD TEMPLATES');
|
|
1112
|
-
console.log('═══════════════════════════════════════════════════════\n');
|
|
1113
|
-
|
|
1114
|
-
Object.entries(TEMPLATES).forEach(([key, template]) => {
|
|
1115
|
-
console.log(`📄 ${key}`);
|
|
1116
|
-
console.log(` Name: ${template.name}`);
|
|
1117
|
-
console.log(` Default location: ${template.filename}`);
|
|
1118
|
-
console.log(` Size: ${(template.content.length / 1024).toFixed(1)}KB\n`);
|
|
1119
|
-
});
|
|
1120
|
-
|
|
1121
|
-
console.log('Usage:');
|
|
1122
|
-
console.log(' node generate-template.js <template-name>');
|
|
1123
|
-
console.log(' node generate-template.js <template-name> --output <path>');
|
|
1124
|
-
console.log(' node generate-template.js <template-name> --force\n');
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
// Main execution
|
|
1129
|
-
const args = process.argv.slice(2);
|
|
1130
|
-
const generator = new TemplateGenerator();
|
|
1131
|
-
|
|
1132
|
-
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
1133
|
-
generator.listTemplates();
|
|
1134
|
-
} else {
|
|
1135
|
-
const templateKey = args[0];
|
|
1136
|
-
const options = {};
|
|
1137
|
-
|
|
1138
|
-
// Parse options
|
|
1139
|
-
for (let i = 1; i < args.length; i++) {
|
|
1140
|
-
if (args[i] === '--output' || args[i] === '-o') {
|
|
1141
|
-
options.output = args[i + 1];
|
|
1142
|
-
i++;
|
|
1143
|
-
} else if (args[i] === '--force' || args[i] === '-f') {
|
|
1144
|
-
options.force = true;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
generator.generateTemplate(templateKey, options);
|
|
1149
|
-
}
|