Running Code Analyzer Skill ⚠️ CRITICAL: Tool Selection BEFORE DOING ANYTHING ELSE: This skill MUST use the Bash tool to execute and Node.js scripts. DO NOT use these tools under any circumstances: - ❌ (MCP tool) - ❌ (any MCP tool) - ❌ Any tool containing in its name If you see a tool available, ignore it completely . Use only the Bash tool with . --- Overview This skill translates natural language requests ("scan for security issues", "check my changes") into the correct command, executes scans with any combination of engines/targets/severities, and presents actionable results. When engine-p…

\n ```\n3. If no scannable files changed: \"No scannable files in your diff. Code Analyzer supports: .cls, .trigger, .js, .ts, .html, .css, .xml, .flow-meta.xml\"\n4. Pass filtered files as comma-separated `--target` value\n\n## Large Result Sets (500+ violations)\n\n- Summarize: top 10 rules by frequency, top 10 files by violation count\n- Offer: \"Want me to export the full results? Or focus on a specific category/file?\"\n- Don't try to display all 500+ violations inline\n\n## Mega Result Sets (5000+ violations)\n\n- Same as above, but also proactively suggest narrowing scope:\n - \"This is a very large number of violations. Want me to focus on just Critical/High severity, a specific category like Security, or a specific folder?\"\n- If the user originally said \"scan and fix everything\", still follow the full flow (scan → present → discover fixes → ask → apply → summarize) — do NOT shortcut any steps just because the result set is large\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":4731,"content_sha256":"ad1dc6ccf7e6d204073cc8d8e46caa24dc436d6a000928614d8db78227108ea1"},{"filename":"references/vendor-file-handling.md","content":"# Vendor File Handling\n\n## Problem\n\nCode Analyzer scans all JavaScript files, including third-party vendor libraries like jQuery, Bootstrap, Lodash, Handlebars, etc. These libraries often trigger thousands of violations, especially:\n\n- **no-var** (legacy `var` declarations)\n- **prefer-const** (variables that could be const)\n- **code style** (indentation, quotes, semicolons)\n\nA typical scan might find:\n- **9,714 total violations**\n- **9,089 in vendor files** (jQuery UI, Bootstrap, tablesorter)\n- **634 in project source** (your Aura/LWC components)\n\n## Why You Shouldn't Fix Vendor Files\n\n| Risk | Impact |\n|------|--------|\n| **Breaks upgrades** | Modified vendor files can't be cleanly upgraded to newer versions |\n| **Untested changes** | Libraries weren't designed for strict mode or modern JS patterns |\n| **Subtle bugs** | Converting `var` to `let/const` can change scope/hoisting behavior in legacy code |\n| **Maintainability** | Future developers won't know the file was modified and why |\n| **Wasted effort** | The next library upgrade will overwrite your fixes anyway |\n\n## Solutions\n\n### Solution 1: Re-scan with --target (Fastest)\n\nIf you know your project source locations upfront:\n\n```bash\nsf code-analyzer run --rule-selector \u003cselector> \\\n --target \"force-app/main/default/aura,force-app/main/default/lwc\" \\\n --output-file \"./results-project-only.json\" \\\n --include-fixes\n```\n\n**Pros:**\n- Only scans what you need\n- Faster execution\n- Cleaner results\n\n**Cons:**\n- Must know target directories upfront\n- Doesn't show you what violations exist in vendor files (for awareness)\n\n### Solution 2: Intelligent Filtering (Most Accurate)\n\nScan everything first, then use the intelligent filter script to separate vendor from project:\n\n```bash\n# 1. Run full scan\nsf code-analyzer run --rule-selector \u003cselector> \\\n --output-file \"./results-all.json\" --include-fixes\n\n# 2. Filter to project files only\nnode \"\u003cskill_dir>/scripts/filter-violations.js\" \\\n \"./results-all.json\" \\\n \"./results-project.json\" \\\n --report\n\n# 3. Apply fixes to filtered results\nnode \"\u003cskill_dir>/scripts/apply-fixes.js\" \"./results-project.json\"\n```\n\n**Pros:**\n- Intelligent classification using multiple heuristics\n- Shows you vendor vs project breakdown\n- Handles uncertain files (30-70% confidence)\n- No manual pattern maintenance\n\n**Cons:**\n- Scans more files than necessary\n- Takes longer for large codebases\n\n## How the Intelligent Filter Works\n\nThe `filter-violations.js` script uses a **multi-heuristic confidence scoring system**:\n\n### 1. Path-Based Signals (30% weight)\n\n```javascript\n// High confidence vendor indicators\nnode_modules/ → 100% vendor\nbower_components/ → 100% vendor\nvendor/ → 95% vendor\nthird-party/ → 95% vendor\nStaticResourceSources/ → 70% vendor\n\n// Project source indicators\nforce-app/main/default/aura/ → Project\nforce-app/main/default/lwc/ → Project\n```\n\n### 2. Name-Based Signals (30% weight)\n\n```javascript\n// Filename patterns\n*.min.js → 95% vendor (minified)\n*-1.12.1.js → 85% vendor (version in name)\njquery*.js → 85% vendor (known library)\nbootstrap*.js → 85% vendor (known library)\n\n// Checked against package.json dependencies\n```\n\n### 3. Content-Based Signals (40% weight)\n\n```javascript\n// License headers\nMIT License, Apache, BSD, GPL → 80% vendor\n\n// Minification indicators\nAverage line length > 500 chars → 90% vendor\n\u003c 10 lines but > 5KB file → 85% vendor\n\n// Library patterns\nUMD/AMD/CommonJS wrapper → 70% vendor\n@version x.x.x → 65% vendor\n@author (non-project) → 50% vendor\n```\n\n### Final Score\n\n```\nWeighted Score = (PathScore × 0.3) + (NameScore × 0.3) + (ContentScore × 0.4)\n\n> 70% = Vendor file\n\u003c 30% = Project file\n30-70% = Uncertain (manual review)\n```\n\n## Example Output\n\n```\n=== INTELLIGENT VENDOR FILE DETECTION ===\n\nOriginal violations: 9714\nFiltered violations: 634\nReduction: 9080 (93.5%)\n\n📦 Vendor files excluded: 127\n 610 violations | 95% confidence | jquery-ui-1.12.1.js\n located in vendor directory, version number in filename, minified file\n 525 violations | 98% confidence | jquery-ui-1.12.1.min.js\n located in vendor directory, minified file (.min.js)\n ... and 125 more vendor files\n\n✅ Project files included: 39\n 157 violations | CRLP_RollupHelper.js\n 103 violations | HH_ContainerHelper.js\n 84 violations | CRLP_FilterGroupHelper.js\n ...\n\n⚠️ Uncertain files: 2\n These files have 30-70% vendor confidence - review manually:\n 45 violations | 55% vendor | customUtility.js\n located in vendor directory\n\n✓ Filtered results written to: ./results-project.json\n```\n\n## Workflow Integration\n\n### When to Use Each Approach\n\n| Scenario | Recommended Approach |\n|----------|---------------------|\n| User says \"fix no-var in my code\" | Use intelligent filter (excludes vendor by default) |\n| User says \"fix all no-var\" | Ask: \"Including vendor files (jQuery, Bootstrap)?\" |\n| User specifies path | Use --target directly |\n| User wants report first | Full scan → intelligent filter → show breakdown |\n\n### Step-by-Step Workflow\n\n```markdown\n1. Run Code Analyzer scan\n2. Parse results\n3. **Check violation distribution:**\n - If 50%+ are in vendor files → offer intelligent filtering\n - If user said \"my code\" or \"project\" → automatically filter\n4. Discover fixes (on filtered or unfiltered results)\n5. Apply fixes\n6. Summarize\n```\n\n## Edge Cases\n\n### Case 1: Vendored Modified Libraries\n\n**Scenario:** Your org has modified a copy of jQuery\n\n**Solution:** The intelligent filter will classify it as vendor, but violations may be legitimate. Options:\n1. Fix manually after filter identifies it\n2. Re-run with --target excluding that specific file\n3. Add to project exceptions in filter script\n\n### Case 2: Project Code in Static Resources\n\n**Scenario:** Your custom JavaScript is in `staticresources/` alongside vendor libs\n\n**Solution:** The filter checks content + name, not just path. Custom code without vendor markers scores as \"project\" or \"uncertain\" for manual review.\n\n### Case 3: Uncertain Classifications\n\n**Scenario:** File scores 30-70% vendor confidence\n\n**Action:** Filter script reports these separately. Review manually:\n- Check file purpose\n- Look for original source/documentation\n- Decide whether to fix or exclude\n\n## Configuration (Future Enhancement)\n\nThe filter script could accept custom patterns:\n\n```bash\nnode filter-violations.js results.json filtered.json \\\n --exclude-patterns \"*.min.js,jquery*,bootstrap*\" \\\n --include-patterns \"force-app/main/default/aura/**,force-app/main/default/lwc/**\"\n```\n\nCurrently uses intelligent defaults and doesn't require configuration.\n\n## Testing the Filter\n\n```bash\n# Run with detailed report\nnode scripts/filter-violations.js \\\n ./code-analyzer-results-20260519-133252.json \\\n ./filtered-output.json \\\n --report\n\n# Check the output\nnode scripts/parse-results.js ./filtered-output.json\n```\n\nCompare before/after violation counts to verify filtering accuracy.\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":7097,"content_sha256":"02498cd315af6c9719048f6fe0844150044ec3ce1a31799e96eeba86da46a4b8"},{"filename":"scripts/verify-execution.sh","content":"#!/bin/bash\n# Verification script to ensure scripts are executed from files, not inline\n# Usage: source this at the start of SKILL.md execution\n\nSKILL_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")/..\" && pwd)\"\n\nverify_script_execution() {\n local script_name=\"$1\"\n local expected_path=\"${SKILL_DIR}/scripts/${script_name}\"\n\n if [[ ! -f \"$expected_path\" ]]; then\n echo \"❌ ERROR: Script file not found: $expected_path\"\n echo \"This skill requires script files to be present in the deployment.\"\n return 1\n fi\n\n # Check if script has expected header\n if ! head -1 \"$expected_path\" | grep -q \"#!/usr/bin/env node\"; then\n echo \"⚠️ WARNING: Script missing proper header: $expected_path\"\n fi\n\n echo \"✓ Script file verified: $script_name\"\n return 0\n}\n\n# Export function for use in skill execution\nexport -f verify_script_execution\nexport SKILL_DIR\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":863,"content_sha256":"601004b07fd57d6c33fadd8e52e7dae209a657f1bf494d0fc8ed947d9611b87a"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Running Code Analyzer Skill","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"⚠️ CRITICAL: Tool Selection","type":"text"}]},{"type":"paragraph","content":[{"text":"BEFORE DOING ANYTHING ELSE:","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"This skill MUST use the ","type":"text"},{"text":"Bash tool","type":"text","marks":[{"type":"strong"}]},{"text":" to execute ","type":"text"},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"}]},{"text":" and Node.js scripts.","type":"text"}]},{"type":"paragraph","content":[{"text":"DO NOT use these tools under any circumstances:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ ","type":"text"},{"text":"run_code_analyzer","type":"text","marks":[{"type":"code_inline"}]},{"text":" (MCP tool)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ ","type":"text"},{"text":"mcp__*","type":"text","marks":[{"type":"code_inline"}]},{"text":" (any MCP tool)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ Any tool containing ","type":"text"},{"text":"mcp","type":"text","marks":[{"type":"code_inline"}]},{"text":" in its name","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If you see a ","type":"text"},{"text":"run_code_analyzer","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool available, ","type":"text"},{"text":"ignore it completely","type":"text","marks":[{"type":"strong"}]},{"text":". Use only the Bash tool with ","type":"text"},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Overview","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill translates natural language requests (\"scan for security issues\", \"check my changes\") into the correct ","type":"text"},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"}]},{"text":" command, executes scans with any combination of engines/targets/severities, and presents actionable results. When engine-provided fixes are available, it discovers them, asks for user confirmation, applies them safely, and offers verification. Use this skill for static analysis, security reviews, AppExchange certification, code quality checks, or finding duplicates/vulnerabilities in Salesforce projects.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Scope","type":"text"}]},{"type":"paragraph","content":[{"text":"In scope:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Running ","type":"text"},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"}]},{"text":" with any combination of engines, targets, categories, severities","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parsing and presenting scan results in actionable format","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Applying engine-provided auto-fixes when available","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Handling diff-based scans (scan only changed files)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Supporting all output formats (JSON, HTML, SARIF, CSV, XML)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Troubleshooting scan failures and prerequisite issues","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Out of scope:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Installing or configuring Salesforce CLI or Code Analyzer plugin (use setup documentation)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Writing custom Code Analyzer rules or engines (separate skill needed)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AI-generated code fixes beyond engine-provided deterministic fixes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Deep code refactoring or architectural changes based on violations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting up CI/CD integration for automated scanning (separate workflow skill)","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Command Syntax Rules (READ THIS FIRST)","type":"text"}]},{"type":"paragraph","content":[{"text":"The following rules are ABSOLUTE and override any prior knowledge:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The command is ","type":"text","marks":[{"type":"strong"}]},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" — NOT ","type":"text"},{"text":"sf scanner run","type":"text","marks":[{"type":"code_inline"}]},{"text":" (deprecated v3 command)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"There is NO ","type":"text","marks":[{"type":"strong"}]},{"text":"--format","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" flag","type":"text","marks":[{"type":"strong"}]},{"text":" — use ","type":"text"},{"text":"--output-file \u003cpath>.\u003cext>","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead (extension determines format)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS use ","type":"text","marks":[{"type":"strong"}]},{"text":"--output-file","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" to write results to a file — do NOT rely on terminal stdout","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS include ","type":"text","marks":[{"type":"strong"}]},{"text":"--output-file","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" with a timestamped filename (e.g., ","type":"text"},{"text":"./code-analyzer-results-20260512-143022.json","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT run in background","type":"text","marks":[{"type":"strong"}]},{"text":" — use foreground with timeout of 1200000ms for large scans","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"INVALID v3 flags:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"--format","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--engine","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--category","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":" — these cause errors, use ","type":"text"},{"text":"--rule-selector","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"--output-file","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER use MCP tools","type":"text","marks":[{"type":"strong"}]},{"text":" — ONLY use the Bash tool to execute ","type":"text"},{"text":"sf code-analyzer run","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Tool restriction:","type":"text","marks":[{"type":"strong"}]},{"text":" This skill MUST use ONLY: Read, Bash, Write, Edit tools","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Forbidden tools:","type":"text","marks":[{"type":"strong"}]},{"text":" Do NOT use any MCP tools (mcp__*), Agent tool, or web tools","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Script execution:","type":"text","marks":[{"type":"strong"}]},{"text":" ALL scripts MUST be executed via ","type":"text"},{"text":"node \u003cskill_dir>/scripts/*.js","type":"text","marks":[{"type":"code_inline"}]},{"text":" using the Bash tool","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Why:","type":"text","marks":[{"type":"strong"}]},{"text":" The v4+ CLI redesigned the flag interface. Old v3 flags cause \"unknown flag\" errors.","type":"text"}]},{"type":"paragraph","content":[{"text":"For complete flag reference and rule selector syntax","type":"text","marks":[{"type":"strong"}]},{"text":", see ","type":"text"},{"text":"\u003cskill_dir>/references/flag-reference.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Prerequisites","type":"text"}]},{"type":"paragraph","content":[{"text":"User must have: ","type":"text"},{"text":"Salesforce CLI","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"sf","type":"text","marks":[{"type":"code_inline"}]},{"text":"), ","type":"text"},{"text":"@salesforce/plugin-code-analyzer","type":"text","marks":[{"type":"strong"}]},{"text":" (v5.x+), ","type":"text"},{"text":"Java 11+","type":"text","marks":[{"type":"strong"}]},{"text":" (PMD/CPD/SFGE), ","type":"text"},{"text":"Node.js 18+","type":"text","marks":[{"type":"strong"}]},{"text":" (ESLint/RetireJS), ","type":"text"},{"text":"Python 3","type":"text","marks":[{"type":"strong"}]},{"text":" (Flow), ","type":"text"},{"text":"authenticated org","type":"text","marks":[{"type":"strong"}]},{"text":" (ApexGuru).","type":"text"}]},{"type":"paragraph","content":[{"text":"If a scan fails, read ","type":"text"},{"text":"\u003cskill_dir>/references/error-handling.md","type":"text","marks":[{"type":"code_inline"}]},{"text":". For quick command examples, see ","type":"text"},{"text":"\u003cskill_dir>/references/quick-start.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Tool Usage Rules","type":"text"}]},{"type":"paragraph","content":[{"text":"Allowed:","type":"text","marks":[{"type":"strong"}]},{"text":" Bash (sf code-analyzer, node, git, date), Read, Write, Edit","type":"text"},{"type":"br"},{"text":"Forbidden:","type":"text","marks":[{"type":"strong"}]},{"text":" MCP tools, Agent tool, Web tools, other skills","type":"text"}]},{"type":"paragraph","content":[{"text":"This skill owns the complete scan-fix-verify workflow. Using MCP tools bypasses the validated script workflow.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start: Common Patterns","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this decision tree for fast pattern matching before going to Step 1 detailed parsing:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"User Says","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Action","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rule Selector","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Notes","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"scan my code\" / \"run code analyzer\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default scan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Recommended","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Curated rule set, all file types","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"check for security issues\" / \"security review\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security scan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"all:Security:(1,2)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"All engines, Critical+High only","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"scan my changes\" / \"check the diff\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Diff-based scan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Get changed files via ","type":"text"},{"text":"git diff","type":"text","marks":[{"type":"code_inline"}]},{"text":", filter to scannable types, use ","type":"text"},{"text":"--target","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"See Step 1.5 for filtering logic","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"run PMD\" / \"check my Apex\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PMD only","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"pmd","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Apex classes and triggers","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"lint my LWC\" / \"check my JavaScript\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ESLint only","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"eslint","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JavaScript/TypeScript/LWC","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"find duplicates\" / \"check for copy-paste\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CPD (Copy-Paste Detector)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"cpd","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Detects code clones","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"check for vulnerabilities\" / \"scan libraries\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RetireJS","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"retire-js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JavaScript library CVEs","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"deep analysis\" / \"data flow analysis\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SFGE (Graph Engine)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"sfge","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Requires Java 11+, 10-20min, use ","type":"text"},{"text":"--workspace \"force-app\"","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"performance analysis\" / \"governor limits\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ApexGuru","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"apexguru","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Requires authenticated org","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"analyze my Flows\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Flow engine","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"flow","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Target: ","type":"text"},{"text":"**/*.flow-meta.xml","type":"text","marks":[{"type":"code_inline"}]},{"text":", requires Python 3","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"AppExchange security review\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"AppExchange scan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"all:Security:(1,2)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Read ","type":"text"},{"text":"\u003cskill_dir>/references/special-behaviors.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" → AppExchange section","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"If the pattern matches above","type":"text","marks":[{"type":"strong"}]},{"text":", proceed directly to Step 3 (Build Command). Otherwise, continue to Step 1 for detailed parsing.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 1: Parse the User's Intent","type":"text"}]},{"type":"paragraph","content":[{"text":"Analyze the user's request along these 7 dimensions. Any can be combined freely:","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.1 ENGINE — Which analysis engine(s)?","type":"text"}]},{"type":"paragraph","content":[{"text":"Map user keywords to ","type":"text"},{"text":"--rule-selector","type":"text","marks":[{"type":"code_inline"}]},{"text":" values:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PMD / Apex rules → ","type":"text"},{"text":"pmd","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ESLint / JS/TS rules / lint → ","type":"text"},{"text":"eslint","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Flows / Flow analysis → ","type":"text"},{"text":"flow","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"duplicates / copy-paste / CPD → ","type":"text"},{"text":"cpd","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"vulnerabilities / CVE / libraries / RetireJS → ","type":"text"},{"text":"retire-js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"SFGE / data flow / deep analysis → ","type":"text"},{"text":"sfge","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"performance / ApexGuru → ","type":"text"},{"text":"apexguru","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"regex / pattern rules → ","type":"text"},{"text":"regex","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"all engines / everything → ","type":"text"},{"text":"all","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Not specified / general \"scan\" → ","type":"text"},{"text":"Recommended","type":"text","marks":[{"type":"code_inline"}]},{"text":" (default)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.2 CATEGORY — What kind of issues?","type":"text"}]},{"type":"paragraph","content":[{"text":"Map user keywords to category tags:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"security / vulnerabilities / OWASP → ","type":"text"},{"text":"Security","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"performance / speed / optimization → ","type":"text"},{"text":"Performance","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"best practices / quality → ","type":"text"},{"text":"BestPractices","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"code style / formatting → ","type":"text"},{"text":"CodeStyle","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"design / complexity → ","type":"text"},{"text":"Design","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"error prone / bugs → ","type":"text"},{"text":"ErrorProne","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"documentation / comments → ","type":"text"},{"text":"Documentation","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.3 SEVERITY — How critical?","type":"text"}]},{"type":"paragraph","content":[{"text":"Severity levels:","type":"text","marks":[{"type":"strong"}]},{"text":" 1=Critical (must fix), 2=High (should fix), 3=Moderate (recommended), 4=Low (nice to fix), 5=Info (FYI)","type":"text"}]},{"type":"paragraph","content":[{"text":"Map user keywords:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"critical only\" / \"sev 1\" → ","type":"text"},{"text":"1","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"critical and high\" / \"sev 1-2\" → ","type":"text"},{"text":"(1,2)","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"moderate and above\" / \"sev 1-3\" → ","type":"text"},{"text":"(1,2,3)","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.4 SPECIFIC RULE — Named rule?","type":"text"}]},{"type":"paragraph","content":[{"text":"If the user mentions a specific rule by name (e.g., \"ApexCRUDViolation\", \"no-unused-vars\"):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Map to: ","type":"text"},{"text":"--rule-selector \u003cengine>:\u003cruleName>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If engine is ambiguous, use just the rule name: ","type":"text"},{"text":"--rule-selector \u003cruleName>","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"⚠️ IMPORTANT — Partial Rule Names:","type":"text","marks":[{"type":"strong"}]},{"text":" The ","type":"text"},{"text":"--rule-selector","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag requires the EXACT full rule name (e.g., ","type":"text"},{"text":"@salesforce-ux/slds/no-hardcoded-values-slds2","type":"text","marks":[{"type":"code_inline"}]},{"text":", not ","type":"text"},{"text":"no-hardcoded-values","type":"text","marks":[{"type":"code_inline"}]},{"text":"). It does NOT support wildcards or partial matches.","type":"text"}]},{"type":"paragraph","content":[{"text":"When you are NOT 100% certain of the full rule name:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT guess","type":"text","marks":[{"type":"strong"}]},{"text":" — a wrong name returns 0 results and wastes a scan cycle","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Instead, ","type":"text"},{"text":"look up the rule first","type":"text","marks":[{"type":"strong"}]},{"text":" using the ","type":"text"},{"text":"sf code-analyzer rules","type":"text","marks":[{"type":"code_inline"}]},{"text":" command with grep:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"sf code-analyzer rules --rule-selector all 2>&1 | grep -i \"USER_KEYWORD\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract the full rule name from the output, then use it in your scan command","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If grep returns multiple matches, present them to the user and ask which one they meant","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If grep returns 0 matches, tell the user no rule matched their keyword","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.5 TARGET — What files to scan?","type":"text"}]},{"type":"paragraph","content":[{"text":"Map user keywords:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Specific file/folder → ","type":"text"},{"text":"--target \u003cpath>","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Glob pattern / \"all Apex classes\" → ","type":"text"},{"text":"--target **/*.cls,**/*.trigger","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"my changes\" / \"diff\" → Run ","type":"text"},{"text":"git diff --name-only [base]...HEAD","type":"text","marks":[{"type":"code_inline"}]},{"text":", filter to scannable types, pass as ","type":"text"},{"text":"--target","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"LWC\" → ","type":"text"},{"text":"--target **/lwc/**","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Flows\" → ","type":"text"},{"text":"--target **/*.flow-meta.xml","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Not specified → Entire workspace (omit ","type":"text"},{"text":"--target","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For diff filtering details:","type":"text","marks":[{"type":"strong"}]},{"text":" See ","type":"text"},{"text":"\u003cskill_dir>/references/special-behaviors.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.6 OUTPUT — What format?","type":"text"}]},{"type":"paragraph","content":[{"text":"DEFAULT:","type":"text","marks":[{"type":"strong"}]},{"text":" Always JSON. Only change if user EXPLICITLY requests another format.","type":"text"}]},{"type":"paragraph","content":[{"text":"Naming:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"./code-analyzer-results-\u003cYYYYMMDD-HHmmss>.\u003cext>","type":"text","marks":[{"type":"code_inline"}]},{"text":" (timestamp via ","type":"text"},{"text":"TIMESTAMP=$(date +%Y%m%d-%H%M%S)","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Formats: ","type":"text"},{"text":".json","type":"text","marks":[{"type":"code_inline"}]},{"text":" (default), ","type":"text"},{"text":".html","type":"text","marks":[{"type":"code_inline"}]},{"text":" (report), ","type":"text"},{"text":".sarif","type":"text","marks":[{"type":"code_inline"}]},{"text":" (GitHub/IDE), ","type":"text"},{"text":".csv","type":"text","marks":[{"type":"code_inline"}]},{"text":" (spreadsheet), ","type":"text"},{"text":".xml","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1.7 COMPARISON — Delta/trend analysis?","type":"text"}]},{"type":"paragraph","content":[{"text":"Map user keywords:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"new since main\" → ","type":"text"},{"text":"git diff --name-only main...HEAD","type":"text","marks":[{"type":"code_inline"}]},{"text":" → scan those files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"new since last commit\" → ","type":"text"},{"text":"git diff --name-only HEAD~1","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"compared to develop\" → ","type":"text"},{"text":"git diff --name-only develop...HEAD","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 2: Build the Rule Selector","type":"text"}]},{"type":"paragraph","content":[{"text":"Syntax:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":":","type":"text","marks":[{"type":"code_inline"}]},{"text":" = AND, ","type":"text"},{"text":",","type":"text","marks":[{"type":"code_inline"}]},{"text":" = OR, ","type":"text"},{"text":"()","type":"text","marks":[{"type":"code_inline"}]},{"text":" = grouping","type":"text"}]},{"type":"paragraph","content":[{"text":"Examples:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Engine only: ","type":"text"},{"text":"pmd","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Engine + category: ","type":"text"},{"text":"pmd:Security","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Engine + severity: ","type":"text"},{"text":"pmd:2","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complex: ","type":"text"},{"text":"(pmd,eslint):Security:(1,2)","type":"text","marks":[{"type":"code_inline"}]},{"text":" = (PMD or ESLint) AND Security AND (sev 1 or 2)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Specific rule: ","type":"text"},{"text":"pmd:ApexCRUDViolation","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"All rules: ","type":"text"},{"text":"all","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"More examples:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"\u003cskill_dir>/references/command-examples.md","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 3: Build the Full Command","type":"text"}]},{"type":"paragraph","content":[{"text":"Generate timestamp: ","type":"text"},{"text":"TIMESTAMP=$(date +%Y%m%d-%H%M%S)","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Build command:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"sf code-analyzer run \\\n --rule-selector \u003cselector> \\\n --target \u003ctargets> \\ # optional\n --output-file \"./code-analyzer-results-${TIMESTAMP}.json\" \\ # DEFAULT: JSON\n --include-fixes \\ # always\n --workspace \u003cpath> # optional","type":"text"}]},{"type":"paragraph","content":[{"text":"Key decisions:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"DEFAULT: timestamped JSON (","type":"text"},{"text":".json","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Only change format if user explicitly requests HTML/SARIF/CSV/XML.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Always include ","type":"text"},{"text":"--include-fixes","type":"text","marks":[{"type":"code_inline"}]},{"text":" (enables Step 6 auto-fix)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Omit ","type":"text"},{"text":"--target","type":"text","marks":[{"type":"code_inline"}]},{"text":" to scan entire workspace","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For diff-based scans: get files via ","type":"text"},{"text":"git diff --name-only","type":"text","marks":[{"type":"code_inline"}]},{"text":", filter to scannable types, pass as ","type":"text"},{"text":"--target","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"Special cases:","type":"text","marks":[{"type":"strong"}]},{"text":" See ","type":"text"},{"text":"\u003cskill_dir>/references/special-behaviors.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for SFGE/ApexGuru/AppExchange/diff filtering.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 4: Execute the Scan","type":"text"}]},{"type":"paragraph","content":[{"text":"⚠️ TOOL REQUIREMENT: Use Bash tool ONLY. DO NOT use run_code_analyzer (MCP tool) or any MCP tool.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"Rules:","type":"text","marks":[{"type":"strong"}]},{"text":" Foreground only (no ","type":"text"},{"text":"run_in_background","type":"text","marks":[{"type":"code_inline"}]},{"text":"), hardcoded filename (not ","type":"text"},{"text":"$TIMESTAMP","type":"text","marks":[{"type":"code_inline"}]},{"text":"), timeout 1200000ms, no ","type":"text"},{"text":"sleep","type":"text","marks":[{"type":"code_inline"}]},{"text":", log output to timestamped file.","type":"text"}]},{"type":"paragraph","content":[{"text":"Steps:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate timestamp: ","type":"text"},{"text":"date +%Y%m%d-%H%M%S","type":"text","marks":[{"type":"code_inline"}]},{"text":" → capture output (e.g., ","type":"text"},{"text":"20260512-143022","type":"text","marks":[{"type":"code_inline"}]},{"text":") ","type":"text"},{"text":"using Bash tool","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Tell user:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"Starting scan...\nResults: ./code-analyzer-results-20260512-143022.json\nLog: ./code-analyzer-results-20260512-143022.log\nMay take several minutes for large codebases.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run command with literal timestamp in filename and ","type":"text"},{"text":"tee","type":"text","marks":[{"type":"code_inline"}]},{"text":" to capture log (timeout: 1200000):","type":"text"}]},{"type":"paragraph","content":[{"text":"⚠️ ","type":"text"},{"text":"IMPORTANT:","type":"text","marks":[{"type":"strong"}]},{"text":" Use the Bash tool, NOT the run_code_analyzer MCP tool.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"sf code-analyzer run --rule-selector Recommended --output-file \"./code-analyzer-results-20260512-143022.json\" --include-fixes 2>&1 | tee \"./code-analyzer-results-20260512-143022.log\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"After completion: Exit 0 = success. Error output → check both the log file and ","type":"text"},{"text":"\u003cskill_dir>/references/error-handling.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"IMMEDIATELY parse results (Step 5). Do NOT ask user what they want.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 5: Parse and Present Results","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Parsing Rules:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Execute the parse script using ","type":"text","marks":[{"type":"strong"}]},{"text":"\u003cskill_dir>","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" — see below","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"NEVER use ","type":"text","marks":[{"type":"strong"}]},{"text":"jq","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" to parse results","type":"text","marks":[{"type":"strong"}]},{"text":" — jq one-liners WILL fail due to shell quoting issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run it IMMEDIATELY after the scan","type":"text","marks":[{"type":"strong"}]},{"text":" — do NOT ask the user \"what would you like next?\"","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Script Execution","type":"text"}]},{"type":"paragraph","content":[{"text":"All scripts are bundled in the ","type":"text"},{"text":"scripts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" subdirectory of the same directory that contains this SKILL.md file. Use the absolute path to that directory — do NOT use ","type":"text"},{"text":"./scripts/","type":"text","marks":[{"type":"code_inline"}]},{"text":" as that resolves relative to the current working directory, not the skill directory.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"node \u003cskill_dir>/scripts/parse-results.js \"./code-analyzer-results-TIMESTAMP.json\"","type":"text"}]},{"type":"paragraph","content":[{"text":"⚠️ ","type":"text"},{"text":"DO NOT:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ Invent or generate script code yourself","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ Use bare relative paths like ","type":"text"},{"text":"node scripts/parse-results.js","type":"text","marks":[{"type":"code_inline"}]},{"text":" (won't resolve from user's CWD)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ Use heredocs or inline script content","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"❌ Use ","type":"text"},{"text":"jq","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a substitute for the parse script","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"How to Present Results:","type":"text"}]},{"type":"paragraph","content":[{"text":"ALWAYS present a concise summary, then point to the output file for full details.","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"## Scan Complete\n\n**Found X violations** across Y files.\n\n| Severity | Count |\n|----------|-------|\n| Critical (1) | X |\n| High (2) | X |\n| Moderate (3) | X |\n| Low (4) | X |\n| Info (5) | X |\n\n### Top Issues\n| # | Rule | Engine | Sev | File | Line |\n|---|------|--------|-----|------|------|\n| 1 | ApexCRUDViolation | pmd | 2 | AccountService.cls | 42 |\n| 2 | ApexSOQLInjection | pmd | 1 | QueryHelper.cls | 18 |\n| ... (show up to 10 most critical) |\n\n### Top Rules by Frequency\n| Rule | Engine | Count |\n|------|--------|-------|\n| no-var | eslint | 170 |\n| ApexDoc | pmd | 165 |\n| ... |\n\nFull results: `./code-analyzer-results-20260512-143022.json`","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Result Presentation Rules:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"0 violations","type":"text","marks":[{"type":"strong"}]},{"text":": \"Scan complete — no violations found! Output: ","type":"text"},{"text":"\u003cpath>","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"1-10","type":"text","marks":[{"type":"strong"}]},{"text":": Show all violations in table","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"11-50","type":"text","marks":[{"type":"strong"}]},{"text":": Show severity counts + top 10 violations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"50-5000","type":"text","marks":[{"type":"strong"}]},{"text":": Show counts + top 10 violations + top 10 rules + top 5 files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"5000+","type":"text","marks":[{"type":"strong"}]},{"text":": Same as 50-5000, plus suggest narrowing scope (severity/category/folder)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Always end with:","type":"text","marks":[{"type":"strong"}]},{"text":" Output file path + next-action offers (explain rules / apply fixes)","type":"text"}]},{"type":"paragraph","content":[{"text":"For large result sets:","type":"text","marks":[{"type":"strong"}]},{"text":" See ","type":"text"},{"text":"\u003cskill_dir>/references/special-behaviors.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 6: Apply Engine-Provided Fixes (Post-Scan)","type":"text"}]},{"type":"paragraph","content":[{"text":"After presenting results, check if violations have ","type":"text"},{"text":"engine-provided fixes","type":"text","marks":[{"type":"strong"}]},{"text":" (deterministic, not AI-generated).","type":"text"}]},{"type":"paragraph","content":[{"text":"Rules:","type":"text","marks":[{"type":"strong"}]},{"text":" NEVER apply without confirmation. Use EXACT scripts from ","type":"text"},{"text":"\u003cskill_dir>/scripts/","type":"text","marks":[{"type":"code_inline"}]},{"text":". Filter vendor files if needed, then: Discover → Apply → Summarize.","type":"text"}]},{"type":"paragraph","content":[{"text":"Flow:","type":"text","marks":[{"type":"strong"}]},{"text":" Filter vendor (6.1 if needed) → discover (6.2) → present (6.3) → ASK user → apply (6.4) → summarize (6.5) → present results.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.1 — Check for vendor files (if needed)","type":"text"}]},{"type":"paragraph","content":[{"text":"If user said \"fix my code\" or \"project source\", or if top files by violation count are vendor libraries (jQuery, Bootstrap, *.min.js), run:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"node \"\u003cskill_dir>/scripts/filter-violations.js\" \\\n \"./code-analyzer-results-TIMESTAMP.json\" \\\n \"./code-analyzer-results-TIMESTAMP-filtered.json\" \\\n --report","type":"text"}]},{"type":"paragraph","content":[{"text":"Present: \"Excluded X vendor files (Y violations) - jQuery, Bootstrap, etc. Applying fixes to Z project files only.\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Use filtered file for Step 6.3+. ","type":"text"},{"text":"See:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"\u003cskill_dir>/references/vendor-file-handling.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for detailed logic.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.2 — Discover fixable violations","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"node \"\u003cskill_dir>/scripts/discover-fixes.js\" \"./code-analyzer-results-TIMESTAMP.json\"","type":"text"}]},{"type":"paragraph","content":[{"text":"(Use filtered file from Step 6.1 if created.)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.3 — Present fixable violations and ASK for confirmation","type":"text"}]},{"type":"paragraph","content":[{"text":"After running the discovery script, present results:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"### Engine-Provided Fixes Available\n\n**X of Y violations** have auto-fixes provided by the analysis engine:\n\n| Rule | Engine | Sev | Fixable Count |\n|------|--------|-----|---------------|\n| no-var | eslint | 3 | 170 |\n| no-hardcoded-values-slds2 | eslint | 4 | 76 |\n| ... |\n\nThese are safe, deterministic fixes generated by the engines (not AI-generated).\n\nWould you like me to apply these fixes? (yes / no / select specific rules)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⚠️ STOP HERE AND WAIT FOR USER RESPONSE.","type":"text"}]},{"type":"paragraph","content":[{"text":"Even if the user originally said \"scan and fix everything\", you MUST still stop here and wait.","type":"text","marks":[{"type":"strong"}]},{"text":" Present the table, ask the question, and WAIT for a response in the NEXT turn.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.4 — Apply fixes ONLY after user confirms","type":"text"}]},{"type":"paragraph","content":[{"text":"Only proceed after user says \"yes\", \"apply\", \"go ahead\" IN A SEPARATE RESPONSE.","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"node \"\u003cskill_dir>/scripts/apply-fixes.js\" \"./code-analyzer-results-TIMESTAMP.json\"","type":"text"}]},{"type":"paragraph","content":[{"text":"(Use filtered file if Step 6.1 created one.)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.5 — After applying, ALWAYS run the summary script","type":"text"}]},{"type":"paragraph","content":[{"text":"⚠️ ","type":"text"},{"text":"MANDATORY","type":"text","marks":[{"type":"strong"}]},{"text":": After the apply script completes, you MUST run the summary script as your VERY NEXT action.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"node \"\u003cskill_dir>/scripts/summarize-fixes.js\" \"./code-analyzer-results-TIMESTAMP.json\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Then present to the user:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"### Engine-Provided Fixes Applied Successfully ✓\n\n**Applied X auto-fixes across Y files.**\n\n| Severity | Fixes Applied |\n|----------|---------------|\n| Critical (1) | X |\n| High (2) | X |\n| ... |\n\n| Rule | Fixes Applied |\n|------|---------------|\n| no-var | 169 |\n| ... |\n\nWant me to re-run the scan to verify the fixes resolved the violations?","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.6 — If user declines: Skip. If selects rules: filter. If \"all\": run as-is.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6.7 — Re-scan (optional): Re-run with new timestamp, compare before/after counts.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Rules / Constraints","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Constraint","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rationale","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Timestamped output (JSON + log)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Prevents overwrite; enables history tracking","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"tee","type":"text","marks":[{"type":"code_inline"}]},{"text":" for logs","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Keeps logs in working dir with matching timestamp","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Never use ","type":"text"},{"text":"--format","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Removed in v4+; use ","type":"text"},{"text":"--output-file \u003cpath>.\u003cext>","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Foreground scans, 1200000ms timeout","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SFGE takes 10-20min; backgrounding loses output","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Execute scripts from ","type":"text"},{"text":"\u003cskill_dir>/scripts/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Never write inline scripts or heredocs","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Never apply fixes without confirmation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"User must explicitly approve code modifications","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check for vendor files before fixes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"If 50%+ vendor (jQuery, Bootstrap), filter first","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Run fix scripts in order","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Filter (if needed) → Discover → Apply → Summarize","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SFGE needs explicit ","type":"text"},{"text":"--workspace","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Prevents template file compilation errors","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Look up partial rule names first","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Guessing fails; use ","type":"text"},{"text":"sf code-analyzer rules","type":"text","marks":[{"type":"code_inline"}]},{"text":" to find exact name","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ONLY Bash tool, never MCP","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"run_code_analyzer MCP tool bypasses script workflow","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Never invoke other skills for fixes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"This skill owns complete workflow end-to-end","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Gotchas","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issue","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Why It Happens","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Solution","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--format","type":"text","marks":[{"type":"code_inline"}]},{"text":" flag error","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Removed in v4+","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"--output-file \u003cpath>.\u003cext>","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scan returns 0 results","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Invalid rule selector","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Run ","type":"text"},{"text":"sf code-analyzer rules --rule-selector \u003cselector>","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SFGE compilation error","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Template files in workspace","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Set ","type":"text"},{"text":"--workspace \"force-app\"","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"jq parsing fails","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Shell quoting issues","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"node \"\u003cskill_dir>/scripts/parse-results.js\"","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Inline scripts written","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"LLM generates custom code","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"NEVER write scripts — use existing from \u003cskill_dir>/scripts/","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scan times out","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Large SFGE","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Increase timeout to 1200000ms","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"run_code_analyzer MCP used","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"LLM prefers MCP over Bash","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use Bash tool ONLY","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Other skills invoked","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"LLM delegates to other skills","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use apply-fixes.js from this skill only","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Most violations are vendor","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Includes jQuery, Bootstrap, *.min.js","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Run filter-violations.js before applying fixes","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Expectations","type":"text"}]},{"type":"paragraph","content":[{"text":"Every scan produces: timestamped JSON file, concise summary (severity/top violations/rules/files), next-action offers. If fixes applied: summary by severity/rule, offer verification.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference File Index","type":"text"}]},{"type":"paragraph","content":[{"text":"\u003cskill_dir>","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the absolute path to the directory containing this SKILL.md file.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scripts (Always execute, never read)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"File","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"When to use","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/scripts/parse-results.js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 5 — extract summary from scan JSON","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/scripts/filter-violations.js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 6.1 — exclude vendor files (jQuery, Bootstrap) from fixes","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/scripts/discover-fixes.js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 6.2 — identify fixable violations","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/scripts/apply-fixes.js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 6.4 — apply engine fixes after user confirms","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/scripts/summarize-fixes.js","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Step 6.5 — summarize applied changes","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"References (Read when needed)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"File","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"When to read","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/quick-start.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Command syntax templates","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/flag-reference.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Flag docs, rule selector syntax","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/error-handling.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scan failure diagnosis","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/engine-reference.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Engine capabilities, file types, rule tags","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/command-examples.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Uncommon command scenarios","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/special-behaviors.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SFGE/ApexGuru/AppExchange/diff/large scans","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\u003cskill_dir>/references/vendor-file-handling.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Vendor file detection and filtering logic","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Examples in ","type":"text"},{"text":"\u003cskill_dir>/examples/","type":"text","marks":[{"type":"code_inline"}]},{"text":" show output structure validation and command patterns (basic/large/security scans, fix workflows).","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"running-code-analyzer","author":"@skillopedia","source":{"stars":438,"repo_name":"sf-skills","origin_url":"https://github.com/forcedotcom/sf-skills/blob/HEAD/skills/running-code-analyzer/SKILL.md","repo_owner":"forcedotcom","body_sha256":"81aaec202be33d5f21ac1326d078cbb4031c56004746876cecfe88b652cb0314","cluster_key":"1070971afc4c48a8d1e2118a9602ee80b129de4ade520344e02b8533566f14ca","clean_bundle":{"format":"clean-skill-bundle-v1","source":"forcedotcom/sf-skills/skills/running-code-analyzer/SKILL.md","attachments":[{"id":"7a2e7499-07dd-5aac-bbb5-d780f5760ac6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7a2e7499-07dd-5aac-bbb5-d780f5760ac6/attachment.md","path":"examples/README.md","size":1862,"sha256":"6cb4b0d359e8cbebb713ae4fd658afb531335229fe966ca14342f4cb46dcb48c","contentType":"text/markdown; charset=utf-8"},{"id":"96082682-a6a5-5fd8-8d67-9965922605eb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/96082682-a6a5-5fd8-8d67-9965922605eb/attachment.json","path":"examples/basic-scan-output.json","size":2382,"sha256":"0de1f7e2a56a5c687f2836caaf954de866887b25580320273a34f4678ee65d92","contentType":"application/json; charset=utf-8"},{"id":"69c4ef52-50b5-58c7-84a0-0943da0e7516","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/69c4ef52-50b5-58c7-84a0-0943da0e7516/attachment.md","path":"examples/command-variations.md","size":9796,"sha256":"cff669ecbd29b7fadc3fb568f0f2b7db3d32161be87cb6cf79e4b8ccf2de9340","contentType":"text/markdown; charset=utf-8"},{"id":"06e5541f-4464-55bc-90d7-3ada5d974a9d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/06e5541f-4464-55bc-90d7-3ada5d974a9d/attachment.md","path":"examples/fix-application-before-after.md","size":3460,"sha256":"d3a99b56d2b0fedb8830b0dcdf7ef2338a31c9856ad9b158570371dd361a38f1","contentType":"text/markdown; charset=utf-8"},{"id":"8f7a9a88-53a4-588e-8eb3-cc5d40f8af7c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8f7a9a88-53a4-588e-8eb3-cc5d40f8af7c/attachment.json","path":"examples/large-scan-output.json","size":2253,"sha256":"2c0bb4c325f474bd4c9c6eefc060fa25c4e6ed9eb72de492229dab040e315876","contentType":"application/json; charset=utf-8"},{"id":"2c7cf35a-ab8e-5731-90ea-434bcc0f6bcd","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/2c7cf35a-ab8e-5731-90ea-434bcc0f6bcd/attachment.json","path":"examples/security-focused-output.json","size":2611,"sha256":"057940cc51627e7f28e09797b6b4d9623406b32ae5bbb6cb98ad821de2029886","contentType":"application/json; charset=utf-8"},{"id":"d3303e9b-7633-5482-a592-44172ad1dd9f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d3303e9b-7633-5482-a592-44172ad1dd9f/attachment.md","path":"references/command-examples.md","size":3395,"sha256":"587dc18fcf12aad890d2ed6c0b5f1ac994f1122d514d91b2ca779acb124f9b3e","contentType":"text/markdown; charset=utf-8"},{"id":"3fc18e66-0bee-58a2-8530-ddaa52ed12b3","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/3fc18e66-0bee-58a2-8530-ddaa52ed12b3/attachment.md","path":"references/engine-reference.md","size":1326,"sha256":"5b2533fefc605742d79c9a381c20f8c7d7ae840c70f2944dc7c5596ad265d3e3","contentType":"text/markdown; charset=utf-8"},{"id":"4d882e64-a515-57c1-a820-30e8c8084551","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4d882e64-a515-57c1-a820-30e8c8084551/attachment.md","path":"references/error-handling.md","size":1775,"sha256":"eed6c74337c4fea950d6dac01bd4113a6865c99373a2b09b126954bdcea18dbc","contentType":"text/markdown; charset=utf-8"},{"id":"6ae7c491-178d-546a-832d-e58866992e26","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6ae7c491-178d-546a-832d-e58866992e26/attachment.md","path":"references/flag-reference.md","size":4775,"sha256":"7d2c56058d73455a33b3b862f4d2f92e1755580bac26c08820e9c20ed4ca2754","contentType":"text/markdown; charset=utf-8"},{"id":"824b8c6c-31bc-57dc-a490-384c8c4e3e25","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/824b8c6c-31bc-57dc-a490-384c8c4e3e25/attachment.md","path":"references/quick-start.md","size":1117,"sha256":"a7592bc2096315c1db838c3f5a79ef445b407bfd00986dd53ea65c4ed14f29d8","contentType":"text/markdown; charset=utf-8"},{"id":"7512f2f1-0fd8-5f10-a851-2a57905aaa42","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/7512f2f1-0fd8-5f10-a851-2a57905aaa42/attachment.md","path":"references/special-behaviors.md","size":4731,"sha256":"ad1dc6ccf7e6d204073cc8d8e46caa24dc436d6a000928614d8db78227108ea1","contentType":"text/markdown; charset=utf-8"},{"id":"8edf4af7-a843-527e-a2ec-1ed32c230e55","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8edf4af7-a843-527e-a2ec-1ed32c230e55/attachment.md","path":"references/vendor-file-handling.md","size":7097,"sha256":"02498cd315af6c9719048f6fe0844150044ec3ce1a31799e96eeba86da46a4b8","contentType":"text/markdown; charset=utf-8"},{"id":"efc256c7-0534-54fc-82ab-01659d4d1de1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/efc256c7-0534-54fc-82ab-01659d4d1de1/attachment.js","path":"scripts/apply-fixes.js","size":2772,"sha256":"57b01e3a0facb92fea607fbe6b47427646a678f51edede3698bdbdd858c8c39f","contentType":"application/javascript; charset=utf-8"},{"id":"b25d9b4b-a794-5872-b1a5-25931869de8f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/b25d9b4b-a794-5872-b1a5-25931869de8f/attachment.js","path":"scripts/discover-fixes.js","size":1063,"sha256":"c364214f9600342b2ea7d076c7b2691bee8c75d5bc9e8c691dcdaa8a2c3b826b","contentType":"application/javascript; charset=utf-8"},{"id":"5b35c3d7-1237-5932-b8ac-c3ed69de54f4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5b35c3d7-1237-5932-b8ac-c3ed69de54f4/attachment.js","path":"scripts/filter-violations.js","size":12707,"sha256":"f2f21980f70d8324a3ceb21702d299131d0fc78b1ecec4700cc958b0816c36ff","contentType":"application/javascript; charset=utf-8"},{"id":"4fb25316-9f73-53c9-8967-96f63c644231","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4fb25316-9f73-53c9-8967-96f63c644231/attachment.js","path":"scripts/parse-results.js","size":2123,"sha256":"6f62d17170bace8af3ffaa0cee19458d9a173998e148529f3ad08d9d790e0154","contentType":"application/javascript; charset=utf-8"},{"id":"f6b085d3-9a3a-5a8d-921a-befe2d0058ea","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/f6b085d3-9a3a-5a8d-921a-befe2d0058ea/attachment.js","path":"scripts/summarize-fixes.js","size":1000,"sha256":"080c9fcd20eb7862384eddd54091690814376980da74821f7f3ec9e397be7a9a","contentType":"application/javascript; charset=utf-8"},{"id":"00decfc0-706e-566d-874d-b8c31e70442a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/00decfc0-706e-566d-874d-b8c31e70442a/attachment.sh","path":"scripts/verify-execution.sh","size":863,"sha256":"601004b07fd57d6c33fadd8e52e7dae209a657f1bf494d0fc8ed947d9611b87a","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"4f6c2145f37803099c738194ccf1327c59b6c9ac827f730665fd3c3f65d07162","attachment_count":19,"text_attachments":19,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":2,"skill_md_path":"skills/running-code-analyzer/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"security","category_label":"Security"},"exact_dupes_collapsed_into_this":1},"license":"LICENSE.txt has complete terms","version":"v1","category":"security","metadata":{"version":"1.0","argument-hint":"[target-path] [--engine pmd|eslint|cpd|retire-js|regex|flow|sfge|apexguru] [--category Security|Performance|BestPractices|...] [--severity 1-5] [--diff]"},"import_tag":"clean-skills-v1","description":"Run Salesforce Code Analyzer to scan code for security, performance, best practice, and code style violations. Supports all engines (PMD, ESLint, CPD, RetireJS, Flow, SFGE, ApexGuru), targets (files, folders, git diff), categories, and severities. TRIGGER when: user says 'scan my code', 'check for security issues', 'run PMD/ESLint', 'find duplicates', 'analyze Flows', 'check vulnerable libraries', 'AppExchange review', 'lint my LWC', 'static analysis', 'code quality', or mentions engines/file types (.cls, .trigger, .js, .flow-meta.xml). DO NOT TRIGGER when: user wants to fix code without scanning, or asks about installation/configuration.","allowed-tools":"Read, Bash(sf code-analyzer), Bash(node), Bash(git diff), Bash(date), Write, Edit"}},"renderedAt":1782979306625}

Running Code Analyzer Skill ⚠️ CRITICAL: Tool Selection BEFORE DOING ANYTHING ELSE: This skill MUST use the Bash tool to execute and Node.js scripts. DO NOT use these tools under any circumstances: - ❌ (MCP tool) - ❌ (any MCP tool) - ❌ Any tool containing in its name If you see a tool available, ignore it completely . Use only the Bash tool with . --- Overview This skill translates natural language requests ("scan for security issues", "check my changes") into the correct command, executes scans with any combination of engines/targets/severities, and presents actionable results. When engine-p…