FA

Triage test failures to filter out expected failures.

Install

mkdir -p .claude/skills/failure-classify && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13648" && unzip -o skill.zip -d .claude/skills/failure-classify && rm skill.zip

Installs to .claude/skills/failure-classify

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Group failing tests by naming convention so a real assertion failure is not hidden among tests that exist to verify a system rejects something. Use after running the test suite and before reading the report.
207 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Extract failing test names from logs.
  • Classify failing tests into predefined categories.
  • Deduplicate failing test names.
  • Emit JSON output with failures, counts, and grouped listings.
  • Support different programming languages for pattern matching.

How it works

The skill extracts failing test names from a provided log path, classifies them into categories like EXPECTED_FAILURE or ASSERTION_FAILURE using language-specific patterns, and then outputs a JSON object with the classified results.

Inputs & outputs

You give it
A test runner log path, optionally with a language pattern.
You get back
A JSON object with deduplicated failing test names, counts per class, and test names bucketed by class.

When to use failure-classify

  • Triaging CI failures
  • Filtering false-positive test failures
  • Cleaning test reports

About this skill

failure-classify

Triage failing tests so a real regression does not get lost among tests that are expected to fail (because they verify that the system rejects bad input).

When to use

  • After every test run that produced at least one failing test.
  • Before triaging a CI failure manually.
  • In the report-render skill's input pipeline.

Do not use this skill to decide whether a regression is "important enough to fix". That is a human judgement. The skill only sorts.

Inputs

NameRequiredDefaultDescription
log_pathyesnonePath to the test runner's output. The skill scans for lines (or FAIL lines, depending on the language pattern).
languagenoswiftOne of swift, python, go, rust. Picks the line-extraction regex and the classification patterns.
self_testnofalseWhen true, runs the skill's internal unit tests and exits. Use after editing the classification rules.

Output

ChannelContent
stdoutA JSON object with three keys: failures (deduplicated list of failing test names), failures_by_class (counts per class), failures_grouped (test names bucketed by class).
exit code0 on success regardless of test outcomes. 1 if the log could not be read. 2 on self-test failure.

Classification taxonomy

Seven classes. Order matters: the first matching pattern wins. A test name that matches no pattern falls into ASSERTION_FAILURE by default.

ClassMeaningTrigger keyword (regex fragment)
EXPECTED_FAILUREthe test verifies the system rejects somethingReject, Refuse, ErrorContains, WithInvalid, DataCorrupted, InvalidDuration, LongSessionOnBattery
IO_BACKENDthe test exercises a system API (IOKit, libusb, raw sockets)language-specific prefix, e.g. powerAssertion* in Swift
ENVIRONMENT_ERRORthe test depends on a live system readingPowerSourceMonitor, BluetoothState, NetworkLink
TEST_SCAFFOLDthe test depends on a missing setup artifactreserved; no patterns in v0.1
ASSERTION_FAILUREreal bugdefault bucket
PRECONDITION_MISSINGrequired env var / file is missingrequireEnv, skipIf markers
UNKNOWNcould not classifyfallback (rare; usually means the runner produced an unexpected line format)

Algorithm

  1. Extract failing test names from the log. Swift Testing emits two lines per failing test (one for the issue, one for the summary). The skill deduplicates while keeping the first-seen order.
  2. Classify each name against the patterns, first-match-wins.
  3. Emit JSON: list, counts, grouped.

Worked example (Swift)

Log:

✔ Test foo() passed after 0.001 seconds.
✘ Test barRejectsZero() failed after 0.001 seconds with 1 issue.
✘ Test bazShouldBehave() failed after 0.001 seconds with 1 issue.

Output:

{
  "failures": ["barRejectsZero", "bazShouldBehave"],
  "failures_by_class": {
    "EXPECTED_FAILURE": 1,
    "ASSERTION_FAILURE": 1
  },
  "failures_grouped": {
    "EXPECTED_FAILURE": ["barRejectsZero"],
    "ASSERTION_FAILURE": ["bazShouldBehave"]
  }
}

The first test is an expected-failure pattern (Rejects). The second is a real regression candidate.

Anti-patterns

  • Treating EXPECTED_FAILURE as a green light. A failure classified as EXPECTED_FAILURE still failed. The classification only means the failure is the test's purpose, not that the system under test behaves correctly. The test author must read the message.
  • Adding patterns that match everything. Patterns are first-match wins. A pattern like .* would swallow every test into one bucket.
  • Assuming a runner that is not in the language list still works. The v0.1 patterns cover Swift Testing only. For other runners, the user must extend the patterns and add a self-test.

Cross-references

  • report-render — consumes the JSON output and embeds it in the Markdown report.
  • drill — uses this skill to verify the loop reacts to a real failure.
  • drift-check — the previous step in the loop.

When not to use it

  • Before a test run has produced at least one failing test.
  • To decide whether a regression is 'important enough to fix'.

Limitations

  • The skill only sorts failing tests; it does not decide the importance of a regression.
  • The classification patterns are language-specific and may require extension for unsupported runners.
  • A pattern like '.*' would swallow every test into one bucket due to first-match-wins.

How it compares

This skill automates the classification of failing tests into meaningful categories, distinguishing real bugs from tests intended to verify system rejections, which is more efficient than manually triaging raw test logs.

Compared to similar skills

failure-classify side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
failure-classify (this skill)02moNo flagsIntermediate
python-testing-patterns772moReviewIntermediate
chrome-devtools417moReviewIntermediate
bats97moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

python-testing-patterns

wshobson

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

77204

chrome-devtools

mrgoonie

Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.

41157

bats

OleksandrKucherenko

Bash Automated Testing System (BATS) for TDD-style testing of shell scripts. Use when: (1) Writing unit or integration tests for Bash scripts, (2) Testing CLI tools or shell functions, (3) Setting up test infrastructure with setup/teardown hooks, (4) Mocking external commands (curl, git, docker), (5) Generating JUnit reports for CI/CD, (6) Debugging test failures or flaky tests, (7) Implementing test-driven development for shell scripts.

991

browser-daemon

noiv

Persistent browser automation via Playwright daemon. Keep a browser window open and send it commands (navigate, execute JS, inspect console). Perfect for interactive debugging, development, and testing web applications. Use when you need to interact with a browser repeatedly without opening/closing it.

587

performance-profiling

davila7

Performance profiling principles. Measurement, analysis, and optimization techniques.

633

obsidian-local-dev-loop

jeremylongshore

Configure Obsidian plugin development with hot-reload and fast iteration. Use when setting up development workflow, configuring test vaults, or establishing a rapid development cycle. Trigger with phrases like "obsidian dev loop", "obsidian hot reload", "obsidian development workflow", "develop obsidian plugin".

328

Search skills

Search the agent skills registry