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).

# platform-apex-logs-debug

Salesforce debugging and troubleshooting skill with log analysis, governor limit detection, and agentic fix suggestions. Identify performance bottlenecks and automatically suggest fixes.

## Features

- **Log Analysis**: Parse and analyze Apex debug logs
- **Governor Limit Detection**: SOQL, DML, CPU, and heap limit monitoring
- **Performance Analysis**: Find slow queries and expensive operations
- **Stack Trace Interpretation**: Parse exceptions and identify root causes
- **Agentic Fix Suggestions**: Automatically suggest code fixes
- **100-Point Scoring**: Issue severity classification


## Quick Start

### 1. Invoke the skill

```text
Skill: platform-apex-logs-debug
Request: "Analyze debug logs for AccountTrigger performance issues in org dev"
```

### 2. Common operations

| Operation | Example Request |
|-----------|-----------------|
| Analyze log | "Analyze the latest debug log for errors" |
| List logs | "Show recent debug logs for org dev" |
| Tail logs | "Tail logs for user admin@company.com" |
| Find limits | "Find governor limit issues in the log" |
| Query plan | "Analyze query plan for Account SOQL" |

## Log Commands

```bash
# List recent logs
sf apex list log --target-org [alias] --json

# Get specific log
sf apex get log --log-id 07Lxx0000000000 --target-org [alias]

# Tail logs real-time
sf apex tail log --target-org [alias] --color
```

## Scoring System (100 Points)

| Category | Points | Focus |
|----------|--------|-------|
| Governor Limits | 25 | SOQL, DML, CPU, Heap analysis |
| Performance | 25 | Query optimization, N+1 detection |
| Error Analysis | 20 | Exception handling, stack traces |
| Root Cause | 20 | Issue identification, fix suggestions |
| Documentation | 10 | Clear explanations, actionable fixes |

## Cross-Skill Integration

| Related Skill | When to Use |
|---------------|-------------|
| platform-apex-generate | Fix identified Apex issues |
| platform-soql-query | Optimize slow SOQL queries |
| platform-apex-test-run | Re-run tests after fixes |

## Documentation

- [Benchmarking Guide](references/benchmarking-guide.md)


## Requirements

- sf CLI v2
- Target Salesforce org
- Debug logs enabled for target user
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