qe-defect-intelligence — Claude Code skill: predict defect-prone code
qe-defect-intelligence identifies high-risk code before bugs escape by analyzing change frequency, complexity metrics, and past defect patterns. Flags risky PRs and runs root cause analysis on test failures.
MIT 129 installs ★ 533 updated 2026-10-25
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a claude-codeWhat qe-defect-intelligence does
The skill operates on three tracks: predicts defect likelihood in modified code using complexity metrics and developer experience, learns from historical test failures to spot recurring patterns, and performs structured root cause analysis via five-whys and fishbone diagrams.
Each prediction factor gets a weight—code churn, complexity, test coverage, author experience, and file history. Risk scores range from low to critical. Integrates with Jira to create tasks for high-risk changes and suggest reviewers based on past patterns.
Needs access to git history, test results, and defect tracking systems. Orchestrates three agents: qe-defect-predictor, qe-pattern-learner, and qe-root-cause-analyzer.
What it helps with
- spot which changed files are likely to break in production
- trace a failing test back to its root cause using structured analysis
- discover recurring bug patterns that repeat month after month
- prioritize code review effort by actual risk, not PR size
Example prompts for the agent
- Predict defect likelihood for PR #456 using recent changes and complexity metrics
- Investigate why the AuthService test keeps failing and find the underlying cause in the last 30 days
- Learn from resolved bugs in Jira and flag similar code patterns in the current codebase
How to install qe-defect-intelligence
1Skills CLI (Vercel)
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a claude-code2Manually: put the files in place
~/.claude/skills/qe-defect-intelligence/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/qe-defect-intelligence/
1Skills CLI (Vercel)
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a codex2Manually: put the files in place
.agents/skills/qe-defect-intelligence/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a cursor2Manually: put the files in place
.cursor/skills/qe-defect-intelligence/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install proffesor-for-testing/agentic-qe assets/skills/qe-defect-intelligence2Manually: put the files in place
.github/skills/qe-defect-intelligence/SKILL.md1Skills CLI (Vercel)
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a gemini-cli2Platform CLI
gemini skills install https://github.com/proffesor-for-testing/agentic-qe --path assets/skills/qe-defect-intelligenceManually: put the files in place
.devin/skills/qe-defect-intelligence/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about qe-defect-intelligence
How do I install qe-defect-intelligence in Claude Code?
Run npx skills add proffesor-for-testing/agentic-qe --skill qe-defect-intelligence -a claude-code. The skill will be installed to ~/.claude/skills/qe-defect-intelligence/SKILL.md.
What does qe-defect-intelligence do?
Predicts defect likelihood by analyzing code churn, complexity, and author experience. Learns failure patterns from test history and performs root cause analysis using five-whys and fault trees.
What dependencies does qe-defect-intelligence need?
Git history (at least five commits), test run results, and access to a defect tracker like Jira. Without these, the model cannot learn patterns or correlate changes to failures.
Source text
SKILL.md · MIT
---
name: "qe-defect-intelligence"
description: "Predicts defect-prone code using change frequency, complexity metrics, and historical bug patterns. Use when predicting defects before they escape, analyzing root causes of test failures, learning from past defect patterns, or implementing proactive quality management."
trust_tier: 3
validation:
schema_path: schemas/output.json
validator_path: scripts/validate-config.json
eval_path: evals/qe-defect-intelligence.yaml
---
# QE Defect Intelligence
## Purpose
Guide the use of v3's defect intelligence capabilities including ML-based defect prediction, pattern recognition from historical data, and automated root cause analysis.
## Activation
- When predicting defect-prone code
- When analyzing failure patterns
- When performing root cause analysis
- When learning from past defects
- When prioritizing testing based on risk
## Quick Start
```bash
# Predict defects in changed code
aqe defect predict --changes HEAD~5..HEAD
# Analyze failure patterns
aqe defect patterns --period 90d --min-occurrences 3
# Root cause analysis
aqe defect rca --failure "test/auth.test.ts:45"
# Learn from resolved defects
aqe defect learn --source jira --status resolved
```
## Agent Workflow
```typescript
// Defect prediction
Task("Predict defect-prone code", `
Analyze PR #456 changes and predict defect likelihood:
- Historical defect correlation
- Code complexity factors
- Author experience with module
- Test coverage gaps
Flag high-risk changes requiring extra review.
`, "qe-defect-predictor")
// Root cause analysis
Task("Analyze test failure", `
Investigate recurring failure in AuthService tests:
- Collect failure history (last 30 days)
- Identify common patterns
- Trace to potential root causes
- Suggest fixes using 5-whys analysis
`, "qe-root-cause-analyzer")
```
## Prediction Models
### 1. Change-Based Prediction
```typescript
await defectPredictor.predictFromChanges({
changes: prChanges,
factors: {
codeChurn: { weight: 0.2 },
complexity: { weight: 0.25 },
authorExperience: { weight: 0.15 },
fileHistory: { weight: 0.2 },
testCoverage: { weight: 0.2 }
},
threshold: {
high: 0.7,
medium: 0.4,
low: 0.2
}
});
```
### 2. Pattern Learning
```typescript
await patternLearner.learnPatterns({
source: {
defects: 'jira:project=MYAPP&type=bug',
commits: 'git:last-6-months',
tests: 'test-results:last-1000-runs'
},
patterns: [
'code-smell-to-defect',
'change-coupling',
'test-gap-correlation',
'complexity-defect-density'
],
output: {
rules: true,
visualizations: true,
recommendations: true
}
});
```
### 3. Root Cause Analysis
```typescript
await rootCauseAnalyzer.analyze({
failure: testFailure,
methods: [
'five-whys',
'fishbone-diagram',
'fault-tree',
'change-impact'
],
context: {
recentChanges: true,
environmentDiff: true,
dependencyChanges: true,
similarFailures: true
}
});
```
## Defect Prediction Report
```typescript
interface DefectPrediction {
file: string;
riskScore: number; // 0-1
riskLevel: 'critical' | 'high' | 'medium' | 'low';
factors: {
name: string;
contribution: number;
details: string;
}[];
historicalDefects: {
count: number;
recent: Defect[];
patterns: string[];
};
recommendations: {
action: string;
priority: string;
expectedRiskReduction: number;
}[];
}
```
## Pattern Categories
| Pattern | Detection | Prevention |
|---------|-----------|------------|
| Null pointer | Static analysis | Null checks, Optional |
| Race condition | Concurrency analysis | Locks, atomic ops |
| Memory leak | Heap analysis | Resource cleanup |
| Off-by-one | Boundary analysis | Loop invariants |
| Injection | Taint analysis | Input validation |
## Root Cause Templates
```yaml
root_cause_analysis:
five_whys:
max_depth: 5
prompt_template: "Why did {effect} happen?"
fishbone:
categories:
- people
- process
- tools
- environment
- materials
- measurement
fault_tree:
top_event: "Test Failure"
gate_types: [AND, OR, NOT]
basic_events: true
```
## Integration with Issue Tracking
```typescript
await defectIntelligence.syncWithTracker({
source: 'jira',
project: 'MYAPP',
sync: {
defectData: 'bidirectional',
predictions: 'create-tasks',
patterns: 'update-labels'
},
automation: {
flagHighRisk: true,
suggestAssignee: true,
linkRelated: true
}
});
```
## Coordination
**Primary Agents**: qe-defect-predictor, qe-pattern-learner, qe-root-cause-analyzer
**Coordinator**: qe-defect-intelligence-coordinator
**Related Skills**: qe-coverage-analysis, qe-quality-assessment
© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe