dx-devops-test-failures-analyze
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure category, offending file/class/method/line, rule viola…
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Analyze DevOps Center Test Failures
Parses a test failure or Code Analyzer violation payload, explains it in plain language, produces prioritized improvement suggestions, and — only on explicit user request — creates a tracked fix work item. Parts 1–2 are pure reasoning (no writes); Part 3 is an optional, confirmation-gated write.
Never expose raw JSON, stack traces, or internal Salesforce error codes to the user. Always translate to file name, method, line, and plain description.
Prerequisites
- Parts 1–2 (analysis): If the failure payload is already in context, no prerequisites are needed — this is pure reasoning. If you must fetch the payload yourself, run prerequisites (
references/prerequisite-checks.md, Prereqs 1–4) and obtain the execution result viadx-devops-test-suite-run(its polling step). - Part 3 (work item): Run Prerequisites 1–4. You also need a
DevopsProjectIdto file under and anOwnerId(assignee). Seereferences/work-item-creation.md.
Part 1 — Classify and explain each failure
Determine the failure category, then for each failure extract and translate to plain language: offending file/class, method, line number, the rule or assertion violated, and a fix direction (without writing code). Group failures by category if more than one.
| Category | Description |
|---|---|
| Assertion failure | A test assertion failed (expected vs actual mismatch) |
| Exception | An unhandled exception was thrown |
| Code Analyzer violation | A static-analysis rule was violated (e.g. ApexCRUDViolation) |
| Timeout | Test exceeded execution time limit |
| Compile error | Class failed to compile |
Output format:
Test failure summary:
<N> failure(s) found:
1. [<Category>] `<ClassName>.cls` — `<methodName>()` at line <N>
What happened: <plain-language description>
Rule violated: <ruleName or assertion description>
Fix direction: <plain-language suggestion>
Full category/pattern tables and Code Analyzer rule translations: references/failure-categories.md and references/code-analyzer-violations.md.
Empty / no-data case: If the payload contains no failures or violations, report that clearly (e.g. "No failures found in the provided execution results.") and stop. Do NOT fabricate failures or suggestions.
Part 2 — Improvement suggestions
Run this after execution completes with failures, not on static source. For each failed test, reason over the failure message (the primary signal) to identify what the test is not handling, then produce a specific, actionable suggestion and a fix location (Test vs Production code). The full failure-pattern → suggestion mapping is in references/failure-categories.md.
Test improvement suggestions based on execution results:
`<testMethodName>()` — [Assertion Failure / Exception / etc.]
Failure: "<failure message>"
What this reveals: <plain-language explanation>
Suggestion: <specific, actionable recommendation>
Fix location: Test | Production code
Overall: <N> improvement(s) across <M> failed test(s).
Do not rewrite the test — only describe what needs to change and why. Fix location: Production code indicates a code defect exposed by a sound test (track separately, not a test-quality blocker). Fix location: Test indicates the test needs hardening (setup, assertions, edge cases).
Part 3 — Create a fix work item (optional, on request only)
Trigger only when the user wants to create a fix work item, log a remediation, or assign a failure to a developer. This is a write operation with a mandatory confirmation gate. Follow references/work-item-creation.md for inputs, the subject/assignee/project confirmation gate, the sf data create record --sobject WorkItem call, and error handling.
> Use WorkItem (no namespace) — DevopsWorkItem is not a supported sObject in this org version.
If no DevopsProject exists in the org, report that the work item cannot be created until a project is set up — do NOT fabricate a project or proceed.
Related skills
dx-devops-test-suite-run— produces the failure payload (via its polling step) that feeds this skill.dx-devops-test-suite-assignments-configure— assign/strengthen the suites whose tests are failing.platform-apex-generate/platform-apex-test-generate— to actually write fix code or new test classes (out of scope here).
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
plugins/builder/dx-devops/skills/dx-devops-test-failures-analyze/SKILL.md同一个仓库里的其他技能
- commerce-b2b-open-code-components-integrate
- commerce-b2b-open-code-components-replace
- dx-devops-conflict-resolve
- dx-devops-pipeline-manage
- dx-devops-test-pipeline-configure
- dx-devops-test-suite-assignments-configure
- dx-devops-test-suite-run
- dx-devops-work-item-manage
- dx-app-analytics-query
- platform-agentexchange-partner-offers-configure
- automation-sandbox-post-copy-config-generate
- automation-sandbox-post-copy-configure
同名技能的其他版本
有 2 个不同仓库或目录里都有叫 dx-devops-test-failures-analyze 的技能。它们内容并不相同,别混用:
- forcedotcom/sf-skills — Analyzes DevOps Center test failures and Code Analyzer violations in plain language — fail