sf-debugging

Diagnose Salesforce runtime errors and analyze debug logs.

13|2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-debugging
Source: https://github.com/jiten-singh-shahi/salesforce-claude-code/tree/main/.cursor/skills/sf-debugging
Command: npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill sf-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers rapidly diagnose runtime failures across the Salesforce platform by guiding log capture, interpretation, and targeted remediation steps to resolve Apex exceptions, governor limit breaches, Flow faults, LWC errors, and failing integrations.

Core Features & Use Cases

  • Debug log capture & streaming: Steps for streaming and retrieving debug logs via the Salesforce CLI, Developer Console, and Setup UI.
  • Performance and SOQL analysis: Guidance on reading SOQL query plans, identifying CPU and SOQL hotspots, and optimizing queries or indexing choices.
  • Apex and Flow troubleshooting: Replay debugging, anonymous Apex techniques, checkpoint heap inspection, and Flow debug/run-as workflows with rollback options.
  • LWC and integration diagnostics: Browser devtools practices, Lightning debug mode, callout payload logging, and inspecting request/response entries in logs.
  • Use case: Reproduce an intermittent System.LimitException, stream the debug log, locate the offending SOQL/DML pattern, and recommend code or design fixes.

Quick Start

Use the sf-debugging skill to stream debug logs from my org, analyze the log for slow SOQL or DML operations, and provide a prioritized list of fixes.

Frequently Asked Questions about sf-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze Salesforce debug logs for SOQL and CPU hotspots?

To analyze Salesforce debug logs, capture the log via Salesforce CLI or Developer Console, then inspect the log execution tree to identify SOQL query plan inefficiencies and CPU hotspots. This allows you to pinpoint slow queries and optimize indexing choices to improve performance.

What is the best way to troubleshoot a Flow failure and debug execution in Salesforce?

The best way to troubleshoot a Flow failure is to use the Flow debug execution feature with run-as workflows and rollback options. This allows you to replay the execution, inspect checkpoint heaps, and identify the exact fault element causing the runtime error.

How do I diagnose Apex exceptions and System.LimitException governor limit breaches?

To diagnose Apex exceptions and governor limit breaches, stream the debug log from your org and trace the execution timeline to locate the offending SOQL or DML pattern. This reveals the specific code block exceeding limits so you can apply targeted remediation steps.

Can I use anonymous Apex to replay debug and troubleshoot LWC JavaScript errors?

Yes, you can use anonymous Apex for replay debugging and checkpoint heap inspection, while enabling Lightning debug mode and browser devtools practices for LWC JavaScript errors. This combination isolates component state issues and backend data discrepancies.

Why does my Salesforce integration callout fail and how do I inspect the payload?

Salesforce integration callouts fail due to endpoint misconfigurations or payload mismatches, which you can investigate by inspecting request and response entries in the debug logs. Callout payload logging reveals the exact HTTP transaction details to resolve the failure.

What are the limitations of using Developer Console for log capture versus Salesforce CLI?

Developer Console limitations include shorter log truncation limits and manual refresh requirements compared to Salesforce CLI, which supports direct log streaming and retrieval. Using CLI provides a more robust method for capturing large logs needed for deep governor limit investigations.