Agent skill

Platform Apex Logs Debug

by forcedotcom in forcedotcom/sf-skills

Salesforce debug log analysis and troubleshooting with 100-point scoring.

Apache-2.0Auto-check passedSales & Support

Install Platform Apex Logs Debug

skills CLI
$ npx skills add forcedotcom/sf-skills --skill platform-apex-logs-debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills platform-apex-logs-debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/platform-apex-logs-debug .claude/skills/platform-apex-logs-debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
platform-apex-logs-debug
GitHub stars
1.1k
Token cost
~1.9k tokens
SKILL.md length
769 words
Files
14 (incl. references, assets)
Skills in repo
248
Repo updated
First seen
Licence
Apache-2.0

At a glance

Salesforce debug log analysis and troubleshooting with 100-point scoring.

  • Works in 4 steps: Retrieve logs → Analyze in this order → Classify severity → …
  • : user analyzes debug logs
  • SKILL.md covers When This Skill Owns the Task, Required Context to Gather First, Recommended Workflow and High-Signal Issue Patterns, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Platform Apex Logs Debug is an agent skill from forcedotcom/sf-skills. 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).

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including reference files and assets (for example `README.md`, `references/analysis-playbook.md` and `references/benchmarking-guide.md`).

It sits in Sales & Support, covering Debugging and CRM management. It works with Salesforce. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • : user analyzes debug logs
  • Hits governor limits
  • Reads stack traces
  • Touches .log files from Salesforce orgs

Example prompts

  • “/platform-apex-logs-debug”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Retrieve logs
  2. Analyze in this order
  3. Classify severity
  4. Recommend the smallest correct fix

What it can do on your machine

Read from SKILL.md and the folder at commit 3c15867. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Platform Apex Logs Debug loads about 1.9k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 769 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit 3c15867, republished under its Apache-2.0 licence (© forcedotcom). 769 words, ~1,940 tokens.

Download SKILL.mdSave it as .claude/skills/platform-apex-logs-debug/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
platform-apex-logs-debug
description
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).
metadata.version
1.1
metadata.domains
Platform
metadata.relatedSkills
agentforce-observe, platform-apex-generate, platform-apex-test-run, platform-data-manage, platform-metadata-deploy, platform-soql-query

platform-apex-logs-debug: Salesforce Debug Log Analysis & Troubleshooting

Use this skill when the user needs root-cause analysis from debug logs: governor-limit diagnosis, stack-trace interpretation, slow-query investigation, heap / CPU pressure analysis, or a reproduction-to-fix loop based on log evidence.

When This Skill Owns the Task

Use platform-apex-logs-debug when the work involves:

  • .log files from Salesforce
  • stack traces and exception analysis
  • governor limits
  • SOQL / DML / CPU / heap troubleshooting
  • query-plan or performance evidence extracted from logs

Delegate elsewhere when the user is:


Required Context to Gather First

Ask for or infer:

  • org alias
  • failing transaction / user flow / test name
  • approximate timestamp or transaction window
  • user / record / request ID if known
  • whether the goal is diagnosis only or diagnosis + fix loop

1. Retrieve logs

Use the commands in references/cli-commands.md to list, download, or stream logs for the target org.

2. Analyze in this order
  1. entry point and transaction type
  2. exceptions / fatal errors
  3. governor limits
  4. repeated SOQL / DML patterns
  5. CPU / heap hotspots
  6. callout timing and external failures
3. Classify severity
  • Critical — runtime failure, hard limit, corruption risk
  • Warning — near-limit, non-selective query, slow path
  • Info — optimization opportunity or hygiene issue
4. Recommend the smallest correct fix

Prefer fixes that are:

  • root-cause oriented
  • bulk-safe
  • testable
  • easy to verify with a rerun

Expanded workflow: references/analysis-playbook.md


High-Signal Issue Patterns

IssuePrimary signalDefault fix direction
SOQL in looprepeating SOQL_EXECUTE_BEGIN in a repeated call pathquery once, use maps / grouped collections
DML in looprepeated DML_BEGIN patternscollect rows, bulk DML once
Non-selective queryhigh rows scanned / poor selectivityadd indexed filters, reduce scope
CPU pressureCPU usage approaching sync limitreduce algorithmic complexity, cache, async where valid
Heap pressureheap usage approaching sync limitstream with SOQL for-loops, reduce in-memory data
Null pointer / fatal errorEXCEPTION_THROWN / FATAL_ERRORguard null assumptions, fix empty-query handling

Expanded examples: references/common-issues.md


Output Format

When finishing analysis, report in this order:

  1. What failed
  2. Where it failed (class / method / line / transaction stage)
  3. Why it failed (root cause, not just symptom)
  4. How severe it is
  5. Recommended fix
  6. Verification step

Suggested shape:

text
Issue: <summary>
Location: <class / line / transaction>
Root cause: <explanation>
Severity: Critical | Warning | Info
Fix: <specific action>
Verify: <test or rerun step>

Rules / Constraints

RuleRationale
Always base fix recommendations on log evidenceAvoid speculative diagnosis — root cause must be traceable in the log
Report all six output fields for every issue foundEnsures actionable, complete findings for each problem
Classify every finding as Critical, Warning, or InfoHelps the user prioritize which issues to address first
Delegate code generation to platform-apex-generateThis skill diagnoses; it does not rewrite Apex code
Delegate test execution to platform-apex-test-runThis skill does not run or repair test classes
Never assume limits are safe without reading LIMIT_USAGE eventsLimits may be consumed by earlier operations not visible in the failure point

Show full SKILL.md (297 more words)Show less

Gotchas

PitfallResolution
Log truncated at 2 MBReduce debug levels (e.g., ApexCode: INFO, ApexProfiling: FINE) and re-capture
Same issue appears as both SOQL and CPU problemFix SOQL-in-loop first — it typically drives the CPU spike as a secondary effect
No logs appear after trace flag is setVerify the trace flag ExpirationDate is in the future and the correct user is traced
Async context changes limit valuesCPU limit is 60,000 ms async vs 10,000 ms sync — check transaction type before flagging limits
Stack trace points to framework line, not user codeWalk up the call stack past trigger handlers to find the originating user code

Cross-Skill Integration

NeedDelegate toReason
Implement Apex fixplatform-apex-generatecode change generation / review
Reproduce via testsplatform-apex-test-runtest execution and coverage loop
Deploy fixplatform-metadata-deploydeployment orchestration
Create debugging dataplatform-data-managetargeted seed / repro data

Reference File Index

FileWhen to read
references/analysis-playbook.mdStart here — expanded step-by-step workflow for any debugging session
references/common-issues.mdQuick lookup for SOQL in loop, DML in loop, CPU/heap pressure, null pointer patterns
references/cli-commands.mdSF CLI commands for retrieving, streaming, and managing debug logs
references/debug-log-reference.mdFull event type catalog, log levels, and governor limit reference values
references/log-analysis-tools.mdTool guide: Apex Log Analyzer, Developer Console, CLI grep patterns
references/benchmarking-guide.mdPerformance benchmarking techniques, benchmark data, and anti-patterns
references/scoring-rubric.md100-point scoring rubric for evaluating analysis quality
assets/benchmarking-template.clsCopy-paste Anonymous Apex template for running performance benchmarks
assets/cpu-heap-optimization.clsApex patterns for reducing CPU time and heap allocation
assets/dml-in-loop-fix.clsBefore/after example for resolving DML-in-loop violations
assets/soql-in-loop-fix.clsBefore/after example for resolving SOQL-in-loop violations
assets/null-pointer-fix.clsPatterns for guarding against null pointer exceptions

Score Guide

ScoreMeaning
90+Expert analysis with strong fix guidance
80–89Good analysis with minor gaps
70–79Acceptable but may miss secondary issues
60–69Partial diagnosis only
< 60Incomplete analysis

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (references, assets) in skills/platform-apex-logs-debug of forcedotcom/sf-skills.

  • SKILL.md
  • README.md
  • assets/benchmarking-template.cls
  • assets/cpu-heap-optimization.cls
  • assets/dml-in-loop-fix.cls
  • assets/null-pointer-fix.cls
  • assets/soql-in-loop-fix.cls
  • references/analysis-playbook.md
  • references/benchmarking-guide.md
  • references/cli-commands.md
  • references/common-issues.md
  • references/debug-log-reference.md
  • references/log-analysis-tools.md
  • references/scoring-rubric.md

Open the folder on GitHubat commit 3c15867

Compare with similar skills

Platform Apex Logs Debug next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Platform Apex Logs Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Platform Apex Logs Debug this skillforcedotcom/sf-skills1.1k—~1.9kAutomated safety check: PassApache-2.0
Sf DebugJaganpro/sf-skills424—~1.3kAutomated safety check: PassMIT
Sf ApexJaganpro/sf-skills424—~2kAutomated safety check: PassMIT
Churn Riskindranilbanerjee/digital-marketing-pro8541 repos~2.4kAutomated safety check: PassMIT
Lead Importindranilbanerjee/digital-marketing-pro8541 repos~3.3kAutomated safety check: PassMIT
Pipeline Updateindranilbanerjee/digital-marketing-pro8541 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Sf Debug

    Jaganpro/sf-skills

    Salesforce debug log analysis and troubleshooting with 100-point scoring.

    424 GitHub stars~1.3k tokensUpdated 5 mo ago
    Sales & SupportAuto-check passed
  • Sf Apex

    Jaganpro/sf-skills

    Generates and reviews Salesforce Apex code with 150-point scoring.

    424 GitHub stars~2k tokensUpdated 5 mo ago
    Sales & SupportAuto-check passed
  • Churn Risk

    indranilbanerjee/digital-marketing-pro

    Score customer segments for churn risk from behavioral signals — email engagement decline, purchase recency, usage drops, support sentiment — producing a 0-100 risk scorecard with four tiers…

    854 GitHub starsUsed in 1 repo~2.4k tokens
    Sales & SupportAuto-check passed
  • Lead Import

    indranilbanerjee/digital-marketing-pro

    Import leads into Salesforce, HubSpot, Zoho, or Pipedrive with validation, deduplication against existing CRM records, lead scoring, consent and compliance checks, and source attribution — then push…

    854 GitHub starsUsed in 1 repo~3.3k tokens
    Sales & SupportAuto-check passed
  • Pipeline Update

    indranilbanerjee/digital-marketing-pro

    Update CRM deals — move stages, change values and close dates, attach notes and activities, create follow-up tasks — with validation against pipeline rules, a before-and-after comparison, and…

    854 GitHub starsUsed in 1 repo~3.3k tokens
    Sales & SupportAuto-check passed
  • Pipeline Review

    majiayu000/claude-skill-registry

    Pipeline analysis composite. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 2 repos~6.9k tokens
    Sales & SupportAuto-check passed

More from forcedotcom/sf-skills

All 248 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~3.6k tokensUpdated 4 days ago
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated 4 days ago
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated 4 days ago
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated 4 days ago
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Platform Apex Logs Debug

What does Platform Apex Logs Debug do?

Salesforce debug log analysis and troubleshooting with 100-point scoring. Platform Apex Logs Debug is an agent skill from forcedotcom/sf-skills. Salesforce debug log analysis and troubleshooting with 100-point scoring.

When should I use Platform Apex Logs Debug?

Platform Apex Logs Debug fits situations like: : user analyzes debug logs; hits governor limits; reads stack traces; touches .log files from Salesforce orgs.

How do I install Platform Apex Logs Debug in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill platform-apex-logs-debug -a claude-code`. Or copy the skill folder (skills/platform-apex-logs-debug in forcedotcom/sf-skills) into .claude/skills/platform-apex-logs-debug in your project. Claude Code loads it when a task matches its description.

How do I install Platform Apex Logs Debug in Codex?

Run `npx skills add forcedotcom/sf-skills --skill platform-apex-logs-debug -a codex`. Or copy the skill folder (skills/platform-apex-logs-debug in forcedotcom/sf-skills) into .agents/skills/platform-apex-logs-debug in your project. Codex loads it when a task matches its description.

Can I use Platform Apex Logs Debug in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill platform-apex-logs-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/platform-apex-logs-debug, .gemini/skills/platform-apex-logs-debug, .github/skills/platform-apex-logs-debug and .opencode/skills/platform-apex-logs-debug in your project.

What does Platform Apex Logs Debug need to run?

SKILL.md names no scripts, command-line tools or credentials: Platform Apex Logs Debug is instructions for the agent only.

Does Platform Apex Logs Debug access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Platform Apex Logs Debug safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Platform Apex Logs Debug use?

Platform Apex Logs Debug is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Platform Apex Logs Debug use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.1k tokens, read only when the agent opens those files.

What are the alternatives to Platform Apex Logs Debug?

Skills that share tags, products or a category with Platform Apex Logs Debug: Sf Debug (Jaganpro/sf-skills, 424 stars), Sf Apex (Jaganpro/sf-skills, 424 stars), Churn Risk (indranilbanerjee/digital-marketing-pro, 854 stars) and Lead Import (indranilbanerjee/digital-marketing-pro, 854 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Platform Apex Logs Debug?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,058 GitHub stars. The repository holds 248 skills in this directory. The repository was last updated on October 3, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.