Test audit disable

From bdfinst/agentic-dev-team · View interactive version

Test audit disable is an AI agent skill from the GitHub repository bdfinst/agentic-dev-team. Standalone worker. Audits the existing test suite for tests that cannot fail — no assertions, assertions on constants, expect-true, swallowed exceptions, self-equality — and disables each one by skip-and-tag (never deletes). Records each disabled test plus its reason in a JSON log under `.claude/mem

How to use this skill

Skill file

Test Audit + Disable

Role: worker. Identifies tests that cannot fail and disables them so the next coverage run measures a true baseline, not a false positive inflated by tautologies. Tests are skipped + tagged, never deleted — Phase 4 repairs them.

You have been invoked with the /test-audit-disable command.

Parse Arguments

Arguments: $ARGUMENTS

Steps

1. Detect language + test framework

Probe the repo root for the test stack. Take the first match:

If multiple stacks are present, process each. If none, ask the operator which to use.

2. Detect cannot-fail tests

For each test file, search for the cannot-fail patterns. The set is language-agnostic conceptually but the regex differs per framework — use these signal patterns:

| Pattern | Example | Reason |

|---|---|---|

| No assertion at all | it('does X', () => { service.doX(); }) | nothing to fail on |

| Assertion on a literal | expect(1).toBe(1), assertEquals(true, true) | self-evaluating |

| Expect-truthy on a constant | expect(true).toBeTruthy() | tautology |

| Self-equality | expect(x).toBe(x), assertEquals(obj, obj) | always true |

| Swallowed exception with no assertion in the catch | try { … } catch { } | masks failures |

| Assertion only inside a never-entered branch | if (false) { assert … } | dead test |

| expect.anything() / expect.any(*) as the only assertion | | matches anything |

| Negative assertion on a never-thrown error | expect(() => fn()).not.toThrow() with no throw path | tautology unless fn can throw |

For Python add: assert True, self.assertTrue(True), self.assertIsNotNone(self). For JVM add: assertTrue(true), assertEquals(x, x). For Go add: if err != nil { t.Errorf(…) } blocks with no error-path coverage and t.Log as the only call.

A finding requires file path + line + snippet + reason. Use Grep (ripgrep) with file globs scoped to the framework's test conventions.

Graph-assisted lookup. Prefer CodeGraph/Repowise over raw Grep for locating

test files and confirming a suspect assertion has no real call path behind it

(e.g. a swallowed-exception catch block that never reaches production error

handling) — see CODE0

for tool selection and the fallback contract.

3. Build the cannot-fail list

Collect all findings into a JSON array:

[
  {
    "file": "src/widget/widget.test.ts",
    "line": 42,
    "test": "renders without crashing",
    "snippet": "it('renders without crashing', () => { render(<Widget/>) });",
    "reason": "no-assertion"
  },
  …
]

4. Preview + confirm

Print the count by reason and the first ~20 entries. Ask:

Disable these N cannot-fail tests? (yes / no / show all)

If --dry-run, print and exit zero without modifying anything.

5. Disable in place

For each finding, use Edit to insert the framework's skip helper at the matching test boundary, with the reason as the skip message:

Never delete the test body. Phase 4 needs the original implementation to repair against the public-interface Gherkin.

6. Persist phase-3 progress + the disabled-tests log

Write:

The orchestrator's Phase-3 progress file is owned by /coverage-baseline, which runs immediately after this worker.

7. Report

Print:

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.