# Dx Devops Test Failures Analyze

Analyzes DevOps Center test failures and Code Analyzer violations in plain language, ...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-failures-analyze -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-failures-analyze -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-failures-analyze -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill dx-devops-test-failures-analyze -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## Description

Analyzes DevOps Center test failures and Code Analyzer violations in plain language, failure category, offending file/class/method/line, rule violated, fix direction, and prioritized improvement suggestions (test-code vs production-code), then optionally creates a tracked fix WorkItem on explicit request. Analysis is pure reasoning; work-item creation is a confirmation-gated write. Use this skill to explain failures or improvement suggestions, translate Code Analyzer violations, or track a fix as a work item. TRIGGER when: a run failed and the user wants root cause; a quality gate failure needs explaining; violations need translating; the user shares a failure payload and asks how to address it; wants to strengthen tests; or wants to create a fix work item, log a remediation, or assign a failure. DO NOT TRIGGER when: the user wants fix code written (use platform-apex-generate) or new test classes authored (use platform-apex-test-generate).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 via `dx-devops-test-suite-run` (its polling step).
- **Part 3 (work item):** Run Prerequisites 1, 4. You also need a `DevopsProjectId` to file under and an `OwnerId` (assignee). See `references/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:**

```text
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>
```

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/dx-devops/skills/dx-devops-test-failures-analyze/SKILL.md
