Identifies non-deterministic or unreliable tests through static code analysis and test result analysis. Use when Claude needs to find flaky tests, analyze test reliability, or investigate intermittent test failures. Supports Python (pytest, unittest) and Java (JUnit, TestNG) test frameworks. Trigger when users mention "flaky tests", "intermittent failures", "non-deterministic tests", "unreliable tests", or ask to "find flaky tests", "analyze test stability", or "why tests fail randomly".
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill flaky-test-detector
Identify and fix non-deterministic tests that intermittently fail without code changes.
When a user reports flaky tests or asks for test reliability analysis:
Flaky tests fail intermittently without code changes due to:
Analyze test code for common flaky patterns.
When to use:
Process:
Common patterns to detect:
Timing issues:
time.sleep(), Thread.sleep() - Fixed waitsawait in async functionsState issues:
External dependencies:
requests.get(), http.client - Real network callsRandomness:
random. without seedUUID.randomUUID() without mockingTime dependencies:
datetime.now(), System.currentTimeMillis()Analyze test execution history to find inconsistent results.
When to use:
Process:
scripts/analyze_test_results.py to analyze patternsScript usage:
python scripts/analyze_test_results.py test_results.json
Input format (JSON):
[
{
"test_name": "test_user_login",
"status": "passed",
"timestamp": "2024-01-01T10:00:00",
"duration": 1.23
},
{
"test_name": "test_user_login",
"status": "failed",
"timestamp": "2024-01-01T11:00:00",
"duration": 1.45
}
]
Metrics:
Common issues:
tmp_path for file operations@pytest.mark.django_db for database testsrandom module usageBest practices:
tmp_path fixture for file operationspytest-mock or unittest.mockfreezegun for time mockingrandom.seed()Common issues:
@Before/@After cleanup@Transactional for database testsThread.sleep() callsBest practices:
@Before/@After for setup/cleanup@Transactional for automatic rollbackClock for time mockingAsk clarifying questions:
Static analysis if:
Result analysis if:
For static analysis:
For result analysis:
analyze_test_results.py scriptStructure the report:
Example format:
Found 5 potentially flaky tests:
HIGH PRIORITY:
- test_user_login (flakiness: 0.85)
- Line 45: time.sleep(2) - fixed wait
- Line 52: Shared class variable 'user_data'
MEDIUM PRIORITY:
- test_api_call (flakiness: 0.62)
- Line 23: requests.get() - unmocked network call
For each issue, provide:
Reference remediation-strategies.md for detailed fixes.
User: "Our test_checkout test keeps failing randomly"
→ Analyze test code for flaky patterns, report findings with fixes
User: "Find all flaky tests in the test suite"
→ Scan all test files for common flaky patterns
User: "This test has a 60% pass rate, why?"
→ Analyze test code and suggest specific fixes
User: "Analyze these test results for flakiness"
→ Use analyze_test_results.py script on provided data
User: "How do I fix this race condition in my test?"
→ Provide remediation strategy with code examples
User: "Review this test for potential flakiness"
→ Static analysis of specific test with recommendations
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Modern JavaScript/TypeScript development with Bun runtime. Covers package management, bundling, testing, and migration from Node.js. Use when working with Bun, optimizing JS/TS development speed, or migrating from Node.js to Bun.
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use when investigating bugs, performance issues, or unexpected behavior.
Opinionated backend development standards for Node.js + Express + TypeScript microservices. Covers layered architecture, BaseController pattern, dependency injection, Prisma repositories, Zod validation, unifiedConfig, Sentry error tracking, async safety, and testing discipline.
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
Take arabelatso/flaky-test-detector from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.