proagents 1.6.17 → 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 (168) hide show
  1. package/.claude/settings.local.json +169 -0
  2. package/COMMANDS.md +595 -0
  3. package/README.md +13 -23
  4. package/package.json +2 -7
  5. package/.proagents/ai-models/README.md +0 -141
  6. package/.proagents/ai-models/cost-management.md +0 -362
  7. package/.proagents/ai-models/fallbacks.md +0 -342
  8. package/.proagents/ai-models/model-config.md +0 -318
  9. package/.proagents/ai-models/task-routing.md +0 -503
  10. package/.proagents/ai-training/README.md +0 -155
  11. package/.proagents/ai-training/continuous-learning.md +0 -413
  12. package/.proagents/ai-training/domain-knowledge.md +0 -378
  13. package/.proagents/ai-training/pattern-learning.md +0 -455
  14. package/.proagents/ai-training/training-data.md +0 -337
  15. package/.proagents/ai-training/user-preferences.md +0 -346
  16. package/.proagents/approval-workflows/README.md +0 -146
  17. package/.proagents/approval-workflows/approval-config.md +0 -332
  18. package/.proagents/approval-workflows/approval-stages.md +0 -503
  19. package/.proagents/approval-workflows/emergency-bypass.md +0 -351
  20. package/.proagents/approval-workflows/examples.md +0 -859
  21. package/.proagents/approval-workflows/notifications.md +0 -320
  22. package/.proagents/compliance/README.md +0 -206
  23. package/.proagents/compliance/access-control.md +0 -310
  24. package/.proagents/compliance/audit-logging.md +0 -444
  25. package/.proagents/compliance/compliance-frameworks.md +0 -429
  26. package/.proagents/compliance/reports.md +0 -491
  27. package/.proagents/compliance/retention-policies.md +0 -454
  28. package/.proagents/config-versioning/README.md +0 -120
  29. package/.proagents/config-versioning/changelog.md +0 -300
  30. package/.proagents/config-versioning/rollback.md +0 -283
  31. package/.proagents/config-versioning/versioning.md +0 -330
  32. package/.proagents/contract-testing/README.md +0 -223
  33. package/.proagents/contract-testing/contract-testing.md +0 -614
  34. package/.proagents/contract-testing/pact-integration.md +0 -507
  35. package/.proagents/contract-testing/schema-validation.md +0 -565
  36. package/.proagents/dependency-management/README.md +0 -140
  37. package/.proagents/dependency-management/automation.md +0 -363
  38. package/.proagents/dependency-management/compatibility.md +0 -319
  39. package/.proagents/dependency-management/security-scanning.md +0 -413
  40. package/.proagents/dependency-management/update-policies.md +0 -374
  41. package/.proagents/disaster-recovery/README.md +0 -247
  42. package/.proagents/disaster-recovery/automation.md +0 -366
  43. package/.proagents/disaster-recovery/backup-recovery.md +0 -571
  44. package/.proagents/disaster-recovery/incident-response.md +0 -565
  45. package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
  46. package/.proagents/disaster-recovery/runbooks.md +0 -603
  47. package/.proagents/disaster-recovery/scenarios.md +0 -892
  48. package/.proagents/disaster-recovery/testing.md +0 -438
  49. package/.proagents/environments/README.md +0 -244
  50. package/.proagents/environments/configuration.md +0 -437
  51. package/.proagents/environments/promotion.md +0 -434
  52. package/.proagents/environments/setup.md +0 -420
  53. package/.proagents/examples/README.md +0 -55
  54. package/.proagents/examples/backend-nodejs/README.md +0 -188
  55. package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
  56. package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
  57. package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
  58. package/.proagents/examples/fullstack-nextjs/README.md +0 -155
  59. package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
  60. package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
  61. package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
  62. package/.proagents/examples/mobile-react-native/README.md +0 -171
  63. package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
  64. package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
  65. package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
  66. package/.proagents/examples/web-frontend-react/README.md +0 -125
  67. package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
  68. package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
  69. package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
  70. package/.proagents/existing-projects/README.md +0 -65
  71. package/.proagents/existing-projects/challenges.md +0 -861
  72. package/.proagents/existing-projects/coexistence-mode.md +0 -483
  73. package/.proagents/existing-projects/compatibility-assessment.md +0 -541
  74. package/.proagents/existing-projects/gradual-adoption.md +0 -515
  75. package/.proagents/existing-projects/migration-strategies.md +0 -788
  76. package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
  77. package/.proagents/existing-projects/team-onboarding.md +0 -617
  78. package/.proagents/existing-projects/technical-debt-handling.md +0 -644
  79. package/.proagents/feature-flags/README.md +0 -263
  80. package/.proagents/feature-flags/ab-testing.md +0 -413
  81. package/.proagents/feature-flags/configuration.md +0 -420
  82. package/.proagents/feature-flags/kill-switches.md +0 -444
  83. package/.proagents/feature-flags/rollout-strategies.md +0 -392
  84. package/.proagents/history.log +0 -12
  85. package/.proagents/i18n/README.md +0 -133
  86. package/.proagents/i18n/extraction.md +0 -433
  87. package/.proagents/i18n/tms-integration.md +0 -332
  88. package/.proagents/i18n/translation-workflow.md +0 -413
  89. package/.proagents/i18n/validation.md +0 -355
  90. package/.proagents/logging/README.md +0 -276
  91. package/.proagents/logging/aggregation.md +0 -475
  92. package/.proagents/logging/log-levels.md +0 -376
  93. package/.proagents/logging/sensitive-data.md +0 -423
  94. package/.proagents/logging/structured-logging.md +0 -406
  95. package/.proagents/metrics/README.md +0 -69
  96. package/.proagents/metrics/code-quality-kpis.md +0 -461
  97. package/.proagents/metrics/deployment-metrics.md +0 -517
  98. package/.proagents/metrics/developer-productivity.md +0 -368
  99. package/.proagents/metrics/learning-effectiveness.md +0 -478
  100. package/.proagents/migrations/README.md +0 -77
  101. package/.proagents/migrations/from-claude-projects.md +0 -313
  102. package/.proagents/migrations/from-cursor-rules.md +0 -345
  103. package/.proagents/migrations/from-custom-workflows.md +0 -410
  104. package/.proagents/monitoring/README.md +0 -308
  105. package/.proagents/monitoring/alerting.md +0 -449
  106. package/.proagents/monitoring/dashboards.md +0 -454
  107. package/.proagents/monitoring/health-checks.md +0 -436
  108. package/.proagents/monitoring/metrics.md +0 -434
  109. package/.proagents/multi-project/README.md +0 -170
  110. package/.proagents/multi-project/coordinated-deploy.md +0 -510
  111. package/.proagents/multi-project/cross-project-deps.md +0 -395
  112. package/.proagents/multi-project/unified-changelog.md +0 -477
  113. package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
  114. package/.proagents/multi-project/workspace-config.md +0 -408
  115. package/.proagents/notifications/README.md +0 -151
  116. package/.proagents/notifications/channels.md +0 -457
  117. package/.proagents/notifications/preferences.md +0 -415
  118. package/.proagents/notifications/routing.md +0 -449
  119. package/.proagents/notifications/scheduling.md +0 -425
  120. package/.proagents/notifications/templates.md +0 -446
  121. package/.proagents/offline-mode/README.md +0 -145
  122. package/.proagents/offline-mode/caching.md +0 -344
  123. package/.proagents/offline-mode/offline-operations.md +0 -312
  124. package/.proagents/offline-mode/queue-specifications.md +0 -679
  125. package/.proagents/offline-mode/sync.md +0 -475
  126. package/.proagents/parallel-features/README.md +0 -85
  127. package/.proagents/parallel-features/conflict-detection.md +0 -226
  128. package/.proagents/parallel-features/dependency-management.md +0 -392
  129. package/.proagents/parallel-features/merge-coordination.md +0 -506
  130. package/.proagents/parallel-features/tracking-system.md +0 -416
  131. package/.proagents/performance/README.md +0 -59
  132. package/.proagents/performance/bundle-analysis.md +0 -375
  133. package/.proagents/performance/load-testing.md +0 -563
  134. package/.proagents/performance/runtime-metrics.md +0 -489
  135. package/.proagents/performance/web-vitals.md +0 -425
  136. package/.proagents/plugins/README.md +0 -139
  137. package/.proagents/plugins/creating-plugins.md +0 -504
  138. package/.proagents/plugins/plugin-api.md +0 -467
  139. package/.proagents/plugins/plugin-registry.md +0 -276
  140. package/.proagents/reporting/README.md +0 -158
  141. package/.proagents/reporting/dashboards.md +0 -366
  142. package/.proagents/reporting/exports.md +0 -524
  143. package/.proagents/reporting/quality-metrics.md +0 -385
  144. package/.proagents/reporting/templates/README.md +0 -56
  145. package/.proagents/reporting/templates/dashboard-config.json +0 -187
  146. package/.proagents/reporting/templates/metrics-queries.md +0 -427
  147. package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
  148. package/.proagents/reporting/templates/widgets.md +0 -451
  149. package/.proagents/reporting/velocity-metrics.md +0 -340
  150. package/.proagents/reverse-engineering/README.md +0 -151
  151. package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
  152. package/.proagents/reverse-engineering/code-analysis.md +0 -377
  153. package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
  154. package/.proagents/reverse-engineering/diagram-generation.md +0 -586
  155. package/.proagents/reverse-engineering/documentation-generation.md +0 -468
  156. package/.proagents/reverse-engineering/pattern-detection.md +0 -569
  157. package/.proagents/reverse-engineering/quality-assessment.md +0 -733
  158. package/.proagents/secrets/README.md +0 -278
  159. package/.proagents/secrets/access-control.md +0 -443
  160. package/.proagents/secrets/rotation.md +0 -403
  161. package/.proagents/secrets/scanning.md +0 -487
  162. package/.proagents/secrets/storage.md +0 -394
  163. package/.proagents/webhooks/README.md +0 -126
  164. package/.proagents/webhooks/endpoints.md +0 -298
  165. package/.proagents/webhooks/events.md +0 -316
  166. package/.proagents/webhooks/payloads.md +0 -325
  167. package/.proagents/webhooks/reliability.md +0 -363
  168. package/.proagents/webhooks/security.md +0 -380
@@ -1,438 +0,0 @@
1
- # Disaster Recovery Testing
2
-
3
- Validate your recovery procedures before you need them.
4
-
5
- ---
6
-
7
- ## Testing Types
8
-
9
- | Type | Frequency | Scope | Impact |
10
- |------|-----------|-------|--------|
11
- | **Tabletop Exercise** | Monthly | Discussion-based | None |
12
- | **Component Test** | Weekly | Single service | Minimal |
13
- | **Partial Failover** | Monthly | Multiple services | Low |
14
- | **Full DR Test** | Quarterly | Complete system | Medium |
15
- | **Chaos Engineering** | Continuous | Random failures | Variable |
16
-
17
- ---
18
-
19
- ## Tabletop Exercises
20
-
21
- ### Scenario Planning
22
-
23
- ```yaml
24
- # proagents.config.yaml
25
- disaster_recovery:
26
- testing:
27
- tabletop:
28
- scenarios:
29
- - name: "Database Corruption"
30
- description: "Primary database becomes corrupted during peak hours"
31
- participants: ["DBA", "Backend Lead", "SRE"]
32
- duration: "1h"
33
- questions:
34
- - "How do we detect the corruption?"
35
- - "What's our RTO for database recovery?"
36
- - "How do we communicate to users?"
37
- - "What data might we lose?"
38
-
39
- - name: "Cloud Region Outage"
40
- description: "Primary cloud region becomes unavailable"
41
- participants: ["SRE", "Platform Lead", "Engineering Manager"]
42
- duration: "2h"
43
- questions:
44
- - "How quickly can we failover to secondary region?"
45
- - "What services are region-dependent?"
46
- - "How do we handle data synchronization?"
47
-
48
- - name: "Security Breach"
49
- description: "Unauthorized access detected in production"
50
- participants: ["Security Team", "SRE", "CTO"]
51
- duration: "2h"
52
- questions:
53
- - "How do we isolate affected systems?"
54
- - "What's our communication plan?"
55
- - "How do we preserve evidence?"
56
- ```
57
-
58
- ### Exercise Template
59
-
60
- ```markdown
61
- ## Tabletop Exercise: [Scenario Name]
62
-
63
- **Date:** [YYYY-MM-DD]
64
- **Participants:** [List]
65
- **Facilitator:** [Name]
66
-
67
- ### Scenario
68
- [Detailed scenario description]
69
-
70
- ### Timeline
71
- | Time | Event | Expected Response |
72
- |------|-------|-------------------|
73
- | T+0 | Incident detected | Alert triggers |
74
- | T+5m | Initial assessment | Oncall responds |
75
- | T+15m | Escalation decision | Team assembled |
76
- | T+30m | Recovery initiated | Rollback/failover |
77
- | T+60m | Verification | Health checks pass |
78
-
79
- ### Discussion Points
80
- 1. [Question 1]
81
- - Response: [Team's answer]
82
- - Gap identified: [Any issues found]
83
-
84
- ### Action Items
85
- - [ ] [Action 1] - Owner: [Name] - Due: [Date]
86
- - [ ] [Action 2] - Owner: [Name] - Due: [Date]
87
-
88
- ### Lessons Learned
89
- [Summary of findings]
90
- ```
91
-
92
- ---
93
-
94
- ## Component Testing
95
-
96
- ### Single Service Rollback
97
-
98
- ```yaml
99
- disaster_recovery:
100
- testing:
101
- component:
102
- # Test individual service rollback
103
- service_rollback:
104
- schedule: "weekly"
105
- environment: "staging"
106
- services:
107
- - name: "api-gateway"
108
- test_steps:
109
- - deploy_test_version
110
- - verify_degradation
111
- - trigger_rollback
112
- - verify_recovery
113
-
114
- - name: "auth-service"
115
- test_steps:
116
- - deploy_test_version
117
- - verify_auth_fails
118
- - trigger_rollback
119
- - verify_auth_works
120
- ```
121
-
122
- ### Database Recovery Test
123
-
124
- ```yaml
125
- disaster_recovery:
126
- testing:
127
- component:
128
- database_recovery:
129
- schedule: "weekly"
130
- environment: "staging"
131
- steps:
132
- - create_backup
133
- - simulate_corruption
134
- - restore_from_backup
135
- - verify_data_integrity
136
- - measure_recovery_time
137
-
138
- acceptance_criteria:
139
- recovery_time: "< 30m"
140
- data_loss: "< 5m of transactions"
141
- ```
142
-
143
- ---
144
-
145
- ## Partial Failover Testing
146
-
147
- ### Multi-Service Failover
148
-
149
- ```yaml
150
- disaster_recovery:
151
- testing:
152
- partial_failover:
153
- schedule: "monthly"
154
- environment: "staging"
155
-
156
- scenarios:
157
- - name: "Backend Cluster Failure"
158
- services: ["api", "worker", "scheduler"]
159
- steps:
160
- - mark_cluster_unhealthy
161
- - verify_traffic_shifts
162
- - verify_secondary_handles_load
163
- - restore_primary
164
- - verify_traffic_returns
165
-
166
- - name: "Database Failover"
167
- components: ["primary-db"]
168
- steps:
169
- - promote_replica
170
- - update_connection_strings
171
- - verify_write_capability
172
- - demote_old_primary
173
- - resync_data
174
- ```
175
-
176
- ### Failover Metrics
177
-
178
- ```yaml
179
- disaster_recovery:
180
- testing:
181
- metrics:
182
- # Track during tests
183
- measure:
184
- - name: "failover_time"
185
- description: "Time from trigger to recovery"
186
- target: "< 5m"
187
-
188
- - name: "data_loss_window"
189
- description: "Time of unrecoverable transactions"
190
- target: "< 30s"
191
-
192
- - name: "error_spike_duration"
193
- description: "Duration of elevated errors"
194
- target: "< 2m"
195
-
196
- - name: "full_recovery_time"
197
- description: "Time to return to normal operations"
198
- target: "< 15m"
199
- ```
200
-
201
- ---
202
-
203
- ## Full DR Testing
204
-
205
- ### Complete System Failover
206
-
207
- ```yaml
208
- disaster_recovery:
209
- testing:
210
- full_dr:
211
- schedule: "quarterly"
212
- notification_lead_time: "1 week"
213
-
214
- phases:
215
- - name: "Preparation"
216
- duration: "1 day"
217
- tasks:
218
- - notify_stakeholders
219
- - verify_backup_integrity
220
- - prepare_runbooks
221
- - brief_team
222
-
223
- - name: "Failover"
224
- duration: "4 hours"
225
- tasks:
226
- - initiate_failover
227
- - verify_all_services
228
- - test_critical_flows
229
- - measure_performance
230
-
231
- - name: "Operation"
232
- duration: "4 hours"
233
- tasks:
234
- - run_on_dr_site
235
- - monitor_for_issues
236
- - handle_any_incidents
237
- - document_findings
238
-
239
- - name: "Failback"
240
- duration: "4 hours"
241
- tasks:
242
- - initiate_failback
243
- - resync_data
244
- - verify_primary
245
- - restore_normal_operations
246
-
247
- - name: "Review"
248
- duration: "1 day"
249
- tasks:
250
- - analyze_metrics
251
- - document_issues
252
- - update_runbooks
253
- - plan_improvements
254
- ```
255
-
256
- ### DR Test Report Template
257
-
258
- ```markdown
259
- ## Full DR Test Report
260
-
261
- **Date:** [YYYY-MM-DD]
262
- **Duration:** [X hours]
263
- **Participants:** [List]
264
-
265
- ### Objectives
266
- - [ ] Complete failover to DR site
267
- - [ ] Operate on DR site for [X hours]
268
- - [ ] Failback to primary site
269
- - [ ] Meet RTO/RPO targets
270
-
271
- ### Results Summary
272
-
273
- | Metric | Target | Actual | Status |
274
- |--------|--------|--------|--------|
275
- | Failover Time | 15m | 12m | Pass |
276
- | Data Loss | 0 | 0 | Pass |
277
- | Error Rate During Failover | < 5% | 3.2% | Pass |
278
- | Failback Time | 30m | 45m | Fail |
279
-
280
- ### Issues Encountered
281
-
282
- #### Issue 1: [Title]
283
- - **Severity:** [High/Medium/Low]
284
- - **Description:** [Details]
285
- - **Impact:** [Effect on test]
286
- - **Resolution:** [How it was handled]
287
- - **Follow-up:** [Action item]
288
-
289
- ### Recommendations
290
- 1. [Recommendation 1]
291
- 2. [Recommendation 2]
292
-
293
- ### Sign-off
294
- - [ ] Engineering Lead: ________
295
- - [ ] SRE Lead: ________
296
- - [ ] Security: ________
297
- ```
298
-
299
- ---
300
-
301
- ## Chaos Engineering
302
-
303
- ### Chaos Configuration
304
-
305
- ```yaml
306
- disaster_recovery:
307
- testing:
308
- chaos:
309
- enabled: true
310
- environment: "staging" # Never in production without controls
311
-
312
- experiments:
313
- - name: "pod_failure"
314
- type: "kubernetes"
315
- action: "kill_pod"
316
- target:
317
- selector: "app=api"
318
- count: 1
319
- schedule: "random"
320
- window: "business_hours"
321
-
322
- - name: "network_latency"
323
- type: "network"
324
- action: "add_latency"
325
- parameters:
326
- latency: "500ms"
327
- duration: "5m"
328
- target: "api-to-database"
329
-
330
- - name: "resource_stress"
331
- type: "resource"
332
- action: "cpu_stress"
333
- parameters:
334
- load: "80%"
335
- duration: "10m"
336
- target: "worker-nodes"
337
- ```
338
-
339
- ### Chaos Guardrails
340
-
341
- ```yaml
342
- disaster_recovery:
343
- testing:
344
- chaos:
345
- guardrails:
346
- # Stop conditions
347
- abort_conditions:
348
- - "error_rate > 10%"
349
- - "p99_latency > 5s"
350
- - "health_check_failing"
351
-
352
- # Blast radius limits
353
- limits:
354
- max_affected_pods: 2
355
- max_affected_nodes: 1
356
- max_duration: "30m"
357
-
358
- # Excluded resources
359
- excluded:
360
- - "production-*"
361
- - "critical-*"
362
- - "database-primary"
363
-
364
- # Notification on experiment
365
- notify:
366
- before: ["#chaos-engineering"]
367
- on_abort: ["#incidents", "oncall"]
368
- ```
369
-
370
- ---
371
-
372
- ## Automated DR Testing
373
-
374
- ### Scheduled Tests
375
-
376
- ```yaml
377
- disaster_recovery:
378
- testing:
379
- automation:
380
- # Automated test schedule
381
- schedule:
382
- - name: "backup_verification"
383
- cron: "0 2 * * *" # Daily at 2 AM
384
- test: "verify_backup_integrity"
385
-
386
- - name: "restore_test"
387
- cron: "0 3 * * 0" # Weekly on Sunday
388
- test: "restore_to_test_env"
389
-
390
- - name: "failover_drill"
391
- cron: "0 4 1 * *" # Monthly on 1st
392
- test: "staging_failover"
393
-
394
- # Reporting
395
- reports:
396
- destination: "s3://dr-reports/"
397
- notify: ["engineering@company.com"]
398
- on_failure: ["oncall@company.com"]
399
- ```
400
-
401
- ---
402
-
403
- ## Commands
404
-
405
- ```bash
406
- # Run tabletop exercise
407
- proagents dr test tabletop --scenario "database-corruption"
408
-
409
- # Test component rollback
410
- proagents dr test component --service api --env staging
411
-
412
- # Run partial failover test
413
- proagents dr test failover --scope partial --env staging
414
-
415
- # Schedule full DR test
416
- proagents dr test schedule --type full --date 2024-03-15
417
-
418
- # Run chaos experiment
419
- proagents dr chaos run --experiment pod_failure --duration 5m
420
-
421
- # View test history
422
- proagents dr test history --last 30d
423
-
424
- # Generate DR test report
425
- proagents dr test report --date 2024-01-15
426
- ```
427
-
428
- ---
429
-
430
- ## Best Practices
431
-
432
- 1. **Start Small**: Begin with tabletop exercises before live tests
433
- 2. **Regular Schedule**: Test consistently, not just before audits
434
- 3. **Document Everything**: Capture findings and improvements
435
- 4. **Include Everyone**: Involve all relevant teams
436
- 5. **Fix Issues**: Address gaps found during testing
437
- 6. **Measure Improvement**: Track metrics over time
438
- 7. **Chaos Carefully**: Start chaos engineering in non-production
@@ -1,244 +0,0 @@
1
- # Environment Management
2
-
3
- Configure and manage development, staging, and production environments.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Consistent environment configuration across development, staging, and production.
10
-
11
- ## Documentation
12
-
13
- | Document | Description |
14
- |----------|-------------|
15
- | [Environment Setup](./setup.md) | Setting up environments |
16
- | [Configuration](./configuration.md) | Environment-specific config |
17
- | [Promotion](./promotion.md) | Promoting between environments |
18
-
19
- ---
20
-
21
- ## Environment Types
22
-
23
- ### Standard Environments
24
-
25
- | Environment | Purpose | Data |
26
- |-------------|---------|------|
27
- | `development` | Local development | Mock/seed data |
28
- | `staging` | Pre-production testing | Production-like |
29
- | `production` | Live users | Real data |
30
-
31
- ### Optional Environments
32
-
33
- | Environment | Purpose |
34
- |-------------|---------|
35
- | `test` | Automated testing |
36
- | `preview` | PR previews |
37
- | `sandbox` | Experimentation |
38
-
39
- ---
40
-
41
- ## Configuration
42
-
43
- ### Environment Files
44
-
45
- ```
46
- your-project/
47
- ├── .env # Shared defaults
48
- ├── .env.development # Development overrides
49
- ├── .env.staging # Staging overrides
50
- ├── .env.production # Production overrides
51
- └── .env.local # Local overrides (gitignored)
52
- ```
53
-
54
- ### ProAgents Config
55
-
56
- ```yaml
57
- # proagents.config.yaml
58
- environments:
59
- default: "development"
60
-
61
- development:
62
- api_url: "http://localhost:3000"
63
- debug: true
64
- mocks: true
65
-
66
- staging:
67
- api_url: "https://staging-api.example.com"
68
- debug: true
69
- mocks: false
70
-
71
- production:
72
- api_url: "https://api.example.com"
73
- debug: false
74
- mocks: false
75
- ```
76
-
77
- ---
78
-
79
- ## Environment Variables
80
-
81
- ### Variable Categories
82
-
83
- ```yaml
84
- environments:
85
- variables:
86
- # Public (safe to expose)
87
- public:
88
- - "API_URL"
89
- - "APP_NAME"
90
- - "FEATURE_FLAGS"
91
-
92
- # Private (server-only)
93
- private:
94
- - "DATABASE_URL"
95
- - "API_KEY"
96
- - "JWT_SECRET"
97
-
98
- # Sensitive (encrypted)
99
- sensitive:
100
- - "AWS_SECRET_KEY"
101
- - "STRIPE_SECRET"
102
- ```
103
-
104
- ### Validation
105
-
106
- ```yaml
107
- environments:
108
- validation:
109
- required:
110
- all:
111
- - "API_URL"
112
- - "NODE_ENV"
113
- production:
114
- - "DATABASE_URL"
115
- - "REDIS_URL"
116
-
117
- format:
118
- API_URL: "url"
119
- PORT: "number"
120
- DEBUG: "boolean"
121
- ```
122
-
123
- ---
124
-
125
- ## Commands
126
-
127
- ```bash
128
- # Check current environment
129
- proagents env current
130
-
131
- # List all environments
132
- proagents env list
133
-
134
- # Switch environment
135
- proagents env use staging
136
-
137
- # Validate environment
138
- proagents env validate
139
-
140
- # Compare environments
141
- proagents env diff staging production
142
-
143
- # Export environment
144
- proagents env export staging --output .env.staging
145
- ```
146
-
147
- ---
148
-
149
- ## Environment Promotion
150
-
151
- ### Promotion Flow
152
-
153
- ```
154
- development → staging → production
155
- ↓ ↓ ↓
156
- Test QA Release
157
- ```
158
-
159
- ### Promotion Configuration
160
-
161
- ```yaml
162
- environments:
163
- promotion:
164
- development_to_staging:
165
- requires:
166
- - "all_tests_pass"
167
- - "code_review_approved"
168
-
169
- staging_to_production:
170
- requires:
171
- - "all_tests_pass"
172
- - "qa_approved"
173
- - "security_scan_clean"
174
-
175
- approval:
176
- required: true
177
- approvers: ["tech_lead", "product_manager"]
178
- ```
179
-
180
- ### Promote Command
181
-
182
- ```bash
183
- # Promote to staging
184
- proagents env promote staging
185
-
186
- # Promote to production (with approval)
187
- proagents env promote production --request-approval
188
- ```
189
-
190
- ---
191
-
192
- ## Environment Parity
193
-
194
- ### Keeping Environments in Sync
195
-
196
- ```yaml
197
- environments:
198
- parity:
199
- # Sync these between environments
200
- sync:
201
- - "database_schema"
202
- - "feature_flags"
203
- - "config_structure"
204
-
205
- # Detect drift
206
- drift_detection:
207
- enabled: true
208
- schedule: "daily"
209
- notify: "#devops"
210
- ```
211
-
212
- ### Drift Report
213
-
214
- ```
215
- ┌─────────────────────────────────────────────────────────────┐
216
- │ Environment Drift Report │
217
- ├─────────────────────────────────────────────────────────────┤
218
- │ │
219
- │ Comparing: staging ↔ production │
220
- │ │
221
- │ Schema Differences: │
222
- │ ├── Missing in prod: users.preferences (column) │
223
- │ └── Extra in prod: legacy_table (table) │
224
- │ │
225
- │ Config Differences: │
226
- │ ├── FEATURE_X: staging=true, prod=false │
227
- │ └── MAX_CONNECTIONS: staging=10, prod=100 │
228
- │ │
229
- │ Recommendation: Run migrations before next deploy │
230
- │ │
231
- └─────────────────────────────────────────────────────────────┘
232
- ```
233
-
234
- ---
235
-
236
- ## Best Practices
237
-
238
- 1. **Parity**: Keep environments as similar as possible
239
- 2. **Never Share Secrets**: Different secrets per environment
240
- 3. **Validate Early**: Check env vars on startup
241
- 4. **Document Requirements**: List required variables
242
- 5. **Use Defaults Wisely**: Safe defaults for development
243
- 6. **Protect Production**: Require approvals for prod changes
244
- 7. **Monitor Drift**: Regularly check for differences