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.
- package/.claude/settings.local.json +169 -0
- package/.proagents/AGENTS.md +2 -0
- package/.proagents/AI_INSTRUCTIONS.md +13 -0
- package/.proagents/ANTIGRAVITY.md +2 -0
- package/.proagents/BOLT.md +2 -0
- package/.proagents/CHATGPT.md +2 -0
- package/.proagents/CLAUDE.md +2 -0
- package/.proagents/GEMINI.md +2 -0
- package/.proagents/GROQ.md +2 -0
- package/.proagents/KIRO.md +2 -0
- package/.proagents/LOVABLE.md +2 -0
- package/.proagents/PROAGENTS.md +2 -0
- package/.proagents/REPLIT.md +2 -0
- package/.proagents/prompts/00-project-setup.md +878 -0
- package/.proagents/prompts/04-planning.md +38 -0
- package/.proagents/prompts/12-rnd.md +957 -0
- package/.proagents/workflow-modes/entry-modes.md +27 -0
- package/.proagents/worklog/_context.template.md +47 -0
- package/COMMANDS.md +654 -0
- package/README.md +16 -24
- package/package.json +2 -7
- package/.proagents/ai-models/README.md +0 -141
- package/.proagents/ai-models/cost-management.md +0 -362
- package/.proagents/ai-models/fallbacks.md +0 -342
- package/.proagents/ai-models/model-config.md +0 -318
- package/.proagents/ai-models/task-routing.md +0 -503
- package/.proagents/ai-training/README.md +0 -155
- package/.proagents/ai-training/continuous-learning.md +0 -413
- package/.proagents/ai-training/domain-knowledge.md +0 -378
- package/.proagents/ai-training/pattern-learning.md +0 -455
- package/.proagents/ai-training/training-data.md +0 -337
- package/.proagents/ai-training/user-preferences.md +0 -346
- package/.proagents/approval-workflows/README.md +0 -146
- package/.proagents/approval-workflows/approval-config.md +0 -332
- package/.proagents/approval-workflows/approval-stages.md +0 -503
- package/.proagents/approval-workflows/emergency-bypass.md +0 -351
- package/.proagents/approval-workflows/examples.md +0 -859
- package/.proagents/approval-workflows/notifications.md +0 -320
- package/.proagents/compliance/README.md +0 -206
- package/.proagents/compliance/access-control.md +0 -310
- package/.proagents/compliance/audit-logging.md +0 -444
- package/.proagents/compliance/compliance-frameworks.md +0 -429
- package/.proagents/compliance/reports.md +0 -491
- package/.proagents/compliance/retention-policies.md +0 -454
- package/.proagents/config-versioning/README.md +0 -120
- package/.proagents/config-versioning/changelog.md +0 -300
- package/.proagents/config-versioning/rollback.md +0 -283
- package/.proagents/config-versioning/versioning.md +0 -330
- package/.proagents/contract-testing/README.md +0 -223
- package/.proagents/contract-testing/contract-testing.md +0 -614
- package/.proagents/contract-testing/pact-integration.md +0 -507
- package/.proagents/contract-testing/schema-validation.md +0 -565
- package/.proagents/dependency-management/README.md +0 -140
- package/.proagents/dependency-management/automation.md +0 -363
- package/.proagents/dependency-management/compatibility.md +0 -319
- package/.proagents/dependency-management/security-scanning.md +0 -413
- package/.proagents/dependency-management/update-policies.md +0 -374
- package/.proagents/disaster-recovery/README.md +0 -247
- package/.proagents/disaster-recovery/automation.md +0 -366
- package/.proagents/disaster-recovery/backup-recovery.md +0 -571
- package/.proagents/disaster-recovery/incident-response.md +0 -565
- package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
- package/.proagents/disaster-recovery/runbooks.md +0 -603
- package/.proagents/disaster-recovery/scenarios.md +0 -892
- package/.proagents/disaster-recovery/testing.md +0 -438
- package/.proagents/environments/README.md +0 -244
- package/.proagents/environments/configuration.md +0 -437
- package/.proagents/environments/promotion.md +0 -434
- package/.proagents/environments/setup.md +0 -420
- package/.proagents/examples/README.md +0 -55
- package/.proagents/examples/backend-nodejs/README.md +0 -188
- package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
- package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
- package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
- package/.proagents/examples/fullstack-nextjs/README.md +0 -155
- package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
- package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
- package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
- package/.proagents/examples/mobile-react-native/README.md +0 -171
- package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
- package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
- package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
- package/.proagents/examples/web-frontend-react/README.md +0 -125
- package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
- package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
- package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
- package/.proagents/existing-projects/README.md +0 -65
- package/.proagents/existing-projects/challenges.md +0 -861
- package/.proagents/existing-projects/coexistence-mode.md +0 -483
- package/.proagents/existing-projects/compatibility-assessment.md +0 -541
- package/.proagents/existing-projects/gradual-adoption.md +0 -515
- package/.proagents/existing-projects/migration-strategies.md +0 -788
- package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
- package/.proagents/existing-projects/team-onboarding.md +0 -617
- package/.proagents/existing-projects/technical-debt-handling.md +0 -644
- package/.proagents/feature-flags/README.md +0 -263
- package/.proagents/feature-flags/ab-testing.md +0 -413
- package/.proagents/feature-flags/configuration.md +0 -420
- package/.proagents/feature-flags/kill-switches.md +0 -444
- package/.proagents/feature-flags/rollout-strategies.md +0 -392
- package/.proagents/history.log +0 -12
- package/.proagents/i18n/README.md +0 -133
- package/.proagents/i18n/extraction.md +0 -433
- package/.proagents/i18n/tms-integration.md +0 -332
- package/.proagents/i18n/translation-workflow.md +0 -413
- package/.proagents/i18n/validation.md +0 -355
- package/.proagents/logging/README.md +0 -276
- package/.proagents/logging/aggregation.md +0 -475
- package/.proagents/logging/log-levels.md +0 -376
- package/.proagents/logging/sensitive-data.md +0 -423
- package/.proagents/logging/structured-logging.md +0 -406
- package/.proagents/metrics/README.md +0 -69
- package/.proagents/metrics/code-quality-kpis.md +0 -461
- package/.proagents/metrics/deployment-metrics.md +0 -517
- package/.proagents/metrics/developer-productivity.md +0 -368
- package/.proagents/metrics/learning-effectiveness.md +0 -478
- package/.proagents/migrations/README.md +0 -77
- package/.proagents/migrations/from-claude-projects.md +0 -313
- package/.proagents/migrations/from-cursor-rules.md +0 -345
- package/.proagents/migrations/from-custom-workflows.md +0 -410
- package/.proagents/monitoring/README.md +0 -308
- package/.proagents/monitoring/alerting.md +0 -449
- package/.proagents/monitoring/dashboards.md +0 -454
- package/.proagents/monitoring/health-checks.md +0 -436
- package/.proagents/monitoring/metrics.md +0 -434
- package/.proagents/multi-project/README.md +0 -170
- package/.proagents/multi-project/coordinated-deploy.md +0 -510
- package/.proagents/multi-project/cross-project-deps.md +0 -395
- package/.proagents/multi-project/unified-changelog.md +0 -477
- package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
- package/.proagents/multi-project/workspace-config.md +0 -408
- package/.proagents/notifications/README.md +0 -151
- package/.proagents/notifications/channels.md +0 -457
- package/.proagents/notifications/preferences.md +0 -415
- package/.proagents/notifications/routing.md +0 -449
- package/.proagents/notifications/scheduling.md +0 -425
- package/.proagents/notifications/templates.md +0 -446
- package/.proagents/offline-mode/README.md +0 -145
- package/.proagents/offline-mode/caching.md +0 -344
- package/.proagents/offline-mode/offline-operations.md +0 -312
- package/.proagents/offline-mode/queue-specifications.md +0 -679
- package/.proagents/offline-mode/sync.md +0 -475
- package/.proagents/parallel-features/README.md +0 -85
- package/.proagents/parallel-features/conflict-detection.md +0 -226
- package/.proagents/parallel-features/dependency-management.md +0 -392
- package/.proagents/parallel-features/merge-coordination.md +0 -506
- package/.proagents/parallel-features/tracking-system.md +0 -416
- package/.proagents/performance/README.md +0 -59
- package/.proagents/performance/bundle-analysis.md +0 -375
- package/.proagents/performance/load-testing.md +0 -563
- package/.proagents/performance/runtime-metrics.md +0 -489
- package/.proagents/performance/web-vitals.md +0 -425
- package/.proagents/plugins/README.md +0 -139
- package/.proagents/plugins/creating-plugins.md +0 -504
- package/.proagents/plugins/plugin-api.md +0 -467
- package/.proagents/plugins/plugin-registry.md +0 -276
- package/.proagents/reporting/README.md +0 -158
- package/.proagents/reporting/dashboards.md +0 -366
- package/.proagents/reporting/exports.md +0 -524
- package/.proagents/reporting/quality-metrics.md +0 -385
- package/.proagents/reporting/templates/README.md +0 -56
- package/.proagents/reporting/templates/dashboard-config.json +0 -187
- package/.proagents/reporting/templates/metrics-queries.md +0 -427
- package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
- package/.proagents/reporting/templates/widgets.md +0 -451
- package/.proagents/reporting/velocity-metrics.md +0 -340
- package/.proagents/reverse-engineering/README.md +0 -151
- package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
- package/.proagents/reverse-engineering/code-analysis.md +0 -377
- package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
- package/.proagents/reverse-engineering/diagram-generation.md +0 -586
- package/.proagents/reverse-engineering/documentation-generation.md +0 -468
- package/.proagents/reverse-engineering/pattern-detection.md +0 -569
- package/.proagents/reverse-engineering/quality-assessment.md +0 -733
- package/.proagents/secrets/README.md +0 -278
- package/.proagents/secrets/access-control.md +0 -443
- package/.proagents/secrets/rotation.md +0 -403
- package/.proagents/secrets/scanning.md +0 -487
- package/.proagents/secrets/storage.md +0 -394
- package/.proagents/webhooks/README.md +0 -126
- package/.proagents/webhooks/endpoints.md +0 -298
- package/.proagents/webhooks/events.md +0 -316
- package/.proagents/webhooks/payloads.md +0 -325
- package/.proagents/webhooks/reliability.md +0 -363
- package/.proagents/webhooks/security.md +0 -380
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
# Pattern Reconciliation
|
|
2
|
-
|
|
3
|
-
Reconcile existing code patterns with ProAgents recommendations.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
Existing projects often have multiple patterns for the same thing. Pattern reconciliation:
|
|
10
|
-
- Identifies all patterns in use
|
|
11
|
-
- Helps choose primary patterns
|
|
12
|
-
- Creates migration path for legacy patterns
|
|
13
|
-
- Configures ProAgents to respect project patterns
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Pattern Detection
|
|
18
|
-
|
|
19
|
-
### Running Detection
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
# Detect all patterns
|
|
23
|
-
pa:detect-patterns
|
|
24
|
-
|
|
25
|
-
# Focus on specific area
|
|
26
|
-
pa:detect-patterns --type state-management
|
|
27
|
-
pa:detect-patterns --type components
|
|
28
|
-
pa:detect-patterns --type api
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Detection Output
|
|
32
|
-
|
|
33
|
-
```yaml
|
|
34
|
-
pattern_detection:
|
|
35
|
-
analyzed_files: 450
|
|
36
|
-
patterns_found: 23
|
|
37
|
-
inconsistencies: 8
|
|
38
|
-
|
|
39
|
-
categories:
|
|
40
|
-
components:
|
|
41
|
-
patterns:
|
|
42
|
-
- name: "Functional with hooks"
|
|
43
|
-
usage: 85%
|
|
44
|
-
age: "current"
|
|
45
|
-
locations: ["src/components/*", "src/features/*"]
|
|
46
|
-
|
|
47
|
-
- name: "Class components"
|
|
48
|
-
usage: 15%
|
|
49
|
-
age: "legacy"
|
|
50
|
-
locations: ["src/legacy/*", "src/admin/*"]
|
|
51
|
-
|
|
52
|
-
recommendation:
|
|
53
|
-
primary: "Functional with hooks"
|
|
54
|
-
migrate: "Class components"
|
|
55
|
-
|
|
56
|
-
state_management:
|
|
57
|
-
patterns:
|
|
58
|
-
- name: "Zustand"
|
|
59
|
-
usage: 30%
|
|
60
|
-
age: "newest"
|
|
61
|
-
|
|
62
|
-
- name: "Redux"
|
|
63
|
-
usage: 45%
|
|
64
|
-
age: "older"
|
|
65
|
-
|
|
66
|
-
- name: "Context API"
|
|
67
|
-
usage: 25%
|
|
68
|
-
age: "medium"
|
|
69
|
-
|
|
70
|
-
recommendation:
|
|
71
|
-
primary: "Zustand"
|
|
72
|
-
migrate: "Redux (gradual)"
|
|
73
|
-
keep: "Context API (for DI)"
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Reconciliation Process
|
|
79
|
-
|
|
80
|
-
### Step 1: Identify All Patterns
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
84
|
-
│ Pattern Inventory │
|
|
85
|
-
├─────────────────────────────────────────────────────────────┤
|
|
86
|
-
│ │
|
|
87
|
-
│ State Management │
|
|
88
|
-
│ ├── Redux (45%) ──────────── src/store/ │
|
|
89
|
-
│ ├── Zustand (30%) ────────── src/features/*/store.ts │
|
|
90
|
-
│ └── Context (25%) ────────── src/contexts/ │
|
|
91
|
-
│ │
|
|
92
|
-
│ Components │
|
|
93
|
-
│ ├── Functional (85%) ─────── src/components/ │
|
|
94
|
-
│ └── Class (15%) ──────────── src/legacy/ │
|
|
95
|
-
│ │
|
|
96
|
-
│ Styling │
|
|
97
|
-
│ ├── Tailwind (60%) ───────── src/components/ │
|
|
98
|
-
│ ├── CSS Modules (30%) ────── src/features/ │
|
|
99
|
-
│ └── Styled Components (10%)─ src/legacy/ │
|
|
100
|
-
│ │
|
|
101
|
-
│ API Calls │
|
|
102
|
-
│ ├── React Query (50%) ────── src/features/ │
|
|
103
|
-
│ ├── Custom hooks (30%) ───── src/hooks/ │
|
|
104
|
-
│ └── Direct axios (20%) ───── src/services/ │
|
|
105
|
-
│ │
|
|
106
|
-
└─────────────────────────────────────────────────────────────┘
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Step 2: Categorize Patterns
|
|
110
|
-
|
|
111
|
-
```yaml
|
|
112
|
-
pattern_categorization:
|
|
113
|
-
state_management:
|
|
114
|
-
primary:
|
|
115
|
-
name: "Zustand"
|
|
116
|
-
reason: "Newest, simplest, team prefers"
|
|
117
|
-
use_for: "New feature state"
|
|
118
|
-
|
|
119
|
-
secondary:
|
|
120
|
-
name: "Context API"
|
|
121
|
-
reason: "Good for dependency injection"
|
|
122
|
-
use_for: "Theme, auth context"
|
|
123
|
-
|
|
124
|
-
legacy:
|
|
125
|
-
name: "Redux"
|
|
126
|
-
reason: "Older code, works but complex"
|
|
127
|
-
use_for: "Existing features (don't add new)"
|
|
128
|
-
migration: "gradual"
|
|
129
|
-
|
|
130
|
-
components:
|
|
131
|
-
primary:
|
|
132
|
-
name: "Functional with hooks"
|
|
133
|
-
use_for: "All new components"
|
|
134
|
-
|
|
135
|
-
legacy:
|
|
136
|
-
name: "Class components"
|
|
137
|
-
migration: "when touched"
|
|
138
|
-
|
|
139
|
-
styling:
|
|
140
|
-
primary:
|
|
141
|
-
name: "Tailwind"
|
|
142
|
-
use_for: "All new components"
|
|
143
|
-
|
|
144
|
-
secondary:
|
|
145
|
-
name: "CSS Modules"
|
|
146
|
-
use_for: "Complex animations"
|
|
147
|
-
|
|
148
|
-
legacy:
|
|
149
|
-
name: "Styled Components"
|
|
150
|
-
migration: "when refactoring"
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Step 3: Document Decisions
|
|
154
|
-
|
|
155
|
-
```markdown
|
|
156
|
-
# Pattern Decisions
|
|
157
|
-
|
|
158
|
-
## State Management
|
|
159
|
-
|
|
160
|
-
### Decision: Use Zustand for new features
|
|
161
|
-
|
|
162
|
-
**Context:**
|
|
163
|
-
We currently have three state management solutions:
|
|
164
|
-
- Redux (45% of codebase)
|
|
165
|
-
- Zustand (30% of codebase)
|
|
166
|
-
- Context API (25% of codebase)
|
|
167
|
-
|
|
168
|
-
**Decision:**
|
|
169
|
-
- Zustand is primary for new feature state
|
|
170
|
-
- Context API for dependency injection (theme, auth)
|
|
171
|
-
- Redux: maintain but don't add new
|
|
172
|
-
|
|
173
|
-
**Rationale:**
|
|
174
|
-
- Zustand is simpler, less boilerplate
|
|
175
|
-
- Team productivity higher with Zustand
|
|
176
|
-
- Redux migration would be disruptive
|
|
177
|
-
|
|
178
|
-
**Migration Plan:**
|
|
179
|
-
- New features: Zustand only
|
|
180
|
-
- When touching Redux code: consider migration
|
|
181
|
-
- Target: Redux < 20% in 6 months
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Step 4: Configure ProAgents
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
# proagents.config.yaml
|
|
188
|
-
|
|
189
|
-
patterns:
|
|
190
|
-
state_management:
|
|
191
|
-
primary: "zustand"
|
|
192
|
-
allowed: ["zustand", "context"]
|
|
193
|
-
discouraged: ["redux"]
|
|
194
|
-
|
|
195
|
-
on_discouraged:
|
|
196
|
-
action: "warn"
|
|
197
|
-
message: "Consider using Zustand for new state"
|
|
198
|
-
|
|
199
|
-
on_disallowed:
|
|
200
|
-
action: "block"
|
|
201
|
-
message: "MobX is not used in this project"
|
|
202
|
-
|
|
203
|
-
components:
|
|
204
|
-
primary: "functional"
|
|
205
|
-
allowed: ["functional"]
|
|
206
|
-
discouraged: ["class"]
|
|
207
|
-
|
|
208
|
-
on_discouraged:
|
|
209
|
-
action: "suggest_migration"
|
|
210
|
-
provide_example: true
|
|
211
|
-
|
|
212
|
-
styling:
|
|
213
|
-
primary: "tailwind"
|
|
214
|
-
allowed: ["tailwind", "css-modules"]
|
|
215
|
-
discouraged: ["styled-components"]
|
|
216
|
-
|
|
217
|
-
api:
|
|
218
|
-
primary: "react-query"
|
|
219
|
-
allowed: ["react-query", "custom-hooks"]
|
|
220
|
-
discouraged: ["direct-axios"]
|
|
221
|
-
|
|
222
|
-
migration:
|
|
223
|
-
mode: "gradual"
|
|
224
|
-
suggest_on_touch: true
|
|
225
|
-
create_issues: true
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Pattern Migration
|
|
231
|
-
|
|
232
|
-
### Migration Strategies
|
|
233
|
-
|
|
234
|
-
#### Strategy 1: Gradual (Recommended)
|
|
235
|
-
|
|
236
|
-
```yaml
|
|
237
|
-
gradual_migration:
|
|
238
|
-
trigger: "when_touched"
|
|
239
|
-
|
|
240
|
-
process:
|
|
241
|
-
1. "Developer modifies file with old pattern"
|
|
242
|
-
2. "ProAgents suggests migration"
|
|
243
|
-
3. "Developer decides: migrate now or later"
|
|
244
|
-
4. "If later, create tracking issue"
|
|
245
|
-
5. "Track migration progress"
|
|
246
|
-
|
|
247
|
-
example:
|
|
248
|
-
file: "src/features/user/UserProfile.tsx"
|
|
249
|
-
current: "Class component with Redux"
|
|
250
|
-
suggested: "Functional with Zustand"
|
|
251
|
-
|
|
252
|
-
suggestion: |
|
|
253
|
-
This file uses legacy patterns:
|
|
254
|
-
- Class component → Consider functional
|
|
255
|
-
- Redux → Consider Zustand
|
|
256
|
-
|
|
257
|
-
Would you like to:
|
|
258
|
-
1. Migrate now (30 min estimated)
|
|
259
|
-
2. Create migration task for later
|
|
260
|
-
3. Skip (file will be tracked)
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
#### Strategy 2: Dedicated Migration
|
|
264
|
-
|
|
265
|
-
```yaml
|
|
266
|
-
dedicated_migration:
|
|
267
|
-
approach: "Sprint allocation"
|
|
268
|
-
|
|
269
|
-
process:
|
|
270
|
-
1. "Allocate 20% of sprint to migration"
|
|
271
|
-
2. "Pick highest-impact files"
|
|
272
|
-
3. "Full migration with tests"
|
|
273
|
-
4. "Track progress"
|
|
274
|
-
|
|
275
|
-
sprint_plan:
|
|
276
|
-
sprint_1:
|
|
277
|
-
- "Migrate auth feature Redux → Zustand"
|
|
278
|
-
- "Convert 5 class components"
|
|
279
|
-
|
|
280
|
-
sprint_2:
|
|
281
|
-
- "Migrate user feature"
|
|
282
|
-
- "Convert 5 more components"
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
#### Strategy 3: Big Bang (Risky)
|
|
286
|
-
|
|
287
|
-
```yaml
|
|
288
|
-
big_bang_migration:
|
|
289
|
-
use_when: "Small codebase or major refactor anyway"
|
|
290
|
-
|
|
291
|
-
process:
|
|
292
|
-
1. "Plan comprehensive migration"
|
|
293
|
-
2. "Freeze feature development"
|
|
294
|
-
3. "Migrate everything"
|
|
295
|
-
4. "Extensive testing"
|
|
296
|
-
5. "Resume development"
|
|
297
|
-
|
|
298
|
-
risk: "High"
|
|
299
|
-
recommendation: "Avoid unless necessary"
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### Migration Tracking
|
|
303
|
-
|
|
304
|
-
```yaml
|
|
305
|
-
migration_tracking:
|
|
306
|
-
redux_to_zustand:
|
|
307
|
-
total_files: 45
|
|
308
|
-
migrated: 12
|
|
309
|
-
in_progress: 3
|
|
310
|
-
remaining: 30
|
|
311
|
-
percentage: 27%
|
|
312
|
-
|
|
313
|
-
priority:
|
|
314
|
-
high:
|
|
315
|
-
- "src/store/authSlice.ts"
|
|
316
|
-
- "src/store/userSlice.ts"
|
|
317
|
-
medium:
|
|
318
|
-
- "src/store/settingsSlice.ts"
|
|
319
|
-
low:
|
|
320
|
-
- "src/store/adminSlice.ts"
|
|
321
|
-
|
|
322
|
-
class_to_functional:
|
|
323
|
-
total_files: 23
|
|
324
|
-
migrated: 8
|
|
325
|
-
remaining: 15
|
|
326
|
-
percentage: 35%
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## Handling Conflicts
|
|
332
|
-
|
|
333
|
-
### When Patterns Conflict
|
|
334
|
-
|
|
335
|
-
```yaml
|
|
336
|
-
conflict_example:
|
|
337
|
-
situation: "New feature needs to use both old and new patterns"
|
|
338
|
-
|
|
339
|
-
old_pattern:
|
|
340
|
-
name: "Redux"
|
|
341
|
-
existing_feature: "User management"
|
|
342
|
-
|
|
343
|
-
new_pattern:
|
|
344
|
-
name: "Zustand"
|
|
345
|
-
new_feature: "User preferences"
|
|
346
|
-
|
|
347
|
-
resolution_options:
|
|
348
|
-
- option: "Bridge"
|
|
349
|
-
description: "Create adapter between patterns"
|
|
350
|
-
code: |
|
|
351
|
-
// Bridge Redux and Zustand
|
|
352
|
-
const useUserBridge = () => {
|
|
353
|
-
const reduxUser = useSelector(selectUser);
|
|
354
|
-
const zustandUser = useUserStore(s => s.user);
|
|
355
|
-
return reduxUser || zustandUser;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
- option: "Isolate"
|
|
359
|
-
description: "Keep patterns completely separate"
|
|
360
|
-
boundary: "Feature boundary"
|
|
361
|
-
|
|
362
|
-
- option: "Migrate First"
|
|
363
|
-
description: "Migrate dependency before new feature"
|
|
364
|
-
effort: "Additional time"
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Coexistence Rules
|
|
368
|
-
|
|
369
|
-
```yaml
|
|
370
|
-
coexistence:
|
|
371
|
-
state_management:
|
|
372
|
-
rule: "One source of truth per domain"
|
|
373
|
-
example:
|
|
374
|
-
- "User data: Redux only (until migrated)"
|
|
375
|
-
- "UI state: Zustand only"
|
|
376
|
-
- "Theme: Context only"
|
|
377
|
-
|
|
378
|
-
components:
|
|
379
|
-
rule: "New components are functional"
|
|
380
|
-
exception: "Error boundaries can be class"
|
|
381
|
-
|
|
382
|
-
api:
|
|
383
|
-
rule: "React Query for server state"
|
|
384
|
-
exception: "One-off requests can use axios directly"
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
---
|
|
388
|
-
|
|
389
|
-
## Pattern Documentation
|
|
390
|
-
|
|
391
|
-
### Auto-Generated Pattern Guide
|
|
392
|
-
|
|
393
|
-
```markdown
|
|
394
|
-
# Project Patterns Guide
|
|
395
|
-
|
|
396
|
-
## State Management
|
|
397
|
-
|
|
398
|
-
### Primary: Zustand
|
|
399
|
-
Use Zustand for all new feature state.
|
|
400
|
-
|
|
401
|
-
```typescript
|
|
402
|
-
// Example: Creating a store
|
|
403
|
-
import { create } from 'zustand';
|
|
404
|
-
|
|
405
|
-
interface UserStore {
|
|
406
|
-
user: User | null;
|
|
407
|
-
setUser: (user: User) => void;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export const useUserStore = create<UserStore>((set) => ({
|
|
411
|
-
user: null,
|
|
412
|
-
setUser: (user) => set({ user }),
|
|
413
|
-
}));
|
|
414
|
-
|
|
415
|
-
// Usage
|
|
416
|
-
const user = useUserStore((state) => state.user);
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
### Legacy: Redux
|
|
420
|
-
Existing code uses Redux. Maintain but don't add new.
|
|
421
|
-
|
|
422
|
-
### When to Use What
|
|
423
|
-
| Use Case | Pattern |
|
|
424
|
-
|----------|---------|
|
|
425
|
-
| Feature state | Zustand |
|
|
426
|
-
| Global app state | Zustand |
|
|
427
|
-
| Server state | React Query |
|
|
428
|
-
| Theme/Auth context | Context API |
|
|
429
|
-
| Legacy features | Redux (existing) |
|
|
430
|
-
|
|
431
|
-
## Components
|
|
432
|
-
|
|
433
|
-
### Primary: Functional Components
|
|
434
|
-
|
|
435
|
-
```typescript
|
|
436
|
-
interface Props {
|
|
437
|
-
title: string;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
export const MyComponent: FC<Props> = ({ title }) => {
|
|
441
|
-
return <div>{title}</div>;
|
|
442
|
-
};
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
### Migration from Class
|
|
446
|
-
|
|
447
|
-
[See migration guide]
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
---
|
|
451
|
-
|
|
452
|
-
## Configuration
|
|
453
|
-
|
|
454
|
-
```yaml
|
|
455
|
-
# proagents.config.yaml
|
|
456
|
-
|
|
457
|
-
pattern_reconciliation:
|
|
458
|
-
enabled: true
|
|
459
|
-
|
|
460
|
-
detection:
|
|
461
|
-
on_init: true
|
|
462
|
-
periodic: "weekly"
|
|
463
|
-
|
|
464
|
-
reconciliation:
|
|
465
|
-
auto_suggest: true
|
|
466
|
-
create_documentation: true
|
|
467
|
-
track_migration: true
|
|
468
|
-
|
|
469
|
-
enforcement:
|
|
470
|
-
level: "warn" # warn | suggest | block
|
|
471
|
-
exceptions_allowed: true
|
|
472
|
-
|
|
473
|
-
migration:
|
|
474
|
-
mode: "gradual"
|
|
475
|
-
track_progress: true
|
|
476
|
-
create_issues: true
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
## Commands
|
|
482
|
-
|
|
483
|
-
| Command | Description |
|
|
484
|
-
|---------|-------------|
|
|
485
|
-
| `pa:detect-patterns` | Detect all patterns |
|
|
486
|
-
| `pa:pattern-status` | View pattern usage |
|
|
487
|
-
| `pa:pattern-reconcile` | Start reconciliation |
|
|
488
|
-
| `pa:pattern-migrate [from] [to]` | Plan migration |
|
|
489
|
-
| `pa:pattern-document` | Generate pattern docs |
|