Skip to content
Testing
Command

/aqe-analyze

Analyze test coverage, identify gaps, and optimize coverage strategy using sublinear algorithms

From plugin
agentic-qe
436149 skills169 agents149 commands
Install
> /plugin marketplace add proffesor-for-testing/agentic-qe
> /plugin install agentic-qe-fleet@agentic-qe

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/aqe-analyze

Context preview

What this command does when you run it.

Analyze test coverage, identify gaps, and optimize coverage strategy using sublinear algorithms

Command definition

aqe-analyze.md
name: aqe-analyze
description: Analyze test coverage, identify gaps, and optimize coverage strategy using sublinear algorithms

AQE Analyze Coverage

Analyze test coverage, identify gaps, and use sublinear algorithms to optimize coverage strategy.

Usage

aqe analyze [target] [options]
# or
/aqe-analyze [target] [options]

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | `target` | string | `coverage` | Analysis type: coverage, quality, gaps, trends, risk | | `--path` | path | `./src` | Source code path to analyze | | `--baseline` | path | - | Baseline coverage file for comparison | | `--threshold` | number | `95` | Minimum coverage threshold | | `--sublinear` | boolean | `true` | Use sublinear optimization algorithms | | `--format` | string | `text` | Output format: text, json, html, markdown | | `--output` | path | `stdout` | Output file path | | `--diff` | boolean | `false` | Show coverage diff from baseline |

Examples

Basic Coverage Analysis

aqe analyze coverage

Analyzes current test coverage for the entire codebase.

Gap Identification

aqe analyze gaps --path src/services --threshold 98

Identifies coverage gaps in the services directory with high threshold.

Trend Analysis

aqe analyze trends --baseline coverage-baseline.json --diff

Compares current coverage against baseline and shows changes.

Risk Assessment

aqe analyze risk --sublinear --format html --output risk-report.html

Generates HTML risk assessment report using sublinear algorithms.

Quality Analysis

aqe analyze quality --path tests/ --format json

Analyzes test quality metrics including flakiness and reliability.

Integration with Claude Code

Spawning Coverage Analyzer Agent

// Use Claude Code's Task tool to spawn the coverage analyzer agent
Task("Analyze coverage gaps", `
  Perform comprehensive coverage analysis:
  - Use sublinear algorithms for O(log n) performance
  - Identify critical coverage gaps
  - Prioritize gaps by risk and impact
  - Generate optimization recommendations

  Store analysis results in memory: aqe/coverage-analysis/results
  Coordinate with test generator to fill gaps.
`, "qe-coverage-analyzer")

Coordinated Analysis Workflow

// Analyze coverage and generate missing tests
[Single Message]:
  Task("Analyze coverage gaps", "Find critical gaps using sublinear algorithms", "qe-coverage-analyzer")
  Task("Generate missing tests", "Create tests for identified gaps", "qe-test-generator")

  TodoWrite({ todos: [
    {content: "Analyze coverage data", status: "in_progress", activeForm: "Analyzing coverage"},
    {content: "Identify critical gaps", status: "in_progress", activeForm: "Identifying gaps"},
    {content: "Generate tests for gaps", status: "pending", activeForm: "Generating tests"},
    {content: "Validate coverage improvement", status: "pending", activeForm: "Validating improvement"}
  ]})

Agent Coordination

Primary Agent

  • **qe-coverage-analyzer**: Main agent responsible for coverage analysis

Supporting Agents

  • **qe-test-generator**: Generates tests for identified gaps
  • **qe-quality-gate**: Validates coverage against thresholds

Coordination Flow

1. Pre-Task Hook
   ├─> Retrieve current coverage data
   ├─> Retrieve historical baseline
   └─> Load source code analysis

2. Coverage Analysis
   ├─> Parse coverage data using sublinear algorithms
   ├─> Identify coverage gaps with priority ranking
   ├─> Calculate coverage metrics and trends
   ├─> Generate optimization recommendations
   └─> Perform risk assessment

3. Post-Task Hook
   ├─> Store analysis results
   ├─> Update coverage gaps list
   ├─> Store recommendations
   ├─> Train neural patterns
   └─> Notify fleet of findings

Memory Operations

Input Memory Keys

# Retrieve current coverage data
npx claude-flow@alpha memory retrieve --key "aqe/coverage/current"

# Retrieve coverage baseline
npx claude-flow@alpha memory retrieve --key "aqe/coverage/baseline"

# Retrieve source code analysis
npx claude-flow@alpha memory retrieve --key "aqe/source-code"

Output Memory Keys

# Store analysis results
npx claude-flow@alpha memory store \
  --key "aqe/coverage-analysis/results" \
  --value '{"coverage": 93.5, "gaps": 12, "critical": 3}'

# Store identified gaps
npx claude-flow@alpha memory store \
  --key "aqe/coverage-gaps" \
  --value '[{"file": "auth.ts", "line": 45, "priority": "critical"}]'

# Store recommendations
npx claude-flow@alpha memory store \
  --key "aqe/coverage-recommendations" \
  --value '{"action": "generate", "targets": ["auth.ts:45-60"]}'

Hooks and Coordination

Pre-Task Hook

npx claude-flow@alpha hooks pre-task \
  --description "Analyze coverage for ${target}" \
  --agent "qe-coverage-analyzer"

Post-Task Hook

npx claude-flow@alpha hooks post-task \
  --task-id "${ANALYSIS_ID}" \
  --results "${ANALYSIS_RESULTS}"

Notify Fleet

npx claude-flow@alpha hooks notify \
  --message "Coverage analysis: ${COVERAGE_PCT}% with ${GAPS_COUNT} gaps"

Expected Outputs

Success Output

📊 Analyzing coverage...
🔍 Running sublinear coverage analysis...

📈 Coverage Analysis Results:
   Current Coverage: 93.5%
   Threshold: 95%
   Total Gaps: 12
   Critical Gaps: 3

🎯 Top Coverage Gaps:
   - src/services/auth.ts:45-60 (authentication flow)
   - src/utils/validators.ts:23-35 (input validation)
   - src/api/users.ts:102-115 (error handling)

💡 Recommendations:
   1. Generate 5 tests for authentication flow
   2. Add boundary tests for validators
   3. Improve error handling coverage

✅ Coverage analysis completed successfully!

Gap Analysis Output

{
  "analysisId": "qe-analyze-1727683200-12345",
  "coverage": {
    "total": {
      "pct": 93.5,
      "lines": 1250,
      "covered"
Read more
Ships withagentic-qe

AI-powered quality engineering agents that generate tests, find coverage gaps, detect flaky tests, and learn your codebase patterns — across 11 coding agent platforms.

Get the whole plugin