.cursor/skills/xfi-debug-analysis/SKILL.md
Guide for debugging X-Fidelity analysis issues. Use when troubleshooting analysis failures, rule evaluation problems, VSCode extension issues, or unexpected results.
npx skillsauth add zotoio/x-fidelity xfi-debug-analysisInstall 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 guides you through troubleshooting X-Fidelity analysis issues.
Debugging Checklist:
- [ ] Check Output panel for errors
- [ ] Verify archetype detection
- [ ] Review file inclusion/exclusion patterns
- [ ] Test rule evaluation
- [ ] Compare CLI vs VSCode output
- [ ] Check plugin loading status
CLI:
xfi --debug
VSCode Extension:
| Level | When to Use |
|-------|-------------|
| info | Normal operation (default) |
| debug | Detailed execution flow |
| trace | Full diagnostic output |
Symptoms: No issues found, analysis seems to skip
Diagnostic Steps:
# Verify files match inclusion patterns
xfi --debug 2>&1 | grep -E "(whitelist|blacklist|skip)"
# Check archetype configuration
cat .xfi-config.json
Common Causes:
Solution:
Check whitelistPatterns and blacklistPatterns in archetype config:
{
"whitelistPatterns": [".*\\.(ts|tsx|js|jsx)$"],
"blacklistPatterns": [".*\\/node_modules\\/.*"]
}
Symptoms: Expected issue not appearing
Diagnostic Steps:
# Check archetype includes the rule
cat packages/x-fidelity-democonfig/src/{archetype}.json | grep "ruleName"
xfi --debug 2>&1 | grep -E "fact|operator"
all (AND) or any (OR)?REPO_GLOBAL_CHECK condition present?Solution: Review rule JSON structure - see xfi-create-rule skill
Symptoms: Issue appearing on files that should pass
Diagnostic Steps:
# View what the fact is seeing
xfi --debug 2>&1 | grep -A5 "factName"
Solution:
Symptoms: Extension shows no issues but CLI finds them
Diagnostic Steps:
Check Output panel:
Verify workspace:
Run extension test:
Compare with CLI:
cd /path/to/workspace
xfi --archetype node-fullstack
Common Causes:
Solution:
Symptoms: CLI and VSCode show different issues
Diagnostic Steps:
# Run consistency test
yarn test:consistency
# Check both outputs
xfi --mode cli # Human-readable
xfi --mode vscode # Clean JSON output
Common Causes:
Solution:
# Ensure build is current
yarn build
# Verify same configuration
cat .xfi-config.json
Symptoms: "Plugin not found" or "Failed to load"
Diagnostic Steps:
xfi --debug 2>&1 | grep -E "(plugin|load|register)"
Common Causes:
Solution:
packages/x-fidelity-plugins/src/index.tsyarn workspace @x-fidelity/plugins testSymptoms: "Tree-sitter" errors, AST facts returning empty
Diagnostic Steps:
Check WASM status in VSCode:
Verify WASM files exist:
ls packages/x-fidelity-vscode/dist/*.wasm
xfi --debug 2>&1 | grep -E "(tree-sitter|wasm|parse)"
Solution:
# Rebuild with WASM copy
yarn workspace x-fidelity-vscode build
# Verify WASM files
ls -la dist/*.wasm
Symptoms: Analysis taking too long or timing out
Diagnostic Steps:
# Check file count
find . -name "*.ts" -o -name "*.tsx" | wc -l
# Run with timing
time xfi --debug
Common Causes:
Solution:
packages/x-fidelity-vscode in VSCodeUse Control Center > Development Tools > Debug Info to copy:
| Output Channel | Content | |----------------|---------| | X-Fidelity Debug | Extension lifecycle, errors | | X-Fidelity Analysis | Analysis execution, file processing |
File logs (if enabled with --enable-file-logging):
.xfiResults/x-fidelity.log# Full debug output
xfi --debug 2>&1 | tee debug.log
# Just errors
xfi 2>&1 | grep -i error
# Rule evaluation
xfi --debug 2>&1 | grep -E "(rule|condition|event)"
# File processing
xfi --debug 2>&1 | grep -E "(file|scan|process)"
# Plugin activity
xfi --debug 2>&1 | grep -E "(plugin|fact|operator)"
| Purpose | Location |
|---------|----------|
| Debug output | Output panel > "X-Fidelity Debug" |
| Analysis logs | Output panel > "X-Fidelity Analysis" |
| File logs | .xfiResults/x-fidelity.log |
| Extension code | packages/x-fidelity-vscode/src/ |
| CLI code | packages/x-fidelity-cli/src/ |
| Core engine | packages/x-fidelity-core/src/core/engine/ |
documentation
Guide for managing X-Fidelity releases using the unified release system. Use when releasing, versioning, troubleshooting release issues, or writing commit messages.
documentation
Guide for executing engineering plans through coordinated subagent work. Use when executing existing plans from knowledge/plans/ directory.
development
Guide for updating X-Fidelity documentation including README and website. Use when updating docs, adding new features to documentation, or ensuring docs stay in sync with code.
development
End-to-end guide for creating a new X-Fidelity analysis rule. Use when creating rules, adding new checks, or when the user asks about rule development.