Stop Guessing.
Detect Flaky Tests with AI
Identify and resolve flaky tests using semantic embeddings and density-based clustering. Open source, production-ready, and built for modern CI/CD.
Get Started in Minutes
Install from npm and start detecting flaky tests immediately
Installation
# Install core packages
pnpm add @flakiness-detective/core @flakiness-detective/adapters
# Install peer dependencies (for Firestore and AI)
pnpm add @google-cloud/firestore @google/generative-ai
# Or install CLI globally
pnpm add -g @flakiness-detective/cliBasic Usage
import { FlakinessDetective } from '@flakiness-detective/core';
import { createDataAdapter, createEmbeddingProvider } from '@flakiness-detective/adapters';
// Configure adapters
const dataAdapter = createDataAdapter({ type: 'in-memory' });
const embeddingProvider = createEmbeddingProvider({ type: 'mock' });
// Run detection
const detective = new FlakinessDetective(
dataAdapter,
embeddingProvider,
{
timeWindow: { days: 7 },
clustering: {
epsilon: 0.15,
minPoints: 2,
distance: 'cosine',
}
}
);
const clusters = await detective.detect();
console.log(`Found ${clusters.length} flaky test patterns`);Powerful Features
Everything you need to detect, analyze, and resolve flaky tests
AI-Powered Analysis
Uses semantic embeddings to understand test failure patterns beyond simple text matching
DBSCAN Clustering
Groups similar failures using density-based clustering with configurable distance metrics
Rich Pattern Extraction
Automatically extracts patterns from Playwright errors including locators, matchers, and timeouts
Flexible Adapters
Support for multiple data sources: Firestore, Filesystem, In-Memory, and Playwright reports
Production Ready
Comprehensive input validation, type safety, and error handling for production use
CLI & Programmatic API
Use from command line for CI/CD or programmatically in your Node.js applications
npm Packages
Modular packages designed to work together or independently
@flakiness-detective/core
Core detection engine with DBSCAN clustering algorithms
@flakiness-detective/adapters
Data adapters and AI providers for flexible integrations
@flakiness-detective/cli
Command-line interface for CI/CD pipelines
@flakiness-detective/utils
Shared utilities and logger for all packages
Ready to Fix Your Flaky Tests?
Join developers who are using Flakiness Detective to improve their test reliability