fixing-flakes
Installation
SKILL.md
Fixing Flakes
Invoke delegate-low-reasoning-work before any Gradle command and delegate the exact command when an executor is available.
Treat every ShampooRule swap or iteration-count edit as uncommittable diagnostic instrumentation. Use it only in the local working tree to reproduce and validate a fix. Never stage, commit, push, or submit those edits in a pull request.
Establish the scope
- Locate the test and its rules with
rg. Classify it as unit, coroutine, Robolectric/Compose, screenshot, instrumentation, managed-device, or external-surface E2E. Do not use an emulator for a non-instrumentation test. - Write one sentence stating the behavior the test proves. A synchronization step may observe readiness, but must not directly perform the behavior under test. If a proposed wait or helper makes the assertion tautological, reject it and fix the dependency or replace the invalid test instead.
- Record the original exception, first relevant stack frame, execution task, device/API/browser when applicable, and whether the failure occurred before, during, or after the tested behavior. Distinguish a test failure from emulator boot, Gradle, network, or other infrastructure failures.
- Audit the boundaries that can vary between executions: wall versus virtual time, animation/frame time, process-global state, retained caches or selections, external activities, IME/browser state, asynchronous resource identity, and teardown completion.
Require failure evidence before permanent changes
Do not implement or submit a permanent fix until the failure has qualifying evidence. Require one of:
- A focused local reproduction with the original exception, relevant stack frame, and failure artifact.
- An actionable original CI failure trace plus a deterministic regression test that fails for the same reason before the fix.