salesforce-debug-bundle
Collect Salesforce debug evidence including API limits, debug logs, and org info for support tickets. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Salesforce problems. Trigger with phrases like "salesforce debug", "salesforce support bundle", "collect salesforce logs", "salesforce diagnostic", "salesforce debug log".
Best use case
salesforce-debug-bundle is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Collect Salesforce debug evidence including API limits, debug logs, and org info for support tickets. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Salesforce problems. Trigger with phrases like "salesforce debug", "salesforce support bundle", "collect salesforce logs", "salesforce diagnostic", "salesforce debug log".
Teams using salesforce-debug-bundle should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/salesforce-debug-bundle/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How salesforce-debug-bundle Compares
| Feature / Agent | salesforce-debug-bundle | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Collect Salesforce debug evidence including API limits, debug logs, and org info for support tickets. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Salesforce problems. Trigger with phrases like "salesforce debug", "salesforce support bundle", "collect salesforce logs", "salesforce diagnostic", "salesforce debug log".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Salesforce Debug Bundle
## Overview
Collect all necessary diagnostic information for Salesforce issues: debug logs, API limits, org configuration, and error traces.
## Prerequisites
- Salesforce CLI authenticated (`sf org login web`)
- jsforce connection configured
- Access to Setup in your Salesforce org
## Instructions
### Step 1: Collect Org Info & API Limits
```typescript
import { getConnection } from './salesforce/connection';
const conn = await getConnection();
// Org limits — most critical diagnostic info
const limits = await conn.request('/services/data/v59.0/limits/');
console.log('=== API Limits ===');
console.log(`Daily API Requests: ${limits.DailyApiRequests.Remaining}/${limits.DailyApiRequests.Max}`);
console.log(`Daily Bulk API: ${limits.DailyBulkV2QueryJobs.Remaining}/${limits.DailyBulkV2QueryJobs.Max}`);
console.log(`Data Storage (MB): ${limits.DataStorageMB.Remaining}/${limits.DataStorageMB.Max}`);
console.log(`File Storage (MB): ${limits.FileStorageMB.Remaining}/${limits.FileStorageMB.Max}`);
console.log(`Single Email: ${limits.SingleEmail.Remaining}/${limits.SingleEmail.Max}`);
// Org identity
const identity = await conn.identity();
console.log(`\n=== Org Info ===`);
console.log(`Username: ${identity.username}`);
console.log(`Org ID: ${identity.organization_id}`);
console.log(`Instance: ${conn.instanceUrl}`);
console.log(`API Version: ${conn.version}`);
```
### Step 2: Enable & Retrieve Debug Logs
```bash
# Set up a trace flag for debug logging via SF CLI
sf apex log list --target-org my-org
# Get the most recent debug log
sf apex log get --number 1 --target-org my-org
# Or tail logs in real-time during testing
sf apex log tail --target-org my-org --debug-level SFDC_DevConsole
```
### Step 3: Query Recent API Events
```typescript
// EventLogFile — Enterprise+ orgs only
// Contains API usage data for the last 30 days
const eventLogs = await conn.query(`
SELECT Id, EventType, LogDate, LogFileLength
FROM EventLogFile
WHERE EventType = 'API'
AND LogDate >= LAST_N_DAYS:7
ORDER BY LogDate DESC
LIMIT 5
`);
for (const log of eventLogs.records) {
console.log(`Event: ${log.EventType}, Date: ${log.LogDate}, Size: ${log.LogFileLength}`);
// Download log content
const content = await conn.request(`/services/data/v59.0/sobjects/EventLogFile/${log.Id}/LogFile`);
console.log(content);
}
```
### Step 4: Create Debug Bundle Script
```bash
#!/bin/bash
# salesforce-debug-bundle.sh
BUNDLE_DIR="sf-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
echo "=== Salesforce Debug Bundle ===" > "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$BUNDLE_DIR/summary.txt"
# Org info
sf org display --target-org my-org --json > "$BUNDLE_DIR/org-info.json" 2>&1
# API limits
sf limits api display --target-org my-org --json > "$BUNDLE_DIR/api-limits.json" 2>&1
# Recent debug logs
sf apex log list --target-org my-org --json > "$BUNDLE_DIR/log-list.json" 2>&1
sf apex log get --number 5 --target-org my-org > "$BUNDLE_DIR/debug-logs.txt" 2>&1
# Node environment
echo "--- Node Environment ---" >> "$BUNDLE_DIR/summary.txt"
node --version >> "$BUNDLE_DIR/summary.txt" 2>&1
npm list jsforce 2>/dev/null >> "$BUNDLE_DIR/summary.txt"
# Salesforce system status
curl -s "https://api.status.salesforce.com/v1/instances/$(sf org display --target-org my-org --json | jq -r '.result.instanceUrl' | sed 's|https://||;s|\..*||')/status" > "$BUNDLE_DIR/sf-status.json" 2>&1
# Redact secrets from .env
if [ -f .env ]; then
cat .env | sed 's/=.*/=***REDACTED***/' > "$BUNDLE_DIR/config-redacted.txt"
fi
# Package
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
echo "Bundle created: $BUNDLE_DIR.tar.gz"
```
### Step 5: Check Salesforce System Status
```typescript
// Check if Salesforce itself is having issues
const statusResponse = await fetch('https://api.status.salesforce.com/v1/incidents/active');
const incidents = await statusResponse.json();
if (incidents.length > 0) {
console.log('ACTIVE SALESFORCE INCIDENTS:');
for (const incident of incidents) {
console.log(` ${incident.id}: ${incident.message.maintenanceType}`);
console.log(` Affected: ${incident.instanceKeys.join(', ')}`);
}
} else {
console.log('No active Salesforce incidents — issue is likely org-specific');
}
```
## Output
- `sf-debug-YYYYMMDD-HHMMSS.tar.gz` archive containing:
- `summary.txt` — Environment and SDK versions
- `org-info.json` — Org identity and configuration
- `api-limits.json` — Current API usage vs limits
- `debug-logs.txt` — Recent Apex debug logs
- `sf-status.json` — Salesforce system status
- `config-redacted.txt` — Configuration (secrets removed)
## Error Handling
| Item | Purpose | Included |
|------|---------|----------|
| API limits | Check if limits are exhausted | Yes |
| Debug logs | Apex execution traces | Yes |
| Org info | Instance, edition, user | Yes |
| System status | Salesforce-side outages | Yes |
| Environment | Node.js, jsforce versions | Yes |
## Resources
- [Salesforce Status API](https://api.status.salesforce.com/)
- [Debug Log Levels](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm)
- [EventLogFile (Shield)](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventlogfile.htm)
- [API Limits Resource](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm)
## Next Steps
For rate limit issues, see `salesforce-rate-limits`.Related Skills
workhuman-debug-bundle
Workhuman debug bundle for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman debug bundle".
wispr-debug-bundle
Wispr Flow debug bundle for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr debug bundle".
webflow-debug-bundle
Collect Webflow debug evidence for support tickets and troubleshooting. Gathers SDK version, token validation, rate limit status, site connectivity, CMS health, and error logs into a single diagnostic bundle. Trigger with phrases like "webflow debug", "webflow support bundle", "collect webflow logs", "webflow diagnostic", "webflow troubleshoot".
vercel-debug-bundle
Collect Vercel debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Vercel problems. Trigger with phrases like "vercel debug", "vercel support bundle", "collect vercel logs", "vercel diagnostic".
veeva-debug-bundle
Veeva Vault debug bundle for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva debug bundle".
vastai-debug-bundle
Collect Vast.ai debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Vast.ai problems. Trigger with phrases like "vastai debug", "vastai support bundle", "collect vastai logs", "vastai diagnostic".
twinmind-debug-bundle
Collect comprehensive diagnostic information for TwinMind issues. Use when preparing support requests, investigating complex problems, or gathering evidence for bug reports. Trigger with phrases like "twinmind debug", "twinmind diagnostics", "collect twinmind info", "twinmind support bundle".
together-debug-bundle
Together AI debug bundle for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together debug bundle".
techsmith-debug-bundle
TechSmith debug bundle for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith debug bundle".
supabase-debug-bundle
Collect Supabase diagnostic info for troubleshooting and support tickets. Use when debugging connection failures, auth issues, Realtime drops, Storage errors, RLS misconfigurations, or preparing a support escalation. Trigger: "supabase debug", "supabase diagnostics", "supabase support bundle", "collect supabase logs", "debug supabase connection".
stackblitz-debug-bundle
Collect WebContainer diagnostic info: boot state, file system, process list. Use when working with WebContainers or StackBlitz SDK. Trigger: "stackblitz debug".
speak-debug-bundle
Collect diagnostic information for Speak API issues: auth verification, audio format validation, session inspection, and network testing. Use when implementing debug bundle features, or troubleshooting Speak language learning integration issues. Trigger with phrases like "speak debug bundle", "speak debug bundle".