qe-learning-optimization
Optimizes QE agent performance through transfer learning, hyperparameter tuning, and pattern distillation across test domains. Use when improving agent accuracy, applying learned patterns to new projects, tuning quality thresholds, or implementing continuous improvement loops for AI-powered testing.
Works with
---
name: qe-learning-optimization
description: Optimizes QE agent performance through transfer learning, hyperparameter tuning, and pattern distillation across test domains. Use when improving agent accuracy, applying learned patterns to new projects, tuning quality thresholds, or implementing continuous improvement loops for AI-powered testing.
license: MIT
---
# QE Learning Optimization
## Purpose
Guide the use of v3's learning optimization capabilities including transfer learning between agents, hyperparameter tuning, A/B testing, and continuous performance improvement.
## Activation
- When optimizing agent performance
- When transferring knowledge between agents
- When tuning learning parameters
- When running A/B tests
- When analyzing learning metrics
## Quick Start
```bash
# Transfer knowledge between agents
aqe learn transfer --from jest-generator --to vitest-generator
# Tune hyperparameters
aqe learn tune --agent defect-predictor --metric accuracy
# Run A/B test
aqe learn ab-test --hypothesis "new-algorithm" --duration 7d
# View learning metrics
aqe learn metrics --agent test-generator --period 30d
```
## Agent Workflow
```typescript
// Transfer learning
Task("Transfer test patterns", `
Transfer learned patterns from Jest test generator to Vitest:
- Map framework-specific syntax
- Adapt assertion styles
- Preserve test structure patterns
- Validate transfer accuracy
`, "qe-transfer-specialist")
// Metrics optimization
Task("Optimize prediction accuracy", `
Tune defect-predictor agent:
- Analyze current performance metrics
- Run Bayesian hyperparameter search
- Validate improvements on holdout set
- Deploy if accuracy improves >5%
`, "qe-metrics-optimizer")
```
## Learning Operations
### 1. Transfer Learning
```typescript
await transferSpecialist.transfer({
source: {
agent: 'qe-jest-generator',
knowledge: ['patterns', 'heuristics', 'optimizations']
},
target: {
agent: 'qe-vitest-generator',
adaptations: ['framework-syntax', 'api-differences']
},
strategy: 'fine-tuning',
validation: {
testSet: 'validation-samples',
minAccuracy: 0.9
}
});
```
### 2. Hyperparameter Tuning
```typescript
await metricsOptimizer.tune({
agent: 'defect-predictor',
parameters: {
learningRate: { min: 0.001, max: 0.1, type: 'log' },
batchSize: { values: [16, 32, 64, 128] },
patternThreshold: { min: 0.5, max: 0.95 }
},
optimization: {
method: 'bayesian',
objective: 'accuracy',
trials: 50,
parallelism: 4
}
});
```
### 3. A/B Testing
```typescript
await metricsOptimizer.abTest({
hypothesis: 'ML pattern matching improves test quality',
variants: {
control: { algorithm: 'rule-based' },
treatment: { algorithm: 'ml-enhanced' }
},
metrics: ['test-quality-score', 'generation-time'],
traffic: {
split: 50,
minSampleSize: 1000
},
duration: '7d',
significance: 0.05
});
```
### 4. Feedback Loop
```typescript
await metricsOptimizer.feedbackLoop({
agent: 'test-generator',
feedback: {
sources: ['user-corrections', 'test-results', 'code-reviews'],
aggregation: 'weighted',
frequency: 'real-time'
},
learning: {
strategy: 'incremental',
validationSplit: 0.2,
earlyStoppingPatience: 5
}
});
```
## Learning Metrics Dashboard
```typescript
interface LearningDashboard {
agent: string;
period: DateRange;
performance: {
current: MetricValues;
trend: 'improving' | 'stable' | 'declining';
percentile: number;
};
learning: {
samplesProcessed: number;
patternsLearned: number;
improvementRate: number;
};
experiments: {
active: Experiment[];
completed: ExperimentResult[];
};
recommendations: {
action: string;
expectedImpact: number;
confidence: number;
}[];
}
```
## Cross-Framework Transfer
```yaml
transfer_mappings:
jest_to_vitest:
syntax:
"describe": "describe"
"it": "it"
"expect": "expect"
"jest.mock": "vi.mock"
"jest.fn": "vi.fn"
patterns:
- mock-module
- async-testing
- snapshot-testing
mocha_to_jest:
syntax:
"describe": "describe"
"it": "it"
"chai.expect": "expect"
"sinon.stub": "jest.fn"
adaptations:
- assertion-style
- hook-naming
```
## Continuous Improvement
```typescript
await learningOptimizer.continuousImprovement({
agents: ['test-generator', 'coverage-analyzer', 'defect-predictor'],
schedule: {
metricCollection: 'hourly',
tuning: 'weekly',
majorUpdates: 'monthly'
},
thresholds: {
degradationAlert: 5, // percent
improvementTarget: 2, // percent per week
},
automation: {
autoTune: true,
autoRollback: true,
requireApproval: ['major-changes']
}
});
```
## Pattern Learning
```typescript
await patternLearner.learn({
sources: {
codeExamples: 'examples/**/*.ts',
testExamples: 'tests/**/*.test.ts',
userFeedback: 'feedback/*.json'
},
extraction: {
syntacticPatterns: true,
semanticPatterns: true,
contextualPatterns: true
},
storage: {
vectorDB: 'agentdb',
versioning: true
}
});
```
## Coordination
**Primary Agents**: qe-transfer-specialist, qe-metrics-optimizer, qe-pattern-learner
**Coordinator**: qe-learning-coordinator
**Related Skills**: qe-test-generation, qe-defect-intelligenceMore Testing skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
setup-pre-commit
mattpocock/skills
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

