ai-flow-dev 2.1.2 → 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.
- package/README.md +28 -40
- package/dist/cli.js +69 -47
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
- package/prompts/backend/flow-build-phase-0.md +96 -84
- package/prompts/backend/flow-build-phase-1.md +10 -18
- package/prompts/backend/flow-build-phase-10.md +199 -583
- package/prompts/backend/flow-build-phase-2.md +152 -86
- package/prompts/backend/flow-build-phase-3.md +108 -68
- package/prompts/backend/flow-build-phase-4.md +5 -8
- package/prompts/backend/flow-build-phase-5.md +39 -12
- package/prompts/backend/flow-build-phase-6.md +29 -8
- package/prompts/backend/flow-build-phase-7.md +121 -41
- package/prompts/backend/flow-build-phase-8.md +28 -65
- package/prompts/backend/flow-build-phase-9.md +267 -1298
- package/prompts/backend/flow-build.md +881 -957
- package/prompts/backend/flow-dev-commit.md +27 -50
- package/prompts/backend/flow-dev-feature.md +1929 -2017
- package/prompts/backend/flow-dev-fix.md +936 -964
- package/prompts/backend/flow-dev-refactor.md +672 -701
- package/prompts/backend/flow-dev-review.md +356 -389
- package/prompts/backend/flow-dev-work.md +1066 -1118
- package/prompts/backend/flow-docs-sync.md +31 -210
- package/prompts/frontend/flow-build-phase-0.md +503 -484
- package/prompts/frontend/flow-build-phase-1.md +445 -433
- package/prompts/frontend/flow-build-phase-2.md +910 -957
- package/prompts/frontend/flow-build-phase-3.md +692 -664
- package/prompts/frontend/flow-build-phase-4.md +478 -463
- package/prompts/frontend/flow-build-phase-5.md +488 -467
- package/prompts/frontend/flow-build-phase-6.md +571 -550
- package/prompts/frontend/flow-build-phase-7.md +560 -592
- package/prompts/frontend/flow-build-phase-8.md +17 -42
- package/prompts/frontend/flow-build.md +457 -503
- package/prompts/frontend/flow-docs-sync.md +24 -45
- package/prompts/mobile/flow-build-phase-0.md +104 -97
- package/prompts/mobile/flow-build-phase-1.md +137 -122
- package/prompts/mobile/flow-build-phase-2.md +123 -130
- package/prompts/mobile/flow-build-phase-3.md +144 -149
- package/prompts/mobile/flow-build-phase-4.md +140 -132
- package/prompts/mobile/flow-build-phase-5.md +70 -70
- package/prompts/mobile/flow-build-phase-6.md +136 -134
- package/prompts/mobile/flow-build-phase-7.md +24 -58
- package/prompts/mobile/flow-build-phase-8.md +17 -42
- package/prompts/mobile/flow-build.md +47 -97
- package/prompts/mobile/flow-docs-sync.md +23 -42
- package/prompts/shared/mermaid-guidelines.md +106 -0
- package/prompts/shared/scope-levels.md +126 -0
- package/prompts/shared/story-points.md +65 -0
- package/prompts/shared/task-format.md +86 -0
- package/templates/AGENT.template.md +194 -15
- package/templates/backend/README.template.md +2 -32
- package/templates/backend/ai-instructions.template.md +2 -32
- package/templates/backend/copilot-instructions.template.md +2 -22
- package/templates/backend/docs/api.template.md +89 -20
- package/templates/backend/docs/architecture.template.md +165 -53
- package/templates/backend/docs/business-flows.template.md +7 -14
- package/templates/backend/docs/code-standards.template.md +2 -38
- package/templates/backend/docs/contributing.template.md +2 -16
- package/templates/backend/docs/data-model.template.md +125 -21
- package/templates/backend/docs/operations.template.md +179 -50
- package/templates/backend/docs/testing.template.md +2 -42
- package/templates/backend/project-brief.template.md +2 -28
- package/templates/backend/specs/configuration.template.md +2 -14
- package/templates/backend/specs/security.template.md +2 -32
- package/templates/frontend/README.template.md +2 -18
- package/templates/frontend/ai-instructions.template.md +2 -20
- package/templates/frontend/docs/api-integration.template.md +12 -30
- package/templates/frontend/docs/components.template.md +2 -28
- package/templates/frontend/docs/error-handling.template.md +11 -27
- package/templates/frontend/docs/operations.template.md +8 -18
- package/templates/frontend/docs/performance.template.md +8 -18
- package/templates/frontend/docs/pwa.template.md +8 -18
- package/templates/frontend/docs/state-management.template.md +2 -28
- package/templates/frontend/docs/styling.template.md +2 -26
- package/templates/frontend/docs/testing.template.md +2 -28
- package/templates/frontend/project-brief.template.md +2 -16
- package/templates/frontend/specs/accessibility.template.md +8 -18
- package/templates/frontend/specs/configuration.template.md +2 -24
- package/templates/frontend/specs/security.template.md +10 -24
- package/templates/fullstack/README.template.md +17 -47
- package/templates/fullstack/ai-instructions.template.md +17 -45
- package/templates/fullstack/project-brief.template.md +16 -42
- package/templates/fullstack/specs/configuration.template.md +16 -42
- package/templates/mobile/README.template.md +11 -29
- package/templates/mobile/ai-instructions.template.md +11 -27
- package/templates/mobile/docs/app-store.template.md +11 -29
- package/templates/mobile/docs/architecture.template.md +14 -38
- package/templates/mobile/docs/native-features.template.md +16 -44
- package/templates/mobile/docs/navigation.template.md +9 -23
- package/templates/mobile/docs/offline-strategy.template.md +10 -26
- package/templates/mobile/docs/permissions.template.md +9 -23
- package/templates/mobile/docs/state-management.template.md +12 -32
- package/templates/mobile/docs/testing.template.md +14 -38
- package/templates/mobile/project-brief.template.md +12 -30
- package/templates/mobile/specs/build-configuration.template.md +10 -26
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
####
|
|
62
|
-
|
|
63
|
-
A) ⭐ **
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
-
|
|
330
|
-
|
|
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
|
-
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
- `{{
|
|
428
|
-
- `{{
|
|
429
|
-
- `{{
|
|
430
|
-
- `{{
|
|
431
|
-
- `{{
|
|
432
|
-
- `{{
|
|
433
|
-
- `{{
|
|
434
|
-
- `{{
|
|
435
|
-
- `{{
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
- **
|
|
444
|
-
- **
|
|
445
|
-
- **
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
- ✅ ALWAYS use {{
|
|
451
|
-
- ✅ ALWAYS
|
|
452
|
-
-
|
|
453
|
-
- ❌ NEVER
|
|
454
|
-
-
|
|
455
|
-
- ✅ ALWAYS
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
-
|
|
481
|
-
|
|
482
|
-
|
|
500
|
+
**Last Updated:** 2025-01-XX
|
|
501
|
+
|
|
502
|
+
**Version:** 1.2.0
|
|
503
|
+
|
|
483
504
|
|
|
484
505
|
|
|
485
506
|
|