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,330 +0,0 @@
1
- # Configuration Versioning
2
-
3
- Track all configuration changes with full history.
4
-
5
- ---
6
-
7
- ## Version Structure
8
-
9
- ### Version Format
10
-
11
- ```
12
- v{major}.{minor}.{patch}
13
-
14
- Examples:
15
- v1.0.0 - Initial configuration
16
- v1.1.0 - Added new checkpoint
17
- v1.1.1 - Fixed typo in rule
18
- v2.0.0 - Breaking change to standards
19
- ```
20
-
21
- ### Version Metadata
22
-
23
- ```json
24
- {
25
- "version": "v1.5.0",
26
- "timestamp": "2024-01-15T10:30:00Z",
27
- "author": "developer@company.com",
28
- "reason": "Added stricter security rules",
29
- "files_changed": [
30
- "proagents.config.yaml",
31
- "rules/security-rules.yaml"
32
- ],
33
- "checksum": "sha256:abc123..."
34
- }
35
- ```
36
-
37
- ---
38
-
39
- ## Creating Versions
40
-
41
- ### Automatic Versioning
42
-
43
- Changes are automatically versioned when using CLI:
44
-
45
- ```bash
46
- # Set config value (creates version)
47
- proagents config set checkpoints.before_deployment true
48
-
49
- # Output:
50
- Configuration updated.
51
- Version: v1.5.1
52
- Reason: Updated checkpoints.before_deployment
53
- ```
54
-
55
- ### Manual Versioning
56
-
57
- ```bash
58
- # Create version with message
59
- proagents config commit --message "Added new security rules"
60
-
61
- # Create version with specific version number
62
- proagents config commit --version v2.0.0 --message "Breaking changes"
63
- ```
64
-
65
- ### Version on Edit
66
-
67
- ```yaml
68
- config_versioning:
69
- auto_version:
70
- enabled: true
71
- on_save: true
72
- version_bump: "patch" # auto, major, minor, patch
73
- ```
74
-
75
- ---
76
-
77
- ## Version History
78
-
79
- ### View History
80
-
81
- ```bash
82
- # Show recent versions
83
- proagents config history
84
-
85
- # Output:
86
- ┌─────────────────────────────────────────────────────────────┐
87
- │ Configuration History │
88
- ├─────────────────────────────────────────────────────────────┤
89
- │ │
90
- │ v1.5.1 (current) │
91
- │ ├── Date: Jan 15, 2024 10:30 │
92
- │ ├── Author: developer@company.com │
93
- │ └── Reason: Updated checkpoint settings │
94
- │ │
95
- │ v1.5.0 │
96
- │ ├── Date: Jan 14, 2024 15:45 │
97
- │ ├── Author: lead@company.com │
98
- │ └── Reason: Added stricter security rules │
99
- │ │
100
- │ v1.4.0 │
101
- │ ├── Date: Jan 10, 2024 09:00 │
102
- │ ├── Author: developer@company.com │
103
- │ └── Reason: Configured test coverage targets │
104
- │ │
105
- │ Showing 3 of 15 versions. Use --all to see all. │
106
- │ │
107
- └─────────────────────────────────────────────────────────────┘
108
- ```
109
-
110
- ### Filter History
111
-
112
- ```bash
113
- # By date range
114
- proagents config history --from 2024-01-01 --to 2024-01-31
115
-
116
- # By author
117
- proagents config history --author developer@company.com
118
-
119
- # By file
120
- proagents config history --file rules/security-rules.yaml
121
- ```
122
-
123
- ---
124
-
125
- ## Comparing Versions
126
-
127
- ### Diff Versions
128
-
129
- ```bash
130
- # Compare with previous
131
- proagents config diff
132
-
133
- # Compare specific versions
134
- proagents config diff v1.4.0 v1.5.0
135
-
136
- # Compare with current
137
- proagents config diff v1.4.0
138
- ```
139
-
140
- ### Diff Output
141
-
142
- ```diff
143
- --- v1.4.0
144
- +++ v1.5.0
145
-
146
- proagents.config.yaml:
147
- @@ -15,6 +15,9 @@
148
- checkpoints:
149
- after_analysis: true
150
- - before_deployment: false
151
- + before_deployment: true
152
- +
153
- +security:
154
- + require_review: true
155
- + scan_dependencies: true
156
-
157
- rules/security-rules.yaml:
158
- @@ -1,4 +1,8 @@
159
- rules:
160
- - id: no-secrets
161
- severity: error
162
- +
163
- + - id: dependency-check
164
- + severity: warning
165
- + scan_on: commit
166
- ```
167
-
168
- ---
169
-
170
- ## Version Storage
171
-
172
- ### Storage Structure
173
-
174
- ```
175
- .proagents/config-history/
176
- ├── index.json # Version index
177
- ├── versions/
178
- │ ├── v1.5.1/
179
- │ │ ├── metadata.json # Version metadata
180
- │ │ ├── proagents.config.yaml
181
- │ │ └── rules/
182
- │ │ └── security-rules.yaml
183
- │ ├── v1.5.0/
184
- │ │ └── ...
185
- │ └── v1.4.0/
186
- │ └── ...
187
- └── changelog.md # Human-readable changelog
188
- ```
189
-
190
- ### Index File
191
-
192
- ```json
193
- {
194
- "current_version": "v1.5.1",
195
- "versions": [
196
- {
197
- "version": "v1.5.1",
198
- "timestamp": "2024-01-15T10:30:00Z",
199
- "author": "developer@company.com",
200
- "path": "versions/v1.5.1"
201
- },
202
- {
203
- "version": "v1.5.0",
204
- "timestamp": "2024-01-14T15:45:00Z",
205
- "author": "lead@company.com",
206
- "path": "versions/v1.5.0"
207
- }
208
- ]
209
- }
210
- ```
211
-
212
- ---
213
-
214
- ## Validation
215
-
216
- ### Pre-Apply Validation
217
-
218
- ```bash
219
- # Validate current config
220
- proagents config validate
221
-
222
- # Validate specific version
223
- proagents config validate --version v1.5.0
224
-
225
- # Output:
226
- ┌─────────────────────────────────────────────────────────────┐
227
- │ Configuration Validation │
228
- ├─────────────────────────────────────────────────────────────┤
229
- │ │
230
- │ ✅ Syntax: Valid YAML │
231
- │ ✅ Schema: Matches expected structure │
232
- │ ✅ Rules: All rules have valid syntax │
233
- │ ✅ References: All file references exist │
234
- │ ⚠️ Warning: Deprecated option 'old_setting' used │
235
- │ │
236
- │ Validation: PASSED (with warnings) │
237
- │ │
238
- └─────────────────────────────────────────────────────────────┘
239
- ```
240
-
241
- ### Validation Rules
242
-
243
- ```yaml
244
- config_versioning:
245
- validation:
246
- # Schema validation
247
- schema: true
248
-
249
- # Syntax check
250
- syntax: true
251
-
252
- # Check file references
253
- references: true
254
-
255
- # Check for deprecated options
256
- deprecation_warnings: true
257
-
258
- # Custom validators
259
- custom:
260
- - "validate_rule_ids_unique"
261
- - "validate_paths_exist"
262
- ```
263
-
264
- ---
265
-
266
- ## Export/Import
267
-
268
- ### Export Configuration
269
-
270
- ```bash
271
- # Export current config
272
- proagents config export > config-backup.yaml
273
-
274
- # Export specific version
275
- proagents config export --version v1.5.0 > config-v1.5.0.yaml
276
-
277
- # Export with history
278
- proagents config export --include-history > config-full.tar.gz
279
- ```
280
-
281
- ### Import Configuration
282
-
283
- ```bash
284
- # Import and apply
285
- proagents config import config-backup.yaml
286
-
287
- # Import as new version
288
- proagents config import config-backup.yaml --as-version v2.0.0
289
-
290
- # Import and validate only
291
- proagents config import config-backup.yaml --dry-run
292
- ```
293
-
294
- ---
295
-
296
- ## Hooks
297
-
298
- ### Pre-Change Hooks
299
-
300
- ```yaml
301
- config_versioning:
302
- hooks:
303
- pre_change:
304
- - script: "validate-config.sh"
305
- blocking: true
306
-
307
- - script: "notify-team.sh"
308
- blocking: false
309
- ```
310
-
311
- ### Post-Change Hooks
312
-
313
- ```yaml
314
- config_versioning:
315
- hooks:
316
- post_change:
317
- - script: "sync-to-remote.sh"
318
- - script: "update-documentation.sh"
319
- ```
320
-
321
- ---
322
-
323
- ## Best Practices
324
-
325
- 1. **Always Add Reason**: Document why changes were made
326
- 2. **Review Diffs**: Before applying, review changes
327
- 3. **Test First**: Validate in staging before production
328
- 4. **Backup Regularly**: Export config periodically
329
- 5. **Use Semantic Versioning**: Major for breaking changes
330
- 6. **Keep History Clean**: Remove very old versions
@@ -1,223 +0,0 @@
1
- # Contract Testing
2
-
3
- Ensure API contracts between services remain compatible.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Contract testing verifies that API interactions between services conform to agreed-upon contracts, catching integration issues early without requiring full end-to-end testing.
10
-
11
- ---
12
-
13
- ## What is Contract Testing?
14
-
15
- Contract testing validates that:
16
- - **Consumers** correctly call providers
17
- - **Providers** return expected responses
18
- - **Both sides** agree on the contract
19
-
20
- ```
21
- ┌──────────────┐ ┌──────────────┐
22
- │ Consumer │ ←── Contract ───→ │ Provider │
23
- │ (Frontend) │ │ (Backend) │
24
- └──────────────┘ └──────────────┘
25
- │ │
26
- ▼ ▼
27
- Consumer Tests Provider Tests
28
- verify request verify response
29
- matches contract matches contract
30
- ```
31
-
32
- ---
33
-
34
- ## Quick Start
35
-
36
- ### Install Pact
37
-
38
- ```bash
39
- # Node.js
40
- npm install --save-dev @pact-foundation/pact
41
-
42
- # Or use Pact standalone
43
- curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/latest/download/pact-2.0.0-osx.tar.gz
44
- ```
45
-
46
- ### Consumer Test
47
-
48
- ```typescript
49
- import { PactV3, MatchersV3 } from '@pact-foundation/pact';
50
-
51
- const provider = new PactV3({
52
- consumer: 'Frontend',
53
- provider: 'UserService',
54
- });
55
-
56
- describe('User API', () => {
57
- it('gets user by ID', async () => {
58
- await provider
59
- .given('user exists')
60
- .uponReceiving('a request for user')
61
- .withRequest({
62
- method: 'GET',
63
- path: '/users/123',
64
- })
65
- .willRespondWith({
66
- status: 200,
67
- body: {
68
- id: MatchersV3.string('123'),
69
- name: MatchersV3.string('John'),
70
- email: MatchersV3.email(),
71
- },
72
- })
73
- .executeTest(async (mockServer) => {
74
- const response = await fetch(`${mockServer.url}/users/123`);
75
- const user = await response.json();
76
- expect(user.name).toBe('John');
77
- });
78
- });
79
- });
80
- ```
81
-
82
- ### Provider Test
83
-
84
- ```typescript
85
- import { Verifier } from '@pact-foundation/pact';
86
-
87
- describe('User Service Provider', () => {
88
- it('validates the contract', async () => {
89
- await new Verifier({
90
- providerBaseUrl: 'http://localhost:3000',
91
- pactUrls: ['./pacts/frontend-userservice.json'],
92
- stateHandlers: {
93
- 'user exists': async () => {
94
- await db.users.create({ id: '123', name: 'John' });
95
- },
96
- },
97
- }).verifyProvider();
98
- });
99
- });
100
- ```
101
-
102
- ---
103
-
104
- ## Documentation
105
-
106
- | Document | Description |
107
- |----------|-------------|
108
- | [Contract Testing Guide](./contract-testing.md) | Complete contract testing guide |
109
- | [Pact Integration](./pact-integration.md) | Using Pact for contract testing |
110
- | [Schema Validation](./schema-validation.md) | JSON Schema and OpenAPI validation |
111
-
112
- ---
113
-
114
- ## Contract Testing vs Other Testing
115
-
116
- | Type | Purpose | When to Use |
117
- |------|---------|-------------|
118
- | **Unit Tests** | Test individual components | Always |
119
- | **Contract Tests** | Test API agreements | Service boundaries |
120
- | **Integration Tests** | Test real interactions | Critical paths |
121
- | **E2E Tests** | Test full workflows | Key user journeys |
122
-
123
- ---
124
-
125
- ## Benefits
126
-
127
- - **Catch breaking changes early** - Before deployment
128
- - **Decouple teams** - Test independently
129
- - **Faster feedback** - No need for running all services
130
- - **Living documentation** - Contracts serve as specs
131
- - **Prevent regression** - Automated verification
132
-
133
- ---
134
-
135
- ## Commands
136
-
137
- ```bash
138
- # Run consumer tests
139
- pa:contract test consumer
140
-
141
- # Run provider tests
142
- pa:contract test provider
143
-
144
- # Publish contracts
145
- pa:contract publish
146
-
147
- # Verify contracts
148
- pa:contract verify
149
-
150
- # Generate contract documentation
151
- pa:contract docs
152
- ```
153
-
154
- ---
155
-
156
- ## Configuration
157
-
158
- ```yaml
159
- # proagents.config.yaml
160
- contract_testing:
161
- enabled: true
162
- tool: "pact"
163
-
164
- broker:
165
- url: "${PACT_BROKER_URL}"
166
- token: "${PACT_BROKER_TOKEN}"
167
-
168
- consumer:
169
- output_dir: "./pacts"
170
-
171
- provider:
172
- pact_urls:
173
- - "${PACT_BROKER_URL}/pacts/provider/UserService/latest"
174
-
175
- ci:
176
- can_i_deploy: true
177
- publish_on_success: true
178
- ```
179
-
180
- ---
181
-
182
- ## CI/CD Integration
183
-
184
- ```yaml
185
- # .github/workflows/contract.yml
186
- name: Contract Tests
187
-
188
- on: [push, pull_request]
189
-
190
- jobs:
191
- consumer:
192
- runs-on: ubuntu-latest
193
- steps:
194
- - uses: actions/checkout@v3
195
- - run: npm ci
196
- - run: npm run test:contract:consumer
197
- - run: npm run pact:publish
198
-
199
- provider:
200
- runs-on: ubuntu-latest
201
- needs: consumer
202
- steps:
203
- - uses: actions/checkout@v3
204
- - run: npm ci
205
- - run: npm run test:contract:provider
206
-
207
- can-i-deploy:
208
- runs-on: ubuntu-latest
209
- needs: [consumer, provider]
210
- steps:
211
- - run: pact-broker can-i-deploy --pacticipant Frontend --latest
212
- ```
213
-
214
- ---
215
-
216
- ## Best Practices
217
-
218
- 1. **Consumer-driven** - Consumers define what they need
219
- 2. **Minimal contracts** - Only include what's used
220
- 3. **Use matchers** - Don't hardcode values
221
- 4. **Version contracts** - Track changes over time
222
- 5. **Automate publishing** - Integrate with CI/CD
223
- 6. **Can-I-Deploy** - Block deployments on failures