proagents 1.6.17 → 1.6.19

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 (185) hide show
  1. package/.claude/settings.local.json +169 -0
  2. package/.proagents/AGENTS.md +2 -0
  3. package/.proagents/AI_INSTRUCTIONS.md +13 -0
  4. package/.proagents/ANTIGRAVITY.md +2 -0
  5. package/.proagents/BOLT.md +2 -0
  6. package/.proagents/CHATGPT.md +2 -0
  7. package/.proagents/CLAUDE.md +2 -0
  8. package/.proagents/GEMINI.md +2 -0
  9. package/.proagents/GROQ.md +2 -0
  10. package/.proagents/KIRO.md +2 -0
  11. package/.proagents/LOVABLE.md +2 -0
  12. package/.proagents/PROAGENTS.md +2 -0
  13. package/.proagents/REPLIT.md +2 -0
  14. package/.proagents/prompts/00-project-setup.md +878 -0
  15. package/.proagents/prompts/04-planning.md +38 -0
  16. package/.proagents/prompts/12-rnd.md +957 -0
  17. package/.proagents/workflow-modes/entry-modes.md +27 -0
  18. package/.proagents/worklog/_context.template.md +47 -0
  19. package/COMMANDS.md +654 -0
  20. package/README.md +16 -24
  21. package/package.json +2 -7
  22. package/.proagents/ai-models/README.md +0 -141
  23. package/.proagents/ai-models/cost-management.md +0 -362
  24. package/.proagents/ai-models/fallbacks.md +0 -342
  25. package/.proagents/ai-models/model-config.md +0 -318
  26. package/.proagents/ai-models/task-routing.md +0 -503
  27. package/.proagents/ai-training/README.md +0 -155
  28. package/.proagents/ai-training/continuous-learning.md +0 -413
  29. package/.proagents/ai-training/domain-knowledge.md +0 -378
  30. package/.proagents/ai-training/pattern-learning.md +0 -455
  31. package/.proagents/ai-training/training-data.md +0 -337
  32. package/.proagents/ai-training/user-preferences.md +0 -346
  33. package/.proagents/approval-workflows/README.md +0 -146
  34. package/.proagents/approval-workflows/approval-config.md +0 -332
  35. package/.proagents/approval-workflows/approval-stages.md +0 -503
  36. package/.proagents/approval-workflows/emergency-bypass.md +0 -351
  37. package/.proagents/approval-workflows/examples.md +0 -859
  38. package/.proagents/approval-workflows/notifications.md +0 -320
  39. package/.proagents/compliance/README.md +0 -206
  40. package/.proagents/compliance/access-control.md +0 -310
  41. package/.proagents/compliance/audit-logging.md +0 -444
  42. package/.proagents/compliance/compliance-frameworks.md +0 -429
  43. package/.proagents/compliance/reports.md +0 -491
  44. package/.proagents/compliance/retention-policies.md +0 -454
  45. package/.proagents/config-versioning/README.md +0 -120
  46. package/.proagents/config-versioning/changelog.md +0 -300
  47. package/.proagents/config-versioning/rollback.md +0 -283
  48. package/.proagents/config-versioning/versioning.md +0 -330
  49. package/.proagents/contract-testing/README.md +0 -223
  50. package/.proagents/contract-testing/contract-testing.md +0 -614
  51. package/.proagents/contract-testing/pact-integration.md +0 -507
  52. package/.proagents/contract-testing/schema-validation.md +0 -565
  53. package/.proagents/dependency-management/README.md +0 -140
  54. package/.proagents/dependency-management/automation.md +0 -363
  55. package/.proagents/dependency-management/compatibility.md +0 -319
  56. package/.proagents/dependency-management/security-scanning.md +0 -413
  57. package/.proagents/dependency-management/update-policies.md +0 -374
  58. package/.proagents/disaster-recovery/README.md +0 -247
  59. package/.proagents/disaster-recovery/automation.md +0 -366
  60. package/.proagents/disaster-recovery/backup-recovery.md +0 -571
  61. package/.proagents/disaster-recovery/incident-response.md +0 -565
  62. package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
  63. package/.proagents/disaster-recovery/runbooks.md +0 -603
  64. package/.proagents/disaster-recovery/scenarios.md +0 -892
  65. package/.proagents/disaster-recovery/testing.md +0 -438
  66. package/.proagents/environments/README.md +0 -244
  67. package/.proagents/environments/configuration.md +0 -437
  68. package/.proagents/environments/promotion.md +0 -434
  69. package/.proagents/environments/setup.md +0 -420
  70. package/.proagents/examples/README.md +0 -55
  71. package/.proagents/examples/backend-nodejs/README.md +0 -188
  72. package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
  73. package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
  74. package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
  75. package/.proagents/examples/fullstack-nextjs/README.md +0 -155
  76. package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
  77. package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
  78. package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
  79. package/.proagents/examples/mobile-react-native/README.md +0 -171
  80. package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
  81. package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
  82. package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
  83. package/.proagents/examples/web-frontend-react/README.md +0 -125
  84. package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
  85. package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
  86. package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
  87. package/.proagents/existing-projects/README.md +0 -65
  88. package/.proagents/existing-projects/challenges.md +0 -861
  89. package/.proagents/existing-projects/coexistence-mode.md +0 -483
  90. package/.proagents/existing-projects/compatibility-assessment.md +0 -541
  91. package/.proagents/existing-projects/gradual-adoption.md +0 -515
  92. package/.proagents/existing-projects/migration-strategies.md +0 -788
  93. package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
  94. package/.proagents/existing-projects/team-onboarding.md +0 -617
  95. package/.proagents/existing-projects/technical-debt-handling.md +0 -644
  96. package/.proagents/feature-flags/README.md +0 -263
  97. package/.proagents/feature-flags/ab-testing.md +0 -413
  98. package/.proagents/feature-flags/configuration.md +0 -420
  99. package/.proagents/feature-flags/kill-switches.md +0 -444
  100. package/.proagents/feature-flags/rollout-strategies.md +0 -392
  101. package/.proagents/history.log +0 -12
  102. package/.proagents/i18n/README.md +0 -133
  103. package/.proagents/i18n/extraction.md +0 -433
  104. package/.proagents/i18n/tms-integration.md +0 -332
  105. package/.proagents/i18n/translation-workflow.md +0 -413
  106. package/.proagents/i18n/validation.md +0 -355
  107. package/.proagents/logging/README.md +0 -276
  108. package/.proagents/logging/aggregation.md +0 -475
  109. package/.proagents/logging/log-levels.md +0 -376
  110. package/.proagents/logging/sensitive-data.md +0 -423
  111. package/.proagents/logging/structured-logging.md +0 -406
  112. package/.proagents/metrics/README.md +0 -69
  113. package/.proagents/metrics/code-quality-kpis.md +0 -461
  114. package/.proagents/metrics/deployment-metrics.md +0 -517
  115. package/.proagents/metrics/developer-productivity.md +0 -368
  116. package/.proagents/metrics/learning-effectiveness.md +0 -478
  117. package/.proagents/migrations/README.md +0 -77
  118. package/.proagents/migrations/from-claude-projects.md +0 -313
  119. package/.proagents/migrations/from-cursor-rules.md +0 -345
  120. package/.proagents/migrations/from-custom-workflows.md +0 -410
  121. package/.proagents/monitoring/README.md +0 -308
  122. package/.proagents/monitoring/alerting.md +0 -449
  123. package/.proagents/monitoring/dashboards.md +0 -454
  124. package/.proagents/monitoring/health-checks.md +0 -436
  125. package/.proagents/monitoring/metrics.md +0 -434
  126. package/.proagents/multi-project/README.md +0 -170
  127. package/.proagents/multi-project/coordinated-deploy.md +0 -510
  128. package/.proagents/multi-project/cross-project-deps.md +0 -395
  129. package/.proagents/multi-project/unified-changelog.md +0 -477
  130. package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
  131. package/.proagents/multi-project/workspace-config.md +0 -408
  132. package/.proagents/notifications/README.md +0 -151
  133. package/.proagents/notifications/channels.md +0 -457
  134. package/.proagents/notifications/preferences.md +0 -415
  135. package/.proagents/notifications/routing.md +0 -449
  136. package/.proagents/notifications/scheduling.md +0 -425
  137. package/.proagents/notifications/templates.md +0 -446
  138. package/.proagents/offline-mode/README.md +0 -145
  139. package/.proagents/offline-mode/caching.md +0 -344
  140. package/.proagents/offline-mode/offline-operations.md +0 -312
  141. package/.proagents/offline-mode/queue-specifications.md +0 -679
  142. package/.proagents/offline-mode/sync.md +0 -475
  143. package/.proagents/parallel-features/README.md +0 -85
  144. package/.proagents/parallel-features/conflict-detection.md +0 -226
  145. package/.proagents/parallel-features/dependency-management.md +0 -392
  146. package/.proagents/parallel-features/merge-coordination.md +0 -506
  147. package/.proagents/parallel-features/tracking-system.md +0 -416
  148. package/.proagents/performance/README.md +0 -59
  149. package/.proagents/performance/bundle-analysis.md +0 -375
  150. package/.proagents/performance/load-testing.md +0 -563
  151. package/.proagents/performance/runtime-metrics.md +0 -489
  152. package/.proagents/performance/web-vitals.md +0 -425
  153. package/.proagents/plugins/README.md +0 -139
  154. package/.proagents/plugins/creating-plugins.md +0 -504
  155. package/.proagents/plugins/plugin-api.md +0 -467
  156. package/.proagents/plugins/plugin-registry.md +0 -276
  157. package/.proagents/reporting/README.md +0 -158
  158. package/.proagents/reporting/dashboards.md +0 -366
  159. package/.proagents/reporting/exports.md +0 -524
  160. package/.proagents/reporting/quality-metrics.md +0 -385
  161. package/.proagents/reporting/templates/README.md +0 -56
  162. package/.proagents/reporting/templates/dashboard-config.json +0 -187
  163. package/.proagents/reporting/templates/metrics-queries.md +0 -427
  164. package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
  165. package/.proagents/reporting/templates/widgets.md +0 -451
  166. package/.proagents/reporting/velocity-metrics.md +0 -340
  167. package/.proagents/reverse-engineering/README.md +0 -151
  168. package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
  169. package/.proagents/reverse-engineering/code-analysis.md +0 -377
  170. package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
  171. package/.proagents/reverse-engineering/diagram-generation.md +0 -586
  172. package/.proagents/reverse-engineering/documentation-generation.md +0 -468
  173. package/.proagents/reverse-engineering/pattern-detection.md +0 -569
  174. package/.proagents/reverse-engineering/quality-assessment.md +0 -733
  175. package/.proagents/secrets/README.md +0 -278
  176. package/.proagents/secrets/access-control.md +0 -443
  177. package/.proagents/secrets/rotation.md +0 -403
  178. package/.proagents/secrets/scanning.md +0 -487
  179. package/.proagents/secrets/storage.md +0 -394
  180. package/.proagents/webhooks/README.md +0 -126
  181. package/.proagents/webhooks/endpoints.md +0 -298
  182. package/.proagents/webhooks/events.md +0 -316
  183. package/.proagents/webhooks/payloads.md +0 -325
  184. package/.proagents/webhooks/reliability.md +0 -363
  185. package/.proagents/webhooks/security.md +0 -380
@@ -1,569 +0,0 @@
1
- # Pattern Detection
2
-
3
- Automatically detect design patterns, coding conventions, and architectural decisions from existing code.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Pattern detection helps:
10
- - Understand how a codebase is built
11
- - Ensure new code follows existing conventions
12
- - Document implicit decisions
13
- - Identify inconsistencies and tech debt
14
-
15
- ---
16
-
17
- ## Detection Categories
18
-
19
- ### 1. Architectural Patterns
20
-
21
- ```yaml
22
- architecture_detection:
23
- detected_pattern: "Feature-Based Architecture"
24
- confidence: 0.92
25
-
26
- evidence:
27
- - "src/features/ directory exists"
28
- - "Each feature has components/, hooks/, services/"
29
- - "Shared code in src/shared/"
30
- - "Clear module boundaries with index.ts exports"
31
-
32
- structure:
33
- features:
34
- - name: "auth"
35
- path: "src/features/auth/"
36
- components: ["LoginForm", "RegisterForm", "AuthProvider"]
37
- hooks: ["useAuth", "useSession"]
38
- services: ["authService"]
39
-
40
- - name: "dashboard"
41
- path: "src/features/dashboard/"
42
- components: ["DashboardPage", "StatsWidget"]
43
- hooks: ["useDashboardData"]
44
- services: ["dashboardService"]
45
-
46
- recommendation: "Continue using feature-based architecture for new features"
47
- ```
48
-
49
- **Common Patterns Detected:**
50
-
51
- | Pattern | Detection Signals |
52
- |---------|-------------------|
53
- | **Feature-Based** | `features/[name]/` with components, hooks, services |
54
- | **Atomic Design** | `atoms/`, `molecules/`, `organisms/`, `templates/`, `pages/` |
55
- | **MVC** | `controllers/`, `models/`, `views/` |
56
- | **Clean Architecture** | `domain/`, `application/`, `infrastructure/` |
57
- | **Layered** | `presentation/`, `business/`, `data/` |
58
- | **Hexagonal** | `ports/`, `adapters/`, `core/` |
59
-
60
- ---
61
-
62
- ### 2. Component Patterns
63
-
64
- ```yaml
65
- component_patterns:
66
- detected:
67
- - pattern: "Functional Components with Hooks"
68
- usage: "100%"
69
- evidence:
70
- - "No class components found"
71
- - "useState/useEffect in all stateful components"
72
- - "Custom hooks for shared logic"
73
-
74
- - pattern: "Props Interface Above Component"
75
- usage: "95%"
76
- evidence:
77
- - "interface [Component]Props defined before export"
78
- - "TypeScript strict mode enabled"
79
- example: |
80
- interface UserCardProps {
81
- user: User;
82
- onSelect?: (user: User) => void;
83
- }
84
-
85
- export const UserCard: FC<UserCardProps> = ({ user, onSelect }) => {
86
- // ...
87
- }
88
-
89
- - pattern: "Memo for Performance"
90
- usage: "40%"
91
- locations:
92
- - "src/components/DataTable.tsx"
93
- - "src/components/VirtualList.tsx"
94
- context: "Used for expensive renders"
95
-
96
- - pattern: "Compound Components"
97
- usage: "15%"
98
- locations:
99
- - "src/components/ui/Tabs/"
100
- - "src/components/ui/Accordion/"
101
- structure: |
102
- <Tabs>
103
- <Tabs.List>
104
- <Tabs.Trigger>...</Tabs.Trigger>
105
- </Tabs.List>
106
- <Tabs.Content>...</Tabs.Content>
107
- </Tabs>
108
- ```
109
-
110
- ---
111
-
112
- ### 3. State Management Patterns
113
-
114
- ```yaml
115
- state_patterns:
116
- global_state:
117
- pattern: "Zustand Stores"
118
- usage: "Primary"
119
- stores_found:
120
- - name: "useAuthStore"
121
- path: "src/stores/authStore.ts"
122
- state: ["user", "token", "isAuthenticated"]
123
- actions: ["login", "logout", "setUser"]
124
-
125
- - name: "useUIStore"
126
- path: "src/stores/uiStore.ts"
127
- state: ["theme", "sidebarOpen", "notifications"]
128
- actions: ["setTheme", "toggleSidebar", "addNotification"]
129
-
130
- server_state:
131
- pattern: "React Query"
132
- usage: "All API calls"
133
- queries_found: 45
134
- mutations_found: 28
135
- example: |
136
- const { data, isLoading } = useQuery({
137
- queryKey: ['users', filters],
138
- queryFn: () => userService.getUsers(filters)
139
- });
140
-
141
- local_state:
142
- pattern: "useState for simple, useReducer for complex"
143
- simple_state:
144
- - "isOpen", "isLoading", "activeTab"
145
- complex_state:
146
- - "formState with useReducer"
147
- - "multiStepWizard with useReducer"
148
-
149
- context_usage:
150
- pattern: "Context for dependency injection"
151
- contexts:
152
- - "ThemeContext"
153
- - "AuthContext"
154
- - "ToastContext"
155
- ```
156
-
157
- ---
158
-
159
- ### 4. API/Data Patterns
160
-
161
- ```yaml
162
- api_patterns:
163
- client:
164
- pattern: "Axios with interceptors"
165
- path: "src/lib/api.ts"
166
- features:
167
- - "Base URL configuration"
168
- - "Auth token injection"
169
- - "Error interceptor"
170
- - "Request/response logging"
171
-
172
- service_layer:
173
- pattern: "Service objects"
174
- structure: |
175
- // Typical service pattern found
176
- export const userService = {
177
- getAll: (params) => api.get('/users', { params }),
178
- getById: (id) => api.get(`/users/${id}`),
179
- create: (data) => api.post('/users', data),
180
- update: (id, data) => api.put(`/users/${id}`, data),
181
- delete: (id) => api.delete(`/users/${id}`),
182
- };
183
-
184
- error_handling:
185
- pattern: "Centralized error handling"
186
- approach:
187
- - "API interceptor catches errors"
188
- - "Custom error classes (ApiError, ValidationError)"
189
- - "Toast notifications for user feedback"
190
- - "Error boundaries for React components"
191
-
192
- data_fetching:
193
- pattern: "React Query + Custom Hooks"
194
- example: |
195
- // Custom hook wrapping React Query
196
- export function useUsers(filters: UserFilters) {
197
- return useQuery({
198
- queryKey: ['users', filters],
199
- queryFn: () => userService.getUsers(filters),
200
- staleTime: 5 * 60 * 1000,
201
- });
202
- }
203
- ```
204
-
205
- ---
206
-
207
- ### 5. Form Patterns
208
-
209
- ```yaml
210
- form_patterns:
211
- library: "React Hook Form"
212
- validation: "Zod"
213
-
214
- structure:
215
- pattern: "Form + Schema + Component"
216
- example: |
217
- // 1. Schema (validation)
218
- const loginSchema = z.object({
219
- email: z.string().email(),
220
- password: z.string().min(8),
221
- });
222
-
223
- // 2. Form hook
224
- const form = useForm({
225
- resolver: zodResolver(loginSchema),
226
- });
227
-
228
- // 3. Component
229
- <form onSubmit={form.handleSubmit(onSubmit)}>
230
- <Input {...form.register('email')} />
231
- <Input {...form.register('password')} />
232
- </form>
233
-
234
- field_components:
235
- - "FormField" - wrapper with label/error
236
- - "Input", "Select", "Checkbox" - controlled inputs
237
- - "FormMessage" - error display
238
-
239
- submission_pattern:
240
- pattern: "React Query mutations"
241
- example: |
242
- const mutation = useMutation({
243
- mutationFn: authService.login,
244
- onSuccess: () => router.push('/dashboard'),
245
- onError: (error) => toast.error(error.message),
246
- });
247
- ```
248
-
249
- ---
250
-
251
- ### 6. Styling Patterns
252
-
253
- ```yaml
254
- styling_patterns:
255
- primary:
256
- approach: "Tailwind CSS"
257
- usage: "95%"
258
- features:
259
- - "Utility-first classes"
260
- - "Custom theme in tailwind.config"
261
- - "Component variants with CVA"
262
-
263
- component_styling:
264
- pattern: "CVA (Class Variance Authority)"
265
- example: |
266
- const buttonVariants = cva(
267
- "inline-flex items-center justify-center rounded-md",
268
- {
269
- variants: {
270
- variant: {
271
- default: "bg-primary text-primary-foreground",
272
- destructive: "bg-destructive text-destructive-foreground",
273
- outline: "border border-input bg-background",
274
- },
275
- size: {
276
- default: "h-10 px-4 py-2",
277
- sm: "h-9 px-3",
278
- lg: "h-11 px-8",
279
- },
280
- },
281
- defaultVariants: {
282
- variant: "default",
283
- size: "default",
284
- },
285
- }
286
- );
287
-
288
- design_system:
289
- tokens:
290
- colors: "CSS variables in globals.css"
291
- spacing: "Tailwind default scale"
292
- typography: "Custom font in tailwind.config"
293
- components:
294
- library: "shadcn/ui pattern"
295
- location: "src/components/ui/"
296
- ```
297
-
298
- ---
299
-
300
- ### 7. Testing Patterns
301
-
302
- ```yaml
303
- testing_patterns:
304
- unit_tests:
305
- framework: "Vitest"
306
- pattern: "AAA (Arrange-Act-Assert)"
307
- naming: "should [expected behavior] when [condition]"
308
- example: |
309
- describe('UserService', () => {
310
- it('should return user when valid id provided', async () => {
311
- // Arrange
312
- const userId = 'user-123';
313
- mockApi.get.mockResolvedValue({ data: mockUser });
314
-
315
- // Act
316
- const result = await userService.getById(userId);
317
-
318
- // Assert
319
- expect(result).toEqual(mockUser);
320
- expect(mockApi.get).toHaveBeenCalledWith(`/users/${userId}`);
321
- });
322
- });
323
-
324
- component_tests:
325
- framework: "Testing Library"
326
- pattern: "User-centric testing"
327
- queries_preferred:
328
- - "getByRole"
329
- - "getByLabelText"
330
- - "getByText"
331
- example: |
332
- it('should submit form with valid data', async () => {
333
- render(<LoginForm onSubmit={mockSubmit} />);
334
-
335
- await userEvent.type(screen.getByLabelText('Email'), 'test@example.com');
336
- await userEvent.type(screen.getByLabelText('Password'), 'password123');
337
- await userEvent.click(screen.getByRole('button', { name: 'Login' }));
338
-
339
- expect(mockSubmit).toHaveBeenCalledWith({
340
- email: 'test@example.com',
341
- password: 'password123',
342
- });
343
- });
344
-
345
- e2e_tests:
346
- framework: "Playwright"
347
- pattern: "Page Object Model"
348
- structure: |
349
- // Page object
350
- class LoginPage {
351
- constructor(page) {
352
- this.page = page;
353
- this.emailInput = page.getByLabel('Email');
354
- this.passwordInput = page.getByLabel('Password');
355
- this.submitButton = page.getByRole('button', { name: 'Login' });
356
- }
357
-
358
- async login(email, password) {
359
- await this.emailInput.fill(email);
360
- await this.passwordInput.fill(password);
361
- await this.submitButton.click();
362
- }
363
- }
364
- ```
365
-
366
- ---
367
-
368
- ### 8. Error Handling Patterns
369
-
370
- ```yaml
371
- error_patterns:
372
- api_errors:
373
- pattern: "Custom Error Classes"
374
- hierarchy:
375
- - "AppError (base)"
376
- - "ApiError extends AppError"
377
- - "ValidationError extends AppError"
378
- - "AuthError extends AppError"
379
- example: |
380
- class ApiError extends AppError {
381
- constructor(message, status, code) {
382
- super(message);
383
- this.status = status;
384
- this.code = code;
385
- }
386
- }
387
-
388
- react_errors:
389
- pattern: "Error Boundaries"
390
- usage:
391
- - "Global error boundary at app level"
392
- - "Feature-level boundaries for isolation"
393
- fallback: "Custom error UI with retry"
394
-
395
- async_errors:
396
- pattern: "Try-catch with typed errors"
397
- example: |
398
- try {
399
- await userService.update(id, data);
400
- } catch (error) {
401
- if (error instanceof ValidationError) {
402
- setFieldErrors(error.fields);
403
- } else if (error instanceof AuthError) {
404
- router.push('/login');
405
- } else {
406
- toast.error('An unexpected error occurred');
407
- }
408
- }
409
- ```
410
-
411
- ---
412
-
413
- ### 9. File/Naming Conventions
414
-
415
- ```yaml
416
- naming_conventions:
417
- files:
418
- components: "PascalCase.tsx"
419
- hooks: "use[Name].ts"
420
- services: "[name]Service.ts"
421
- types: "[name].types.ts"
422
- utils: "camelCase.ts"
423
- constants: "UPPER_SNAKE_CASE or camelCase"
424
- tests: "[name].test.ts or [name].spec.ts"
425
-
426
- code:
427
- variables: "camelCase"
428
- constants: "UPPER_SNAKE_CASE"
429
- functions: "camelCase"
430
- classes: "PascalCase"
431
- interfaces: "PascalCase (no I prefix)"
432
- types: "PascalCase"
433
- enums: "PascalCase with UPPER_SNAKE members"
434
-
435
- directories:
436
- features: "kebab-case"
437
- components: "PascalCase"
438
- utilities: "kebab-case"
439
-
440
- examples:
441
- good:
442
- - "UserProfile.tsx"
443
- - "useUserData.ts"
444
- - "userService.ts"
445
- - "MAX_RETRY_COUNT"
446
- bad:
447
- - "userprofile.tsx" # Should be PascalCase
448
- - "UserData.ts" # Hook should have 'use' prefix
449
- - "UserService.ts" # Services are camelCase
450
- ```
451
-
452
- ---
453
-
454
- ## Pattern Report
455
-
456
- ```markdown
457
- # Pattern Detection Report
458
-
459
- ## Project: MyApp
460
- ## Analyzed: 2024-01-15
461
-
462
- ---
463
-
464
- ## Architecture
465
- **Pattern:** Feature-Based Architecture
466
- **Confidence:** 92%
467
- **Status:** Consistently Applied
468
-
469
- ---
470
-
471
- ## Component Patterns
472
-
473
- | Pattern | Usage | Consistency |
474
- |---------|-------|-------------|
475
- | Functional Components | 100% | High |
476
- | Props Interface First | 95% | High |
477
- | Custom Hooks | 85% | High |
478
- | Memo for Performance | 40% | Medium |
479
-
480
- ---
481
-
482
- ## State Management
483
-
484
- | Scope | Solution | Adoption |
485
- |-------|----------|----------|
486
- | Global State | Zustand | 100% |
487
- | Server State | React Query | 100% |
488
- | Form State | React Hook Form | 100% |
489
- | Local State | useState/useReducer | 100% |
490
-
491
- ---
492
-
493
- ## API Patterns
494
- - **Client:** Axios with interceptors
495
- - **Services:** Object method pattern
496
- - **Error Handling:** Custom error classes
497
-
498
- ---
499
-
500
- ## Inconsistencies Found
501
-
502
- 1. **Naming inconsistency in `/src/utils/`**
503
- - `formatDate.ts` vs `StringHelpers.ts`
504
- - Recommendation: Use camelCase for all utils
505
-
506
- 2. **Mixed error handling in forms**
507
- - Some use try-catch, some use onError
508
- - Recommendation: Standardize on mutation onError
509
-
510
- 3. **Test naming variations**
511
- - `.test.ts` and `.spec.ts` both used
512
- - Recommendation: Standardize on `.test.ts`
513
-
514
- ---
515
-
516
- ## Recommendations
517
-
518
- 1. Create a CONVENTIONS.md documenting detected patterns
519
- 2. Add ESLint rules to enforce naming conventions
520
- 3. Standardize error handling approach
521
- 4. Consider adding more Memo usage for list items
522
- ```
523
-
524
- ---
525
-
526
- ## Configuration
527
-
528
- ```yaml
529
- # proagents.config.yaml
530
-
531
- reverse_engineering:
532
- pattern_detection:
533
- enabled: true
534
-
535
- detect:
536
- - architecture_patterns
537
- - component_patterns
538
- - state_patterns
539
- - api_patterns
540
- - form_patterns
541
- - styling_patterns
542
- - testing_patterns
543
- - error_patterns
544
- - naming_conventions
545
-
546
- report:
547
- generate: true
548
- format: "markdown"
549
- include_examples: true
550
- include_recommendations: true
551
-
552
- learning:
553
- store_patterns: true
554
- apply_to_new_code: true
555
- ```
556
-
557
- ---
558
-
559
- ## Commands
560
-
561
- | Command | Description |
562
- |---------|-------------|
563
- | `pa:re-patterns` | Detect all patterns |
564
- | `pa:re-patterns --type architecture` | Architecture patterns only |
565
- | `pa:re-patterns --type components` | Component patterns only |
566
- | `pa:re-patterns --type state` | State management patterns |
567
- | `pa:re-patterns --type naming` | Naming conventions only |
568
- | `pa:re-patterns --report` | Generate full report |
569
- | `pa:re-patterns --inconsistencies` | Show inconsistencies only |