npx skills add https://github.com/jaganpro/sf-skills --skill sf-debug当用户需要基于调试日志进行根本原因分析时使用此技能:包括治理限制诊断、堆栈跟踪解读、慢查询调查、堆内存/CPU压力分析,或基于日志证据的复现到修复循环。
当工作涉及以下内容时,使用 sf-debug:
.log 文件当用户进行以下操作时,请委托给其他技能:
询问或推断:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
sf apex list log --target-org <alias> --json
sf apex get log --log-id <id> --target-org <alias>
sf apex tail log --target-org <alias> --color
优先选择以下修复方案:
| 问题 | 主要信号 | 默认修复方向 |
|---|---|---|
| 循环中的 SOQL | 在重复调用路径中重复出现 SOQL_EXECUTE_BEGIN | 查询一次,使用映射 / 分组集合 |
| 循环中的 DML | 重复的 DML_BEGIN 模式 | 收集行,批量执行一次 DML |
| 非选择性查询 | 扫描行数高 / 选择性差 | 添加索引过滤器,缩小范围 |
| CPU 压力 | CPU 使用率接近同步限制 | 降低算法复杂度,使用缓存,在有效时采用异步 |
| 堆内存压力 | 堆内存使用量接近同步限制 | 使用 SOQL for 循环流式处理,减少内存中的数据 |
| 空指针 / 致命错误 | EXCEPTION_THROWN / FATAL_ERROR | 防范空值假设,修复空查询处理 |
完成分析时,按此顺序报告:
建议格式:
Issue: <summary>
Location: <class / line / transaction>
Root cause: <explanation>
Severity: Critical | Warning | Info
Fix: <specific action>
Verify: <test or rerun step>
| 需求 | 委托给 | 原因 |
|---|---|---|
| 实施 Apex 修复 | sf-apex | 代码变更生成 / 审查 |
| 通过测试复现 | sf-testing | 测试执行和覆盖率循环 |
| 部署修复 | sf-deploy | 部署编排 |
| 创建调试数据 | sf-data | 针对性的种子 / 复现数据 |
| 分数 | 含义 |
|---|---|
| 90+ | 专家级分析,提供强有力的修复指导 |
| 80–89 | 良好的分析,存在微小差距 |
| 70–79 | 可接受,但可能遗漏次要问题 |
| 60–69 | 仅部分诊断 |
| < 60 | 分析不完整 |
每周安装次数
296
代码仓库
GitHub 星标数
223
首次出现
Jan 22, 2026
安全审计
安装于
codex285
cursor283
gemini-cli281
opencode280
github-copilot279
amp272
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.
Use sf-debug when the work involves:
.log files from SalesforceDelegate elsewhere when the user is:
Ask for or infer:
sf apex list log --target-org <alias> --json
sf apex get log --log-id <id> --target-org <alias>
sf apex tail log --target-org <alias> --color
Prefer fixes that are:
Expanded workflow: references/analysis-playbook.md
| Issue | Primary signal | Default fix direction |
|---|---|---|
| SOQL in loop | repeating SOQL_EXECUTE_BEGIN in a repeated call path | query once, use maps / grouped collections |
| DML in loop | repeated DML_BEGIN patterns | collect rows, bulk DML once |
| Non-selective query | high rows scanned / poor selectivity | add indexed filters, reduce scope |
| CPU pressure | CPU usage approaching sync limit | reduce algorithmic complexity, cache, async where valid |
| Heap pressure | heap usage approaching sync limit | stream with SOQL for-loops, reduce in-memory data |
| Null pointer / fatal error | EXCEPTION_THROWN / |
Expanded examples: references/common-issues.md
When finishing analysis, report in this order:
Suggested shape:
Issue: <summary>
Location: <class / line / transaction>
Root cause: <explanation>
Severity: Critical | Warning | Info
Fix: <specific action>
Verify: <test or rerun step>
| Need | Delegate to | Reason |
|---|---|---|
| Implement Apex fix | sf-apex | code change generation / review |
| Reproduce via tests | sf-testing | test execution and coverage loop |
| Deploy fix | sf-deploy | deployment orchestration |
| Create debugging data | sf-data | targeted seed / repro data |
| Score | Meaning |
|---|---|
| 90+ | Expert analysis with strong fix guidance |
| 80–89 | Good analysis with minor gaps |
| 70–79 | Acceptable but may miss secondary issues |
| 60–69 | Partial diagnosis only |
| < 60 | Incomplete analysis |
Weekly Installs
296
Repository
GitHub Stars
223
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex285
cursor283
gemini-cli281
opencode280
github-copilot279
amp272
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
FATAL_ERROR| guard null assumptions, fix empty-query handling |