plugins/code-analysis/skills/tester-detective/SKILL.md
⚡ PRIMARY TOOL for: 'what's tested', 'find test coverage', 'audit test quality', 'missing tests', 'edge cases', 'test patterns'. Uses claudemem v0.3.0 AST with callers analysis for test discovery. GREP/FIND/GLOB ARE FORBIDDEN.
npx skillsauth add involvex/involvex-claude-marketplace tester-detectiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ 🧠 THIS SKILL USES claudemem v0.3.0 AST ANALYSIS EXCLUSIVELY ║
║ ║
║ ❌ GREP IS FORBIDDEN ║
║ ❌ FIND IS FORBIDDEN ║
║ ❌ GLOB IS FORBIDDEN ║
║ ║
║ ✅ claudemem --nologo callers <name> --raw TO FIND TESTS ║
║ ✅ claudemem --nologo map "test spec" --raw TO MAP TEST INFRASTRUCTURE ║
║ ║
║ ⭐ v0.3.0: callers shows which tests call each function ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
Version: 3.3.0 Role: QA Engineer / Test Specialist Purpose: Test coverage investigation using AST callers analysis and automated test-gaps detection
You are investigating this codebase as a QA Engineer. Your focus is on:
callers is Perfect for Test AnalysisThe callers command shows you:
# Who calls this function? (tests will appear as callers)
claudemem --nologo callers processPayment --raw
# Filter: callers from test files are your tests
# src/services/payment.test.ts:45 → This is a test!
# Find all test files
claudemem --nologo map "test spec describe it" --raw
# Find test utilities
claudemem --nologo map "test helper mock stub" --raw
# Find fixtures
claudemem --nologo map "fixture factory builder" --raw
# Find high-importance untested code automatically
claudemem --nologo test-gaps --raw
# Output:
# file: src/services/payment.ts
# line: 45-89
# name: processPayment
# pagerank: 0.034
# production_callers: 4
# test_callers: 0
# ---
# This is CRITICAL - high PageRank but no tests!
Why test-gaps is better than manual analysis:
Handling Empty Results:
GAPS=$(claudemem --nologo test-gaps --raw)
if [ -z "$GAPS" ] || echo "$GAPS" | grep -q "No test gaps"; then
echo "Excellent test coverage! All high-importance code has tests."
echo ""
echo "Optional: Check lower-importance code:"
echo " claudemem --nologo test-gaps --min-pagerank 0.005 --raw"
else
echo "Test Coverage Gaps Found:"
echo "$GAPS"
fi
Limitations Note: Test detection relies on file naming patterns:
*.test.ts, *.spec.ts, *_test.go, etc.Method 1: Automated (v0.4.0+ Required - Recommended)
# Let claudemem find all gaps automatically
GAPS=$(claudemem --nologo test-gaps --raw)
if [ -z "$GAPS" ]; then
echo "No high-importance untested code found!"
else
echo "$GAPS"
fi
# Focus on critical gaps only
claudemem --nologo test-gaps --min-pagerank 0.05 --raw
Method 2: Manual (for specific functions, v0.3.0 compatible)
# Get callers for a function
claudemem --nologo callers importantFunction --raw
# If NO callers from *.test.ts or *.spec.ts files:
# This function has NO tests!
# For each critical function, check callers
claudemem --nologo callers authenticateUser --raw
claudemem --nologo callers processPayment --raw
claudemem --nologo callers saveToDatabase --raw
# Note which have test callers and which don't
which claudemem && claudemem --version
# Must be 0.3.0+
Use AskUserQuestion (see ultrathink-detective for template)
# Check claudemem installation and index
claudemem --version && ls -la .claudemem/index.db 2>/dev/null
Before proceeding with investigation, verify the index is current:
# First check if index exists
if [ ! -d ".claudemem" ] || [ ! -f ".claudemem/index.db" ]; then
# Use AskUserQuestion to prompt for index creation
# Options: [1] Create index now (Recommended), [2] Cancel investigation
exit 1
fi
# Count files modified since last index
STALE_COUNT=$(find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \) \
-newer .claudemem/index.db 2>/dev/null | grep -v "node_modules" | grep -v ".git" | grep -v "dist" | grep -v "build" | wc -l)
STALE_COUNT=$((STALE_COUNT + 0)) # Normalize to integer
if [ "$STALE_COUNT" -gt 0 ]; then
# Get index time with explicit platform detection
if [[ "$OSTYPE" == "darwin"* ]]; then
INDEX_TIME=$(stat -f "%Sm" -t "%Y-%m-%d %H:%M" .claudemem/index.db 2>/dev/null)
else
INDEX_TIME=$(stat -c "%y" .claudemem/index.db 2>/dev/null | cut -d'.' -f1)
fi
INDEX_TIME=${INDEX_TIME:-"unknown time"}
# Get sample of stale files
STALE_SAMPLE=$(find . -type f \( -name "*.ts" -o -name "*.tsx" \) \
-newer .claudemem/index.db 2>/dev/null | grep -v "node_modules" | grep -v ".git" | head -5)
# Use AskUserQuestion (see template in ultrathink-detective)
fi
claudemem index
# Run test-gaps FIRST - it does the work for you
GAPS=$(claudemem --nologo test-gaps --raw)
if [ -z "$GAPS" ]; then
echo "No gaps found at default threshold"
echo "Optionally check with lower threshold:"
claudemem --nologo test-gaps --min-pagerank 0.005 --raw
else
# This gives you a prioritized list of:
# - High-PageRank symbols
# - With 0 test callers
# - Sorted by importance
echo "$GAPS"
fi
# Find test configuration
claudemem --nologo map "jest vitest mocha config" --raw
# Find test utilities and mocks
claudemem --nologo map "mock stub spy helper" --raw
# Map the feature area
claudemem --nologo map "payment processing" --raw
# High-PageRank functions are most critical to test
# For each critical function, check callers
claudemem --nologo callers PaymentService --raw
# Look for callers from test files:
# src/services/payment.test.ts:23 ← TEST CALLER
# src/controllers/checkout.ts:45 ← NOT A TEST
# Functions with NO test callers = untested
# Make a list of untested critical functions
# For functions with test callers, read the tests
# Check: Are they testing edge cases? Error paths?
┌─────────────────────────────────────────────────────────┐
│ TEST INFRASTRUCTURE │
├─────────────────────────────────────────────────────────┤
│ Framework: Vitest 2.x │
│ Test Files: 156 files (*.spec.ts, *.test.ts) │
│ Test Utils: src/__tests__/utils/ │
│ Search Method: claudemem v0.3.0 (callers analysis) │
└─────────────────────────────────────────────────────────┘
| Function | Test Callers | Coverage |
|---------------------|--------------|----------|
| authenticateUser | 5 tests | ✅ Good |
| processPayment | 3 tests | ✅ Good |
| calculateDiscount | 0 tests | ❌ None |
| sendEmail | 1 test | ⚠️ Low |
| updateUserProfile | 0 tests | ❌ None |
🔴 HIGH PRIORITY - No Test Callers:
└── calculateDiscount (PageRank: 0.034)
└── callers show: 4 production callers, 0 test callers
└── updateUserProfile (PageRank: 0.028)
└── callers show: 3 production callers, 0 test callers
⚠️ MEDIUM PRIORITY - Few Test Callers:
└── sendEmail (PageRank: 0.021)
└── callers show: 1 test, no edge case tests
📝 OBSERVATIONS:
1. calculateDiscount has 4 production callers but 0 test callers
→ Critical business logic untested!
2. sendEmail has 1 test caller
→ Only happy path tested, no error scenarios
3. authenticateUser has 5 test callers
→ Good coverage including edge cases
# Step 1: Map the feature
claudemem --nologo map "payment" --raw
# Step 2: For each function, check callers
claudemem --nologo callers processPayment --raw
claudemem --nologo callers validateCard --raw
claudemem --nologo callers chargeCustomer --raw
# Step 3: Count test callers vs production callers
# Step 1: Find high-PageRank (important) functions
claudemem --nologo map --raw
# Step 2: Check callers for each
claudemem --nologo callers importantFunc1 --raw
claudemem --nologo callers importantFunc2 --raw
# Step 3: Functions with 0 test callers = gap
# Step 1: Find test callers
claudemem --nologo callers targetFunction --raw
# Step 2: Read each test file at the caller line
# Step 3: Check: Does test cover edge cases? Errors?
After EVERY claudemem command, validate results:
When checking test coverage:
CALLERS=$(claudemem --nologo callers processPayment --raw)
EXIT_CODE=$?
# Check for command failure
if [ "$EXIT_CODE" -ne 0 ]; then
DIAGNOSIS=$(claudemem status 2>&1)
# Use AskUserQuestion for recovery
fi
# Validate we got callers, not an error
if echo "$CALLERS" | grep -qi "error\|failed"; then
# Actual error, not 0 callers
# Use AskUserQuestion
fi
# Count test vs production callers
TEST_CALLERS=$(echo "$CALLERS" | grep -E "\.test\.|\.spec\.|_test\." | wc -l)
PROD_CALLERS=$(echo "$CALLERS" | grep -v -E "\.test\.|\.spec\.|_test\." | wc -l)
# Report coverage ratio
if [ "$TEST_CALLERS" -eq 0 ]; then
echo "WARNING: No test coverage found for this function"
fi
RESULTS=$(claudemem --nologo map "test spec describe" --raw)
if [ -z "$RESULTS" ]; then
echo "WARNING: No test infrastructure found"
# May indicate:
# 1. Tests in non-standard locations
# 2. Index doesn't include test files
# 3. Wrong query terms
# Use AskUserQuestion
fi
CRITICAL: Never use grep/find/Glob without explicit user approval.
If claudemem fails or returns irrelevant results:
claudemem status// Fallback options (in order of preference)
AskUserQuestion({
questions: [{
question: "claudemem test coverage analysis failed or found no tests. How should I proceed?",
header: "Test Coverage Issue",
multiSelect: false,
options: [
{ label: "Reindex codebase", description: "Run claudemem index (~1-2 min)" },
{ label: "Try different query", description: "Search for different test patterns" },
{ label: "Use grep (not recommended)", description: "Traditional search - loses caller analysis" },
{ label: "Cancel", description: "Stop investigation" }
]
}]
})
See ultrathink-detective skill for complete Fallback Protocol documentation.
| Anti-Pattern | Why Wrong | Correct Approach |
|--------------|-----------|------------------|
| grep "test" | No caller relationships | claudemem --nologo callers func --raw |
| Assume tests exist | Miss coverage gaps | Verify with callers analysis |
| Count test files | Doesn't show what's tested | Check callers per function |
| Skip PageRank | Miss critical gaps | Focus on high-PageRank untested |
callers reveals test coverage - Tests are just callers from test filesMaintained by: MadAppGang Plugin: code-analysis v2.7.0 Last Updated: December 2025 (v3.3.0 - Cross-platform compatibility, inline templates, improved validation)
development
Technical SEO audit methodology including crawlability, indexability, and Core Web Vitals analysis. Use when auditing pages or sites for technical SEO issues.
content-media
SERP analysis techniques for intent classification, feature identification, and competitive intelligence. Use when analyzing search results for content strategy.
data-ai
Schema.org markup implementation patterns for rich results. Use when adding structured data to content for enhanced SERP appearances.
development
Correlate content attributes with performance metrics across GA4, GSC, and SE Ranking. Identify what drives performance and build optimization hypotheses.