/coverage
Comprehensive code coverage orchestrator with intelligent gap analysis, multi-format reporting, and automated improvement recommendations
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
/coverage
Context preview
What this command does when you run it.
Comprehensive code coverage orchestrator with intelligent gap analysis, multi-format reporting, and automated improvement recommendations
Command definition
coverage.mdallowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(bat:*), Bash(eza:*), Bash(jq:*), Bash(gdate:*), Bash(deno:*), Bash(cargo:*), Bash(go:*), Bash(mvn:*), Bash(npm:*), Bash(jest:*), Bash(vitest:*), Bash(coverage:*), Bash(tarpaulin:*)
name: "Coverage"
description: "Comprehensive code coverage orchestrator with intelligent gap analysis, multi-format reporting, and automated improvement recommendations"
author: "wcygan"
tags: ["test","analyze"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
- Target project: $ARGUMENTS
- Current directory: !`pwd`
- Project structure: !`eza -la --tree --level=2 2>/dev/null | head -10 || fd . -t d -d 2 | head -8`
- Build files detected: !`fd "(package\.json|Cargo\.toml|go\.mod|deno\.json|pom\.xml|pyproject\.toml|requirements\.txt)" . -d 3 | head -8 || echo "No build files detected"`
- Existing coverage files: !`fd "(coverage|tarpaulin-report|coverage\.out|\.coverage)" . -d 3 | head -5 || echo "No coverage reports found"`
- Language detection: !`echo "Languages: $(fd "\.(js|ts|jsx|tsx)" . | head -1 >/dev/null && echo "JS/TS") $(fd "\.rs$" . | head -1 >/dev/null && echo "Rust") $(fd "\.go$" . | head -1 >/dev/null && echo "Go") $(fd "\.py$" . | head -1 >/dev/null && echo "Python") $(fd "\.java$" . | head -1 >/dev/null && echo "Java")"`
- Coverage tools status: !`echo "Tools: $(which jest >/dev/null && echo "jest✓") $(which vitest >/dev/null && echo "vitest✓") $(which cargo-tarpaulin >/dev/null && echo "tarpaulin✓") $(which go >/dev/null && echo "go✓") $(which coverage >/dev/null && echo "coverage.py✓")"`
Your Task
- CREATE session state file: `/tmp/coverage-session-$SESSION_ID.json`
- ANALYZE project structure and technology stack from Context section
- DETECT coverage tools and existing configurations
- DETERMINE analysis complexity based on project size and language diversity
# Initialize coverage analysis session state
echo '{
"sessionId": "'$SESSION_ID'",
"targetProject": "'$ARGUMENTS'",
"detectedLanguages": [],
"coverageStrategy": "auto-detect",
"analysisComplexity": "standard",
"toolConfiguration": {}
}' > /tmp/coverage-session-$SESSION_ID.jsonSTEP 2: Intelligent technology stack detection and coverage tool configuration
TRY:
**Multi-Language Coverage Tool Detection:**
# Language-specific coverage configuration
configure_coverage_tools() {
local project_languages=()
local coverage_config={}
# Deno/TypeScript projects
if fd "deno\.json" . | head -1 >/dev/null; then
echo "🦕 Deno project detected"
project_languages+=("deno")
DENO_CMD="deno test --allow-all --coverage=coverage"
DENO_REPORT="deno coverage coverage --html"
fi
# Rust projects
if fd "Cargo\.toml" . | head -1 >/dev/null; then
echo "🦀 Rust project detected"
project_languages+=("rust")
RUST_CMD="cargo tarpaulin --out Html --out Json --out Xml --output-dir coverage"
RUST_INSTALL="cargo install cargo-tarpaulin"
fi
# Go projects
if fd "go\.mod" . | head -1 >/dev/null; then
echo "🐹 Go project detected"
project_languages+=("go")
GO_CMD="go test -coverprofile=coverage.out -covermode=atomic ./..."
GO_REPORT="go tool cover -html=coverage.out -o coverage.html"
fi
# Node.js/JavaScript projects
if fd "package\.json" . | head -1 >/dev/null; then
echo "⚡ Node.js project detected"
project_languages+=("node")
# Detect testing framework
if jq -e '.devDependencies.jest' package.json >/dev/null 2>&1; then
NODE_TOOL="jest"
NODE_CMD="jest --coverage --collectCoverageFrom='src/**/*.{js,ts,jsx,tsx}'"
elif jq -e '.devDependencies.vitest' package.json >/dev/null 2>&1; then
NODE_TOOL="vitest"
NODE_CMD="vitest --coverage"
elif jq -e '.devDependencies.c8' package.json >/dev/null 2>&1; then
NODE_TOOL="c8"
NODE_CMD="c8 npm test"
fi
fi
# Python projects
if fd "(pyproject\.toml|requirements\.txt)" . | head -1 >/dev/null; then
echo "🐍 Python project detected"
project_languages+=("python")
PYTHON_CMD="coverage run -m pytest && coverage report --format=json"
PYTHON_REPORT="coverage html"
fi
# Java projects
if fd "(pom\.xml|build\.gradle)" . | head -1 >/dev/null; then
echo "☕ Java project detected"
project_languages+=("java")
if fd "pom\.xml" . | head -1 >/dev/null; then
JAVA_CMD="mvn test jacoco:report"
else
JAVA_CMD="gradle test jacocoTestReport"
fi
fi
echo "Detected languages: ${project_languages[@]}"
}**Existing Coverage Analysis:**
# Analyze current coverage setup and reports
analyze_existing_coverage() {
echo "🔍 Analyzing existing coverage setup..."
# Check for existing coverage files and configurations
for config_file in deno.json package.json Cargo.toml pyproject.toml pom.xml build.gradle; do
if [ -f "$config_file" ]; then
echo "📄 Found $config_file - checking coverage configuration"
case "$config_file" in
"deno.json")
jq -e '.tasks.coverage // .tasks.test' "$config_file" >/dev/null 2>&1 && echo "✅ Coverage task configured" || echo "❌ No coverage task"
;;
"package.json")
jq -e '.scripts | to_entries[] | select(.value | contains("coverage"))' "$config_file" >/dev/null 2>&1 && echo "✅ Coverage script found" || echo "❌ No coverage scripts"
;;
"Cargo.toml")
rg -q "(tarpaulin|cargo-tarpaulin)" "$config_file" && echo "✅ Tarpaulin configured" || echo "❌ No tarpaulin config"
;;
esac
fi
done
# Check for existing coverage reports
existing_reports=$(fd "(coverage|tarpaulin-report|coverage\.out|\.coverage)" . -d 3)
if [ -n "$existing_reports" ];Read more
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(bat:*), Bash(eza:*), Bash(jq:*), Bash(gdate:*), Bash(deno:*), Bash(cargo:*), Bash(go:*), Bash(mvn:*), Bash(npm:*), Bash(jest:*), Bash(vitest:*), Bash(coverage:*), Bash(tarpaulin:*) name: "Coverage" description: "Comprehensive code coverage orchestrator with intelligent gap analysis, multi-format reporting, and automated improvement recommendations" author: "wcygan" tags: ["test","analyze"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
Context
- Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
- Target project: $ARGUMENTS
- Current directory: !`pwd`
- Project structure: !`eza -la --tree --level=2 2>/dev/null | head -10 || fd . -t d -d 2 | head -8`
- Build files detected: !`fd "(package\.json|Cargo\.toml|go\.mod|deno\.json|pom\.xml|pyproject\.toml|requirements\.txt)" . -d 3 | head -8 || echo "No build files detected"`
- Existing coverage files: !`fd "(coverage|tarpaulin-report|coverage\.out|\.coverage)" . -d 3 | head -5 || echo "No coverage reports found"`
- Language detection: !`echo "Languages: $(fd "\.(js|ts|jsx|tsx)" . | head -1 >/dev/null && echo "JS/TS") $(fd "\.rs$" . | head -1 >/dev/null && echo "Rust") $(fd "\.go$" . | head -1 >/dev/null && echo "Go") $(fd "\.py$" . | head -1 >/dev/null && echo "Python") $(fd "\.java$" . | head -1 >/dev/null && echo "Java")"`
- Coverage tools status: !`echo "Tools: $(which jest >/dev/null && echo "jest✓") $(which vitest >/dev/null && echo "vitest✓") $(which cargo-tarpaulin >/dev/null && echo "tarpaulin✓") $(which go >/dev/null && echo "go✓") $(which coverage >/dev/null && echo "coverage.py✓")"`
Your Task
- CREATE session state file: `/tmp/coverage-session-$SESSION_ID.json`
- ANALYZE project structure and technology stack from Context section
- DETECT coverage tools and existing configurations
- DETERMINE analysis complexity based on project size and language diversity
# Initialize coverage analysis session state
echo '{
"sessionId": "'$SESSION_ID'",
"targetProject": "'$ARGUMENTS'",
"detectedLanguages": [],
"coverageStrategy": "auto-detect",
"analysisComplexity": "standard",
"toolConfiguration": {}
}' > /tmp/coverage-session-$SESSION_ID.jsonSTEP 2: Intelligent technology stack detection and coverage tool configuration
TRY:
**Multi-Language Coverage Tool Detection:**
# Language-specific coverage configuration
configure_coverage_tools() {
local project_languages=()
local coverage_config={}
# Deno/TypeScript projects
if fd "deno\.json" . | head -1 >/dev/null; then
echo "🦕 Deno project detected"
project_languages+=("deno")
DENO_CMD="deno test --allow-all --coverage=coverage"
DENO_REPORT="deno coverage coverage --html"
fi
# Rust projects
if fd "Cargo\.toml" . | head -1 >/dev/null; then
echo "🦀 Rust project detected"
project_languages+=("rust")
RUST_CMD="cargo tarpaulin --out Html --out Json --out Xml --output-dir coverage"
RUST_INSTALL="cargo install cargo-tarpaulin"
fi
# Go projects
if fd "go\.mod" . | head -1 >/dev/null; then
echo "🐹 Go project detected"
project_languages+=("go")
GO_CMD="go test -coverprofile=coverage.out -covermode=atomic ./..."
GO_REPORT="go tool cover -html=coverage.out -o coverage.html"
fi
# Node.js/JavaScript projects
if fd "package\.json" . | head -1 >/dev/null; then
echo "⚡ Node.js project detected"
project_languages+=("node")
# Detect testing framework
if jq -e '.devDependencies.jest' package.json >/dev/null 2>&1; then
NODE_TOOL="jest"
NODE_CMD="jest --coverage --collectCoverageFrom='src/**/*.{js,ts,jsx,tsx}'"
elif jq -e '.devDependencies.vitest' package.json >/dev/null 2>&1; then
NODE_TOOL="vitest"
NODE_CMD="vitest --coverage"
elif jq -e '.devDependencies.c8' package.json >/dev/null 2>&1; then
NODE_TOOL="c8"
NODE_CMD="c8 npm test"
fi
fi
# Python projects
if fd "(pyproject\.toml|requirements\.txt)" . | head -1 >/dev/null; then
echo "🐍 Python project detected"
project_languages+=("python")
PYTHON_CMD="coverage run -m pytest && coverage report --format=json"
PYTHON_REPORT="coverage html"
fi
# Java projects
if fd "(pom\.xml|build\.gradle)" . | head -1 >/dev/null; then
echo "☕ Java project detected"
project_languages+=("java")
if fd "pom\.xml" . | head -1 >/dev/null; then
JAVA_CMD="mvn test jacoco:report"
else
JAVA_CMD="gradle test jacocoTestReport"
fi
fi
echo "Detected languages: ${project_languages[@]}"
}**Existing Coverage Analysis:**
# Analyze current coverage setup and reports
analyze_existing_coverage() {
echo "🔍 Analyzing existing coverage setup..."
# Check for existing coverage files and configurations
for config_file in deno.json package.json Cargo.toml pyproject.toml pom.xml build.gradle; do
if [ -f "$config_file" ]; then
echo "📄 Found $config_file - checking coverage configuration"
case "$config_file" in
"deno.json")
jq -e '.tasks.coverage // .tasks.test' "$config_file" >/dev/null 2>&1 && echo "✅ Coverage task configured" || echo "❌ No coverage task"
;;
"package.json")
jq -e '.scripts | to_entries[] | select(.value | contains("coverage"))' "$config_file" >/dev/null 2>&1 && echo "✅ Coverage script found" || echo "❌ No coverage scripts"
;;
"Cargo.toml")
rg -q "(tarpaulin|cargo-tarpaulin)" "$config_file" && echo "✅ Tarpaulin configured" || echo "❌ No tarpaulin config"
;;
esac
fi
done
# Check for existing coverage reports
existing_reports=$(fd "(coverage|tarpaulin-report|coverage\.out|\.coverage)" . -d 3)
if [ -n "$existing_reports" ];A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Other commands on claude-cmd.
- /agent-browser-automation
Automate browser interactions for development testing using Puppeteer MCP
Open command - /agent-prep-merge
Prepare branches for merging across multiple worktrees and coordinate integration
Open command - /agent-persona-accessibility-expert
Transform into accessibility expert for WCAG compliance and inclusive design
Open command - /agent-persona-api-designer
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Open command - /agent-persona-backend-specialist
Transform into backend specialist for scalable API and system design
Open command - /agent-persona-cloud-architect
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies
Open command

