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.
- package/.claude/settings.local.json +169 -0
- package/COMMANDS.md +595 -0
- package/README.md +13 -23
- 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,461 +0,0 @@
|
|
|
1
|
-
# Code Quality KPIs
|
|
2
|
-
|
|
3
|
-
Measure and track code health, maintainability, and technical debt.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Prompt Template
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Analyze code quality metrics for this codebase:
|
|
11
|
-
|
|
12
|
-
Project: {project_name}
|
|
13
|
-
Language: {language}
|
|
14
|
-
Path: {code_path}
|
|
15
|
-
|
|
16
|
-
Analyze and report on:
|
|
17
|
-
1. Test coverage (line, branch, function)
|
|
18
|
-
2. Code complexity (cyclomatic, cognitive)
|
|
19
|
-
3. Technical debt estimation
|
|
20
|
-
4. Code duplication
|
|
21
|
-
5. Dependency health
|
|
22
|
-
6. Security vulnerabilities
|
|
23
|
-
|
|
24
|
-
Compare against:
|
|
25
|
-
- Previous period: {previous_metrics}
|
|
26
|
-
- Industry standards: {benchmarks}
|
|
27
|
-
- Team targets: {targets}
|
|
28
|
-
|
|
29
|
-
Provide:
|
|
30
|
-
- Current quality score
|
|
31
|
-
- Trend analysis
|
|
32
|
-
- Critical issues
|
|
33
|
-
- Improvement priorities
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Key Metrics
|
|
39
|
-
|
|
40
|
-
### Test Coverage
|
|
41
|
-
|
|
42
|
-
```yaml
|
|
43
|
-
test_coverage:
|
|
44
|
-
types:
|
|
45
|
-
line_coverage: "Lines executed by tests"
|
|
46
|
-
branch_coverage: "Decision branches covered"
|
|
47
|
-
function_coverage: "Functions called by tests"
|
|
48
|
-
statement_coverage: "Statements executed"
|
|
49
|
-
|
|
50
|
-
targets:
|
|
51
|
-
minimum: 70%
|
|
52
|
-
recommended: 80%
|
|
53
|
-
critical_paths: 95%
|
|
54
|
-
|
|
55
|
-
exclusions:
|
|
56
|
-
- "**/*.test.ts"
|
|
57
|
-
- "**/mocks/**"
|
|
58
|
-
- "**/types/**"
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Collection:**
|
|
62
|
-
```typescript
|
|
63
|
-
interface CoverageMetrics {
|
|
64
|
-
lines: { covered: number; total: number; percentage: number };
|
|
65
|
-
branches: { covered: number; total: number; percentage: number };
|
|
66
|
-
functions: { covered: number; total: number; percentage: number };
|
|
67
|
-
statements: { covered: number; total: number; percentage: number };
|
|
68
|
-
byFile: Map<string, FileCoverage>;
|
|
69
|
-
uncoveredFiles: string[];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function collectCoverage(coverageFile: string): Promise<CoverageMetrics> {
|
|
73
|
-
const coverage = await parseCoverageReport(coverageFile);
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
lines: calculateLineCoverage(coverage),
|
|
77
|
-
branches: calculateBranchCoverage(coverage),
|
|
78
|
-
functions: calculateFunctionCoverage(coverage),
|
|
79
|
-
statements: calculateStatementCoverage(coverage),
|
|
80
|
-
byFile: mapByFile(coverage),
|
|
81
|
-
uncoveredFiles: findUncoveredFiles(coverage),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Dashboard:**
|
|
87
|
-
```
|
|
88
|
-
Test Coverage Summary
|
|
89
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
90
|
-
Overall: 82.3% ████████░░ ✅
|
|
91
|
-
|
|
92
|
-
By Type:
|
|
93
|
-
Lines: 84.1% ████████░░ ✅
|
|
94
|
-
Branches: 76.5% ███████░░░ ⚠️
|
|
95
|
-
Functions: 89.2% █████████░ ✅
|
|
96
|
-
Statements: 83.8% ████████░░ ✅
|
|
97
|
-
|
|
98
|
-
Lowest Coverage:
|
|
99
|
-
- src/utils/parser.ts: 45%
|
|
100
|
-
- src/api/legacy.ts: 52%
|
|
101
|
-
- src/services/payment.ts: 61%
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
### Code Complexity
|
|
107
|
-
|
|
108
|
-
```yaml
|
|
109
|
-
complexity:
|
|
110
|
-
metrics:
|
|
111
|
-
cyclomatic: "Number of decision paths"
|
|
112
|
-
cognitive: "Mental effort to understand"
|
|
113
|
-
halstead: "Vocabulary and volume"
|
|
114
|
-
|
|
115
|
-
thresholds:
|
|
116
|
-
cyclomatic:
|
|
117
|
-
low: "1-5"
|
|
118
|
-
medium: "6-10"
|
|
119
|
-
high: "11-20"
|
|
120
|
-
very_high: ">20"
|
|
121
|
-
|
|
122
|
-
cognitive:
|
|
123
|
-
low: "1-5"
|
|
124
|
-
medium: "6-15"
|
|
125
|
-
high: "16-25"
|
|
126
|
-
very_high: ">25"
|
|
127
|
-
|
|
128
|
-
targets:
|
|
129
|
-
average_cyclomatic: "< 10"
|
|
130
|
-
max_cyclomatic: "< 20"
|
|
131
|
-
average_cognitive: "< 15"
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Analysis:**
|
|
135
|
-
```typescript
|
|
136
|
-
interface ComplexityAnalysis {
|
|
137
|
-
averageCyclomatic: number;
|
|
138
|
-
maxCyclomatic: { value: number; file: string; function: string };
|
|
139
|
-
averageCognitive: number;
|
|
140
|
-
distribution: {
|
|
141
|
-
low: number;
|
|
142
|
-
medium: number;
|
|
143
|
-
high: number;
|
|
144
|
-
veryHigh: number;
|
|
145
|
-
};
|
|
146
|
-
hotspots: ComplexityHotspot[];
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
interface ComplexityHotspot {
|
|
150
|
-
file: string;
|
|
151
|
-
function: string;
|
|
152
|
-
cyclomatic: number;
|
|
153
|
-
cognitive: number;
|
|
154
|
-
recommendation: string;
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**Report:**
|
|
159
|
-
```
|
|
160
|
-
Complexity Analysis
|
|
161
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
162
|
-
Average Cyclomatic: 7.2 ✅ (target: <10)
|
|
163
|
-
Average Cognitive: 12.4 ✅ (target: <15)
|
|
164
|
-
|
|
165
|
-
Distribution:
|
|
166
|
-
Low (1-5): 45% ████████████████░░░░
|
|
167
|
-
Medium (6-10): 35% ██████████████░░░░░░
|
|
168
|
-
High (11-20): 15% ██████░░░░░░░░░░░░░░
|
|
169
|
-
Very High (>20): 5% ██░░░░░░░░░░░░░░░░░░
|
|
170
|
-
|
|
171
|
-
Hotspots (needs refactoring):
|
|
172
|
-
1. processOrder() - CC: 28, Cog: 35
|
|
173
|
-
→ Split into smaller functions
|
|
174
|
-
2. validateInput() - CC: 22, Cog: 28
|
|
175
|
-
→ Extract validation rules
|
|
176
|
-
3. parseConfig() - CC: 19, Cog: 24
|
|
177
|
-
→ Use strategy pattern
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
### Technical Debt
|
|
183
|
-
|
|
184
|
-
```yaml
|
|
185
|
-
technical_debt:
|
|
186
|
-
calculation:
|
|
187
|
-
method: "time_to_fix" # time_to_fix, sqale, custom
|
|
188
|
-
|
|
189
|
-
categories:
|
|
190
|
-
code_smells: 0.5 # hours per issue
|
|
191
|
-
bugs: 2.0
|
|
192
|
-
vulnerabilities: 4.0
|
|
193
|
-
duplications: 0.25
|
|
194
|
-
complexity: 1.0
|
|
195
|
-
|
|
196
|
-
thresholds:
|
|
197
|
-
ratio:
|
|
198
|
-
A: "< 5%"
|
|
199
|
-
B: "5-10%"
|
|
200
|
-
C: "10-20%"
|
|
201
|
-
D: "20-50%"
|
|
202
|
-
E: "> 50%"
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
**Tracking:**
|
|
206
|
-
```typescript
|
|
207
|
-
interface TechnicalDebt {
|
|
208
|
-
totalHours: number;
|
|
209
|
-
totalDays: number;
|
|
210
|
-
ratio: number; // debt / development time
|
|
211
|
-
grade: 'A' | 'B' | 'C' | 'D' | 'E';
|
|
212
|
-
byCategory: {
|
|
213
|
-
codeSmells: number;
|
|
214
|
-
bugs: number;
|
|
215
|
-
vulnerabilities: number;
|
|
216
|
-
duplications: number;
|
|
217
|
-
complexity: number;
|
|
218
|
-
};
|
|
219
|
-
trend: 'improving' | 'stable' | 'degrading';
|
|
220
|
-
newDebt: number;
|
|
221
|
-
resolvedDebt: number;
|
|
222
|
-
}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
**Dashboard:**
|
|
226
|
-
```
|
|
227
|
-
Technical Debt Summary
|
|
228
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
229
|
-
Total Debt: 24.5 days
|
|
230
|
-
Debt Ratio: 8.2% (Grade: B)
|
|
231
|
-
Trend: ↓ Improving (-12% this month)
|
|
232
|
-
|
|
233
|
-
By Category:
|
|
234
|
-
Code Smells: 12.0 days ████████████░░░░░░░░
|
|
235
|
-
Complexity: 6.5 days ██████░░░░░░░░░░░░░░
|
|
236
|
-
Duplications: 3.0 days ███░░░░░░░░░░░░░░░░░
|
|
237
|
-
Bugs: 2.5 days ██░░░░░░░░░░░░░░░░░░
|
|
238
|
-
Vulnerabilities: 0.5 days ░░░░░░░░░░░░░░░░░░░░
|
|
239
|
-
|
|
240
|
-
This Period:
|
|
241
|
-
New Debt Added: 3.2 days
|
|
242
|
-
Debt Resolved: 5.8 days
|
|
243
|
-
Net Change: -2.6 days ✅
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
### Code Duplication
|
|
249
|
-
|
|
250
|
-
```yaml
|
|
251
|
-
duplication:
|
|
252
|
-
thresholds:
|
|
253
|
-
acceptable: "< 3%"
|
|
254
|
-
concerning: "3-5%"
|
|
255
|
-
problematic: "> 5%"
|
|
256
|
-
|
|
257
|
-
detection:
|
|
258
|
-
min_lines: 6
|
|
259
|
-
min_tokens: 50
|
|
260
|
-
ignore_imports: true
|
|
261
|
-
ignore_comments: true
|
|
262
|
-
|
|
263
|
-
exclusions:
|
|
264
|
-
- "**/*.test.ts"
|
|
265
|
-
- "**/generated/**"
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
**Analysis:**
|
|
269
|
-
```
|
|
270
|
-
Code Duplication Report
|
|
271
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
272
|
-
Duplication Rate: 2.8% ✅
|
|
273
|
-
|
|
274
|
-
Top Duplicated Blocks:
|
|
275
|
-
1. Error handling pattern (12 occurrences)
|
|
276
|
-
Files: api/*.ts
|
|
277
|
-
Lines: 15-28
|
|
278
|
-
→ Extract to shared utility
|
|
279
|
-
|
|
280
|
-
2. Validation logic (8 occurrences)
|
|
281
|
-
Files: services/*.ts
|
|
282
|
-
Lines: 45-62
|
|
283
|
-
→ Create validation decorator
|
|
284
|
-
|
|
285
|
-
3. API response formatting (6 occurrences)
|
|
286
|
-
Files: controllers/*.ts
|
|
287
|
-
Lines: 10-18
|
|
288
|
-
→ Use response middleware
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
### Dependency Health
|
|
294
|
-
|
|
295
|
-
```yaml
|
|
296
|
-
dependencies:
|
|
297
|
-
metrics:
|
|
298
|
-
outdated_count: "Dependencies behind latest"
|
|
299
|
-
vulnerable_count: "Dependencies with CVEs"
|
|
300
|
-
unused_count: "Imported but not used"
|
|
301
|
-
direct_vs_transitive: "Direct dependency ratio"
|
|
302
|
-
|
|
303
|
-
thresholds:
|
|
304
|
-
outdated_warning: 5
|
|
305
|
-
outdated_critical: 15
|
|
306
|
-
vulnerable_any: "critical"
|
|
307
|
-
|
|
308
|
-
scanning:
|
|
309
|
-
schedule: "daily"
|
|
310
|
-
sources:
|
|
311
|
-
- "npm audit"
|
|
312
|
-
- "snyk"
|
|
313
|
-
- "github advisories"
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
**Report:**
|
|
317
|
-
```
|
|
318
|
-
Dependency Health Check
|
|
319
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
320
|
-
Total Dependencies: 145 (42 direct, 103 transitive)
|
|
321
|
-
|
|
322
|
-
Status:
|
|
323
|
-
Up to Date: 128 (88%)
|
|
324
|
-
Minor Behind: 12 (8%)
|
|
325
|
-
Major Behind: 5 (3%)
|
|
326
|
-
|
|
327
|
-
Security:
|
|
328
|
-
Vulnerabilities: 2
|
|
329
|
-
├─ Critical: 0
|
|
330
|
-
├─ High: 1 ⚠️ (lodash - prototype pollution)
|
|
331
|
-
├─ Medium: 1
|
|
332
|
-
└─ Low: 0
|
|
333
|
-
|
|
334
|
-
Recommendations:
|
|
335
|
-
1. npm update lodash@4.17.21 (security fix)
|
|
336
|
-
2. npm update react@18.2.1 (minor update)
|
|
337
|
-
3. npm update typescript@5.3.0 (minor update)
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
## Quality Score
|
|
343
|
-
|
|
344
|
-
### Composite Quality Index
|
|
345
|
-
|
|
346
|
-
```typescript
|
|
347
|
-
interface QualityScore {
|
|
348
|
-
overall: number; // 0-100
|
|
349
|
-
grade: 'A' | 'B' | 'C' | 'D' | 'F';
|
|
350
|
-
breakdown: {
|
|
351
|
-
coverage: { score: number; weight: 0.25 };
|
|
352
|
-
complexity: { score: number; weight: 0.20 };
|
|
353
|
-
duplication: { score: number; weight: 0.15 };
|
|
354
|
-
technicalDebt: { score: number; weight: 0.20 };
|
|
355
|
-
dependencies: { score: number; weight: 0.10 };
|
|
356
|
-
security: { score: number; weight: 0.10 };
|
|
357
|
-
};
|
|
358
|
-
trend: 'improving' | 'stable' | 'degrading';
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function calculateQualityScore(metrics: CodeMetrics): QualityScore {
|
|
362
|
-
const breakdown = {
|
|
363
|
-
coverage: { score: scoreCoverage(metrics.coverage), weight: 0.25 },
|
|
364
|
-
complexity: { score: scoreComplexity(metrics.complexity), weight: 0.20 },
|
|
365
|
-
duplication: { score: scoreDuplication(metrics.duplication), weight: 0.15 },
|
|
366
|
-
technicalDebt: { score: scoreDebt(metrics.debt), weight: 0.20 },
|
|
367
|
-
dependencies: { score: scoreDependencies(metrics.deps), weight: 0.10 },
|
|
368
|
-
security: { score: scoreSecurity(metrics.vulnerabilities), weight: 0.10 },
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
const overall = Object.values(breakdown).reduce(
|
|
372
|
-
(sum, item) => sum + item.score * item.weight,
|
|
373
|
-
0
|
|
374
|
-
);
|
|
375
|
-
|
|
376
|
-
return {
|
|
377
|
-
overall,
|
|
378
|
-
grade: getGrade(overall),
|
|
379
|
-
breakdown,
|
|
380
|
-
trend: calculateTrend(metrics.history),
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
**Dashboard:**
|
|
386
|
-
```
|
|
387
|
-
Code Quality Score
|
|
388
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
389
|
-
Overall Score: 78/100 (Grade: B)
|
|
390
|
-
Trend: ↑ Improving (+5 from last month)
|
|
391
|
-
|
|
392
|
-
Breakdown:
|
|
393
|
-
Coverage (25%): 82/100 ████████░░
|
|
394
|
-
Complexity (20%): 75/100 ███████░░░
|
|
395
|
-
Duplication (15%): 88/100 █████████░
|
|
396
|
-
Tech Debt (20%): 72/100 ███████░░░
|
|
397
|
-
Dependencies (10%): 85/100 ████████░░
|
|
398
|
-
Security (10%): 70/100 ███████░░░
|
|
399
|
-
|
|
400
|
-
Top Improvement Areas:
|
|
401
|
-
1. Reduce tech debt in legacy modules
|
|
402
|
-
2. Add tests to payment service
|
|
403
|
-
3. Simplify order processing logic
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
---
|
|
407
|
-
|
|
408
|
-
## Commands
|
|
409
|
-
|
|
410
|
-
```bash
|
|
411
|
-
# View quality dashboard
|
|
412
|
-
pa:metrics quality
|
|
413
|
-
|
|
414
|
-
# Detailed coverage report
|
|
415
|
-
pa:metrics coverage --detailed
|
|
416
|
-
|
|
417
|
-
# Complexity hotspots
|
|
418
|
-
pa:metrics complexity --hotspots
|
|
419
|
-
|
|
420
|
-
# Technical debt breakdown
|
|
421
|
-
pa:metrics debt --by-category
|
|
422
|
-
|
|
423
|
-
# Dependency audit
|
|
424
|
-
pa:metrics dependencies --audit
|
|
425
|
-
|
|
426
|
-
# Generate quality report
|
|
427
|
-
pa:metrics quality --report --format pdf
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
---
|
|
431
|
-
|
|
432
|
-
## Configuration
|
|
433
|
-
|
|
434
|
-
```yaml
|
|
435
|
-
# proagents.config.yaml
|
|
436
|
-
metrics:
|
|
437
|
-
code_quality:
|
|
438
|
-
enabled: true
|
|
439
|
-
|
|
440
|
-
coverage:
|
|
441
|
-
tool: "jest" # jest, nyc, istanbul
|
|
442
|
-
report_path: "./coverage/lcov.info"
|
|
443
|
-
minimum: 80
|
|
444
|
-
|
|
445
|
-
complexity:
|
|
446
|
-
tool: "eslint" # eslint, sonar
|
|
447
|
-
max_cyclomatic: 15
|
|
448
|
-
max_cognitive: 20
|
|
449
|
-
|
|
450
|
-
duplication:
|
|
451
|
-
tool: "jscpd"
|
|
452
|
-
threshold: 3
|
|
453
|
-
|
|
454
|
-
debt:
|
|
455
|
-
calculation: "sonar"
|
|
456
|
-
target_ratio: 5
|
|
457
|
-
|
|
458
|
-
dependencies:
|
|
459
|
-
audit_tool: "npm"
|
|
460
|
-
block_on_critical: true
|
|
461
|
-
```
|