Files
bi-agents/.agents/skills/bmad-testarch-test-review/steps-c/step-03e-subagent-performance.md
Cassel 647cbec54f docs: update all documentation and add AI tooling configs
- Rewrite README.md with current architecture, features and stack
- Update docs/API.md with all current endpoints (corporate, BI, client 360)
- Update docs/ARCHITECTURE.md with cache, modular queries, services, ETL
- Update docs/GUIA-USUARIO.md for all roles (admin, corporate, agente)
- Add docs/INDEX.md documentation index
- Add PROJETO.md comprehensive project reference
- Add BI-CCC-Implementation-Guide.md
- Include AI agent configs (.claude, .agents, .gemini, _bmad)
- Add netbird VPN configuration
- Add status report

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:29:03 -04:00

118 lines
3.1 KiB
Markdown

---
name: 'step-03e-subagent-performance'
description: 'Subagent: Check test performance (speed, efficiency, parallelization)'
subagent: true
outputFile: '/tmp/tea-test-review-performance-{{timestamp}}.json'
---
# Subagent 3E: Performance Quality Check
## SUBAGENT CONTEXT
This is an **isolated subagent** running in parallel with other quality dimension checks.
**Your task:** Analyze test files for PERFORMANCE violations only.
---
## MANDATORY EXECUTION RULES
- ✅ Check PERFORMANCE only (not other quality dimensions)
- ✅ Output structured JSON to temp file
- ❌ Do NOT check determinism, isolation, maintainability, or coverage
---
## SUBAGENT TASK
### 1. Identify Performance Violations
**HIGH SEVERITY Violations**:
- Tests not parallelizable (using test.describe.serial unnecessarily)
- Slow setup/teardown (creating fresh DB for every test)
- Excessive navigation (reloading pages unnecessarily)
- No fixture reuse (repeating expensive operations)
**MEDIUM SEVERITY Violations**:
- Hard waits >2 seconds (waitForTimeout(5000))
- Inefficient selectors (page.$$ instead of locators)
- Large data sets in tests without pagination
- Missing performance optimizations
**LOW SEVERITY Violations**:
- Could use parallelization (test.describe.configure({ mode: 'parallel' }))
- Minor inefficiencies
- Excessive logging
### 2. Calculate Performance Score
```javascript
const severityWeights = { HIGH: 10, MEDIUM: 5, LOW: 2 };
const totalPenalty = violations.reduce((sum, v) => sum + severityWeights[v.severity], 0);
const score = Math.max(0, 100 - totalPenalty);
```
---
## OUTPUT FORMAT
```json
{
"dimension": "performance",
"score": 80,
"max_score": 100,
"grade": "B",
"violations": [
{
"file": "tests/e2e/search.spec.ts",
"line": 10,
"severity": "HIGH",
"category": "not-parallelizable",
"description": "Tests use test.describe.serial unnecessarily - reduces parallel execution",
"suggestion": "Remove .serial unless tests truly share state",
"code_snippet": "test.describe.serial('Search tests', () => { ... });"
},
{
"file": "tests/api/bulk-operations.spec.ts",
"line": 35,
"severity": "MEDIUM",
"category": "slow-setup",
"description": "Test creates 1000 records in setup - very slow",
"suggestion": "Use smaller data sets or fixture factories",
"code_snippet": "beforeEach(async () => { for (let i=0; i<1000; i++) { ... } });"
}
],
"passed_checks": 13,
"failed_checks": 2,
"violation_summary": {
"HIGH": 1,
"MEDIUM": 1,
"LOW": 0
},
"performance_metrics": {
"parallelizable_tests": 80,
"serial_tests": 20,
"avg_test_duration_estimate": "~2 seconds",
"slow_tests": ["bulk-operations.spec.ts (>30s)"]
},
"recommendations": [
"Enable parallel mode where possible",
"Reduce setup data to minimum needed",
"Use fixtures to share expensive setup across tests",
"Remove unnecessary .serial constraints"
],
"summary": "Good performance with 2 violations - 80% tests can run in parallel"
}
```
---
## EXIT CONDITION
Subagent completes when JSON output written to temp file.
**Subagent terminates here.**