Skip to content

forcedotcom/sf-skills / plugins/builder/salesforce-development/skills/platform-apex-logs-debug

platform-apex-logs-debug

Verified

Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).

references/common-issues.md

View on GitHub
# Common Debug Log Issues

## SOQL in loop

**Signals**
- repeating `SOQL_EXECUTE_BEGIN`
- query appears inside repeated method path

**Fix pattern**
- query once outside the loop
- use `Map<Id, SObject>` or grouped collections

## DML in loop

**Signals**
- repeated `DML_BEGIN`
- high DML statement count for small transactions

**Fix pattern**
- collect changes
- do one bulk DML operation

## Non-selective query

**Signals**
- high rows scanned
- slow query timing
- table-scan indicators

**Fix pattern**
- add indexed filters
- reduce scope
- use query-plan guidance

## CPU pressure

**Signals**
- CPU usage trending toward sync limit
- repeated expensive helper methods
- nested loops / repeated string work

**Fix pattern**
- reduce algorithmic complexity
- cache repeated work
- move heavy processing async where appropriate

## Heap pressure

**Signals**
- large collection allocations
- heap usage approaching sync limit

**Fix pattern**
- use SOQL for-loops
- reduce in-memory object size
- clear collections when done

## Null pointer / unhandled exceptions

**Signals**
- `EXCEPTION_THROWN`
- `FATAL_ERROR`
- clear stack trace with line numbers

**Fix pattern**
- guard null values
- make assumptions explicit
- improve result handling for empty query results
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall