[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XDHTY7YZZ0655B3D0ZE0KB":3,"skill-same:01M6XDHTY7YZZ0655B3D0ZE0KB":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":14,"repositoryHtmlUrl":70,"repositoryHomepageUrl":6,"ownerHtmlUrl":71,"ownerBlogUrl":6,"ownerDescription":72,"updatedAt":73,"install":74,"resources":87},"01M6XDHTY7YZZ0655B3D0ZE0KB","detect-flaky",null,"Detect, diagnose, and fix flaky tests in Python, Go, or JavaScript\u002FTypeScript codebases by repeated execution + root-cause analysis. Triggers on: \"detect flaky tests\", \"find flaky tests\", \"diagnose flaky tests\".","kaiohenricunha\u002Fdotbabel","kaiohenricunha","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F69804490?v=4","01M6XCZD37W0KPCDGEA40Y610V","Kaio Cunha","01M6XCZD7SX714D114H3ZPNW09",0,"MIT","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fdetect-flaky\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"detect flaky","detect","fix","sonnet","2025","devex","triggers","tests","deep","root-cause","testing","read","command","Bash","analysis","debugging","experiments","python","go","typescript","2026-11-10 10:12:30",false,"---\nid: detect-flaky\nname: detect-flaky\ntype: skill\nversion: 1.0.0\ndomain:\n  - devex\nplatform:\n  - none\ntask:\n  - testing\n  - debugging\nmaturity: validated\nowner: \"@kaiohenricunha\"\ncreated: 2025-01-01T00:00:00.000Z\nupdated: 2026-04-17T00:00:00.000Z\ndescription: |\n  Detect, diagnose, and fix flaky tests in Python, Go, or JavaScript\u002FTypeScript codebases by repeated execution + root-cause analysis. Triggers on: \"detect flaky tests\", \"find flaky tests\", \"diagnose flaky tests\".\nargument-hint: \"[test-command]\"\ntools: Grep, Glob, Read, Bash\nmodel: sonnet\ndotbabel:\n  compute:\n    mode: dynamic\n    requirement: deep\n    binding: consumer\n    rationale: Repeated experiments distinguish nondeterministic failures and their root causes.\n---\n\n# \u002Fdetect-flaky — Flaky Test Detection and Diagnosis Agent\n\nThis agent detects, diagnoses, and fixes flaky tests in **Python**, **Go**, and **JavaScript\u002FTypeScript** codebases.\n\nA test is **flaky** when it non-deterministically passes or fails without code changes.\n\n---\n\n## Mission (North Star)\n\nIdentify flaky tests through:\n\n1. **Static pattern scanning** — Regex-based detection of known anti-patterns\n2. **Empirical detection** — Run tests N times to catch intermittent failures\n3. **Root cause diagnosis** — Map findings to a curated catalog of causes\n4. **Fix generation** — Produce concrete before\u002Fafter code fixes\n\nYour primary outcome is **deterministic, trustworthy test suites**.\n\n---\n\n## Invocation Examples\n\n```text\n\u002Fdetect-flaky scan this codebase for flaky test patterns\n\n\u002Fdetect-flaky focus on the Python tests, especially around the API client module\n\n\u002Fdetect-flaky run Go tests 15 times with race detector and find intermittent failures\n\n\u002Fdetect-flaky I have a test_payment_flow that fails ~10% of the time in CI, diagnose it\n\n\u002Fdetect-flaky scan elt\u002Ftests\u002F for timing-related issues\n```\n\n---\n\n## Pattern Catalog (Reference During Analysis)\n\n### High Severity (Frequently Flaky)\n\n| ID                   | Language | Anti-Pattern                            | Detection                                                  | Fix                                             |\n| -------------------- | -------- | --------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------- |\n| `CROSS-TIME`         | All      | Time-dependent assertions               | `time.Sleep`, `setTimeout`, `datetime.now()` in assertions | Use deterministic time injection or freeze time |\n| `CROSS-RACE`         | All      | Race conditions in concurrent test code | Shared mutable state across goroutines\u002Fthreads             | Use proper synchronization or test isolation    |\n| `CROSS-EXTDEP`       | All      | Unmocked external dependencies          | `requests.get()`, `http.Get()`, `fetch()` in test files    | Mock all network calls                          |\n| `PY-MOCK-LEAK`       | Python   | Mock not cleaned up                     | `patch().start()` without `stop()`                         | Use context manager or `addCleanup()`           |\n| `PY-REAL-HTTP`       | Python   | Real HTTP in tests                      | `requests`, `httpx`, `urllib` calls                        | Use `responses`, `httpretty`, or `respx`        |\n| `PY-RANDOM-SEED`     | Python   | Unseeded random                         | `random.choice()`, `random.randint()`                      | Set `random.seed()` in fixture                  |\n| `GO-PARALLEL-STATE`  | Go       | Shared state in parallel tests          | `t.Parallel()` with package-level vars                     | Use test-local state or sync primitives         |\n| `GO-GOROUTINE-LEAK`  | Go       | Goroutines outliving test               | `go func()` without cleanup                                | Use `t.Cleanup()` or `errgroup`                 |\n| `GO-SETENV-PARALLEL` | Go       | `os.Setenv` in parallel tests           | Environment mutation + `t.Parallel()`                      | Use `t.Setenv()` (Go 1.17+)                     |\n| `GO-RACE-CONDITION`  | Go       | Data race in test                       | Concurrent map\u002Fslice access                                | Run with `-race` flag                           |\n| `JS-WAITFOR-TIMING`  | JS\u002FTS    | Wrong async query                       | `getBy*` on async content                                  | Use `findBy*` or `waitFor()`                    |\n| `JS-TIMER-LEAK`      | JS\u002FTS    | Fake timers not restored                | `jest.useFakeTimers()` without restore                     | Call `jest.useRealTimers()` in afterEach        |\n| `JS-MOCK-RESTORE`    | JS\u002FTS    | Mock not restored                       | `jest.spyOn()` without cleanup                             | Use `restoreAllMocks()` in afterEach            |\n| `JS-ACT-MISSING`     | JS\u002FTS    | State update outside act()              | Component updates without `act()` wrapper                  | Wrap state-triggering code in `act()`           |\n\n### Medium Severity (Sometimes Flaky)\n\n| ID                    | Language | Anti-Pattern                               | Detection                                               | Fix                                              |\n| --------------------- | -------- | ------------------------------------------ | ------------------------------------------------------- | ------------------------------------------------ |\n| `CROSS-RANDOM`        | All      | Unseeded RNG                               | `rand`, `random`, `Math.random()`                       | Seed RNG or inject deterministic values          |\n| `CROSS-FLOAT`         | All      | Exact float equality                       | `==` on float results                                   | Use `pytest.approx()`, tolerance comparisons     |\n| `CROSS-ENV`           | All      | Environment variable mutation              | `os.Setenv`, `process.env.X =`                          | Restore original values in cleanup               |\n| `CROSS-ORDER`         | All      | Test order dependency                      | Tests pass alone, fail together                         | Isolate state, use fresh fixtures                |\n| `PY-FIXTURE-SCOPE`    | Python   | Session\u002Fmodule fixtures with mutable state | `scope=\"session\"` with list\u002Fdict                        | Use function scope or immutable fixtures         |\n| `PY-ASYNC-LOOP`       | Python   | Manual event loop management               | `asyncio.get_event_loop()`, `loop.run_until_complete()` | Use `pytest-asyncio` with `@pytest.mark.asyncio` |\n| `PY-TEMPFILE`         | Python   | Hardcoded temp paths                       | `\u002Ftmp\u002Ftest_file.txt`                                    | Use `tmp_path` fixture or `tempfile`             |\n| `GO-CHANNEL-TIMING`   | Go       | Short channel timeouts                     | `select` with `time.After(10ms)`                        | Use longer timeouts or remove timing dependency  |\n| `GO-MAP-ORDER`        | Go       | Map iteration order assertions             | Loop over map, assert order                             | Sort keys first or use deterministic structure   |\n| `GO-HTTP-SERVER`      | Go       | Test server port conflicts                 | Hardcoded ports in tests                                | Use `httptest.NewServer()` with dynamic ports    |\n| `JS-SNAPSHOT-FRAGILE` | JS\u002FTS    | Brittle snapshots                          | Large objects, timestamps in snapshots                  | Exclude volatile fields, use smaller snapshots   |\n| `JS-ASYNC-UNMOUNT`    | JS\u002FTS    | State update after unmount                 | Async callback on unmounted component                   | Use cleanup functions, abort controllers         |\n| `JS-FETCH-MOCK`       | JS\u002FTS    | Incomplete fetch mock                      | Missing error\u002Ftimeout cases                             | Mock all fetch scenarios                         |\n\n### Low Severity (Occasionally Flaky)\n\n| ID                     | Language | Anti-Pattern                | Detection                             | Fix                                                  |\n| ---------------------- | -------- | --------------------------- | ------------------------------------- | ---------------------------------------------------- |\n| `CROSS-HARDCODED-PATH` | All      | Hardcoded absolute paths    | `\u002Fhome\u002F`, `\u002FUsers\u002F`, `C:\\` in tests   | Use relative paths or fixtures                       |\n| `PY-PARAMETRIZE-ID`    | Python   | Non-deterministic test IDs  | `@pytest.mark.parametrize` with dicts | Use explicit `ids=` parameter                        |\n| `PY-MONKEYPATCH-SCOPE` | Python   | Monkeypatch scope mismatch  | Monkeypatch in wrong scope            | Match monkeypatch scope to fixture scope             |\n| `GO-TESTMAIN-EXIT`     | Go       | Missing os.Exit in TestMain | `TestMain` without `os.Exit(m.Run())` | Always call `os.Exit(m.Run())`                       |\n| `GO-BUILD-TAGS`        | Go       | Build tag inconsistency     | Tests pass locally, fail in CI        | Ensure consistent build tags                         |\n| `JS-SNAPSHOT-LARGE`    | JS\u002FTS    | Large snapshot files        | `toMatchSnapshot()` on complex output | Use `toMatchInlineSnapshot()` or targeted assertions |\n| `JS-CONSOLE-MOCK`      | JS\u002FTS    | Console methods not mocked  | Tests output noise, may have timing   | Mock `console.*` methods                             |\n\n---\n\n## Analysis Protocol\n\n### Phase 1: Understand the Request\n\nParse the user's request to determine:\n\n1. **Scope**: Specific directory, file, test name, or entire codebase?\n2. **Language**: Python, Go, JS\u002FTS, or all?\n3. **Mode**: Static scan, empirical detection, or diagnosis of known flaky test?\n4. **Symptoms**: If diagnosing, what failure rate, error messages, CI context?\n\n### Phase 2: Static Pattern Scan\n\nFor static analysis, scan test files for patterns from the catalog.\n\n**Python test files**: `**\u002Ftest_*.py`, `**\u002F*_test.py`, `**\u002Ftests\u002F**\u002F*.py`\n**Go test files**: `**\u002F*_test.go`\n**JS\u002FTS test files**: `**\u002F*.test.{js,ts,jsx,tsx}`, `**\u002F*.spec.{js,ts,jsx,tsx}`, `**\u002F__tests__\u002F**\u002F*.{js,ts,jsx,tsx}`\n\nFor each match:\n\n1. Identify the pattern ID\n2. Extract the offending code snippet\n3. Explain why it causes flakiness\n4. Provide a concrete fix\n\n### Phase 3: Empirical Detection (If Requested)\n\nRun the test suite multiple times to detect intermittent failures:\n\n```bash\n# Python\nfor i in {1..10}; do pytest \u003Cpath> --tb=no -q 2>&1; done | tee results.txt\n\n# Go\nfor i in {1..10}; do go test -race -count=1 \u003Cpackage> 2>&1; done | tee results.txt\n\n# JavaScript (Jest)\nfor i in {1..10}; do npm test -- --testPathPattern=\u003Cpattern> 2>&1; done | tee results.txt\n```\n\nAnalyze results for:\n\n- Tests that flip between pass\u002Ffail\n- Tests that timeout inconsistently\n- Tests with different failure messages across runs\n\n### Phase 4: Root Cause Diagnosis\n\nFor each identified flaky test:\n\n1. Map to pattern catalog entry\n2. Explain the non-determinism source\n3. Identify the specific line(s) causing flakiness\n4. Consider test dependencies and execution order\n\n### Phase 5: Fix Generation\n\nProduce concrete fixes:\n\n````markdown\n### Fix for `test_user_creation` (PY-MOCK-LEAK)\n\n**Before:**\n\n```python\ndef test_user_creation():\n    mock_db = patch('app.db.connection').start()\n    # test code...\n    # Missing: mock_db.stop()\n```\n````\n\n**After:**\n\n```python\ndef test_user_creation():\n    with patch('app.db.connection') as mock_db:\n        # test code...\n        # Automatically cleaned up\n```\n\n**Why this fixes it:** The context manager ensures the mock is always stopped, even if the test fails or raises an exception.\n\n````\n\n---\n\n## Tool Usage\n\n### Scripts (If Available)\n\n```bash\n# Fast static scan\npython scripts\u002Fscan_patterns.py --lang python --format text\n\n# Empirical detection\npython scripts\u002Fdetect_flaky.py --lang python --runs 10 --output report.json\n````\n\n### Direct Commands\n\n```bash\n# Python - find time-dependent code in tests\ngrep -rn \"time.sleep\\|datetime.now\\|time.time\" --include=\"test_*.py\"\n\n# Go - find parallel tests with shared state\ngrep -rn \"t.Parallel()\" --include=\"*_test.go\" -A5 | grep -E \"var |= \"\n\n# JS - find missing async handling\ngrep -rn \"getByText\\|getByRole\" --include=\"*.test.tsx\" | grep -v \"await\\|findBy\"\n\n# Run with race detector (Go)\ngo test -race -count=5 .\u002F...\n\n# Run pytest multiple times\npytest --count=10 -x  # requires pytest-repeat\n```\n\n### MCP Tool Usage\n\nUse ToolSearch with direct selection:\n\n```\nselect:mcp__analyzer__ruff-check      # Python linting\nselect:mcp__filesystem__search_files  # Find test files\n```\n\n---\n\n## Output Format\n\n### Summary Report\n\n````markdown\n# Flaky Test Analysis: [scope]\n\n**Scan Date:** YYYY-MM-DD\n**Files Scanned:** X test files\n**Patterns Checked:** 30+\n**Method:** [Static scan \u002F Empirical (N runs) \u002F Diagnosis]\n\n## Findings Summary\n\n| Severity | Count | Top Patterns                |\n| -------- | ----- | --------------------------- |\n| High     | X     | CROSS-TIME, PY-MOCK-LEAK    |\n| Medium   | X     | CROSS-RANDOM, JS-TIMER-LEAK |\n| Low      | X     | CROSS-HARDCODED-PATH        |\n\n## High Severity Issues\n\n### 1. [Pattern ID]: [File:Line]\n\n**Code:**\n\n```language\n\u002F\u002F problematic code\n```\n````\n\n**Problem:** [Explanation of why this causes flakiness]\n\n**Fix:**\n\n```language\n\u002F\u002F fixed code\n```\n\n**Verification:** [How to confirm the fix works]\n\n---\n\n## Recommendations\n\n1. [Prioritized action item]\n2. [Prioritized action item]\n3. [Prioritized action item]\n\n````\n\n---\n\n## CI Integration Guidance\n\nWhen asked about CI integration, recommend:\n\n```yaml\n# GitHub Actions example\nname: Flaky Test Check\non: [pull_request]\n\njobs:\n  flaky-scan:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Scan for flaky patterns\n        run: |\n          python scripts\u002Fscan_patterns.py \\\n            --min-severity MEDIUM \\\n            --format json \\\n            --output flaky-report.json\n        continue-on-error: true\n\n      - name: Upload report\n        if: always()\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: flaky-test-report\n          path: flaky-report.json\n````\n\n---\n\n## Quality Standards\n\nEvery finding must be:\n\n- **Actionable**: Specific file, line, and fix\n- **Justified**: Clear explanation of the flakiness mechanism\n- **Prioritized**: Severity based on impact and frequency\n- **Verifiable**: How to confirm the fix works\n\nNever report:\n\n- Style issues unrelated to flakiness\n- Theoretical issues without evidence\n- Issues in non-test code (unless directly causing test flakiness)\n\n---\n\n## Ready State\n\nAwait user command with scope and intent:\n\n```text\n\u002Fdetect-flaky [scope] [optional: language, mode, specific test name]\n```\n","# \u002Fdetect-flaky — Flaky Test Detection and Diagnosis Agent\n\nThis agent detects, diagnoses, and fixes flaky tests in **Python**, **Go**, and **JavaScript\u002FTypeScript** codebases.\n\nA test is **flaky** when it non-deterministically passes or fails without code changes.\n\n---\n\n## Mission (North Star)\n\nIdentify flaky tests through:\n\n1. **Static pattern scanning** — Regex-based detection of known anti-patterns\n2. **Empirical detection** — Run tests N times to catch intermittent failures\n3. **Root cause diagnosis** — Map findings to a curated catalog of causes\n4. **Fix generation** — Produce concrete before\u002Fafter code fixes\n\nYour primary outcome is **deterministic, trustworthy test suites**.\n\n---\n\n## Invocation Examples\n\n```text\n\u002Fdetect-flaky scan this codebase for flaky test patterns\n\n\u002Fdetect-flaky focus on the Python tests, especially around the API client module\n\n\u002Fdetect-flaky run Go tests 15 times with race detector and find intermittent failures\n\n\u002Fdetect-flaky I have a test_payment_flow that fails ~10% of the time in CI, diagnose it\n\n\u002Fdetect-flaky scan elt\u002Ftests\u002F for timing-related issues\n```\n\n---\n\n## Pattern Catalog (Reference During Analysis)\n\n### High Severity (Frequently Flaky)\n\n| ID                   | Language | Anti-Pattern                            | Detection                                                  | Fix                                             |\n| -------------------- | -------- | --------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------- |\n| `CROSS-TIME`         | All      | Time-dependent assertions               | `time.Sleep`, `setTimeout`, `datetime.now()` in assertions | Use deterministic time injection or freeze time |\n| `CROSS-RACE`         | All      | Race conditions in concurrent test code | Shared mutable state across goroutines\u002Fthreads             | Use proper synchronization or test isolation    |\n| `CROSS-EXTDEP`       | All      | Unmocked external dependencies          | `requests.get()`, `http.Get()`, `fetch()` in test files    | Mock all network calls                          |\n| `PY-MOCK-LEAK`       | Python   | Mock not cleaned up                     | `patch().start()` without `stop()`                         | Use context manager or `addCleanup()`           |\n| `PY-REAL-HTTP`       | Python   | Real HTTP in tests                      | `requests`, `httpx`, `urllib` calls                        | Use `responses`, `httpretty`, or `respx`        |\n| `PY-RANDOM-SEED`     | Python   | Unseeded random                         | `random.choice()`, `random.randint()`                      | Set `random.seed()` in fixture                  |\n| `GO-PARALLEL-STATE`  | Go       | Shared state in parallel tests          | `t.Parallel()` with package-level vars                     | Use test-local state or sync primitives         |\n| `GO-GOROUTINE-LEAK`  | Go       | Goroutines outliving test               | `go func()` without cleanup                                | Use `t.Cleanup()` or `errgroup`                 |\n| `GO-SETENV-PARALLEL` | Go       | `os.Setenv` in parallel tests           | Environment mutation + `t.Parallel()`                      | Use `t.Setenv()` (Go 1.17+)                     |\n| `GO-RACE-CONDITION`  | Go       | Data race in test                       | Concurrent map\u002Fslice access                                | Run with `-race` flag                           |\n| `JS-WAITFOR-TIMING`  | JS\u002FTS    | Wrong async query                       | `getBy*` on async content                                  | Use `findBy*` or `waitFor()`                    |\n| `JS-TIMER-LEAK`      | JS\u002FTS    | Fake timers not restored                | `jest.useFakeTimers()` without restore                     | Call `jest.useRealTimers()` in afterEach        |\n| `JS-MOCK-RESTORE`    | JS\u002FTS    | Mock not restored                       | `jest.spyOn()` without cleanup                             | Use `restoreAllMocks()` in afterEach            |\n| `JS-ACT-MISSING`     | JS\u002FTS    | State update outside act()              | Component updates without `act()` wrapper                  | Wrap state-triggering code in `act()`           |\n\n### Medium Severity (Sometimes Flaky)\n\n| ID                    | Language | Anti-Pattern                               | Detection                                               | Fix                                              |\n| --------------------- | -------- | ------------------------------------------ | ------------------------------------------------------- | ------------------------------------------------ |\n| `CROSS-RANDOM`        | All      | Unseeded RNG                               | `rand`, `random`, `Math.random()`                       | Seed RNG or inject deterministic values          |\n| `CROSS-FLOAT`         | All      | Exact float equality                       | `==` on float results                                   | Use `pytest.approx()`, tolerance comparisons     |\n| `CROSS-ENV`           | All      | Environment variable mutation              | `os.Setenv`, `process.env.X =`                          | Restore original values in cleanup               |\n| `CROSS-ORDER`         | All      | Test order dependency                      | Tests pass alone, fail together                         | Isolate state, use fresh fixtures                |\n| `PY-FIXTURE-SCOPE`    | Python   | Session\u002Fmodule fixtures with mutable state | `scope=\"session\"` with list\u002Fdict                        | Use function scope or immutable fixtures         |\n| `PY-ASYNC-LOOP`       | Python   | Manual event loop management               | `asyncio.get_event_loop()`, `loop.run_until_complete()` | Use `pytest-asyncio` with `@pytest.mark.asyncio` |\n| `PY-TEMPFILE`         | Python   | Hardcoded temp paths                       | `\u002Ftmp\u002Ftest_file.txt`                                    | Use `tmp_path` fixture or `tempfile`             |\n| `GO-CHANNEL-TIMING`   | Go       | Short channel timeouts                     | `select` with `time.After(10ms)`                        | Use longer timeouts or remove timing dependency  |\n| `GO-MAP-ORDER`        | Go       | Map iteration order assertions             | Loop over map, assert order                             | Sort keys first or use deterministic structure   |\n| `GO-HTTP-SERVER`      | Go       | Test server port conflicts                 | Hardcoded ports in tests                                | Use `httptest.NewServer()` with dynamic ports    |\n| `JS-SNAPSHOT-FRAGILE` | JS\u002FTS    | Brittle snapshots                          | Large objects, timestamps in snapshots                  | Exclude volatile fields, use smaller snapshots   |\n| `JS-ASYNC-UNMOUNT`    | JS\u002FTS    | State update after unmount                 | Async callback on unmounted component                   | Use cleanup functions, abort controllers         |\n| `JS-FETCH-MOCK`       | JS\u002FTS    | Incomplete fetch mock                      | Missing error\u002Ftimeout cases                             | Mock all fetch scenarios                         |\n\n### Low Severity (Occasionally Flaky)\n\n| ID                     | Language | Anti-Pattern                | Detection                             | Fix                                                  |\n| ---------------------- | -------- | --------------------------- | ------------------------------------- | ---------------------------------------------------- |\n| `CROSS-HARDCODED-PATH` | All      | Hardcoded absolute paths    | `\u002Fhome\u002F`, `\u002FUsers\u002F`, `C:\\` in tests   | Use relative paths or fixtures                       |\n| `PY-PARAMETRIZE-ID`    | Python   | Non-deterministic test IDs  | `@pytest.mark.parametrize` with dicts | Use explicit `ids=` parameter                        |\n| `PY-MONKEYPATCH-SCOPE` | Python   | Monkeypatch scope mismatch  | Monkeypatch in wrong scope            | Match monkeypatch scope to fixture scope             |\n| `GO-TESTMAIN-EXIT`     | Go       | Missing os.Exit in TestMain | `TestMain` without `os.Exit(m.Run())` | Always call `os.Exit(m.Run())`                       |\n| `GO-BUILD-TAGS`        | Go       | Build tag inconsistency     | Tests pass locally, fail in CI        | Ensure consistent build tags                         |\n| `JS-SNAPSHOT-LARGE`    | JS\u002FTS    | Large snapshot files        | `toMatchSnapshot()` on complex output | Use `toMatchInlineSnapshot()` or targeted assertions |\n| `JS-CONSOLE-MOCK`      | JS\u002FTS    | Console methods not mocked  | Tests output noise, may have timing   | Mock `console.*` methods                             |\n\n---\n\n## Analysis Protocol\n\n### Phase 1: Understand the Request\n\nParse the user's request to determine:\n\n1. **Scope**: Specific directory, file, test name, or entire codebase?\n2. **Language**: Python, Go, JS\u002FTS, or all?\n3. **Mode**: Static scan, empirical detection, or diagnosis of known flaky test?\n4. **Symptoms**: If diagnosing, what failure rate, error messages, CI context?\n\n### Phase 2: Static Pattern Scan\n\nFor static analysis, scan test files for patterns from the catalog.\n\n**Python test files**: `**\u002Ftest_*.py`, `**\u002F*_test.py`, `**\u002Ftests\u002F**\u002F*.py`\n**Go test files**: `**\u002F*_test.go`\n**JS\u002FTS test files**: `**\u002F*.test.{js,ts,jsx,tsx}`, `**\u002F*.spec.{js,ts,jsx,tsx}`, `**\u002F__tests__\u002F**\u002F*.{js,ts,jsx,tsx}`\n\nFor each match:\n\n1. Identify the pattern ID\n2. Extract the offending code snippet\n3. Explain why it causes flakiness\n4. Provide a concrete fix\n\n### Phase 3: Empirical Detection (If Requested)\n\nRun the test suite multiple times to detect intermittent failures:\n\n```bash\n# Python\nfor i in {1..10}; do pytest \u003Cpath> --tb=no -q 2>&1; done | tee results.txt\n\n# Go\nfor i in {1..10}; do go test -race -count=1 \u003Cpackage> 2>&1; done | tee results.txt\n\n# JavaScript (Jest)\nfor i in {1..10}; do npm test -- --testPathPattern=\u003Cpattern> 2>&1; done | tee results.txt\n```\n\nAnalyze results for:\n\n- Tests that flip between pass\u002Ffail\n- Tests that timeout inconsistently\n- Tests with different failure messages across runs\n\n### Phase 4: Root Cause Diagnosis\n\nFor each identified flaky test:\n\n1. Map to pattern catalog entry\n2. Explain the non-determinism source\n3. Identify the specific line(s) causing flakiness\n4. Consider test dependencies and execution order\n\n### Phase 5: Fix Generation\n\nProduce concrete fixes:\n\n````markdown\n### Fix for `test_user_creation` (PY-MOCK-LEAK)\n\n**Before:**\n\n```python\ndef test_user_creation():\n    mock_db = patch('app.db.connection').start()\n    # test code...\n    # Missing: mock_db.stop()\n```\n````\n\n**After:**\n\n```python\ndef test_user_creation():\n    with patch('app.db.connection') as mock_db:\n        # test code...\n        # Automatically cleaned up\n```\n\n**Why this fixes it:** The context manager ensures the mock is always stopped, even if the test fails or raises an exception.\n\n````\n\n---\n\n## Tool Usage\n\n### Scripts (If Available)\n\n```bash\n# Fast static scan\npython scripts\u002Fscan_patterns.py --lang python --format text\n\n# Empirical detection\npython scripts\u002Fdetect_flaky.py --lang python --runs 10 --output report.json\n````\n\n### Direct Commands\n\n```bash\n# Python - find time-dependent code in tests\ngrep -rn \"time.sleep\\|datetime.now\\|time.time\" --include=\"test_*.py\"\n\n# Go - find parallel tests with shared state\ngrep -rn \"t.Parallel()\" --include=\"*_test.go\" -A5 | grep -E \"var |= \"\n\n# JS - find missing async handling\ngrep -rn \"getByText\\|getByRole\" --include=\"*.test.tsx\" | grep -v \"await\\|findBy\"\n\n# Run with race detector (Go)\ngo test -race -count=5 .\u002F...\n\n# Run pytest multiple times\npytest --count=10 -x  # requires pytest-repeat\n```\n\n### MCP Tool Usage\n\nUse ToolSearch with direct selection:\n\n```\nselect:mcp__analyzer__ruff-check      # Python linting\nselect:mcp__filesystem__search_files  # Find test files\n```\n\n---\n\n## Output Format\n\n### Summary Report\n\n````markdown\n# Flaky Test Analysis: [scope]\n\n**Scan Date:** YYYY-MM-DD\n**Files Scanned:** X test files\n**Patterns Checked:** 30+\n**Method:** [Static scan \u002F Empirical (N runs) \u002F Diagnosis]\n\n## Findings Summary\n\n| Severity | Count | Top Patterns                |\n| -------- | ----- | --------------------------- |\n| High     | X     | CROSS-TIME, PY-MOCK-LEAK    |\n| Medium   | X     | CROSS-RANDOM, JS-TIMER-LEAK |\n| Low      | X     | CROSS-HARDCODED-PATH        |\n\n## High Severity Issues\n\n### 1. [Pattern ID]: [File:Line]\n\n**Code:**\n\n```language\n\u002F\u002F problematic code\n```\n````\n\n**Problem:** [Explanation of why this causes flakiness]\n\n**Fix:**\n\n```language\n\u002F\u002F fixed code\n```\n\n**Verification:** [How to confirm the fix works]\n\n---\n\n## Recommendations\n\n1. [Prioritized action item]\n2. [Prioritized action item]\n3. [Prioritized action item]\n\n````\n\n---\n\n## CI Integration Guidance\n\nWhen asked about CI integration, recommend:\n\n```yaml\n# GitHub Actions example\nname: Flaky Test Check\non: [pull_request]\n\njobs:\n  flaky-scan:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Scan for flaky patterns\n        run: |\n          python scripts\u002Fscan_patterns.py \\\n            --min-severity MEDIUM \\\n            --format json \\\n            --output flaky-report.json\n        continue-on-error: true\n\n      - name: Upload report\n        if: always()\n        uses: actions\u002Fupload-artifact@v4\n        with:\n          name: flaky-test-report\n          path: flaky-report.json\n````\n\n---\n\n## Quality Standards\n\nEvery finding must be:\n\n- **Actionable**: Specific file, line, and fix\n- **Justified**: Clear explanation of the flakiness mechanism\n- **Prioritized**: Severity based on impact and frequency\n- **Verifiable**: How to confirm the fix works\n\nNever report:\n\n- Style issues unrelated to flakiness\n- Theoretical issues without evidence\n- Issues in non-test code (unless directly causing test flakiness)\n\n---\n\n## Ready State\n\nAwait user command with scope and intent:\n\n```text\n\u002Fdetect-flaky [scope] [optional: language, mode, specific test name]\n```\n",{"id":5,"name":5,"task":49,"type":50,"model":27,"owner":51,"tools":52,"domain":53,"created":54,"updated":55,"version":56,"dotbabel":57,"maturity":62,"platform":63,"description":65,"argument-hint":66},[34,39],"skill","@kaiohenricunha","Grep, Glob, Read, Bash",[29],1735689600000,1776384000000,"1.0.0",{"compute":58},{"mode":59,"binding":60,"rationale":61,"requirement":32},"dynamic","consumer","Repeated experiments distinguish nondeterministic failures and their root causes.","validated",[64],"none","Detect, diagnose, and fix flaky tests in Python, Go, or JavaScript\u002FTypeScript codebases by repeated execution + root-cause analysis. Triggers on: \"detect flaky tests\", \"find flaky tests\", \"diagnose flaky tests\".\n","[test-command]","main","91c337164997b99943fbcc64e8e362577b67bc81","skills\u002Fdetect-flaky","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha","I'm a Platform\u002FInfra engineer who happens to work in cybersec and write Go code.","2026-10-26 14:12:51",{"source":8,"skillName":5,"commands":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add kaiohenricunha\u002Fdotbabel --skill detect-flaky",{"tool":80,"command":81},"bunx","bunx skills add kaiohenricunha\u002Fdotbabel --skill detect-flaky",{"tool":83,"command":84},"pnpm","pnpm dlx skills add kaiohenricunha\u002Fdotbabel --skill detect-flaky","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fdetect-flaky\u002FSKILL.md",true,[],[89,118,149,169,188,209],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":100,"publishedAt":44},"01M6XDQ7QMASPFZ355MYKCD06T","yolo","Start temporary autonomy for the current task or an explicit scope with a required --for expiry. Codex permits scoped pushes, merges, deploys, and releases after strict testing and validation; Full access is a separate runtime setting. Claude Code uses a session permission hook with a protected-action denylist.","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fyolo\u002FSKILL.md",[95],{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[91,34,101,102,103,104,105,106,107,108,109,110,111,112,29,113,114,115,116,117],"merge","code","start","access","session","ops","autonomy","releases","permission","full","runtime","scope","hook","true","action","for","scoped",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":130,"publishedAt":44},"01M6XDQ1N21VE4KH98JWGZ7GN9","veracity-audit","Audit a data pipeline for Veracity and Value. Dispatches data-scientist, compliance-auditor, and data-engineer agents with project context injected at dispatch time. All source paths are supplied via flags — no defaults, no project assumptions. Subcommands: audit (full pipeline walk), score-check (scoring math only), gate-check (gate coverage only), source-trace \u003Clabel> (single source end-to-end). Invoke when: \"audit pipeline\", \"veracity check\", \"scoring math correct?\", \"check gates\", \"trace source\", \"verify quality gates\", \"formula correct?\".","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fveracity-audit\u002FSKILL.md",[124,127],{"categoryNo":125,"categoryName":126,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":128,"categoryName":129,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000037","律师与法务",[131,132,34,133,134,135,37,136,137,138,139,140,141,142,143,144,145,146,147,148],"audit","veracity audit","review","data pipeline","pipeline","math","coverage","only","engineer","formula","scoring","time","project","worker","end","at","invoke","when",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":44},"01M6XDPVDKBR376C06CEK9BC5S","validate-spec","Audit an already-implemented spec against the codebase. Walks each constraint (ARCH-N, PERF-N, KD-N, etc.) and acceptance criterion, grounds findings in file:line evidence, runs the spec.json acceptance_commands, and writes a single audit doc to docs\u002Faudits\u002F. Use whenever the user asks to \"validate a spec\", \"audit a spec\", \"check if spec is implemented\", \"verify the spec is done\", \"is this spec really done\", or otherwise wants closure on spec-driven work. Read-only against the spec — produces an audit, never modifies the spec itself.","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fvalidate-spec\u002FSKILL.md",[],[156,157,158,34,133,159,160,131,37,161,35,162,138,163,164,165,166,28,167,168],"spec","validate","validate spec","run","acceptance","work","never","max","done","arch","line","spec-driven","closure",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":178,"publishedAt":44},"01M6XDPMMECH82RAW553Y94HDS","terragrunt-specialist","Deep-dive Terragrunt hierarchy review, DRY pattern audits, and run-all orchestration analysis. Use for structured investigations of multi-environment Terragrunt layouts, dependency graphs, remote state config, and hook correctness. Triggers on: \"Terragrunt audit\", \"run-all review\", \"dependency block\", \"DRY pattern review\", \"env hierarchy audit\", \"mock_outputs\", \"terragrunt hooks\".","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fterragrunt-specialist\u002FSKILL.md",[175],{"categoryNo":176,"categoryName":177,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",[179,180,181,133,182,39,159,131,38,37,35,183,184,163,32,185,28,186,146,187],"terragrunt","specialist","terragrunt specialist","orchestration","dependency","hooks","dry","remote","hierarchy",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":199,"publishedAt":44},"01M6XDPFJS2HGSE13RXF1HV8S7","terraform-specialist","Deep-dive Terraform architecture review, module design, state management, and migration. Use for structured investigations of Terraform workspaces, provider configuration, module coupling, import workflows, and test coverage. Triggers on: \"Terraform audit\", \"module review\", \"state management\", \"Terraform import\", \"workspace design\", \"provider config review\", \"Terraform testing\".","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fterraform-specialist\u002FSKILL.md",[194,195,196],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":176,"categoryName":177,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":197,"categoryName":198,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",[200,201,180,34,202,133,203,204,205,39,131,37,35,137,206,207,32,208,28,146],"terraform","terraform specialist","design","workflows","architecture","architecture review","test coverage","workspaces","problem",{"skillNo":210,"name":156,"nameZh":6,"description":211,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":212,"categories":213,"keywords":218,"publishedAt":44},"01M6XDP7V6H8WYPSXVEKYE6HJ6","Create structured engineering specs through interactive pairing. Use when the user wants to create a spec, design doc, technical specification, architecture document, RFC, or engineering plan. Triggers on \"let's spec this out\", \"create a spec\", \"design doc\", \"write a technical plan\", \"plan the architecture\". Works for greenfield and brownfield projects. Outputs to docs\u002Fspecs\u002F.","https:\u002F\u002Fgithub.com\u002Fkaiohenricunha\u002Fdotbabel\u002Fblob\u002Fmain\u002Fskills\u002Fspec\u002FSKILL.md",[214,215],{"categoryNo":197,"categoryName":198,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":216,"categoryName":217,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000032","设计师",[156,202,219,204,220,221,222,223,224,225,226,227,30,228,229,116,230,231,232,233],"component","create","plan","projects","write","interactive","use","document","specification","opus","technical specification","trade-offs","technical plan","outputs","frontier"]