analyze-selective-test…
Analyzes Xcode selective testing effectiveness for a test run, showing which test targets…
Fixes flaky tests by analyzing failure patterns from Tuist test insights, identifying root causes, and applying targeted corrections. Can be invoked with a specific test case URL (e.g. `https://tuist.dev/{account}/{project}/tests/test-cases/{id}`) or without arguments to
$ npx -y skills add tuist/tuist --skill fix-flaky-tests --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/fix-flaky-testsContext preview
The summary Claude sees to decide when to auto-load this skill.
Fixes flaky tests by analyzing failure patterns from Tuist test insights, identifying root causes, and applying targeted corrections. Can be invoked with a specific test case URL (e.g. `https://tuist.dev/{account}/{project}/tests/test-cases/{id}`) or without arguments to
name: fix-flaky-tests
description: Fixes flaky tests by analyzing failure patterns from Tuist test insights, identifying root causes, and applying targeted corrections. Can be invoked with a specific test case URL (e.g. `https://tuist.dev/{account}/{project}/tests/test-cases/{id}`) or without arguments to discover and fix all flaky tests in the project.You'll typically receive a Tuist test case URL or identifier. Follow these steps to investigate and fix it:
1. Run `tuist test case show <id-or-identifier> --json` to get reliability metrics for the test. 2. Run `tuist test case run list Module/Suite/TestCase --flaky --json` to see flaky run patterns. 3. Run `tuist test case run show <test-case-run-id> --json` on failing flaky runs to get failure messages and file paths. 4. Read the test source at the reported path and line, identify the flaky pattern, and fix it. 5. Verify by running the test multiple times to confirm it passes consistently.
If no specific test is provided, start with the Discovery section below.
When no specific test case is provided, find all flaky tests in the project:
tuist test case list --flaky --json --page-size 50
This returns all test cases currently flagged as flaky. Key fields:
**Triage strategy:** 1. Group tests by suite — multiple flaky tests in the same suite often share a root cause. 2. Check if failures share a `test_run_id` — tests that all failed in the same run may have been killed by a process crash, not individual test bugs. 3. Look at failure messages to categorize: test logic bugs vs infrastructure issues (network errors, server 502s, conflicts on retry).
You can pass either the UUID or the `Module/Suite/TestCase` identifier:
tuist test case show <id> --json tuist test case show Module/Suite/TestCase --json
Key fields:
tuist test case run list Module/Suite/TestCase --flaky --json
The identifier uses the format `ModuleName/SuiteName/TestCaseName` or `ModuleName/TestCaseName` when there is no suite. This returns only runs that were detected as flaky.
tuist test case run list Module/Suite/TestCase --json --page-size 20
Look for patterns:
tuist test case run show <test-case-run-id> --json
Key fields:
1. Open the file at `failures[0].path` and go to `failures[0].line_number`. 2. Read the full test function and its setup/teardown. 3. Identify which of the common flaky patterns below applies. 4. Check if the test shares state with other tests in the same suite.
After identifying the pattern:
1. Apply the smallest fix that addresses the root cause. 2. Do not refactor unrelated code. 3. If the fix requires a test utility (like a mock or helper), check if one already exists before creating a new one.
Run the specific test repeatedly until failure using `xcodebuild`'s built-in repetition support:
xcodebuil
Tuist supercharges your build system, whether you build with Xcode, Gradle, or Bazel.
Analyzes Xcode selective testing effectiveness for a test run, showing which test targets…
Compares two Xcode build runs to identify duration regressions, cache changes, and new…
Compares two app bundles to identify size changes, new or removed artifacts, and platform…
Compares two `tuist cache` runs to identify cache hit rate changes and root-cause analysis of…
Compares two `tuist generate` runs to identify cache hit rate changes and root-cause analysis…
Compares two Gradle build runs to identify duration regressions, cache changes, and task…