proagents 1.6.16 → 1.6.18

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 (170) hide show
  1. package/.claude/settings.local.json +169 -0
  2. package/COMMANDS.md +595 -0
  3. package/README.md +22 -64
  4. package/bin/proagents.js +0 -2
  5. package/lib/commands/init.js +4 -174
  6. package/package.json +2 -7
  7. package/.proagents/ai-models/README.md +0 -141
  8. package/.proagents/ai-models/cost-management.md +0 -362
  9. package/.proagents/ai-models/fallbacks.md +0 -342
  10. package/.proagents/ai-models/model-config.md +0 -318
  11. package/.proagents/ai-models/task-routing.md +0 -503
  12. package/.proagents/ai-training/README.md +0 -155
  13. package/.proagents/ai-training/continuous-learning.md +0 -413
  14. package/.proagents/ai-training/domain-knowledge.md +0 -378
  15. package/.proagents/ai-training/pattern-learning.md +0 -455
  16. package/.proagents/ai-training/training-data.md +0 -337
  17. package/.proagents/ai-training/user-preferences.md +0 -346
  18. package/.proagents/approval-workflows/README.md +0 -146
  19. package/.proagents/approval-workflows/approval-config.md +0 -332
  20. package/.proagents/approval-workflows/approval-stages.md +0 -503
  21. package/.proagents/approval-workflows/emergency-bypass.md +0 -351
  22. package/.proagents/approval-workflows/examples.md +0 -859
  23. package/.proagents/approval-workflows/notifications.md +0 -320
  24. package/.proagents/compliance/README.md +0 -206
  25. package/.proagents/compliance/access-control.md +0 -310
  26. package/.proagents/compliance/audit-logging.md +0 -444
  27. package/.proagents/compliance/compliance-frameworks.md +0 -429
  28. package/.proagents/compliance/reports.md +0 -491
  29. package/.proagents/compliance/retention-policies.md +0 -454
  30. package/.proagents/config-versioning/README.md +0 -120
  31. package/.proagents/config-versioning/changelog.md +0 -300
  32. package/.proagents/config-versioning/rollback.md +0 -283
  33. package/.proagents/config-versioning/versioning.md +0 -330
  34. package/.proagents/contract-testing/README.md +0 -223
  35. package/.proagents/contract-testing/contract-testing.md +0 -614
  36. package/.proagents/contract-testing/pact-integration.md +0 -507
  37. package/.proagents/contract-testing/schema-validation.md +0 -565
  38. package/.proagents/dependency-management/README.md +0 -140
  39. package/.proagents/dependency-management/automation.md +0 -363
  40. package/.proagents/dependency-management/compatibility.md +0 -319
  41. package/.proagents/dependency-management/security-scanning.md +0 -413
  42. package/.proagents/dependency-management/update-policies.md +0 -374
  43. package/.proagents/disaster-recovery/README.md +0 -247
  44. package/.proagents/disaster-recovery/automation.md +0 -366
  45. package/.proagents/disaster-recovery/backup-recovery.md +0 -571
  46. package/.proagents/disaster-recovery/incident-response.md +0 -565
  47. package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
  48. package/.proagents/disaster-recovery/runbooks.md +0 -603
  49. package/.proagents/disaster-recovery/scenarios.md +0 -892
  50. package/.proagents/disaster-recovery/testing.md +0 -438
  51. package/.proagents/environments/README.md +0 -244
  52. package/.proagents/environments/configuration.md +0 -437
  53. package/.proagents/environments/promotion.md +0 -434
  54. package/.proagents/environments/setup.md +0 -420
  55. package/.proagents/examples/README.md +0 -55
  56. package/.proagents/examples/backend-nodejs/README.md +0 -188
  57. package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
  58. package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
  59. package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
  60. package/.proagents/examples/fullstack-nextjs/README.md +0 -155
  61. package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
  62. package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
  63. package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
  64. package/.proagents/examples/mobile-react-native/README.md +0 -171
  65. package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
  66. package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
  67. package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
  68. package/.proagents/examples/web-frontend-react/README.md +0 -125
  69. package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
  70. package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
  71. package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
  72. package/.proagents/existing-projects/README.md +0 -65
  73. package/.proagents/existing-projects/challenges.md +0 -861
  74. package/.proagents/existing-projects/coexistence-mode.md +0 -483
  75. package/.proagents/existing-projects/compatibility-assessment.md +0 -541
  76. package/.proagents/existing-projects/gradual-adoption.md +0 -515
  77. package/.proagents/existing-projects/migration-strategies.md +0 -788
  78. package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
  79. package/.proagents/existing-projects/team-onboarding.md +0 -617
  80. package/.proagents/existing-projects/technical-debt-handling.md +0 -644
  81. package/.proagents/feature-flags/README.md +0 -263
  82. package/.proagents/feature-flags/ab-testing.md +0 -413
  83. package/.proagents/feature-flags/configuration.md +0 -420
  84. package/.proagents/feature-flags/kill-switches.md +0 -444
  85. package/.proagents/feature-flags/rollout-strategies.md +0 -392
  86. package/.proagents/history.log +0 -12
  87. package/.proagents/i18n/README.md +0 -133
  88. package/.proagents/i18n/extraction.md +0 -433
  89. package/.proagents/i18n/tms-integration.md +0 -332
  90. package/.proagents/i18n/translation-workflow.md +0 -413
  91. package/.proagents/i18n/validation.md +0 -355
  92. package/.proagents/logging/README.md +0 -276
  93. package/.proagents/logging/aggregation.md +0 -475
  94. package/.proagents/logging/log-levels.md +0 -376
  95. package/.proagents/logging/sensitive-data.md +0 -423
  96. package/.proagents/logging/structured-logging.md +0 -406
  97. package/.proagents/metrics/README.md +0 -69
  98. package/.proagents/metrics/code-quality-kpis.md +0 -461
  99. package/.proagents/metrics/deployment-metrics.md +0 -517
  100. package/.proagents/metrics/developer-productivity.md +0 -368
  101. package/.proagents/metrics/learning-effectiveness.md +0 -478
  102. package/.proagents/migrations/README.md +0 -77
  103. package/.proagents/migrations/from-claude-projects.md +0 -313
  104. package/.proagents/migrations/from-cursor-rules.md +0 -345
  105. package/.proagents/migrations/from-custom-workflows.md +0 -410
  106. package/.proagents/monitoring/README.md +0 -308
  107. package/.proagents/monitoring/alerting.md +0 -449
  108. package/.proagents/monitoring/dashboards.md +0 -454
  109. package/.proagents/monitoring/health-checks.md +0 -436
  110. package/.proagents/monitoring/metrics.md +0 -434
  111. package/.proagents/multi-project/README.md +0 -170
  112. package/.proagents/multi-project/coordinated-deploy.md +0 -510
  113. package/.proagents/multi-project/cross-project-deps.md +0 -395
  114. package/.proagents/multi-project/unified-changelog.md +0 -477
  115. package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
  116. package/.proagents/multi-project/workspace-config.md +0 -408
  117. package/.proagents/notifications/README.md +0 -151
  118. package/.proagents/notifications/channels.md +0 -457
  119. package/.proagents/notifications/preferences.md +0 -415
  120. package/.proagents/notifications/routing.md +0 -449
  121. package/.proagents/notifications/scheduling.md +0 -425
  122. package/.proagents/notifications/templates.md +0 -446
  123. package/.proagents/offline-mode/README.md +0 -145
  124. package/.proagents/offline-mode/caching.md +0 -344
  125. package/.proagents/offline-mode/offline-operations.md +0 -312
  126. package/.proagents/offline-mode/queue-specifications.md +0 -679
  127. package/.proagents/offline-mode/sync.md +0 -475
  128. package/.proagents/parallel-features/README.md +0 -85
  129. package/.proagents/parallel-features/conflict-detection.md +0 -226
  130. package/.proagents/parallel-features/dependency-management.md +0 -392
  131. package/.proagents/parallel-features/merge-coordination.md +0 -506
  132. package/.proagents/parallel-features/tracking-system.md +0 -416
  133. package/.proagents/performance/README.md +0 -59
  134. package/.proagents/performance/bundle-analysis.md +0 -375
  135. package/.proagents/performance/load-testing.md +0 -563
  136. package/.proagents/performance/runtime-metrics.md +0 -489
  137. package/.proagents/performance/web-vitals.md +0 -425
  138. package/.proagents/plugins/README.md +0 -139
  139. package/.proagents/plugins/creating-plugins.md +0 -504
  140. package/.proagents/plugins/plugin-api.md +0 -467
  141. package/.proagents/plugins/plugin-registry.md +0 -276
  142. package/.proagents/reporting/README.md +0 -158
  143. package/.proagents/reporting/dashboards.md +0 -366
  144. package/.proagents/reporting/exports.md +0 -524
  145. package/.proagents/reporting/quality-metrics.md +0 -385
  146. package/.proagents/reporting/templates/README.md +0 -56
  147. package/.proagents/reporting/templates/dashboard-config.json +0 -187
  148. package/.proagents/reporting/templates/metrics-queries.md +0 -427
  149. package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
  150. package/.proagents/reporting/templates/widgets.md +0 -451
  151. package/.proagents/reporting/velocity-metrics.md +0 -340
  152. package/.proagents/reverse-engineering/README.md +0 -151
  153. package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
  154. package/.proagents/reverse-engineering/code-analysis.md +0 -377
  155. package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
  156. package/.proagents/reverse-engineering/diagram-generation.md +0 -586
  157. package/.proagents/reverse-engineering/documentation-generation.md +0 -468
  158. package/.proagents/reverse-engineering/pattern-detection.md +0 -569
  159. package/.proagents/reverse-engineering/quality-assessment.md +0 -733
  160. package/.proagents/secrets/README.md +0 -278
  161. package/.proagents/secrets/access-control.md +0 -443
  162. package/.proagents/secrets/rotation.md +0 -403
  163. package/.proagents/secrets/scanning.md +0 -487
  164. package/.proagents/secrets/storage.md +0 -394
  165. package/.proagents/webhooks/README.md +0 -126
  166. package/.proagents/webhooks/endpoints.md +0 -298
  167. package/.proagents/webhooks/events.md +0 -316
  168. package/.proagents/webhooks/payloads.md +0 -325
  169. package/.proagents/webhooks/reliability.md +0 -363
  170. 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 |