jettypod 3.0.1
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/PROTECT_SKILLS.md +28 -0
- package/.claude/settings.json +24 -0
- package/.claude/settings.local.json +16 -0
- package/.claude/skills/epic-discover/SKILL.md +262 -0
- package/.claude/skills/feature-discover/SKILL.md +393 -0
- package/.claude/skills/speed-mode/SKILL.md +364 -0
- package/.claude/skills/stable-mode/SKILL.md +591 -0
- package/.github/workflows/test-safety.yml +85 -0
- package/README.md +25 -0
- package/SPEED-STABLE-AUDIT.md +853 -0
- package/SYSTEM-BEHAVIOR.md +1241 -0
- package/TEST_SAFETY_AUDIT.md +314 -0
- package/TEST_SAFETY_IMPLEMENTATION.md +97 -0
- package/cucumber.js +8 -0
- package/docs/COMMAND_REFERENCE.md +903 -0
- package/docs/DECISIONS.md +68 -0
- package/docs/README.md +48 -0
- package/docs/STANDARDS-SYSTEM-DOCUMENTATION.md +374 -0
- package/docs/TEST-REWRITE-PLAN.md +261 -0
- package/docs/ai-test-writing-requirements.md +219 -0
- package/docs/claude-code-skills.md +607 -0
- package/docs/core-jettypod-methodology/comprehensive-jettypod-methodology.md +582 -0
- package/docs/core-jettypod-methodology/deprecated/jettypod-comprehensive-standards.md +1222 -0
- package/docs/core-jettypod-methodology/deprecated/jettypod-operating-guide.md +3399 -0
- package/docs/core-jettypod-methodology/deprecated/jettypod-technical-checklist.md +1325 -0
- package/docs/core-jettypod-methodology/deprecated/jettypod-vibe-coding-framework.md +1544 -0
- package/docs/core-jettypod-methodology/deprecated/prompt-engineering-guide.md +320 -0
- package/docs/core-jettypod-methodology/deprecated/vibe-coding-cheatsheet (1).md +516 -0
- package/docs/core-jettypod-methodology/deprecated/vibe-coding-framework.md +1544 -0
- package/docs/features/jettypod-standards-explained.md +543 -0
- package/docs/features/standards-inventory.md +257 -0
- package/docs/gap-analysis-current-vs-comprehensive-methodology.md +939 -0
- package/docs/jettypod-system-overview.md +409 -0
- package/features/auto-generate-production-chores.feature +14 -0
- package/features/claude-md-protection/steps.js +487 -0
- package/features/decisions/index.js +490 -0
- package/features/decisions/index.test.js +208 -0
- package/features/git-hooks/git-hooks.feature +30 -0
- package/features/git-hooks/index.js +93 -0
- package/features/git-hooks/index.test.js +137 -0
- package/features/git-hooks/post-commit +56 -0
- package/features/git-hooks/post-merge +47 -0
- package/features/git-hooks/pre-commit +28 -0
- package/features/git-hooks/simple-steps.js +53 -0
- package/features/git-hooks/simple-test.feature +10 -0
- package/features/git-hooks/steps.js +196 -0
- package/features/jettypod-update-command.feature +46 -0
- package/features/mode-prompts/index.js +95 -0
- package/features/mode-prompts/simple-steps.js +44 -0
- package/features/mode-prompts/simple-test.feature +9 -0
- package/features/mode-prompts/validation.test.js +120 -0
- package/features/refactor-mode/steps.js +217 -0
- package/features/refactor-mode.feature +49 -0
- package/features/skills-update/index.test.js +216 -0
- package/features/step_definitions/auto-generate-production-chores.steps.js +162 -0
- package/features/step_definitions/terminal-logo.steps.js +145 -0
- package/features/step_definitions/update-command.steps.js +183 -0
- package/features/terminal-logo/index.js +39 -0
- package/features/terminal-logo/terminal-logo.feature +30 -0
- package/features/update-command/index.js +181 -0
- package/features/update-command/index.test.js +225 -0
- package/features/work-commands/bug-workflow-display.feature +22 -0
- package/features/work-commands/index.js +311 -0
- package/features/work-commands/simple-steps.js +69 -0
- package/features/work-commands/stable-tests.feature +57 -0
- package/features/work-commands/steps.js +1120 -0
- package/features/work-commands/validation.test.js +88 -0
- package/features/work-commands/work-commands.feature +13 -0
- package/features/work-tracking/discovery-validation.test.js +228 -0
- package/features/work-tracking/index.js +1511 -0
- package/features/work-tracking/mode-required.feature +112 -0
- package/features/work-tracking/phase-tracking.test.js +482 -0
- package/features/work-tracking/prototype-tracking.test.js +485 -0
- package/features/work-tracking/tree-view.test.js +310 -0
- package/features/work-tracking/work-set-mode.feature +71 -0
- package/features/work-tracking/work-start-mode.feature +88 -0
- package/full-test.txt +0 -0
- package/install.sh +89 -0
- package/jettypod.js +1640 -0
- package/lib/bug-workflow.js +94 -0
- package/lib/bug-workflow.test.js +177 -0
- package/lib/claudemd.js +130 -0
- package/lib/claudemd.test.js +195 -0
- package/lib/comprehensive-standards-full.json +1778 -0
- package/lib/config.js +181 -0
- package/lib/config.test.js +511 -0
- package/lib/constants.js +107 -0
- package/lib/constants.test.js +164 -0
- package/lib/current-work.js +130 -0
- package/lib/current-work.test.js +146 -0
- package/lib/database-project-config.test.js +107 -0
- package/lib/database.js +256 -0
- package/lib/database.test.js +106 -0
- package/lib/decisions-generator.js +102 -0
- package/lib/decisions-generator.test.js +457 -0
- package/lib/decisions-helpers.js +119 -0
- package/lib/decisions-helpers.test.js +310 -0
- package/lib/discovery-checkpoint.js +83 -0
- package/lib/docs-generator.js +280 -0
- package/lib/external-checklist.js +177 -0
- package/lib/git.js +142 -0
- package/lib/git.test.js +145 -0
- package/lib/logo.js +3 -0
- package/lib/migrations/001-epic-to-parent.js +24 -0
- package/lib/migrations/002-default-work-item-modes.js +37 -0
- package/lib/migrations/002-default-work-item-modes.test.js +351 -0
- package/lib/migrations/003-epic-discovery-fields.js +52 -0
- package/lib/migrations/004-discovery-decisions-table.js +32 -0
- package/lib/migrations/005-migrate-decision-data.js +62 -0
- package/lib/migrations/006-feature-phase-field.js +61 -0
- package/lib/migrations/007-prototype-tracking.js +38 -0
- package/lib/migrations/008-scenario-file-field.js +24 -0
- package/lib/migrations/index.js +74 -0
- package/lib/production-helpers.js +69 -0
- package/lib/project-state.test.js +92 -0
- package/lib/test-helpers.js +184 -0
- package/lib/test-helpers.test.js +255 -0
- package/package.json +36 -0
- package/prototypes/test/index.html +1 -0
- package/setup-dist-repo.sh +68 -0
- package/test-safety-check.sh +80 -0
- package/work-item-tracking-plan.md +199 -0
|
@@ -0,0 +1,1222 @@
|
|
|
1
|
+
# Vibe Coding Project Standardization Checklist
|
|
2
|
+
|
|
3
|
+
## The Complete Guide to What AI Assistants Need to Know
|
|
4
|
+
|
|
5
|
+
### 🎯 Why This Matters
|
|
6
|
+
|
|
7
|
+
Every time you start a new conversation with Claude, you risk:
|
|
8
|
+
|
|
9
|
+
- Inconsistent naming conventions (userId vs user_id vs userID)
|
|
10
|
+
- Different state management approaches (useState vs Context vs Redux)
|
|
11
|
+
- Conflicting architectural patterns (where does business logic live?)
|
|
12
|
+
- Reimplemented utilities (date formatting, validation, etc.)
|
|
13
|
+
- Schema drift (different field names for same concept)
|
|
14
|
+
|
|
15
|
+
This checklist ensures every AI conversation follows YOUR standards, not defaults.
|
|
16
|
+
|
|
17
|
+
### 📊 Priority Levels
|
|
18
|
+
|
|
19
|
+
- **🔴 CORE** - Decide these immediately (affects every file/feature)
|
|
20
|
+
- **🟡 SECONDARY** - Decide when you encounter them (situational but common)
|
|
21
|
+
- **🟢 ADVANCED** - Decide when scaling (optimization and enterprise concerns)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# 🔴 CORE STANDARDS
|
|
26
|
+
|
|
27
|
+
*Decide these before writing any code - they affect every file*
|
|
28
|
+
|
|
29
|
+
## Project Structure & Organization
|
|
30
|
+
|
|
31
|
+
### Directory Structure
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
{
|
|
35
|
+
"structure": "feature-based", // or "layer-based" or "domain-based"
|
|
36
|
+
"example": {
|
|
37
|
+
"/features": "Feature modules with all related code",
|
|
38
|
+
"/shared": "Shared components and utilities",
|
|
39
|
+
"/core": "Core business logic and infrastructure"
|
|
40
|
+
},
|
|
41
|
+
"rules": [
|
|
42
|
+
"Features contain their own components, hooks, utils",
|
|
43
|
+
"Shared must be used by 2+ features",
|
|
44
|
+
"Core is for auth, db, config only"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### File Naming Conventions
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
{
|
|
54
|
+
"components": "PascalCase.tsx", // UserProfile.tsx
|
|
55
|
+
"utilities": "camelCase.ts", // formatDate.ts
|
|
56
|
+
"hooks": "useCamelCase.ts", // useAuth.ts
|
|
57
|
+
"constants": "SCREAMING_SNAKE.ts", // API_ENDPOINTS.ts
|
|
58
|
+
"types": "PascalCase.types.ts", // User.types.ts
|
|
59
|
+
"tests": "same-as-source.test.ts", // UserProfile.test.tsx
|
|
60
|
+
"styles": "same-as-component.css", // UserProfile.module.css
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Data & Schema Standards
|
|
66
|
+
|
|
67
|
+
### Database Schema Conventions
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
{
|
|
71
|
+
"naming": {
|
|
72
|
+
"tables": "snake_case_plural", // users, order_items
|
|
73
|
+
"columns": "snake_case", // created_at, user_id
|
|
74
|
+
"indexes": "idx_table_columns", // idx_users_email
|
|
75
|
+
"foreign_keys": "fk_table_column", // fk_orders_user_id
|
|
76
|
+
},
|
|
77
|
+
"required_columns": [
|
|
78
|
+
"id: UUID primary key",
|
|
79
|
+
"created_at: timestamp with timezone",
|
|
80
|
+
"updated_at: timestamp with timezone"
|
|
81
|
+
],
|
|
82
|
+
"soft_deletes": true, // Use deleted_at instead of DELETE
|
|
83
|
+
"json_columns": "Use JSONB for PostgreSQL, JSON for MySQL"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### API Response Format
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
// STANDARDIZE: What every API response looks like
|
|
92
|
+
{
|
|
93
|
+
"success_response": {
|
|
94
|
+
"success": true,
|
|
95
|
+
"data": "{{actual data}}",
|
|
96
|
+
"meta": {
|
|
97
|
+
"timestamp": "ISO 8601",
|
|
98
|
+
"version": "1.0"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"error_response": {
|
|
102
|
+
"success": false,
|
|
103
|
+
"error": {
|
|
104
|
+
"code": "VALIDATION_ERROR",
|
|
105
|
+
"message": "Human readable message",
|
|
106
|
+
"details": {}, // Optional detailed errors
|
|
107
|
+
"trace_id": "uuid-for-debugging"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"pagination": {
|
|
111
|
+
"data": [],
|
|
112
|
+
"pagination": {
|
|
113
|
+
"page": 1,
|
|
114
|
+
"limit": 20,
|
|
115
|
+
"total": 100,
|
|
116
|
+
"hasMore": true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Frontend Data Structures
|
|
124
|
+
|
|
125
|
+
```jsx
|
|
126
|
+
{
|
|
127
|
+
"id_format": "string (UUID)", // Never use number IDs
|
|
128
|
+
"date_format": "ISO 8601 strings", // Not Date objects
|
|
129
|
+
"money_format": "cents as integer", // 1999 = $19.99
|
|
130
|
+
"phone_format": "E.164", // +14155552671
|
|
131
|
+
"empty_states": {
|
|
132
|
+
"lists": "[] not null",
|
|
133
|
+
"objects": "null not {}",
|
|
134
|
+
"strings": "'' not null",
|
|
135
|
+
"numbers": "0 not null"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## React & State Patterns
|
|
142
|
+
|
|
143
|
+
### Component Structure
|
|
144
|
+
|
|
145
|
+
```jsx
|
|
146
|
+
// STANDARDIZE: How every component is organized
|
|
147
|
+
{
|
|
148
|
+
"order": [
|
|
149
|
+
"imports",
|
|
150
|
+
"type definitions",
|
|
151
|
+
"constants",
|
|
152
|
+
"component definition",
|
|
153
|
+
"export"
|
|
154
|
+
],
|
|
155
|
+
"example": `
|
|
156
|
+
// 1. Imports
|
|
157
|
+
import React, { useState } from 'react';
|
|
158
|
+
|
|
159
|
+
// 2. Types
|
|
160
|
+
interface Props {
|
|
161
|
+
userId: string;
|
|
162
|
+
onSave: (data: FormData) => void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// 3. Constants
|
|
166
|
+
const MAX_LENGTH = 100;
|
|
167
|
+
|
|
168
|
+
// 4. Component
|
|
169
|
+
export function UserForm({ userId, onSave }: Props) {
|
|
170
|
+
const [name, setName] = useState('');
|
|
171
|
+
|
|
172
|
+
return <form>...</form>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// 5. NO default export (named exports only)
|
|
176
|
+
`
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### State Management Rules
|
|
182
|
+
|
|
183
|
+
```jsx
|
|
184
|
+
{
|
|
185
|
+
"local_state": "useState for component-specific UI state",
|
|
186
|
+
"shared_state": "Context for feature-wide state",
|
|
187
|
+
"global_state": "Zustand for app-wide state",
|
|
188
|
+
"server_state": "TanStack Query for API data",
|
|
189
|
+
|
|
190
|
+
"rules": [
|
|
191
|
+
"Never put server data in useState",
|
|
192
|
+
"Form state stays local unless explicitly shared",
|
|
193
|
+
"Use optimistic updates for better UX",
|
|
194
|
+
"Derive state when possible, don't sync"
|
|
195
|
+
],
|
|
196
|
+
|
|
197
|
+
"naming": {
|
|
198
|
+
"boolean": "is/has/should prefix", // isLoading, hasError
|
|
199
|
+
"handlers": "handle prefix", // handleSubmit
|
|
200
|
+
"callbacks": "on prefix" // onSave, onClick
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Custom Hooks Patterns
|
|
207
|
+
|
|
208
|
+
```jsx
|
|
209
|
+
{
|
|
210
|
+
"structure": {
|
|
211
|
+
"data_hooks": "useUser, useProducts - return {data, error, isLoading}",
|
|
212
|
+
"action_hooks": "useSaveUser - return {mutate, isLoading, error}",
|
|
213
|
+
"ui_hooks": "useModal - return {isOpen, open, close}",
|
|
214
|
+
"compound_hooks": "useUserProfile - combines multiple hooks"
|
|
215
|
+
},
|
|
216
|
+
"rules": [
|
|
217
|
+
"Always return consistent shape",
|
|
218
|
+
"Handle loading and error states",
|
|
219
|
+
"Clean up subscriptions/timers",
|
|
220
|
+
"Memoize expensive computations"
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Styling & UI Conventions
|
|
227
|
+
|
|
228
|
+
### CSS/Styling Approach
|
|
229
|
+
|
|
230
|
+
```jsx
|
|
231
|
+
{
|
|
232
|
+
"method": "Tailwind CSS", // or "CSS Modules" or "styled-components"
|
|
233
|
+
"rules": [
|
|
234
|
+
"Mobile-first responsive design",
|
|
235
|
+
"Dark mode support from start",
|
|
236
|
+
"Use design tokens for consistency"
|
|
237
|
+
],
|
|
238
|
+
"spacing": "4px base unit (1=4px, 2=8px, 4=16px)",
|
|
239
|
+
"breakpoints": {
|
|
240
|
+
"sm": "640px",
|
|
241
|
+
"md": "768px",
|
|
242
|
+
"lg": "1024px",
|
|
243
|
+
"xl": "1280px"
|
|
244
|
+
},
|
|
245
|
+
"color_naming": {
|
|
246
|
+
"semantic": "primary, secondary, danger, success",
|
|
247
|
+
"not": "blue, red, green"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Component Library Decisions
|
|
254
|
+
|
|
255
|
+
```jsx
|
|
256
|
+
{
|
|
257
|
+
"base": "Radix UI primitives",
|
|
258
|
+
"styling": "Tailwind CSS",
|
|
259
|
+
"icons": "Lucide React",
|
|
260
|
+
"forms": "React Hook Form + Zod",
|
|
261
|
+
"tables": "TanStack Table",
|
|
262
|
+
"dates": "date-fns",
|
|
263
|
+
"animations": "Framer Motion",
|
|
264
|
+
|
|
265
|
+
"custom_components": [
|
|
266
|
+
"Button - always use our custom version",
|
|
267
|
+
"Input - with built-in validation",
|
|
268
|
+
"Modal - consistent across app",
|
|
269
|
+
"Toast - for notifications"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Technical Decisions
|
|
276
|
+
|
|
277
|
+
### API & Backend Patterns
|
|
278
|
+
|
|
279
|
+
```jsx
|
|
280
|
+
{
|
|
281
|
+
"api_style": "REST", // or "GraphQL" or "tRPC"
|
|
282
|
+
"endpoints": {
|
|
283
|
+
"format": "/api/v1/resources",
|
|
284
|
+
"verbs": {
|
|
285
|
+
"GET /users": "list",
|
|
286
|
+
"GET /users/:id": "retrieve",
|
|
287
|
+
"POST /users": "create",
|
|
288
|
+
"PUT /users/:id": "full update",
|
|
289
|
+
"PATCH /users/:id": "partial update",
|
|
290
|
+
"DELETE /users/:id": "soft delete"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"authentication": "JWT in httpOnly cookie",
|
|
294
|
+
"authorization": "RBAC with permissions",
|
|
295
|
+
"rate_limiting": "100 requests per minute per IP",
|
|
296
|
+
"cors": "Explicit whitelist only"
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Error Handling Patterns
|
|
302
|
+
|
|
303
|
+
```jsx
|
|
304
|
+
{
|
|
305
|
+
"frontend": {
|
|
306
|
+
"network_errors": "Show toast, log to Sentry",
|
|
307
|
+
"validation_errors": "Inline field errors",
|
|
308
|
+
"auth_errors": "Redirect to login",
|
|
309
|
+
"unexpected_errors": "Error boundary fallback"
|
|
310
|
+
},
|
|
311
|
+
"backend": {
|
|
312
|
+
"validation": "Return 400 with field errors",
|
|
313
|
+
"auth": "Return 401/403 with clear message",
|
|
314
|
+
"not_found": "Return 404 with resource type",
|
|
315
|
+
"server_error": "Return 500 with trace ID, log details"
|
|
316
|
+
},
|
|
317
|
+
"logging": {
|
|
318
|
+
"errors": "Always include user ID, trace ID, stack",
|
|
319
|
+
"warnings": "Include context and suggested action",
|
|
320
|
+
"info": "Structured JSON for parsing"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Testing Strategy
|
|
327
|
+
|
|
328
|
+
```jsx
|
|
329
|
+
{
|
|
330
|
+
"unit_tests": {
|
|
331
|
+
"what": "Pure functions, utilities, hooks",
|
|
332
|
+
"tool": "Vitest",
|
|
333
|
+
"coverage": "> 80%"
|
|
334
|
+
},
|
|
335
|
+
"integration_tests": {
|
|
336
|
+
"what": "API endpoints, database operations",
|
|
337
|
+
"tool": "Supertest + Vitest",
|
|
338
|
+
"coverage": "All critical paths"
|
|
339
|
+
},
|
|
340
|
+
"e2e_tests": {
|
|
341
|
+
"what": "User journeys, critical flows",
|
|
342
|
+
"tool": "Playwright",
|
|
343
|
+
"coverage": "Happy path + major error cases"
|
|
344
|
+
},
|
|
345
|
+
"naming": "describe('Component', () => { it('should behavior', () => {}) })",
|
|
346
|
+
"mocking": "Mock external services, not internal modules"
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Code Style & Formatting
|
|
352
|
+
|
|
353
|
+
### TypeScript Configuration
|
|
354
|
+
|
|
355
|
+
```jsx
|
|
356
|
+
{
|
|
357
|
+
"strict": true,
|
|
358
|
+
"rules": {
|
|
359
|
+
"no_any": "Error - use unknown",
|
|
360
|
+
"explicit_return_types": "Required for exported functions",
|
|
361
|
+
"interface_vs_type": "Interface for objects, type for unions",
|
|
362
|
+
"enums": "Avoid - use const objects"
|
|
363
|
+
},
|
|
364
|
+
"naming": {
|
|
365
|
+
"types": "PascalCase",
|
|
366
|
+
"interfaces": "PascalCase, no I prefix",
|
|
367
|
+
"generics": "T, K, V or descriptive names"
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Code Formatting
|
|
374
|
+
|
|
375
|
+
```jsx
|
|
376
|
+
{
|
|
377
|
+
"formatter": "Prettier",
|
|
378
|
+
"settings": {
|
|
379
|
+
"printWidth": 80,
|
|
380
|
+
"tabWidth": 2,
|
|
381
|
+
"semi": true,
|
|
382
|
+
"singleQuote": true,
|
|
383
|
+
"trailingComma": "es5",
|
|
384
|
+
"bracketSpacing": true,
|
|
385
|
+
"arrowParens": "always"
|
|
386
|
+
},
|
|
387
|
+
"imports": "Auto-sort with organize imports",
|
|
388
|
+
"file_size": "Max 300 lines, split if larger"
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Git & Version Control
|
|
394
|
+
|
|
395
|
+
### Branch Strategy
|
|
396
|
+
|
|
397
|
+
```jsx
|
|
398
|
+
{
|
|
399
|
+
"main": "Production-ready code only",
|
|
400
|
+
"develop": "Integration branch",
|
|
401
|
+
"feature/*": "New features",
|
|
402
|
+
"fix/*": "Bug fixes",
|
|
403
|
+
"hotfix/*": "Production emergency fixes",
|
|
404
|
+
"release/*": "Release preparation"
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Commit Message Format
|
|
410
|
+
|
|
411
|
+
```jsx
|
|
412
|
+
{
|
|
413
|
+
"format": "[type]([scope]): [subject]",
|
|
414
|
+
"types": [
|
|
415
|
+
"feat: New feature",
|
|
416
|
+
"fix: Bug fix",
|
|
417
|
+
"docs: Documentation",
|
|
418
|
+
"style: Formatting",
|
|
419
|
+
"refactor: Code restructure",
|
|
420
|
+
"test: Testing",
|
|
421
|
+
"chore: Maintenance"
|
|
422
|
+
],
|
|
423
|
+
"example": "feat(auth): add password reset flow"
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
## Environment Variables
|
|
429
|
+
|
|
430
|
+
```jsx
|
|
431
|
+
{
|
|
432
|
+
"naming": "SCREAMING_SNAKE_CASE",
|
|
433
|
+
"prefixes": {
|
|
434
|
+
"public": "NEXT_PUBLIC_* or VITE_*",
|
|
435
|
+
"private": "No prefix",
|
|
436
|
+
"feature_flags": "FEATURE_*"
|
|
437
|
+
},
|
|
438
|
+
"required": [
|
|
439
|
+
"NODE_ENV",
|
|
440
|
+
"DATABASE_URL",
|
|
441
|
+
"API_URL",
|
|
442
|
+
"JWT_SECRET"
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
## Code Comments
|
|
449
|
+
|
|
450
|
+
```jsx
|
|
451
|
+
{
|
|
452
|
+
"when": "Why, not what - code shows what",
|
|
453
|
+
"format": {
|
|
454
|
+
"todo": "// TODO: [owner] - description",
|
|
455
|
+
"fixme": "// FIXME: [issue-link] - description",
|
|
456
|
+
"hack": "// HACK: explanation of why",
|
|
457
|
+
"note": "// NOTE: important context"
|
|
458
|
+
},
|
|
459
|
+
"jsdoc": "For all exported functions and complex logic"
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
# 🟡 SECONDARY STANDARDS
|
|
467
|
+
|
|
468
|
+
*Decide these as you encounter them*
|
|
469
|
+
|
|
470
|
+
## Import Order & Aliases
|
|
471
|
+
|
|
472
|
+
```jsx
|
|
473
|
+
// STANDARDIZE: Import order and path aliases
|
|
474
|
+
{
|
|
475
|
+
"order": [
|
|
476
|
+
"// External imports",
|
|
477
|
+
"import React from 'react'",
|
|
478
|
+
"import { useState } from 'react'",
|
|
479
|
+
"// Internal imports",
|
|
480
|
+
"import { Button } from '@/components'",
|
|
481
|
+
"// Relative imports",
|
|
482
|
+
"import { helper } from './utils'",
|
|
483
|
+
"// Types",
|
|
484
|
+
"import type { User } from '@/types'"
|
|
485
|
+
],
|
|
486
|
+
"aliases": {
|
|
487
|
+
"@/": "src/",
|
|
488
|
+
"@components": "src/components",
|
|
489
|
+
"@utils": "src/utils",
|
|
490
|
+
"@hooks": "src/hooks"
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## Data Validation & Transformation
|
|
497
|
+
|
|
498
|
+
```jsx
|
|
499
|
+
{
|
|
500
|
+
"validation": {
|
|
501
|
+
"email": "RFC 5322 compliant",
|
|
502
|
+
"phone": "E.164 format with country code",
|
|
503
|
+
"url": "Include protocol (https://)",
|
|
504
|
+
"money": "Always validate cents/smallest unit",
|
|
505
|
+
"dates": "ISO 8601 or Unix timestamp"
|
|
506
|
+
},
|
|
507
|
+
"sanitization": {
|
|
508
|
+
"html": "DOMPurify for user content",
|
|
509
|
+
"sql": "Parameterized queries only",
|
|
510
|
+
"filenames": "Alphanumeric + dash/underscore only",
|
|
511
|
+
"json": "Strip undefined, convert NaN to null"
|
|
512
|
+
},
|
|
513
|
+
"transformations": {
|
|
514
|
+
"case": "Transform at API boundary, not in components",
|
|
515
|
+
"dates": "UTC in database, local in UI",
|
|
516
|
+
"money": "Cents in API/DB, formatted in UI",
|
|
517
|
+
"enums": "String literals, not numbers"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
## Form Handling Patterns
|
|
524
|
+
|
|
525
|
+
```jsx
|
|
526
|
+
{
|
|
527
|
+
"library": "react-hook-form", // or "formik" or "native"
|
|
528
|
+
"validation": "zod", // or "yup" or "native"
|
|
529
|
+
"patterns": {
|
|
530
|
+
"controlled": "Only for custom components",
|
|
531
|
+
"uncontrolled": "Default for inputs",
|
|
532
|
+
"submission": "Disable button while submitting",
|
|
533
|
+
"errors": "Show on blur or submit, not onChange"
|
|
534
|
+
},
|
|
535
|
+
"field_standards": {
|
|
536
|
+
"required_marker": "* after label",
|
|
537
|
+
"error_display": "Below field in red",
|
|
538
|
+
"helper_text": "Below field in gray",
|
|
539
|
+
"character_count": "Show when > 70% of max"
|
|
540
|
+
},
|
|
541
|
+
"complex_forms": {
|
|
542
|
+
"multi_step": "Keep state in parent",
|
|
543
|
+
"conditional": "Hide via conditional rendering",
|
|
544
|
+
"arrays": "Use fieldArray pattern",
|
|
545
|
+
"autosave": "Debounce 2 seconds"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
## Accessibility Standards
|
|
552
|
+
|
|
553
|
+
```jsx
|
|
554
|
+
{
|
|
555
|
+
"minimum_requirements": [
|
|
556
|
+
"Keyboard navigable",
|
|
557
|
+
"Screen reader labels",
|
|
558
|
+
"WCAG AA color contrast",
|
|
559
|
+
"Focus indicators visible"
|
|
560
|
+
],
|
|
561
|
+
"patterns": {
|
|
562
|
+
"images": "Alt text required",
|
|
563
|
+
"forms": "Labels associated with inputs",
|
|
564
|
+
"buttons": "Descriptive text, not just icons",
|
|
565
|
+
"modals": "Focus trap and escape key",
|
|
566
|
+
"errors": "Announced to screen readers"
|
|
567
|
+
},
|
|
568
|
+
"testing": {
|
|
569
|
+
"automated": "axe-core in tests",
|
|
570
|
+
"manual": "Keyboard navigation check",
|
|
571
|
+
"screen_reader": "Test with NVDA/JAWS"
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
## Animation & Interaction Patterns
|
|
578
|
+
|
|
579
|
+
```jsx
|
|
580
|
+
{
|
|
581
|
+
"library": "Framer Motion", // or "CSS transitions" or "React Spring"
|
|
582
|
+
"principles": {
|
|
583
|
+
"duration": "200-300ms for micro, 400-600ms for macro",
|
|
584
|
+
"easing": "ease-out for enter, ease-in for exit",
|
|
585
|
+
"reduced_motion": "Respect prefers-reduced-motion"
|
|
586
|
+
},
|
|
587
|
+
"patterns": {
|
|
588
|
+
"hover": "Subtle scale or color change",
|
|
589
|
+
"click": "Scale down briefly",
|
|
590
|
+
"loading": "Skeleton screens over spinners",
|
|
591
|
+
"transitions": "Crossfade between states",
|
|
592
|
+
"scroll": "Parallax sparingly"
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
## Performance Standards
|
|
599
|
+
|
|
600
|
+
```jsx
|
|
601
|
+
{
|
|
602
|
+
"targets": {
|
|
603
|
+
"page_load": "< 3 seconds on 3G",
|
|
604
|
+
"api_response": "< 200ms p50, < 500ms p95",
|
|
605
|
+
"bundle_size": "< 200KB gzipped initial",
|
|
606
|
+
"lighthouse": "> 90 score"
|
|
607
|
+
},
|
|
608
|
+
"techniques": {
|
|
609
|
+
"images": "WebP with fallback, lazy loading",
|
|
610
|
+
"code_splitting": "Route-based + heavy libraries",
|
|
611
|
+
"caching": "SWR strategy, 5 minute stale time",
|
|
612
|
+
"pagination": "20 items default, virtual scroll > 100"
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
## File Upload & Storage Patterns
|
|
619
|
+
|
|
620
|
+
```jsx
|
|
621
|
+
{
|
|
622
|
+
"client_validation": {
|
|
623
|
+
"max_size": "10MB default, 100MB for video",
|
|
624
|
+
"allowed_types": "Whitelist, not blacklist",
|
|
625
|
+
"image_dimensions": "Max 4000x4000",
|
|
626
|
+
"filename": "Sanitize and add UUID"
|
|
627
|
+
},
|
|
628
|
+
"upload_pattern": {
|
|
629
|
+
"small_files": "Base64 in JSON (< 100KB)",
|
|
630
|
+
"large_files": "Multipart form data",
|
|
631
|
+
"huge_files": "Direct to S3 presigned URL"
|
|
632
|
+
},
|
|
633
|
+
"storage": {
|
|
634
|
+
"temporary": "Server temp folder, auto-cleanup",
|
|
635
|
+
"permanent": "S3/Cloudinary/CDN",
|
|
636
|
+
"database": "Store URL only, never blob"
|
|
637
|
+
},
|
|
638
|
+
"processing": {
|
|
639
|
+
"images": "Resize, compress, generate thumbnails",
|
|
640
|
+
"documents": "Virus scan, extract metadata",
|
|
641
|
+
"validation": "Server-side type verification"
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
## Real-time & WebSocket Patterns
|
|
648
|
+
|
|
649
|
+
```jsx
|
|
650
|
+
{
|
|
651
|
+
"library": "Socket.io", // or "native WebSocket" or "Pusher"
|
|
652
|
+
"patterns": {
|
|
653
|
+
"connection": "Authenticate on connect",
|
|
654
|
+
"reconnection": "Exponential backoff",
|
|
655
|
+
"heartbeat": "Ping every 30 seconds",
|
|
656
|
+
"rooms": "One per resource (e.g., document-123)"
|
|
657
|
+
},
|
|
658
|
+
"events": {
|
|
659
|
+
"naming": "verb:noun (update:user, delete:comment)",
|
|
660
|
+
"payload": "Same format as REST API",
|
|
661
|
+
"acknowledgment": "Required for critical actions",
|
|
662
|
+
"ordering": "Include sequence numbers"
|
|
663
|
+
},
|
|
664
|
+
"fallbacks": {
|
|
665
|
+
"offline": "Queue actions, sync on reconnect",
|
|
666
|
+
"polling": "Fall back to polling if WS fails",
|
|
667
|
+
"conflict": "Last-write-wins or CRDT"
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
## Test Data Management
|
|
674
|
+
|
|
675
|
+
```jsx
|
|
676
|
+
{
|
|
677
|
+
"fixtures": {
|
|
678
|
+
"location": "/tests/fixtures",
|
|
679
|
+
"format": "JSON or factory functions",
|
|
680
|
+
"naming": "valid-user.json, invalid-email.json"
|
|
681
|
+
},
|
|
682
|
+
"factories": {
|
|
683
|
+
"library": "Faker.js or custom",
|
|
684
|
+
"pattern": "createUser({ overrides })",
|
|
685
|
+
"defaults": "Valid data by default"
|
|
686
|
+
},
|
|
687
|
+
"database": {
|
|
688
|
+
"strategy": "Isolated test database",
|
|
689
|
+
"seeding": "Before each test suite",
|
|
690
|
+
"cleanup": "Transaction rollback or truncate"
|
|
691
|
+
},
|
|
692
|
+
"external_services": {
|
|
693
|
+
"strategy": "Mock by default",
|
|
694
|
+
"integration": "Separate test suite",
|
|
695
|
+
"contracts": "Record and replay"
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
## Code Review Standards
|
|
702
|
+
|
|
703
|
+
```jsx
|
|
704
|
+
{
|
|
705
|
+
"pr_requirements": {
|
|
706
|
+
"description": "What and why",
|
|
707
|
+
"testing": "How it was tested",
|
|
708
|
+
"screenshots": "For UI changes",
|
|
709
|
+
"breaking": "Call out breaking changes"
|
|
710
|
+
},
|
|
711
|
+
"review_checklist": [
|
|
712
|
+
"Logic correctness",
|
|
713
|
+
"Edge cases handled",
|
|
714
|
+
"Performance impact",
|
|
715
|
+
"Security implications",
|
|
716
|
+
"Test coverage",
|
|
717
|
+
"Documentation updated"
|
|
718
|
+
],
|
|
719
|
+
"approval": {
|
|
720
|
+
"required": "1 for normal, 2 for critical",
|
|
721
|
+
"self_merge": "After 24h if no response",
|
|
722
|
+
"emergency": "Merge, review after"
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
## Deployment Strategy
|
|
729
|
+
|
|
730
|
+
```jsx
|
|
731
|
+
{
|
|
732
|
+
"environments": {
|
|
733
|
+
"local": "Development machine",
|
|
734
|
+
"dev": "Latest commits, unstable",
|
|
735
|
+
"staging": "Production mirror",
|
|
736
|
+
"production": "Live users"
|
|
737
|
+
},
|
|
738
|
+
"pipeline": {
|
|
739
|
+
"trigger": "Push to main",
|
|
740
|
+
"steps": [
|
|
741
|
+
"Lint and format check",
|
|
742
|
+
"Run tests",
|
|
743
|
+
"Build application",
|
|
744
|
+
"Deploy to staging",
|
|
745
|
+
"Smoke tests",
|
|
746
|
+
"Deploy to production"
|
|
747
|
+
]
|
|
748
|
+
},
|
|
749
|
+
"rollback": {
|
|
750
|
+
"strategy": "Keep 3 previous versions",
|
|
751
|
+
"trigger": "Error rate > 5%",
|
|
752
|
+
"procedure": "Revert to last known good"
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
## Documentation Requirements
|
|
759
|
+
|
|
760
|
+
```jsx
|
|
761
|
+
{
|
|
762
|
+
"readme": {
|
|
763
|
+
"sections": [
|
|
764
|
+
"What it does (one paragraph)",
|
|
765
|
+
"Quick start (< 5 steps)",
|
|
766
|
+
"Tech stack",
|
|
767
|
+
"Project structure",
|
|
768
|
+
"Environment setup",
|
|
769
|
+
"Common tasks",
|
|
770
|
+
"Troubleshooting"
|
|
771
|
+
]
|
|
772
|
+
},
|
|
773
|
+
"api_docs": {
|
|
774
|
+
"tool": "OpenAPI/Swagger",
|
|
775
|
+
"location": "/docs/api",
|
|
776
|
+
"examples": "Required for each endpoint",
|
|
777
|
+
"versioning": "Document breaking changes"
|
|
778
|
+
},
|
|
779
|
+
"component_docs": {
|
|
780
|
+
"tool": "Storybook", // or "Docusaurus"
|
|
781
|
+
"requirements": [
|
|
782
|
+
"Props documentation",
|
|
783
|
+
"Usage examples",
|
|
784
|
+
"Edge cases",
|
|
785
|
+
"Accessibility notes"
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
"architecture": {
|
|
789
|
+
"decisions": "ADRs in /docs/adr",
|
|
790
|
+
"diagrams": "Mermaid or draw.io",
|
|
791
|
+
"update": "With significant changes"
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
---
|
|
798
|
+
|
|
799
|
+
# 🟢 ADVANCED STANDARDS
|
|
800
|
+
|
|
801
|
+
*Decide these when scaling or optimizing*
|
|
802
|
+
|
|
803
|
+
## Internationalization (i18n)
|
|
804
|
+
|
|
805
|
+
```jsx
|
|
806
|
+
{
|
|
807
|
+
"enabled": false, // Set true when needed
|
|
808
|
+
"library": "react-i18next",
|
|
809
|
+
"structure": {
|
|
810
|
+
"files": "/locales/[lang]/[namespace].json",
|
|
811
|
+
"defaultLanguage": "en",
|
|
812
|
+
"fallback": "en"
|
|
813
|
+
},
|
|
814
|
+
"patterns": {
|
|
815
|
+
"keys": "dot.notation.lowercase",
|
|
816
|
+
"plurals": "Use ICU format",
|
|
817
|
+
"dates": "Use date-fns locales",
|
|
818
|
+
"numbers": "Intl.NumberFormat"
|
|
819
|
+
},
|
|
820
|
+
"content": {
|
|
821
|
+
"static": "In locale files",
|
|
822
|
+
"dynamic": "From CMS/database",
|
|
823
|
+
"user_generated": "Never translate automatically"
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
## Performance Optimization Patterns
|
|
830
|
+
|
|
831
|
+
```jsx
|
|
832
|
+
{
|
|
833
|
+
"memoization": {
|
|
834
|
+
"when": "Expensive calculations or stable references",
|
|
835
|
+
"React.memo": "For pure components with complex props",
|
|
836
|
+
"useMemo": "For expensive computations",
|
|
837
|
+
"useCallback": "For stable function references"
|
|
838
|
+
},
|
|
839
|
+
"code_splitting": {
|
|
840
|
+
"routes": "Always lazy load routes",
|
|
841
|
+
"modals": "Lazy load modal content",
|
|
842
|
+
"heavy_libs": "Dynamic import for charts, editors",
|
|
843
|
+
"threshold": "Split bundles > 50KB"
|
|
844
|
+
},
|
|
845
|
+
"virtualization": {
|
|
846
|
+
"lists": "> 100 items use virtual scroll",
|
|
847
|
+
"tables": "> 50 rows use virtual table",
|
|
848
|
+
"library": "TanStack Virtual"
|
|
849
|
+
},
|
|
850
|
+
"optimistic_updates": {
|
|
851
|
+
"when": "User actions with network delay",
|
|
852
|
+
"pattern": "Update UI, rollback on error",
|
|
853
|
+
"indication": "Subtle visual cue while pending"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
## Caching Strategies
|
|
860
|
+
|
|
861
|
+
```jsx
|
|
862
|
+
{
|
|
863
|
+
"client_side": {
|
|
864
|
+
"react_query": {
|
|
865
|
+
"staleTime": "5 minutes default",
|
|
866
|
+
"cacheTime": "10 minutes default",
|
|
867
|
+
"refetchOnWindowFocus": false,
|
|
868
|
+
"refetchOnReconnect": true
|
|
869
|
+
},
|
|
870
|
+
"localStorage": {
|
|
871
|
+
"user_preferences": "No expiry",
|
|
872
|
+
"draft_content": "7 days expiry",
|
|
873
|
+
"cache": "1 day expiry"
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
"api_cache": {
|
|
877
|
+
"CDN": "Static assets, long cache",
|
|
878
|
+
"browser": "Cache-Control headers",
|
|
879
|
+
"redis": {
|
|
880
|
+
"sessions": "15 minute TTL",
|
|
881
|
+
"api_responses": "5 minute TTL",
|
|
882
|
+
"computed": "1 hour TTL"
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
"invalidation": {
|
|
886
|
+
"pattern": "Tag-based (user:123, post:456)",
|
|
887
|
+
"strategy": "Invalidate on mutation",
|
|
888
|
+
"cascade": "Parent invalidates children"
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
## Security Patterns
|
|
895
|
+
|
|
896
|
+
```jsx
|
|
897
|
+
{
|
|
898
|
+
"authentication": {
|
|
899
|
+
"passwords": "Argon2id hashing",
|
|
900
|
+
"sessions": "HttpOnly secure cookies",
|
|
901
|
+
"tokens": "Short-lived (15min) + refresh",
|
|
902
|
+
"2fa": "TOTP, backup codes"
|
|
903
|
+
},
|
|
904
|
+
"authorization": {
|
|
905
|
+
"pattern": "RBAC with permissions",
|
|
906
|
+
"checking": "Every endpoint, every query",
|
|
907
|
+
"caching": "5 minute permission cache",
|
|
908
|
+
"audit": "Log all permission checks"
|
|
909
|
+
},
|
|
910
|
+
"data_protection": {
|
|
911
|
+
"pii": "Encrypt at rest",
|
|
912
|
+
"exports": "Audit log + rate limit",
|
|
913
|
+
"deletion": "Soft delete → hard delete after 30d",
|
|
914
|
+
"backups": "Encrypted, separate location"
|
|
915
|
+
},
|
|
916
|
+
"api_security": {
|
|
917
|
+
"rate_limiting": "By IP and user",
|
|
918
|
+
"cors": "Whitelist origins explicitly",
|
|
919
|
+
"csrf": "Double submit cookie",
|
|
920
|
+
"headers": "Helmet.js defaults"
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
## Business Logic Patterns
|
|
927
|
+
|
|
928
|
+
```jsx
|
|
929
|
+
{
|
|
930
|
+
"architecture": {
|
|
931
|
+
"pattern": "Service layer", // or "Domain driven" or "Simple MVC"
|
|
932
|
+
"location": "/services or /domain or /lib",
|
|
933
|
+
"principle": "Thin controllers, rich services"
|
|
934
|
+
},
|
|
935
|
+
"service_patterns": {
|
|
936
|
+
"naming": "UserService, OrderService",
|
|
937
|
+
"methods": "Verbs: createUser, calculateTotal",
|
|
938
|
+
"dependencies": "Inject, don't import directly",
|
|
939
|
+
"testing": "Unit test services, integration test controllers"
|
|
940
|
+
},
|
|
941
|
+
"domain_modeling": {
|
|
942
|
+
"entities": "Classes with methods",
|
|
943
|
+
"value_objects": "Immutable data classes",
|
|
944
|
+
"aggregates": "Transactional boundaries",
|
|
945
|
+
"repositories": "Data access abstraction"
|
|
946
|
+
},
|
|
947
|
+
"complex_operations": {
|
|
948
|
+
"transactions": "Service method boundaries",
|
|
949
|
+
"workflows": "State machines (XState)",
|
|
950
|
+
"events": "Event emitter or message queue",
|
|
951
|
+
"scheduling": "Cron jobs or queue workers"
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
## Monitoring & Observability
|
|
958
|
+
|
|
959
|
+
```jsx
|
|
960
|
+
{
|
|
961
|
+
"error_tracking": {
|
|
962
|
+
"service": "Sentry", // or "Rollbar" or "Bugsnag"
|
|
963
|
+
"environments": ["staging", "production"],
|
|
964
|
+
"user_context": "ID only, no PII",
|
|
965
|
+
"source_maps": "Upload on deploy"
|
|
966
|
+
},
|
|
967
|
+
"performance": {
|
|
968
|
+
"service": "DataDog", // or "New Relic" or "Custom"
|
|
969
|
+
"metrics": [
|
|
970
|
+
"Response time (p50, p95, p99)",
|
|
971
|
+
"Error rate",
|
|
972
|
+
"Database query time",
|
|
973
|
+
"External API latency"
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
"logging": {
|
|
977
|
+
"levels": "ERROR, WARN, INFO, DEBUG",
|
|
978
|
+
"structure": "JSON for parsing",
|
|
979
|
+
"retention": "7 days debug, 30 days info, 90 days error",
|
|
980
|
+
"pii": "Never log passwords, tokens, or PII"
|
|
981
|
+
},
|
|
982
|
+
"alerts": {
|
|
983
|
+
"error_rate": "> 1% for 5 minutes",
|
|
984
|
+
"response_time": "p95 > 1 second",
|
|
985
|
+
"disk_space": "< 10% free",
|
|
986
|
+
"custom": "Business metrics thresholds"
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
## Feature Flags & Experimentation
|
|
993
|
+
|
|
994
|
+
```jsx
|
|
995
|
+
{
|
|
996
|
+
"service": "LaunchDarkly", // or "Unleash" or "custom"
|
|
997
|
+
"patterns": {
|
|
998
|
+
"naming": "kebab-case descriptive",
|
|
999
|
+
"types": {
|
|
1000
|
+
"release": "Enable new features",
|
|
1001
|
+
"experiment": "A/B testing",
|
|
1002
|
+
"ops": "Circuit breakers",
|
|
1003
|
+
"permission": "User access control"
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
"lifecycle": {
|
|
1007
|
+
"creation": "Off by default",
|
|
1008
|
+
"rollout": "Percentage or user groups",
|
|
1009
|
+
"cleanup": "Remove after 30 days stable"
|
|
1010
|
+
},
|
|
1011
|
+
"implementation": {
|
|
1012
|
+
"frontend": "Hook: useFeatureFlag",
|
|
1013
|
+
"backend": "Middleware check",
|
|
1014
|
+
"fallback": "Default to safe behavior"
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
## Analytics & Tracking
|
|
1021
|
+
|
|
1022
|
+
```jsx
|
|
1023
|
+
{
|
|
1024
|
+
"service": "Google Analytics", // or "Mixpanel" or "Posthog"
|
|
1025
|
+
"implementation": {
|
|
1026
|
+
"page_views": "Automatic",
|
|
1027
|
+
"events": "Explicit tracking",
|
|
1028
|
+
"user_properties": "ID only, no PII",
|
|
1029
|
+
"consent": "Required before loading"
|
|
1030
|
+
},
|
|
1031
|
+
"event_naming": {
|
|
1032
|
+
"pattern": "object_action",
|
|
1033
|
+
"examples": [
|
|
1034
|
+
"button_clicked",
|
|
1035
|
+
"form_submitted",
|
|
1036
|
+
"page_viewed",
|
|
1037
|
+
"error_occurred"
|
|
1038
|
+
]
|
|
1039
|
+
},
|
|
1040
|
+
"data_layer": {
|
|
1041
|
+
"structure": {
|
|
1042
|
+
"event": "event_name",
|
|
1043
|
+
"properties": {},
|
|
1044
|
+
"user": { id: "uuid" },
|
|
1045
|
+
"session": { id: "uuid" }
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
"privacy": {
|
|
1049
|
+
"pii": "Never track personal info",
|
|
1050
|
+
"retention": "90 days default",
|
|
1051
|
+
"anonymization": "IP anonymization on",
|
|
1052
|
+
"opt_out": "Respect DNT header"
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
## Email & Notifications
|
|
1059
|
+
|
|
1060
|
+
```jsx
|
|
1061
|
+
{
|
|
1062
|
+
"email": {
|
|
1063
|
+
"service": "SendGrid", // or "AWS SES" or "Postmark"
|
|
1064
|
+
"templates": {
|
|
1065
|
+
"location": "/templates/emails",
|
|
1066
|
+
"engine": "Handlebars or React Email",
|
|
1067
|
+
"testing": "Preview in Storybook"
|
|
1068
|
+
},
|
|
1069
|
+
"patterns": {
|
|
1070
|
+
"transactional": "Immediate send",
|
|
1071
|
+
"batch": "Queue and send hourly",
|
|
1072
|
+
"marketing": "Requires consent"
|
|
1073
|
+
},
|
|
1074
|
+
"requirements": [
|
|
1075
|
+
"Unsubscribe link",
|
|
1076
|
+
"Plain text version",
|
|
1077
|
+
"Mobile responsive",
|
|
1078
|
+
"SPF/DKIM configured"
|
|
1079
|
+
]
|
|
1080
|
+
},
|
|
1081
|
+
"push_notifications": {
|
|
1082
|
+
"service": "OneSignal", // or "Firebase"
|
|
1083
|
+
"opt_in": "Explicit user consent",
|
|
1084
|
+
"frequency": "Max 3 per day",
|
|
1085
|
+
"quiet_hours": "10pm - 8am user timezone"
|
|
1086
|
+
},
|
|
1087
|
+
"in_app": {
|
|
1088
|
+
"pattern": "Toast for actions, banner for system",
|
|
1089
|
+
"duration": "5 seconds auto-dismiss",
|
|
1090
|
+
"priority": "Error > Warning > Success > Info"
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
---
|
|
1097
|
+
|
|
1098
|
+
## 🎯 USAGE WITH AI ASSISTANTS
|
|
1099
|
+
|
|
1100
|
+
### Project Context File Template
|
|
1101
|
+
|
|
1102
|
+
```markdown
|
|
1103
|
+
# Project: [Name]
|
|
1104
|
+
# Mode: [Speed/Discovery/Production]
|
|
1105
|
+
# Last Updated: [Date]
|
|
1106
|
+
|
|
1107
|
+
## Quick Context
|
|
1108
|
+
- Purpose: [One sentence what this does]
|
|
1109
|
+
- Users: [Who uses this]
|
|
1110
|
+
- Stage: [Prototype/MVP/Production]
|
|
1111
|
+
|
|
1112
|
+
## Technical Stack
|
|
1113
|
+
- Frontend: [React/Next.js/etc]
|
|
1114
|
+
- Backend: [Node/Python/etc]
|
|
1115
|
+
- Database: [PostgreSQL/MongoDB/etc]
|
|
1116
|
+
- Auth: [Auth0/Clerk/Custom]
|
|
1117
|
+
- Hosting: [Vercel/AWS/etc]
|
|
1118
|
+
|
|
1119
|
+
## Key Decisions Made
|
|
1120
|
+
1. [Decision]: [Reasoning]
|
|
1121
|
+
2. Using localStorage because single user (Speed Mode)
|
|
1122
|
+
3. No TypeScript yet, will add in Production Mode
|
|
1123
|
+
|
|
1124
|
+
## Current Conventions
|
|
1125
|
+
[Paste relevant sections from this checklist]
|
|
1126
|
+
|
|
1127
|
+
## Known Issues/Tech Debt
|
|
1128
|
+
- [ ] No error handling in API calls
|
|
1129
|
+
- [ ] Components over 500 lines need splitting
|
|
1130
|
+
- [ ] No tests yet
|
|
1131
|
+
|
|
1132
|
+
## Do NOT:
|
|
1133
|
+
- Change naming conventions without asking
|
|
1134
|
+
- Add new state management libraries
|
|
1135
|
+
- Refactor working code unless requested
|
|
1136
|
+
- Suggest optimizations in Speed Mode
|
|
1137
|
+
|
|
1138
|
+
```
|
|
1139
|
+
|
|
1140
|
+
### Prompt Prefix Template
|
|
1141
|
+
|
|
1142
|
+
```markdown
|
|
1143
|
+
@Claude - Continue with project standards:
|
|
1144
|
+
- File naming: [PascalCase components]
|
|
1145
|
+
- State: [useState only, no Redux]
|
|
1146
|
+
- API format: [REST, see response format]
|
|
1147
|
+
- Current file: [filename]
|
|
1148
|
+
- Mode: [Speed/Production]
|
|
1149
|
+
|
|
1150
|
+
Task: [Your actual request]
|
|
1151
|
+
|
|
1152
|
+
```
|
|
1153
|
+
|
|
1154
|
+
---
|
|
1155
|
+
|
|
1156
|
+
## ✅ STANDARDIZATION CHECKLIST
|
|
1157
|
+
|
|
1158
|
+
### 🔴 CORE: Minimum Viable Standards (Speed Mode)
|
|
1159
|
+
|
|
1160
|
+
**Must decide immediately - affects every file:**
|
|
1161
|
+
|
|
1162
|
+
- [ ] File naming convention
|
|
1163
|
+
- [ ] Component structure
|
|
1164
|
+
- [ ] State management approach
|
|
1165
|
+
- [ ] API response format
|
|
1166
|
+
- [ ] Error handling pattern
|
|
1167
|
+
- [ ] Database/data naming conventions
|
|
1168
|
+
- [ ] Git branch and commit strategy
|
|
1169
|
+
|
|
1170
|
+
### 🟡 SECONDARY: Common Decisions (Discovery/Speed Mode)
|
|
1171
|
+
|
|
1172
|
+
**Decide when you encounter them:**
|
|
1173
|
+
|
|
1174
|
+
- [ ] Import order and aliases
|
|
1175
|
+
- [ ] Form handling approach
|
|
1176
|
+
- [ ] Data validation patterns
|
|
1177
|
+
- [ ] Performance thresholds
|
|
1178
|
+
- [ ] Accessibility minimums
|
|
1179
|
+
- [ ] Animation patterns
|
|
1180
|
+
- [ ] File upload approach
|
|
1181
|
+
- [ ] Real-time/WebSocket patterns
|
|
1182
|
+
- [ ] Test data management
|
|
1183
|
+
- [ ] Code review process
|
|
1184
|
+
- [ ] Deployment pipeline
|
|
1185
|
+
- [ ] Documentation requirements
|
|
1186
|
+
|
|
1187
|
+
### 🟢 ADVANCED: Scale Decisions (Production Mode)
|
|
1188
|
+
|
|
1189
|
+
**Decide when optimizing/scaling:**
|
|
1190
|
+
|
|
1191
|
+
- [ ] Internationalization
|
|
1192
|
+
- [ ] Caching strategies
|
|
1193
|
+
- [ ] Security implementations
|
|
1194
|
+
- [ ] Business logic patterns
|
|
1195
|
+
- [ ] Performance optimization tactics
|
|
1196
|
+
- [ ] Monitoring and alerting
|
|
1197
|
+
- [ ] Feature flags
|
|
1198
|
+
- [ ] Analytics implementation
|
|
1199
|
+
- [ ] Email/notification systems
|
|
1200
|
+
- [ ] Advanced testing strategies
|
|
1201
|
+
- [ ] Microservices boundaries
|
|
1202
|
+
- [ ] CI/CD sophistication
|
|
1203
|
+
|
|
1204
|
+
### Signs You Need More Standardization
|
|
1205
|
+
|
|
1206
|
+
- Every AI conversation suggests different approaches
|
|
1207
|
+
- You spend time debating conventions instead of building
|
|
1208
|
+
- Files look like they were written by different people
|
|
1209
|
+
- Refactoring requires changing patterns everywhere
|
|
1210
|
+
- New team members/AI assistants are confused
|
|
1211
|
+
|
|
1212
|
+
---
|
|
1213
|
+
|
|
1214
|
+
## 🔄 KEEPING STANDARDS ALIVE
|
|
1215
|
+
|
|
1216
|
+
1. **Document as you decide** - Don't wait for perfect standards
|
|
1217
|
+
2. **Include in every prompt** - Reference your standards file
|
|
1218
|
+
3. **Update when you learn** - Standards should evolve
|
|
1219
|
+
4. **Be explicit about exceptions** - "Breaking convention because..."
|
|
1220
|
+
5. **Review periodically** - What's causing friction?
|
|
1221
|
+
|
|
1222
|
+
Remember: The goal isn't perfect standards, it's consistent standards that prevent re-litigation of solved problems.
|