ai-flow-dev 2.1.3 → 2.1.4

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.
Files changed (96) hide show
  1. package/README.md +25 -38
  2. package/dist/cli.js +68 -46
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +5 -5
  5. package/prompts/backend/flow-build-phase-0.md +31 -63
  6. package/prompts/backend/flow-build-phase-1.md +9 -17
  7. package/prompts/backend/flow-build-phase-10.md +199 -585
  8. package/prompts/backend/flow-build-phase-2.md +152 -86
  9. package/prompts/backend/flow-build-phase-3.md +108 -68
  10. package/prompts/backend/flow-build-phase-4.md +5 -8
  11. package/prompts/backend/flow-build-phase-5.md +39 -12
  12. package/prompts/backend/flow-build-phase-6.md +29 -8
  13. package/prompts/backend/flow-build-phase-7.md +120 -40
  14. package/prompts/backend/flow-build-phase-8.md +28 -65
  15. package/prompts/backend/flow-build-phase-9.md +267 -1298
  16. package/prompts/backend/flow-build.md +881 -957
  17. package/prompts/backend/flow-dev-commit.md +27 -50
  18. package/prompts/backend/flow-dev-feature.md +1929 -2017
  19. package/prompts/backend/flow-dev-fix.md +936 -964
  20. package/prompts/backend/flow-dev-refactor.md +672 -701
  21. package/prompts/backend/flow-dev-review.md +356 -389
  22. package/prompts/backend/flow-dev-work.md +1066 -1118
  23. package/prompts/backend/flow-docs-sync.md +20 -196
  24. package/prompts/frontend/flow-build-phase-0.md +503 -484
  25. package/prompts/frontend/flow-build-phase-1.md +445 -433
  26. package/prompts/frontend/flow-build-phase-2.md +910 -957
  27. package/prompts/frontend/flow-build-phase-3.md +692 -664
  28. package/prompts/frontend/flow-build-phase-4.md +478 -463
  29. package/prompts/frontend/flow-build-phase-5.md +488 -467
  30. package/prompts/frontend/flow-build-phase-6.md +571 -550
  31. package/prompts/frontend/flow-build-phase-7.md +560 -592
  32. package/prompts/frontend/flow-build-phase-8.md +17 -42
  33. package/prompts/frontend/flow-build.md +457 -503
  34. package/prompts/frontend/flow-docs-sync.md +14 -35
  35. package/prompts/mobile/flow-build-phase-0.md +104 -97
  36. package/prompts/mobile/flow-build-phase-1.md +137 -122
  37. package/prompts/mobile/flow-build-phase-2.md +123 -130
  38. package/prompts/mobile/flow-build-phase-3.md +144 -149
  39. package/prompts/mobile/flow-build-phase-4.md +140 -132
  40. package/prompts/mobile/flow-build-phase-5.md +70 -70
  41. package/prompts/mobile/flow-build-phase-6.md +136 -134
  42. package/prompts/mobile/flow-build-phase-7.md +24 -58
  43. package/prompts/mobile/flow-build-phase-8.md +17 -42
  44. package/prompts/mobile/flow-build.md +47 -97
  45. package/prompts/mobile/flow-docs-sync.md +13 -32
  46. package/prompts/shared/mermaid-guidelines.md +106 -0
  47. package/prompts/shared/scope-levels.md +126 -0
  48. package/prompts/shared/story-points.md +65 -0
  49. package/prompts/shared/task-format.md +86 -0
  50. package/templates/AGENT.template.md +194 -15
  51. package/templates/backend/README.template.md +2 -32
  52. package/templates/backend/ai-instructions.template.md +2 -32
  53. package/templates/backend/copilot-instructions.template.md +2 -22
  54. package/templates/backend/docs/api.template.md +89 -20
  55. package/templates/backend/docs/architecture.template.md +165 -53
  56. package/templates/backend/docs/business-flows.template.md +7 -14
  57. package/templates/backend/docs/code-standards.template.md +2 -38
  58. package/templates/backend/docs/contributing.template.md +2 -16
  59. package/templates/backend/docs/data-model.template.md +125 -21
  60. package/templates/backend/docs/operations.template.md +179 -50
  61. package/templates/backend/docs/testing.template.md +2 -42
  62. package/templates/backend/project-brief.template.md +2 -28
  63. package/templates/backend/specs/configuration.template.md +2 -14
  64. package/templates/backend/specs/security.template.md +2 -32
  65. package/templates/frontend/README.template.md +2 -18
  66. package/templates/frontend/ai-instructions.template.md +2 -20
  67. package/templates/frontend/docs/api-integration.template.md +12 -30
  68. package/templates/frontend/docs/components.template.md +2 -28
  69. package/templates/frontend/docs/error-handling.template.md +11 -27
  70. package/templates/frontend/docs/operations.template.md +8 -18
  71. package/templates/frontend/docs/performance.template.md +8 -18
  72. package/templates/frontend/docs/pwa.template.md +8 -18
  73. package/templates/frontend/docs/state-management.template.md +2 -28
  74. package/templates/frontend/docs/styling.template.md +2 -26
  75. package/templates/frontend/docs/testing.template.md +2 -28
  76. package/templates/frontend/project-brief.template.md +2 -16
  77. package/templates/frontend/specs/accessibility.template.md +8 -18
  78. package/templates/frontend/specs/configuration.template.md +2 -24
  79. package/templates/frontend/specs/security.template.md +10 -24
  80. package/templates/fullstack/README.template.md +17 -47
  81. package/templates/fullstack/ai-instructions.template.md +17 -45
  82. package/templates/fullstack/project-brief.template.md +16 -42
  83. package/templates/fullstack/specs/configuration.template.md +16 -42
  84. package/templates/mobile/README.template.md +11 -29
  85. package/templates/mobile/ai-instructions.template.md +11 -27
  86. package/templates/mobile/docs/app-store.template.md +11 -29
  87. package/templates/mobile/docs/architecture.template.md +14 -38
  88. package/templates/mobile/docs/native-features.template.md +16 -44
  89. package/templates/mobile/docs/navigation.template.md +9 -23
  90. package/templates/mobile/docs/offline-strategy.template.md +10 -26
  91. package/templates/mobile/docs/permissions.template.md +9 -23
  92. package/templates/mobile/docs/state-management.template.md +12 -32
  93. package/templates/mobile/docs/testing.template.md +14 -38
  94. package/templates/mobile/project-brief.template.md +12 -30
  95. package/templates/mobile/specs/build-configuration.template.md +10 -26
  96. package/templates/mobile/specs/deployment.template.md +9 -23
@@ -1,485 +1,506 @@
1
- # Phase 5: Code Standards & Best Practices
2
-
3
- **Duration:** 15-20 minutes
4
- **Questions:** ~10 questions
5
- **Output:** docs/code-standards.md, parts of ai-instructions.md
6
-
1
+ # Phase 5: Code Standards & Best Practices
2
+
3
+ **Duration:** 15-20 minutes
4
+ **Questions:** ~10 questions
5
+ **Output:** docs/code-standards.md, parts of ai-instructions.md
6
+ ---
7
+ ## 🎯 Objective
8
+
9
+ Define coding conventions and standards:
10
+
11
+ 1. File and component naming conventions
12
+ 2. Code formatting and linting rules
13
+ 3. Import organization
14
+ 4. Commit message standards
15
+ 5. Code review practices
16
+ ---
17
+ ## 📋 Questions
18
+
19
+ ### Question 5.1: File Naming Convention
20
+
21
+ **How will you name your files?**
22
+
23
+ #### React/Solid
24
+
25
+ A) ⭐ **PascalCase for components** (Recommended)
26
+
27
+ - Components: `UserProfile.tsx`, `Button.tsx`
28
+ - Hooks: `useAuth.ts`, `useLocalStorage.ts`
29
+ - Utils: `formatDate.ts`, `apiClient.ts`
30
+ - Best for: React ecosystem standard
31
+
32
+ B) **kebab-case for all files**
33
+
34
+ - Components: `user-profile.tsx`, `button.tsx`
35
+ - Best for: Consistency with Vue/Angular
36
+
37
+ C) **camelCase for all files**
38
+
39
+ - Components: `userProfile.tsx`, `button.tsx`
40
+ - Best for: JavaScript naming conventions
41
+
42
+ #### Vue
43
+
44
+ A) ⭐ **PascalCase for components** (Vue 3 recommended)
45
+
46
+ - Components: `UserProfile.vue`, `BaseButton.vue`
47
+ - Composables: `useAuth.ts`, `useLocalStorage.ts`
48
+ - Utils: `formatDate.ts`
49
+
50
+ B) **kebab-case (Vue 2 style)**
51
+
52
+ - Components: `user-profile.vue`, `base-button.vue`
53
+
54
+ #### Angular
55
+
56
+ A) ⭐ **kebab-case with suffixes** (Angular standard)
57
+
58
+ - Components: `user-profile.component.ts`
59
+ - Services: `auth.service.ts`
60
+ - Modules: `user.module.ts`
61
+ - Guards: `auth.guard.ts`
62
+
63
+ #### Svelte
64
+
65
+ A) ⭐ **PascalCase for components**
66
+
67
+ - Components: `UserProfile.svelte`, `Button.svelte`
68
+
69
+ **Your answer:**
7
70
  ---
8
-
9
- ## 🎯 Objective
10
-
11
- Define coding conventions and standards:
12
-
13
- 1. File and component naming conventions
14
- 2. Code formatting and linting rules
15
- 3. Import organization
16
- 4. Commit message standards
17
- 5. Code review practices
18
-
71
+ ### Question 5.2: Component Naming Convention
72
+
73
+ **How will you name components in code?**
74
+
75
+ A) ⭐ **PascalCase** (All frameworks recommend)
76
+
77
+ - Example: `<UserProfile />`, `<Button />`
78
+ - Best for: Standard practice
79
+
80
+ B) **Named exports vs default exports?**
81
+
82
+ #### React/Vue/Solid
83
+
84
+ A) ⭐ **Named exports** (Recommended)
85
+
86
+ ```typescript
87
+ export const Button = () => { ... }
88
+ // Usage: import { Button } from './Button'
89
+ ```
90
+
91
+ - Pros: Better IDE support, easier refactoring, explicit names
92
+ - Cons: Slightly more verbose
93
+
94
+ B) **Default exports**
95
+
96
+ ```typescript
97
+ export default function Button() { ... }
98
+ // Usage: import Button from './Button'
99
+ ```
100
+
101
+ - Pros: Shorter imports
102
+ - Cons: Can rename on import, harder to refactor
103
+
104
+ **Your answer:**
19
105
  ---
20
-
21
- ## 📋 Questions
22
-
23
- ### Question 5.1: File Naming Convention
24
-
25
- **How will you name your files?**
26
-
27
- #### React/Solid
28
-
29
- A) ⭐ **PascalCase for components** (Recommended)
30
- - Components: `UserProfile.tsx`, `Button.tsx`
31
- - Hooks: `useAuth.ts`, `useLocalStorage.ts`
32
- - Utils: `formatDate.ts`, `apiClient.ts`
33
- - Best for: React ecosystem standard
34
-
35
- B) **kebab-case for all files**
36
- - Components: `user-profile.tsx`, `button.tsx`
37
- - Best for: Consistency with Vue/Angular
38
-
39
- C) **camelCase for all files**
40
- - Components: `userProfile.tsx`, `button.tsx`
41
- - Best for: JavaScript naming conventions
42
-
43
- #### Vue
44
-
45
- A) ⭐ **PascalCase for components** (Vue 3 recommended)
46
- - Components: `UserProfile.vue`, `BaseButton.vue`
47
- - Composables: `useAuth.ts`, `useLocalStorage.ts`
48
- - Utils: `formatDate.ts`
49
-
50
- B) **kebab-case (Vue 2 style)**
51
- - Components: `user-profile.vue`, `base-button.vue`
52
-
53
- #### Angular
54
-
55
- A) ⭐ **kebab-case with suffixes** (Angular standard)
56
- - Components: `user-profile.component.ts`
57
- - Services: `auth.service.ts`
58
- - Modules: `user.module.ts`
59
- - Guards: `auth.guard.ts`
60
-
61
- #### Svelte
62
-
63
- A) ⭐ **PascalCase for components**
64
- - Components: `UserProfile.svelte`, `Button.svelte`
65
-
66
- **Your answer:**
67
-
106
+ ### Question 5.3: Linting & Formatting
107
+
108
+ **What linting/formatting tools will you use?**
109
+
110
+ A) ⭐ **ESLint + Prettier** (Recommended)
111
+
112
+ - ESLint: Code quality rules
113
+ - Prettier: Code formatting
114
+ - Best for: Most JavaScript/TypeScript projects
115
+
116
+ B) **ESLint only**
117
+
118
+ - Configure ESLint for both linting and formatting
119
+ - Best for: Simpler setup
120
+
121
+ C) **Biome**
122
+
123
+ - All-in-one linter and formatter (faster than ESLint+Prettier)
124
+ - Best for: Monorepos, performance-critical projects
125
+
126
+ D) **No linting/formatting**
127
+
128
+ - Manual code review only
129
+ - Not recommended
130
+
131
+ **Your answer:**
132
+
133
+ **If ESLint, which config?**
134
+
135
+ #### React
136
+
137
+ A) **eslint-config-airbnb** (Strict, popular)
138
+ B) **@typescript-eslint/recommended** (TypeScript-focused)
139
+ C) **eslint-config-react-app** (Create React App default)
140
+ D) **Custom config**
141
+
142
+ #### Vue
143
+
144
+ A) ⭐ **eslint-plugin-vue** (Official Vue rules)
145
+ B) **@vue/eslint-config-typescript** (Vue + TypeScript)
146
+
147
+ #### Angular
148
+
149
+ A) ⭐ **@angular-eslint** (Official Angular ESLint)
150
+
151
+ **Prettier config:**
152
+
153
+ - Print width: **\_** (default: 80)
154
+ - Tabs or spaces: **\_** (default: 2 spaces)
155
+ - Semicolons: Yes / No (default: Yes)
156
+ - Single quotes: Yes / No (default: No)
157
+ - Trailing commas: es5 / all / none (default: es5)
68
158
  ---
69
-
70
- ### Question 5.2: Component Naming Convention
71
-
72
- **How will you name components in code?**
73
-
74
- A) ⭐ **PascalCase** (All frameworks recommend)
75
- - Example: `<UserProfile />`, `<Button />`
76
- - Best for: Standard practice
77
-
78
- B) **Named exports vs default exports?**
79
-
80
- #### React/Vue/Solid
81
-
82
- A) **Named exports** (Recommended)
83
- ```typescript
84
- export const Button = () => { ... }
85
- // Usage: import { Button } from './Button'
86
- ```
87
- - Pros: Better IDE support, easier refactoring, explicit names
88
- - Cons: Slightly more verbose
89
-
90
- B) **Default exports**
91
- ```typescript
92
- export default function Button() { ... }
93
- // Usage: import Button from './Button'
94
- ```
95
- - Pros: Shorter imports
96
- - Cons: Can rename on import, harder to refactor
97
-
98
- **Your answer:**
99
-
159
+ ### Question 5.4: Import Organization
160
+
161
+ **How will you organize imports?**
162
+
163
+ A) ⭐ **Grouped by type** (Recommended)
164
+
165
+ ```typescript
166
+ // 1. External libraries
167
+ import React from 'react';
168
+ import { useQuery } from '@tanstack/react-query';
169
+
170
+ // 2. Internal modules
171
+ import { Button } from '@/components/Button';
172
+ import { useAuth } from '@/hooks/useAuth';
173
+
174
+ // 3. Relative imports
175
+ import { UserCard } from './UserCard';
176
+
177
+ // 4. Types
178
+ import type { User } from '@/types';
179
+
180
+ // 5. Styles
181
+ import styles from './styles.module.css';
182
+ ```
183
+
184
+ B) **Alphabetical only**
185
+
186
+ - All imports alphabetically sorted
187
+ - Best for: Simpler rule
188
+
189
+ C) **No specific order**
190
+
191
+ - Not recommended
192
+
193
+ **Your answer:**
194
+
195
+ **Import alias for src/?**
196
+
197
+ - `@/` (e.g., `import { Button } from '@/components/Button'`)
198
+ - `~/` (e.g., `import { Button } from '~/components/Button'`)
199
+ - No alias (relative paths only)
200
+
201
+ **Auto-import sorting tool:**
202
+
203
+ - `eslint-plugin-import` + `import/order` rule
204
+ - `prettier-plugin-organize-imports`
205
+ - Manual
100
206
  ---
101
-
102
- ### Question 5.3: Linting & Formatting
103
-
104
- **What linting/formatting tools will you use?**
105
-
106
- A) ⭐ **ESLint + Prettier** (Recommended)
107
- - ESLint: Code quality rules
108
- - Prettier: Code formatting
109
- - Best for: Most JavaScript/TypeScript projects
110
-
111
- B) **ESLint only**
112
- - Configure ESLint for both linting and formatting
113
- - Best for: Simpler setup
114
-
115
- C) **Biome**
116
- - All-in-one linter and formatter (faster than ESLint+Prettier)
117
- - Best for: Monorepos, performance-critical projects
118
-
119
- D) **No linting/formatting**
120
- - Manual code review only
121
- - Not recommended
122
-
123
- **Your answer:**
124
-
125
- **If ESLint, which config?**
126
-
127
- #### React
128
-
129
- A) **eslint-config-airbnb** (Strict, popular)
130
- B) **@typescript-eslint/recommended** (TypeScript-focused)
131
- C) **eslint-config-react-app** (Create React App default)
132
- D) **Custom config**
133
-
134
- #### Vue
135
-
136
- A) **eslint-plugin-vue** (Official Vue rules)
137
- B) **@vue/eslint-config-typescript** (Vue + TypeScript)
138
-
139
- #### Angular
140
-
141
- A) ⭐ **@angular-eslint** (Official Angular ESLint)
142
-
143
- **Prettier config:**
144
- - Print width: _____ (default: 80)
145
- - Tabs or spaces: _____ (default: 2 spaces)
146
- - Semicolons: Yes / No (default: Yes)
147
- - Single quotes: Yes / No (default: No)
148
- - Trailing commas: es5 / all / none (default: es5)
149
-
207
+ ### Question 5.5: TypeScript Strictness
208
+
209
+ **How strict should TypeScript be?**
210
+
211
+ A) ⭐ **Strict mode** (Recommended)
212
+
213
+ ```json
214
+ {
215
+ "strict": true,
216
+ "noUncheckedIndexedAccess": true,
217
+ "noImplicitOverride": true
218
+ }
219
+ ```
220
+
221
+ - Catches most type errors
222
+ - Best for: New projects, type safety
223
+
224
+ B) **Moderate**
225
+
226
+ ```json
227
+ {
228
+ "strict": true,
229
+ "noUncheckedIndexedAccess": false
230
+ }
231
+ ```
232
+
233
+ - Strict but allows some flexibility
234
+
235
+ C) **Lenient**
236
+
237
+ - Minimal type checking
238
+ - Best for: Migration from JavaScript
239
+
240
+ **Your answer:**
241
+
242
+ **`any` type policy:**
243
+ A) Never allow `any` (use `unknown` instead)
244
+ B) ⚠️ Allow `any` with eslint warning
245
+ C) ✅ Allow `any` freely (not recommended)
150
246
  ---
151
-
152
- ### Question 5.4: Import Organization
153
-
154
- **How will you organize imports?**
155
-
156
- A) ⭐ **Grouped by type** (Recommended)
157
- ```typescript
158
- // 1. External libraries
159
- import React from 'react';
160
- import { useQuery } from '@tanstack/react-query';
161
-
162
- // 2. Internal modules
163
- import { Button } from '@/components/Button';
164
- import { useAuth } from '@/hooks/useAuth';
165
-
166
- // 3. Relative imports
167
- import { UserCard } from './UserCard';
168
-
169
- // 4. Types
170
- import type { User } from '@/types';
171
-
172
- // 5. Styles
173
- import styles from './styles.module.css';
174
- ```
175
-
176
- B) **Alphabetical only**
177
- - All imports alphabetically sorted
178
- - Best for: Simpler rule
179
-
180
- C) **No specific order**
181
- - Not recommended
182
-
183
- **Your answer:**
184
-
185
- **Import alias for src/?**
186
- - `@/` (e.g., `import { Button } from '@/components/Button'`)
187
- - `~/` (e.g., `import { Button } from '~/components/Button'`)
188
- - No alias (relative paths only)
189
-
190
- **Auto-import sorting tool:**
191
- - `eslint-plugin-import` + `import/order` rule
192
- - `prettier-plugin-organize-imports`
193
- - Manual
194
-
247
+ ### Question 5.6: Code Comments
248
+
249
+ **What's your commenting policy?**
250
+
251
+ A) ⭐ **JSDoc for public APIs, inline for complex logic**
252
+
253
+ ```typescript
254
+ /**
255
+ * Fetches user data from the API
256
+ * @param userId - The user's unique identifier
257
+ * @returns User object or null if not found
258
+ */
259
+ export async function fetchUser(userId: string): Promise<User | null> {
260
+ // Check cache first to avoid unnecessary API call
261
+ const cached = cache.get(userId);
262
+ if (cached) return cached;
263
+
264
+ return api.get(`/users/${userId}`);
265
+ }
266
+ ```
267
+
268
+ - Best for: Most projects
269
+
270
+ B) **JSDoc everywhere**
271
+
272
+ - Comment all functions, even private ones
273
+ - Best for: Libraries, public APIs
274
+
275
+ C) **Minimal comments**
276
+
277
+ - Self-documenting code only
278
+ - Comments only for "why", not "what"
279
+
280
+ D) **No comment policy**
281
+
282
+ - Up to developers
283
+
284
+ **Your answer:**
195
285
  ---
196
-
197
- ### Question 5.5: TypeScript Strictness
198
-
199
- **How strict should TypeScript be?**
200
-
201
- A) ⭐ **Strict mode** (Recommended)
202
- ```json
203
- {
204
- "strict": true,
205
- "noUncheckedIndexedAccess": true,
206
- "noImplicitOverride": true
207
- }
208
- ```
209
- - Catches most type errors
210
- - Best for: New projects, type safety
211
-
212
- B) **Moderate**
213
- ```json
214
- {
215
- "strict": true,
216
- "noUncheckedIndexedAccess": false
217
- }
218
- ```
219
- - Strict but allows some flexibility
220
-
221
- C) **Lenient**
222
- - Minimal type checking
223
- - Best for: Migration from JavaScript
224
-
225
- **Your answer:**
226
-
227
- **`any` type policy:**
228
- A) ❌ Never allow `any` (use `unknown` instead)
229
- B) ⚠️ Allow `any` with eslint warning
230
- C) ✅ Allow `any` freely (not recommended)
231
-
286
+ ### Question 5.7: Component Structure
287
+
288
+ **How will you structure components?**
289
+
290
+ A) ⭐ **Collocated files** (Recommended)
291
+
292
+ ```
293
+ Button/
294
+ ├── Button.tsx
295
+ ├── Button.test.tsx
296
+ ├── Button.stories.tsx
297
+ ├── Button.module.css
298
+ └── index.ts (re-export)
299
+ ```
300
+
301
+ - Best for: Modularity, easy to move/delete
302
+
303
+ B) **Separate folders**
304
+
305
+ ```
306
+ components/Button.tsx
307
+ styles/Button.module.css
308
+ tests/Button.test.tsx
309
+ ```
310
+
311
+ - Best for: Simpler structure, smaller projects
312
+
313
+ C) **Single file components** (Vue SFC style)
314
+
315
+ ```vue
316
+ <template>...</template>
317
+ <script>
318
+ ...
319
+ </script>
320
+ <style>
321
+ ...
322
+ </style>
323
+ ```
324
+
325
+ - Best for: Vue, Svelte
326
+
327
+ **Your answer:**
232
328
  ---
233
-
234
- ### Question 5.6: Code Comments
235
-
236
- **What's your commenting policy?**
237
-
238
- A) ⭐ **JSDoc for public APIs, inline for complex logic**
239
- ```typescript
240
- /**
241
- * Fetches user data from the API
242
- * @param userId - The user's unique identifier
243
- * @returns User object or null if not found
244
- */
245
- export async function fetchUser(userId: string): Promise<User | null> {
246
- // Check cache first to avoid unnecessary API call
247
- const cached = cache.get(userId);
248
- if (cached) return cached;
249
-
250
- return api.get(`/users/${userId}`);
251
- }
252
- ```
253
- - Best for: Most projects
254
-
255
- B) **JSDoc everywhere**
256
- - Comment all functions, even private ones
257
- - Best for: Libraries, public APIs
258
-
259
- C) **Minimal comments**
260
- - Self-documenting code only
261
- - Comments only for "why", not "what"
262
-
263
- D) **No comment policy**
264
- - Up to developers
265
-
266
- **Your answer:**
267
-
329
+ ### Question 5.8: Error Handling Patterns
330
+
331
+ **How will you handle errors in components?**
332
+
333
+ A) ⭐ **Error Boundaries + Try-Catch**
334
+
335
+ - Error Boundaries: Catch render errors
336
+ - Try-Catch: Catch async errors
337
+ - Best for: React, robust error handling
338
+
339
+ B) **Global error handler**
340
+
341
+ - Vue: `app.config.errorHandler`
342
+ - Angular: `ErrorHandler`
343
+ - Best for: Centralized error logging
344
+
345
+ C) **Try-Catch everywhere**
346
+
347
+ - Manual error handling in each function
348
+ - Best for: Fine-grained control
349
+
350
+ **Your answer:**
351
+
352
+ **Error logging:**
353
+
354
+ - Sentry
355
+ - LogRocket
356
+ - DataDog
357
+ - Console only (development)
358
+ - No logging
268
359
  ---
269
-
270
- ### Question 5.7: Component Structure
271
-
272
- **How will you structure components?**
273
-
274
- A) ⭐ **Collocated files** (Recommended)
275
- ```
276
- Button/
277
- ├── Button.tsx
278
- ├── Button.test.tsx
279
- ├── Button.stories.tsx
280
- ├── Button.module.css
281
- └── index.ts (re-export)
282
- ```
283
- - Best for: Modularity, easy to move/delete
284
-
285
- B) **Separate folders**
286
- ```
287
- components/Button.tsx
288
- styles/Button.module.css
289
- tests/Button.test.tsx
290
- ```
291
- - Best for: Simpler structure, smaller projects
292
-
293
- C) **Single file components** (Vue SFC style)
294
- ```vue
295
- <template>...</template>
296
- <script>...</script>
297
- <style>...</style>
298
- ```
299
- - Best for: Vue, Svelte
300
-
301
- **Your answer:**
302
-
360
+ ### Question 5.9: Code Review Standards
361
+
362
+ **What's required for code review approval?**
363
+
364
+ Select all that apply:
365
+
366
+ - [ ] Linting passes (no ESLint errors)
367
+ - [ ] Tests pass (unit + integration)
368
+ - [ ] Code coverage meets threshold (specify: \_\_\_%)
369
+ - [ ] No TypeScript errors
370
+ - [ ] At least 1 approval from team member
371
+ - [ ] Self-review (author reviews their own PR)
372
+ - [ ] Documentation updated (if public API changed)
373
+ - [ ] No console.log statements
374
+ - [ ] Accessibility review (for UI changes)
375
+
376
+ **Minimum approvals required:** **\_**
377
+
378
+ **Approval required from:**
379
+ A) Any team member
380
+ B) Senior/Lead developer
381
+ C) Code owner (GitHub CODEOWNERS)
382
+
383
+ **Your answer:**
303
384
  ---
304
-
305
- ### Question 5.8: Error Handling Patterns
306
-
307
- **How will you handle errors in components?**
308
-
309
- A) ⭐ **Error Boundaries + Try-Catch**
310
- - Error Boundaries: Catch render errors
311
- - Try-Catch: Catch async errors
312
- - Best for: React, robust error handling
313
-
314
- B) **Global error handler**
315
- - Vue: `app.config.errorHandler`
316
- - Angular: `ErrorHandler`
317
- - Best for: Centralized error logging
318
-
319
- C) **Try-Catch everywhere**
320
- - Manual error handling in each function
321
- - Best for: Fine-grained control
322
-
323
- **Your answer:**
324
-
325
- **Error logging:**
326
- - Sentry
327
- - LogRocket
328
- - DataDog
329
- - Console only (development)
330
- - No logging
331
-
385
+ ### Question 5.10: Commit Message Convention
386
+
387
+ **What commit message format will you use?**
388
+
389
+ A) ⭐ **Conventional Commits** (Recommended)
390
+
391
+ ```
392
+ <type>(<scope>): <subject>
393
+
394
+ <body>
395
+
396
+ <footer>
397
+ ```
398
+
399
+ - Types: feat, fix, docs, style, refactor, test, chore
400
+ - Example: `feat(auth): add Google OAuth login`
401
+ - Best for: Automated changelogs, semantic versioning
402
+
403
+ B) **Simple descriptive**
404
+
405
+ - Example: "Add Google OAuth login"
406
+ - Best for: Small teams, simple projects
407
+
408
+ C) **No convention**
409
+
410
+ - Free-form commit messages
411
+
412
+ **Your answer:**
413
+
414
+ **If Conventional Commits, enforce with:**
415
+
416
+ - commitlint (pre-commit hook)
417
+ - Manual review
418
+ - No enforcement
419
+
420
+ **Require commit body for:**
421
+ A) All commits
422
+ B) Only breaking changes
423
+ C) Never required
332
424
  ---
333
-
334
- ### Question 5.9: Code Review Standards
335
-
336
- **What's required for code review approval?**
337
-
338
- Select all that apply:
339
-
340
- - [ ] Linting passes (no ESLint errors)
341
- - [ ] Tests pass (unit + integration)
342
- - [ ] Code coverage meets threshold (specify: ___%)
343
- - [ ] No TypeScript errors
344
- - [ ] At least 1 approval from team member
345
- - [ ] Self-review (author reviews their own PR)
346
- - [ ] Documentation updated (if public API changed)
347
- - [ ] No console.log statements
348
- - [ ] Accessibility review (for UI changes)
349
-
350
- **Minimum approvals required:** _____
351
-
352
- **Approval required from:**
353
- A) Any team member
354
- B) Senior/Lead developer
355
- C) Code owner (GitHub CODEOWNERS)
356
-
357
- **Your answer:**
358
-
425
+ ## 📊 Phase 5 Summary
426
+
427
+ ```
359
428
  ---
360
-
361
- ### Question 5.10: Commit Message Convention
362
-
363
- **What commit message format will you use?**
364
-
365
- A) ⭐ **Conventional Commits** (Recommended)
366
- ```
367
- <type>(<scope>): <subject>
368
-
369
- <body>
370
-
371
- <footer>
372
- ```
373
- - Types: feat, fix, docs, style, refactor, test, chore
374
- - Example: `feat(auth): add Google OAuth login`
375
- - Best for: Automated changelogs, semantic versioning
376
-
377
- B) **Simple descriptive**
378
- - Example: "Add Google OAuth login"
379
- - Best for: Small teams, simple projects
380
-
381
- C) **No convention**
382
- - Free-form commit messages
383
-
384
- **Your answer:**
385
-
386
- **If Conventional Commits, enforce with:**
387
- - commitlint (pre-commit hook)
388
- - Manual review
389
- - No enforcement
390
-
391
- **Require commit body for:**
392
- A) All commits
393
- B) Only breaking changes
394
- C) Never required
395
-
429
+ 📋 PHASE 5 SUMMARY: CODE STANDARDS
396
430
  ---
397
-
398
- ## 📊 Phase 5 Summary
399
-
400
- ```
401
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
402
- 📋 PHASE 5 SUMMARY: CODE STANDARDS
403
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
404
-
405
- File Naming: [Answer from 5.1]
406
- Component Naming: [Answer from 5.2]
407
- Linting/Formatting: [Answer from 5.3]
408
- Import Organization: [Answer from 5.4]
409
- TypeScript Strictness: [Answer from 5.5]
410
- Code Comments: [Answer from 5.6]
411
- Component Structure: [Answer from 5.7]
412
- Error Handling: [Answer from 5.8]
413
- Code Review: [Answer from 5.9]
414
- Commit Messages: [Answer from 5.10]
415
- Logging Standards: [Answer from 5.11]
416
- Documentation Tools: [Answer from 5.12]
417
-
418
- Is this correct? (Y/n)
419
- ```
420
-
431
+ File Naming: [Answer from 5.1]
432
+ Component Naming: [Answer from 5.2]
433
+ Linting/Formatting: [Answer from 5.3]
434
+ Import Organization: [Answer from 5.4]
435
+ TypeScript Strictness: [Answer from 5.5]
436
+ Code Comments: [Answer from 5.6]
437
+ Component Structure: [Answer from 5.7]
438
+ Error Handling: [Answer from 5.8]
439
+ Code Review: [Answer from 5.9]
440
+ Commit Messages: [Answer from 5.10]
441
+ Logging Standards: [Answer from 5.11]
442
+ Documentation Tools: [Answer from 5.12]
443
+
444
+ Is this correct? (Y/n)
445
+ ```
421
446
  ---
422
-
423
- ## 📝 Document Generation
424
-
425
- Generate `docs/code-standards.md` with these placeholders:
426
-
427
- - `{{FILE_NAMING_CONVENTION}}` → File naming pattern
428
- - `{{COMPONENT_NAMING}}` → Component naming pattern
429
- - `{{LINTING_TOOLS}}` → ESLint + Prettier / Biome / etc.
430
- - `{{IMPORT_ORGANIZATION}}` → Import order rules
431
- - `{{TYPESCRIPT_STRICTNESS}}` → Strict / Moderate / Lenient
432
- - `{{COMMENT_POLICY}}` → Commenting guidelines
433
- - `{{COMPONENT_STRUCTURE}}` → File structure pattern
434
- - `{{ERROR_HANDLING}}` → Error handling approach
435
- - `{{CODE_REVIEW_RULES}}` → Review requirements
436
- - `{{COMMIT_CONVENTION}}` → Commit message format
437
-
438
- Update `ai-instructions.md`:
439
-
440
- ```markdown
441
- ## Code Standards
442
-
443
- - **File Naming:** {{FILE_NAMING_CONVENTION}}
444
- - **Component Naming:** {{COMPONENT_NAMING}}
445
- - **Linting:** {{LINTING_TOOLS}}
446
- - **TypeScript:** {{TYPESCRIPT_STRICTNESS}}
447
-
448
- ### Rules
449
-
450
- - ✅ ALWAYS use {{FILE_NAMING_CONVENTION}} for file names
451
- - ✅ ALWAYS use {{COMPONENT_NAMING}} for component names
452
- - ALWAYS run linter before committing
453
- - ❌ NEVER commit code with ESLint errors
454
- - NEVER use `any` type (use `unknown` instead)
455
- - ✅ ALWAYS write JSDoc for exported functions
456
- - ✅ ALWAYS use {{IMPORT_ORGANIZATION}} for imports
457
- {{#IF_CONVENTIONAL_COMMITS}}
458
- - ✅ ALWAYS use Conventional Commits format
459
- {{/IF_CONVENTIONAL_COMMITS}}
460
- ```
461
-
447
+ ## 📝 Document Generation
448
+
449
+ Generate `docs/code-standards.md` with these placeholders:
450
+
451
+ - `{{FILE_NAMING_CONVENTION}}` → File naming pattern
452
+ - `{{COMPONENT_NAMING}}` → Component naming pattern
453
+ - `{{LINTING_TOOLS}}` → ESLint + Prettier / Biome / etc.
454
+ - `{{IMPORT_ORGANIZATION}}` → Import order rules
455
+ - `{{TYPESCRIPT_STRICTNESS}}` → Strict / Moderate / Lenient
456
+ - `{{COMMENT_POLICY}}` → Commenting guidelines
457
+ - `{{COMPONENT_STRUCTURE}}` → File structure pattern
458
+ - `{{ERROR_HANDLING}}` → Error handling approach
459
+ - `{{CODE_REVIEW_RULES}}` → Review requirements
460
+ - `{{COMMIT_CONVENTION}}` → Commit message format
461
+
462
+ Update `ai-instructions.md`:
463
+
464
+ ```markdown
465
+ ## Code Standards
466
+
467
+ - **File Naming:** {{FILE_NAMING_CONVENTION}}
468
+ - **Component Naming:** {{COMPONENT_NAMING}}
469
+ - **Linting:** {{LINTING_TOOLS}}
470
+ - **TypeScript:** {{TYPESCRIPT_STRICTNESS}}
471
+
472
+ ### Rules
473
+
474
+ - ✅ ALWAYS use {{FILE_NAMING_CONVENTION}} for file names
475
+ - ✅ ALWAYS use {{COMPONENT_NAMING}} for component names
476
+ - ✅ ALWAYS run linter before committing
477
+ - NEVER commit code with ESLint errors
478
+ - ❌ NEVER use `any` type (use `unknown` instead)
479
+ - ALWAYS write JSDoc for exported functions
480
+ - ✅ ALWAYS use {{IMPORT_ORGANIZATION}} for imports
481
+ {{#IF_CONVENTIONAL_COMMITS}}
482
+ - ✅ ALWAYS use Conventional Commits format
483
+ {{/IF_CONVENTIONAL_COMMITS}}
484
+ ```
462
485
  ---
463
-
464
- ## 🚀 Next Steps
465
-
466
- ```
467
- ✅ Phase 5 Complete!
468
-
469
- Documents Generated:
470
- - docs/code-standards.md
471
- - ai-instructions.md (updated)
472
-
473
- Next: Phase 6 - Testing Strategy
474
-
475
- Read: .ai-flow/prompts/frontend/flow-build-phase-6-testing.md
476
- ```
477
-
486
+ ## 🚀 Next Steps
487
+
488
+ ```
489
+ ✅ Phase 5 Complete!
490
+
491
+ Documents Generated:
492
+ - docs/code-standards.md
493
+ - ai-instructions.md (updated)
494
+
495
+ Next: Phase 6 - Testing Strategy
496
+
497
+ Read: .ai-flow/prompts/frontend/flow-build-phase-6-testing.md
498
+ ```
478
499
  ---
479
-
480
- **Last Updated:** 2025-01-XX
481
-
482
- **Version:** 1.2.0
500
+ **Last Updated:** 2025-01-XX
501
+
502
+ **Version:** 1.2.0
503
+
483
504
 
484
505
 
485
506