xarchitecture
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Comprehensive dual coverage analysis for code and specifications
How it fires
How this command gets triggered: by you, by Claude, or both.
/xcoverageContext preview
What this command does when you run it.
Comprehensive dual coverage analysis for code and specifications
description: Comprehensive dual coverage analysis for code and specifications tags: [coverage, testing, specifications, quality, metrics]
Perform dual coverage analysis based on the arguments provided in $ARGUMENTS.
First, examine the project structure for test files and coverage tools: !find . -name "*test*" -o -name "*spec*" | grep -E "\.(py|js|ts)$" | head -10 !ls -la | grep -E "(pytest|jest|coverage|nyc)" !which pytest 2>/dev/null || which npm 2>/dev/null || echo "No test runners found"
Based on $ARGUMENTS, perform the appropriate coverage analysis:
If generating HTML report (--html): !python -m pytest --cov=. --cov-report=html 2>/dev/null || npm test -- --coverage 2>/dev/null || echo "No coverage tools configured" !ls htmlcov/ 2>/dev/null && echo "HTML report generated in htmlcov/" || echo "No HTML coverage report found"
If checking missing coverage (--missing): !python -m pytest --cov=. --cov-report=term-missing 2>/dev/null || echo "Python coverage not available" !npm test -- --coverage --verbose 2>/dev/null || echo "JavaScript coverage not available"
Show uncovered lines and specifications that need attention.
If checking specific specification (--spec): @specs/ 2>/dev/null || echo "No specs directory found" !find . -name "*test*" -exec grep -l "$spec_id" {} \; 2>/dev/null
Analyze:
If showing dual coverage (--dual): !python -m pytest --cov=. --cov-report=term 2>/dev/null | grep "TOTAL" || echo "Code coverage not available" !find specs/ -name "*.md" 2>/dev/null | wc -l | xargs echo "Total specifications:" !find . -name "*test*" 2>/dev/null | wc -l | xargs echo "Total test files:"
Calculate:
If checking by authority (--authority): !grep -r "authority=$authority_level" specs/ 2>/dev/null || echo "No authority specifications found"
Break down coverage by:
If identifying gaps (--gaps): !find specs/ -name "*.md" -exec basename {} \; 2>/dev/null | sed 's/\.md$//' > /tmp/specs.txt !find . -name "*test*" -exec grep -l "spec" {} \; 2>/dev/null | xargs grep -o "spec[0-9a-zA-Z]*" | sort -u > /tmp/tested_specs.txt !comm -23 <(sort /tmp/specs.txt) <(sort /tmp/tested_specs.txt) 2>/dev/null || echo "Gap analysis not available"
Identify:
If generating metrics (--metrics): !uptime !date
Think step by step about coverage analysis and provide:
Generate a comprehensive coverage report with actionable insights and recommendations.
Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!
Design, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
Manage project configuration files, environment variables, and application settings
Continue an execution plan from where it left off across sessions
Interactive debugging support with error analysis and fix suggestions - integrates with Debug Specialist sub-agent for complex…