{"id":45186733,"url":"https://github.com/wrsmith108/claude-skill-flaky-test-detector","last_synced_at":"2026-02-20T11:02:53.211Z","repository":{"id":337710424,"uuid":"1127479352","full_name":"wrsmith108/claude-skill-flaky-test-detector","owner":"wrsmith108","description":"Claude Code skill for detecting flaky test patterns that cause intermittent CI failures","archived":false,"fork":false,"pushed_at":"2026-02-10T21:53:16.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T00:35:05.028Z","etag":null,"topics":["ci-cd","claude-code","claude-skill","developer-tools","flaky-tests","testing"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrsmith108.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-04T01:01:10.000Z","updated_at":"2026-02-10T21:53:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wrsmith108/claude-skill-flaky-test-detector","commit_stats":null,"previous_names":["wrsmith108/claude-skill-flaky-test-detector"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/wrsmith108/claude-skill-flaky-test-detector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-flaky-test-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-flaky-test-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-flaky-test-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-flaky-test-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrsmith108","download_url":"https://codeload.github.com/wrsmith108/claude-skill-flaky-test-detector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrsmith108%2Fclaude-skill-flaky-test-detector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29648434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","claude-code","claude-skill","developer-tools","flaky-tests","testing"],"created_at":"2026-02-20T11:02:53.133Z","updated_at":"2026-02-20T11:02:53.190Z","avatar_url":"https://github.com/wrsmith108.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flaky Test Detector\n\nA Claude Code skill for detecting flaky test patterns that cause intermittent CI failures.\n\n## Installation\n\n### As a Claude Code Skill\n\n```bash\n# Clone to your Claude skills directory\ngit clone https://github.com/wrsmith108/claude-skill-flaky-test-detector.git ~/.claude/skills/flaky-test-detector\n```\n\n### Standalone Usage\n\n```bash\n# Run directly with npx\nnpx tsx scripts/index.ts [directory] [options]\n```\n\n## Trigger Phrases\n\nThis skill activates when you mention:\n- \"flaky test\"\n- \"intermittent failure\"\n- \"test sometimes fails\"\n- \"race condition in test\"\n- \"timing issue in test\"\n- \"test passes locally but fails in CI\"\n- \"non-deterministic test\"\n\n## Pattern Detection\n\nScans `*.test.ts` and `*.spec.ts` files to detect:\n\n| Severity | Pattern | Risk |\n|----------|---------|------|\n| HIGH | 1-second TTL | Second-boundary race conditions |\n| HIGH | `Math.floor(Date.now() / 1000)` | Second truncation timing edge cases |\n| HIGH | Very short setTimeout (\u003c100ms) | Unreliable timeouts |\n| MEDIUM | `Date.now()` without mocking | Real time causes non-determinism |\n| MEDIUM | `new Date()` without mocking | Real date causes flakiness |\n| MEDIUM | Low timeout values | Race conditions in CI |\n| LOW | `Math.random()` without seeding | Non-reproducible behavior |\n| LOW | `process.nextTick` in assertions | Timing-dependent assertions |\n\n## Usage\n\n### Scan Current Directory\n\n```bash\n# Run the detector on all test files\nnpx tsx scripts/index.ts\n\n# Scan specific directory\nnpx tsx scripts/index.ts ./src/tests\n\n# Output as JSON\nnpx tsx scripts/index.ts --json\n\n# CI mode: exit with code 1 if HIGH severity issues found\nnpx tsx scripts/index.ts --ci\n```\n\n### Options\n\n| Option | Description |\n|--------|-------------|\n| `--json` | Output results as JSON |\n| `--ci` | CI mode: exit with code 1 if HIGH severity issues found |\n| `--quiet` | Suppress output except errors |\n| `--help` | Show help message |\n\n## Output Example\n\n```markdown\n## Flaky Test Analysis\n\nScanned 94 test files, found 15 potential flaky patterns.\n\n### High Risk\n**cache.test.ts:119**\n- Pattern: `ttlSeconds: 1`\n- Risk: Second boundary crossing causes race condition\n- Fix: Use vi.useFakeTimers() or increase TTL to 5+\n\n### Medium Risk\n**utils.spec.ts:45**\n- Pattern: `Date.now()`\n- Risk: Real time creates non-determinism\n- Fix: Mock with vi.useFakeTimers() and vi.setSystemTime()\n```\n\n## CI Integration\n\nAdd to your CI pipeline to catch flaky patterns before merge:\n\n```yaml\n- name: Check for flaky test patterns\n  run: npx tsx scripts/index.ts --ci\n```\n\n## Fix Suggestions\n\nThe skill provides actionable fix suggestions:\n- `vi.useFakeTimers()` for time-based flakiness\n- TTL increase recommendations\n- Mock injection patterns\n- Deterministic alternatives\n\n## Requirements\n\n- Node.js 18+\n- TypeScript (tsx for execution)\n\n## Changelog\n\n### 1.0.1 (2026-02-10)\n\n- **Fixed**: Replaced hardcoded `~/.claude/skills/` paths with relative paths for portability across different install locations\n\n## License\n\nMIT\n\n## Related Skills\n\n- [ci-doctor](https://github.com/wrsmith108/claude-skill-ci-doctor) - Diagnose CI/CD pipeline issues\n- [version-sync](https://github.com/wrsmith108/claude-skill-version-sync) - Sync Node.js versions\n- [docker-optimizer](https://github.com/wrsmith108/claude-skill-docker-optimizer) - Optimize Dockerfiles\n- [security-auditor](https://github.com/wrsmith108/claude-skill-security-auditor) - Security audits\n\n## References\n\n- [Vitest Fake Timers](https://vitest.dev/guide/mocking.html#timers)\n- [Testing Best Practices](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrsmith108%2Fclaude-skill-flaky-test-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrsmith108%2Fclaude-skill-flaky-test-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrsmith108%2Fclaude-skill-flaky-test-detector/lists"}