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.
- package/.claude/settings.local.json +169 -0
- package/COMMANDS.md +595 -0
- package/README.md +22 -64
- package/bin/proagents.js +0 -2
- package/lib/commands/init.js +4 -174
- 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,503 +0,0 @@
|
|
|
1
|
-
# Task Routing
|
|
2
|
-
|
|
3
|
-
Route tasks to the most appropriate AI model based on complexity, type, and cost.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Routing Overview
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
11
|
-
│ Task Routing Pipeline │
|
|
12
|
-
├─────────────────────────────────────────────────────────────┤
|
|
13
|
-
│ │
|
|
14
|
-
│ Incoming Task │
|
|
15
|
-
│ │ │
|
|
16
|
-
│ ▼ │
|
|
17
|
-
│ ┌─────────────┐ │
|
|
18
|
-
│ │ Analyzer │ ── Complexity, Type, Context │
|
|
19
|
-
│ └─────────────┘ │
|
|
20
|
-
│ │ │
|
|
21
|
-
│ ▼ │
|
|
22
|
-
│ ┌─────────────┐ ┌─────────────────────────────────┐ │
|
|
23
|
-
│ │ Router │ ───▶ │ Simple → Haiku/GPT-3.5 │ │
|
|
24
|
-
│ └─────────────┘ │ Medium → Sonnet/GPT-4 │ │
|
|
25
|
-
│ │ │ Complex → Opus/GPT-4-Turbo │ │
|
|
26
|
-
│ │ └─────────────────────────────────┘ │
|
|
27
|
-
│ ▼ │
|
|
28
|
-
│ ┌─────────────┐ │
|
|
29
|
-
│ │ Selected │ │
|
|
30
|
-
│ │ Model │ │
|
|
31
|
-
│ └─────────────┘ │
|
|
32
|
-
│ │
|
|
33
|
-
└─────────────────────────────────────────────────────────────┘
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Routing Configuration
|
|
39
|
-
|
|
40
|
-
### Basic Setup
|
|
41
|
-
|
|
42
|
-
```yaml
|
|
43
|
-
ai:
|
|
44
|
-
routing:
|
|
45
|
-
enabled: true
|
|
46
|
-
|
|
47
|
-
# Default model
|
|
48
|
-
default: "claude-3-sonnet"
|
|
49
|
-
|
|
50
|
-
# Routing strategy
|
|
51
|
-
strategy: "smart" # smart, cost_optimized, quality_first
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Task Type Routing
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
ai:
|
|
58
|
-
routing:
|
|
59
|
-
by_task_type:
|
|
60
|
-
# Code analysis
|
|
61
|
-
code_analysis:
|
|
62
|
-
default: "claude-3-opus"
|
|
63
|
-
reason: "Best for deep code understanding"
|
|
64
|
-
|
|
65
|
-
# Code generation
|
|
66
|
-
code_generation:
|
|
67
|
-
simple: "claude-3-haiku"
|
|
68
|
-
moderate: "claude-3-sonnet"
|
|
69
|
-
complex: "claude-3-opus"
|
|
70
|
-
|
|
71
|
-
# Code review
|
|
72
|
-
code_review:
|
|
73
|
-
default: "claude-3-sonnet"
|
|
74
|
-
security_review: "claude-3-opus"
|
|
75
|
-
|
|
76
|
-
# Documentation
|
|
77
|
-
documentation:
|
|
78
|
-
default: "claude-3-sonnet"
|
|
79
|
-
api_docs: "claude-3-sonnet"
|
|
80
|
-
quick_comments: "claude-3-haiku"
|
|
81
|
-
|
|
82
|
-
# Bug fixing
|
|
83
|
-
bug_fix:
|
|
84
|
-
simple: "claude-3-haiku"
|
|
85
|
-
complex: "claude-3-sonnet"
|
|
86
|
-
critical: "claude-3-opus"
|
|
87
|
-
|
|
88
|
-
# Testing
|
|
89
|
-
test_generation:
|
|
90
|
-
unit_tests: "claude-3-sonnet"
|
|
91
|
-
integration_tests: "claude-3-opus"
|
|
92
|
-
|
|
93
|
-
# Refactoring
|
|
94
|
-
refactoring:
|
|
95
|
-
simple: "claude-3-sonnet"
|
|
96
|
-
architectural: "claude-3-opus"
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Complexity Detection
|
|
102
|
-
|
|
103
|
-
### Complexity Indicators
|
|
104
|
-
|
|
105
|
-
```yaml
|
|
106
|
-
ai:
|
|
107
|
-
routing:
|
|
108
|
-
complexity:
|
|
109
|
-
# Low complexity indicators
|
|
110
|
-
low:
|
|
111
|
-
- "single_file_change"
|
|
112
|
-
- "documentation_only"
|
|
113
|
-
- "config_change"
|
|
114
|
-
- "simple_fix"
|
|
115
|
-
- "formatting"
|
|
116
|
-
- "less_than_20_lines"
|
|
117
|
-
|
|
118
|
-
# Medium complexity indicators
|
|
119
|
-
medium:
|
|
120
|
-
- "multiple_files"
|
|
121
|
-
- "new_component"
|
|
122
|
-
- "api_integration"
|
|
123
|
-
- "moderate_logic"
|
|
124
|
-
- "20_to_100_lines"
|
|
125
|
-
|
|
126
|
-
# High complexity indicators
|
|
127
|
-
high:
|
|
128
|
-
- "architectural_change"
|
|
129
|
-
- "cross_module"
|
|
130
|
-
- "security_related"
|
|
131
|
-
- "performance_critical"
|
|
132
|
-
- "more_than_100_lines"
|
|
133
|
-
- "complex_algorithms"
|
|
134
|
-
- "state_management"
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Context-Based Routing
|
|
138
|
-
|
|
139
|
-
```yaml
|
|
140
|
-
ai:
|
|
141
|
-
routing:
|
|
142
|
-
by_context:
|
|
143
|
-
# File patterns
|
|
144
|
-
file_patterns:
|
|
145
|
-
"src/auth/**":
|
|
146
|
-
model: "claude-3-opus"
|
|
147
|
-
reason: "Security-sensitive code"
|
|
148
|
-
|
|
149
|
-
"src/payments/**":
|
|
150
|
-
model: "claude-3-opus"
|
|
151
|
-
reason: "Financial code requires high accuracy"
|
|
152
|
-
|
|
153
|
-
"*.test.*":
|
|
154
|
-
model: "claude-3-sonnet"
|
|
155
|
-
reason: "Test files are moderately complex"
|
|
156
|
-
|
|
157
|
-
"docs/**":
|
|
158
|
-
model: "claude-3-haiku"
|
|
159
|
-
reason: "Documentation is straightforward"
|
|
160
|
-
|
|
161
|
-
# Project phase
|
|
162
|
-
by_phase:
|
|
163
|
-
analysis:
|
|
164
|
-
model: "claude-3-opus"
|
|
165
|
-
reason: "Deep analysis needs best model"
|
|
166
|
-
|
|
167
|
-
implementation:
|
|
168
|
-
model: "claude-3-sonnet"
|
|
169
|
-
reason: "Balance of speed and quality"
|
|
170
|
-
|
|
171
|
-
documentation:
|
|
172
|
-
model: "claude-3-haiku"
|
|
173
|
-
reason: "Fast for documentation tasks"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## Cost Optimization
|
|
179
|
-
|
|
180
|
-
### Cost-Based Routing
|
|
181
|
-
|
|
182
|
-
```yaml
|
|
183
|
-
ai:
|
|
184
|
-
routing:
|
|
185
|
-
cost_optimization:
|
|
186
|
-
enabled: true
|
|
187
|
-
|
|
188
|
-
# Daily budget
|
|
189
|
-
daily_budget: 50.00
|
|
190
|
-
|
|
191
|
-
# Cost thresholds
|
|
192
|
-
thresholds:
|
|
193
|
-
# Use cheaper model when budget is low
|
|
194
|
-
budget_low:
|
|
195
|
-
percentage: 80 # 80% of budget used
|
|
196
|
-
downgrade_to: "claude-3-haiku"
|
|
197
|
-
except:
|
|
198
|
-
- "security_review"
|
|
199
|
-
- "critical_bugs"
|
|
200
|
-
|
|
201
|
-
budget_critical:
|
|
202
|
-
percentage: 95
|
|
203
|
-
downgrade_to: "claude-3-haiku"
|
|
204
|
-
except:
|
|
205
|
-
- "blocking_tasks"
|
|
206
|
-
|
|
207
|
-
# Cost per task type
|
|
208
|
-
max_cost_per_task:
|
|
209
|
-
simple_fix: 0.10
|
|
210
|
-
code_review: 0.50
|
|
211
|
-
feature_implementation: 2.00
|
|
212
|
-
full_analysis: 5.00
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Model Cost Tracking
|
|
216
|
-
|
|
217
|
-
```
|
|
218
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
219
|
-
│ AI Cost Dashboard - Today │
|
|
220
|
-
├─────────────────────────────────────────────────────────────┤
|
|
221
|
-
│ │
|
|
222
|
-
│ Budget: $50.00 | Used: $32.50 (65%) | Remaining: $17.50 │
|
|
223
|
-
│ [████████████████████░░░░░░░░░░] 65% │
|
|
224
|
-
│ │
|
|
225
|
-
│ By Model: │
|
|
226
|
-
│ ├── Opus: $18.00 (12 requests) │
|
|
227
|
-
│ ├── Sonnet: $12.50 (45 requests) │
|
|
228
|
-
│ └── Haiku: $2.00 (120 requests) │
|
|
229
|
-
│ │
|
|
230
|
-
│ By Task Type: │
|
|
231
|
-
│ ├── Code Analysis: $15.00 │
|
|
232
|
-
│ ├── Code Review: $8.00 │
|
|
233
|
-
│ ├── Implementation: $6.50 │
|
|
234
|
-
│ └── Documentation: $3.00 │
|
|
235
|
-
│ │
|
|
236
|
-
│ Routing Decisions: │
|
|
237
|
-
│ ├── Upgraded to Opus: 5 (complexity) │
|
|
238
|
-
│ ├── Downgraded to Haiku: 8 (cost) │
|
|
239
|
-
│ └── Default Sonnet: 32 │
|
|
240
|
-
│ │
|
|
241
|
-
└─────────────────────────────────────────────────────────────┘
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## Quality-First Routing
|
|
247
|
-
|
|
248
|
-
### Quality Priority
|
|
249
|
-
|
|
250
|
-
```yaml
|
|
251
|
-
ai:
|
|
252
|
-
routing:
|
|
253
|
-
quality_first:
|
|
254
|
-
enabled: true
|
|
255
|
-
|
|
256
|
-
# Always use best model for these
|
|
257
|
-
always_use_best:
|
|
258
|
-
- task_type: "security_review"
|
|
259
|
-
- task_type: "architecture_decisions"
|
|
260
|
-
- file_pattern: "src/core/**"
|
|
261
|
-
- tag: "critical"
|
|
262
|
-
|
|
263
|
-
# Quality metrics to consider
|
|
264
|
-
metrics:
|
|
265
|
-
# If previous response quality was low
|
|
266
|
-
retry_with_better:
|
|
267
|
-
enabled: true
|
|
268
|
-
threshold: 0.7 # Quality score
|
|
269
|
-
upgrade_to: "next_tier"
|
|
270
|
-
|
|
271
|
-
# Track model performance
|
|
272
|
-
track_accuracy: true
|
|
273
|
-
adjust_routing: true
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Performance Tracking
|
|
277
|
-
|
|
278
|
-
```yaml
|
|
279
|
-
ai:
|
|
280
|
-
routing:
|
|
281
|
-
performance:
|
|
282
|
-
# Track response quality
|
|
283
|
-
track_quality: true
|
|
284
|
-
|
|
285
|
-
# Adjust routing based on results
|
|
286
|
-
adaptive_routing:
|
|
287
|
-
enabled: true
|
|
288
|
-
|
|
289
|
-
# If model consistently underperforms
|
|
290
|
-
downgrade_threshold: 0.6
|
|
291
|
-
upgrade_threshold: 0.9
|
|
292
|
-
|
|
293
|
-
# Learning period
|
|
294
|
-
evaluation_window: 100 # requests
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## Fallback Chains
|
|
300
|
-
|
|
301
|
-
### Fallback Configuration
|
|
302
|
-
|
|
303
|
-
```yaml
|
|
304
|
-
ai:
|
|
305
|
-
routing:
|
|
306
|
-
fallbacks:
|
|
307
|
-
# Primary fallback chain
|
|
308
|
-
chain:
|
|
309
|
-
- "claude-3-opus"
|
|
310
|
-
- "claude-3-sonnet"
|
|
311
|
-
- "gpt-4-turbo"
|
|
312
|
-
- "claude-3-haiku"
|
|
313
|
-
- "gpt-3.5-turbo"
|
|
314
|
-
|
|
315
|
-
# When to fallback
|
|
316
|
-
triggers:
|
|
317
|
-
- "rate_limit"
|
|
318
|
-
- "model_unavailable"
|
|
319
|
-
- "timeout"
|
|
320
|
-
- "error"
|
|
321
|
-
|
|
322
|
-
# Retry settings
|
|
323
|
-
retry:
|
|
324
|
-
max_attempts: 3
|
|
325
|
-
delay: "2s"
|
|
326
|
-
backoff: "exponential"
|
|
327
|
-
|
|
328
|
-
# Alert on fallback
|
|
329
|
-
notify:
|
|
330
|
-
on_fallback: true
|
|
331
|
-
on_last_resort: true
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
### Fallback Flow
|
|
335
|
-
|
|
336
|
-
```
|
|
337
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
338
|
-
│ Fallback Flow │
|
|
339
|
-
├─────────────────────────────────────────────────────────────┤
|
|
340
|
-
│ │
|
|
341
|
-
│ Request │
|
|
342
|
-
│ │ │
|
|
343
|
-
│ ▼ │
|
|
344
|
-
│ Claude Opus ──[Rate Limited]──▶ Claude Sonnet │
|
|
345
|
-
│ │ │
|
|
346
|
-
│ ▼ │
|
|
347
|
-
│ [Timeout]──▶ GPT-4 │
|
|
348
|
-
│ │ │
|
|
349
|
-
│ ▼ │
|
|
350
|
-
│ [Success] ✅ │
|
|
351
|
-
│ │
|
|
352
|
-
│ Log: "Fallback: Opus → Sonnet → GPT-4 (success)" │
|
|
353
|
-
│ │
|
|
354
|
-
└─────────────────────────────────────────────────────────────┘
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
## Custom Routing Rules
|
|
360
|
-
|
|
361
|
-
### Rule Definition
|
|
362
|
-
|
|
363
|
-
```yaml
|
|
364
|
-
ai:
|
|
365
|
-
routing:
|
|
366
|
-
custom_rules:
|
|
367
|
-
# Rule 1: Security-critical
|
|
368
|
-
- name: "security_critical"
|
|
369
|
-
priority: 1
|
|
370
|
-
conditions:
|
|
371
|
-
any:
|
|
372
|
-
- file_pattern: "src/auth/**"
|
|
373
|
-
- file_pattern: "src/security/**"
|
|
374
|
-
- contains: ["password", "token", "secret", "credential"]
|
|
375
|
-
route_to: "claude-3-opus"
|
|
376
|
-
reason: "Security-sensitive code"
|
|
377
|
-
|
|
378
|
-
# Rule 2: Quick fixes
|
|
379
|
-
- name: "quick_fixes"
|
|
380
|
-
priority: 2
|
|
381
|
-
conditions:
|
|
382
|
-
all:
|
|
383
|
-
- task_type: "bug_fix"
|
|
384
|
-
- files_changed: "<= 2"
|
|
385
|
-
- lines_changed: "<= 20"
|
|
386
|
-
route_to: "claude-3-haiku"
|
|
387
|
-
reason: "Simple fix, fast model"
|
|
388
|
-
|
|
389
|
-
# Rule 3: New features
|
|
390
|
-
- name: "new_features"
|
|
391
|
-
priority: 3
|
|
392
|
-
conditions:
|
|
393
|
-
all:
|
|
394
|
-
- task_type: "feature"
|
|
395
|
-
- complexity: ">= medium"
|
|
396
|
-
route_to: "claude-3-sonnet"
|
|
397
|
-
reason: "Balance of quality and speed"
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
---
|
|
401
|
-
|
|
402
|
-
## Routing API
|
|
403
|
-
|
|
404
|
-
### Programmatic Routing
|
|
405
|
-
|
|
406
|
-
```typescript
|
|
407
|
-
// Request with routing hints
|
|
408
|
-
const response = await proagents.ai.request({
|
|
409
|
-
task: "Review this authentication code",
|
|
410
|
-
context: {
|
|
411
|
-
files: ["src/auth/login.ts"],
|
|
412
|
-
type: "security_review"
|
|
413
|
-
},
|
|
414
|
-
routing: {
|
|
415
|
-
prefer: "quality", // quality, speed, cost
|
|
416
|
-
minModel: "sonnet", // Minimum model tier
|
|
417
|
-
maxCost: 1.00, // Maximum cost
|
|
418
|
-
timeout: 30000 // Timeout in ms
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
### Routing Override
|
|
424
|
-
|
|
425
|
-
```bash
|
|
426
|
-
# Force specific model
|
|
427
|
-
proagents review --model opus
|
|
428
|
-
|
|
429
|
-
# Cost-optimized routing
|
|
430
|
-
proagents analyze --routing cost
|
|
431
|
-
|
|
432
|
-
# Quality-first routing
|
|
433
|
-
proagents review --routing quality
|
|
434
|
-
|
|
435
|
-
# View routing decision
|
|
436
|
-
proagents debug-routing "Review auth code"
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
---
|
|
440
|
-
|
|
441
|
-
## Routing Logs
|
|
442
|
-
|
|
443
|
-
### Decision Logging
|
|
444
|
-
|
|
445
|
-
```yaml
|
|
446
|
-
ai:
|
|
447
|
-
routing:
|
|
448
|
-
logging:
|
|
449
|
-
enabled: true
|
|
450
|
-
|
|
451
|
-
# What to log
|
|
452
|
-
log:
|
|
453
|
-
- decision
|
|
454
|
-
- reason
|
|
455
|
-
- cost
|
|
456
|
-
- latency
|
|
457
|
-
- fallbacks
|
|
458
|
-
|
|
459
|
-
# Storage
|
|
460
|
-
storage:
|
|
461
|
-
path: ".proagents/routing-logs/"
|
|
462
|
-
retention: "30d"
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
### Log Example
|
|
466
|
-
|
|
467
|
-
```json
|
|
468
|
-
{
|
|
469
|
-
"timestamp": "2024-01-15T10:30:00Z",
|
|
470
|
-
"task_id": "task-123",
|
|
471
|
-
"task_type": "code_review",
|
|
472
|
-
"context": {
|
|
473
|
-
"files": ["src/auth/login.ts"],
|
|
474
|
-
"complexity": "high",
|
|
475
|
-
"lines": 150
|
|
476
|
-
},
|
|
477
|
-
"routing_decision": {
|
|
478
|
-
"selected_model": "claude-3-opus",
|
|
479
|
-
"reason": "Security-sensitive file + high complexity",
|
|
480
|
-
"rules_matched": ["security_critical", "high_complexity"],
|
|
481
|
-
"cost_estimate": 0.45
|
|
482
|
-
},
|
|
483
|
-
"actual": {
|
|
484
|
-
"model_used": "claude-3-opus",
|
|
485
|
-
"latency_ms": 2500,
|
|
486
|
-
"tokens_in": 1200,
|
|
487
|
-
"tokens_out": 800,
|
|
488
|
-
"actual_cost": 0.42,
|
|
489
|
-
"quality_score": 0.95
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
```
|
|
493
|
-
|
|
494
|
-
---
|
|
495
|
-
|
|
496
|
-
## Best Practices
|
|
497
|
-
|
|
498
|
-
1. **Start Conservative**: Use higher-tier models initially, optimize later
|
|
499
|
-
2. **Monitor Costs**: Track spending per task type
|
|
500
|
-
3. **Quality Metrics**: Measure and track response quality
|
|
501
|
-
4. **Context Matters**: Consider file sensitivity in routing
|
|
502
|
-
5. **Fallbacks Ready**: Always have fallback chain configured
|
|
503
|
-
6. **Review Logs**: Periodically review routing decisions
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# AI Training & Project Learning
|
|
2
|
-
|
|
3
|
-
Train AI on project-specific patterns, preferences, and domain knowledge.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
ProAgents learns from your project to provide increasingly accurate and relevant suggestions over time.
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
13
|
-
│ Learning Architecture │
|
|
14
|
-
├─────────────────────────────────────────────────────────────┤
|
|
15
|
-
│ │
|
|
16
|
-
│ Data Sources │
|
|
17
|
-
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
18
|
-
│ │Codebase │ │ PRs & │ │ User │ │ Domain │ │
|
|
19
|
-
│ │Patterns │ │ Reviews │ │Feedback │ │ Docs │ │
|
|
20
|
-
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
|
|
21
|
-
│ │ │ │ │ │
|
|
22
|
-
│ └───────────┴─────┬─────┴───────────┘ │
|
|
23
|
-
│ │ │
|
|
24
|
-
│ ▼ │
|
|
25
|
-
│ ┌─────────────────────┐ │
|
|
26
|
-
│ │ Learning Engine │ │
|
|
27
|
-
│ └──────────┬──────────┘ │
|
|
28
|
-
│ │ │
|
|
29
|
-
│ ┌─────────────────┼─────────────────┐ │
|
|
30
|
-
│ ▼ ▼ ▼ │
|
|
31
|
-
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
32
|
-
│ │ Pattern │ │ Domain │ │ User │ │
|
|
33
|
-
│ │ Model │ │ Model │ │ Prefs │ │
|
|
34
|
-
│ └─────────┘ └─────────┘ └─────────┘ │
|
|
35
|
-
│ │
|
|
36
|
-
│ Applied To: │
|
|
37
|
-
│ • Code suggestions │
|
|
38
|
-
│ • Architecture decisions │
|
|
39
|
-
│ • Naming conventions │
|
|
40
|
-
│ • Review comments │
|
|
41
|
-
│ │
|
|
42
|
-
└─────────────────────────────────────────────────────────────┘
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Quick Start
|
|
48
|
-
|
|
49
|
-
### Enable Learning
|
|
50
|
-
|
|
51
|
-
```yaml
|
|
52
|
-
# proagents.config.yaml
|
|
53
|
-
|
|
54
|
-
learning:
|
|
55
|
-
enabled: true
|
|
56
|
-
auto_learn: true
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### View What's Learned
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# Show learning summary
|
|
63
|
-
proagents learning status
|
|
64
|
-
|
|
65
|
-
# Show specific patterns
|
|
66
|
-
proagents learning patterns
|
|
67
|
-
|
|
68
|
-
# Show user preferences
|
|
69
|
-
proagents learning preferences
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Learning Types
|
|
75
|
-
|
|
76
|
-
| Type | Description | Example |
|
|
77
|
-
|------|-------------|---------|
|
|
78
|
-
| **Code Patterns** | Common code structures | "Always use async/await over .then()" |
|
|
79
|
-
| **Naming Conventions** | Variable/function naming | "Components use PascalCase" |
|
|
80
|
-
| **Architecture** | Design patterns used | "Services in /src/services/" |
|
|
81
|
-
| **Domain Knowledge** | Business terminology | "User = registered customer" |
|
|
82
|
-
| **User Preferences** | Individual preferences | "Prefers detailed explanations" |
|
|
83
|
-
| **Team Standards** | Team conventions | "All PRs need 2 approvers" |
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Documentation Files
|
|
88
|
-
|
|
89
|
-
| File | Description |
|
|
90
|
-
|------|-------------|
|
|
91
|
-
| [pattern-learning.md](./pattern-learning.md) | Code pattern recognition |
|
|
92
|
-
| [domain-knowledge.md](./domain-knowledge.md) | Business domain learning |
|
|
93
|
-
| [user-preferences.md](./user-preferences.md) | User preference tracking |
|
|
94
|
-
| [continuous-learning.md](./continuous-learning.md) | Ongoing improvement |
|
|
95
|
-
| [training-data.md](./training-data.md) | Training data management |
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Configuration
|
|
100
|
-
|
|
101
|
-
```yaml
|
|
102
|
-
# proagents.config.yaml
|
|
103
|
-
|
|
104
|
-
learning:
|
|
105
|
-
enabled: true
|
|
106
|
-
|
|
107
|
-
# What to learn from
|
|
108
|
-
sources:
|
|
109
|
-
codebase: true
|
|
110
|
-
pull_requests: true
|
|
111
|
-
code_reviews: true
|
|
112
|
-
user_feedback: true
|
|
113
|
-
documentation: true
|
|
114
|
-
|
|
115
|
-
# What to learn
|
|
116
|
-
learn:
|
|
117
|
-
code_patterns: true
|
|
118
|
-
naming_conventions: true
|
|
119
|
-
architecture_patterns: true
|
|
120
|
-
testing_patterns: true
|
|
121
|
-
domain_knowledge: true
|
|
122
|
-
user_preferences: true
|
|
123
|
-
|
|
124
|
-
# Auto-apply learnings
|
|
125
|
-
auto_apply:
|
|
126
|
-
code_suggestions: true
|
|
127
|
-
review_comments: true
|
|
128
|
-
documentation: true
|
|
129
|
-
|
|
130
|
-
# Storage
|
|
131
|
-
storage:
|
|
132
|
-
path: ".proagents/learning"
|
|
133
|
-
sync_to_cloud: false
|
|
134
|
-
|
|
135
|
-
# Privacy
|
|
136
|
-
privacy:
|
|
137
|
-
anonymize: true
|
|
138
|
-
exclude_secrets: true
|
|
139
|
-
exclude_patterns:
|
|
140
|
-
- "*.env"
|
|
141
|
-
- "**/secrets/**"
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Commands
|
|
147
|
-
|
|
148
|
-
| Command | Description |
|
|
149
|
-
|---------|-------------|
|
|
150
|
-
| `proagents learning status` | Show learning status |
|
|
151
|
-
| `proagents learning patterns` | Show learned patterns |
|
|
152
|
-
| `proagents learning train` | Trigger manual training |
|
|
153
|
-
| `proagents learning reset` | Reset learning data |
|
|
154
|
-
| `proagents learning export` | Export learning data |
|
|
155
|
-
| `proagents learning import` | Import learning data |
|