원클릭으로
test-hygiene-scanner
Triage hardcoded dates, AsyncMock misuse, cross-tier truncates, and envelope assertion bugs in the test suite
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Triage hardcoded dates, AsyncMock misuse, cross-tier truncates, and envelope assertion bugs in the test suite
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Scan a project, interview the user about unknowns, and generate a complete AI harness (Copilot + Claude + Opencode) with Constitutional Articles I–IX
Scan a project, interview the user about unknowns, and generate a complete AI harness (Copilot + Claude + Opencode) with Constitutional Articles I–IX
Scaffold a {{DB_PROVIDER}} SQL migration compliant with sql-standards.md
Scan E2E tests for no-op assertions and overly permissive checks that provide false confidence
Generate a contract test skeleton for a backend or frontend service following TDD Article III
Scan a project, interview the user about unknowns, and generate a complete AI harness (Copilot + Claude + Opencode) with Constitutional Articles I–IX
| name | test-hygiene-scanner |
| description | Triage hardcoded dates, AsyncMock misuse, cross-tier truncates, and envelope assertion bugs in the test suite |
| user-invocable | true |
| disable-model-invocation | true |
Scan the test suite for common hygiene violations that cause flaky or misleading tests.
Search for ISO date strings that will rot as wall-clock advances:
2026- in test filesDate.parse("...") with fixed datesgrace_expires_at pinned to past/future datesSearch for AsyncMock wrapping sync methods:
httpx.Response.json() mocked with AsyncMock__getitem__, __enter__) mocked with AsyncMockSearch for autouse=True conftest fixtures that truncate shared tables:
.delete().neq(...) on users, creator_profiles, agencies, creatorstruncate_all_tables(...) without tier gatingSearch for assert "detail" in error_data against the project's API:
{"error": {"code": ..., "message": ...}} per Article IV.assert "detail" in error_data is a bug unless the response is from a third-party.Search for tests reading module-level caches without patching:
get_prompt_loader(), get_async_supabase(), MLflow factoriesFor each category, report:
Example:
## Test Hygiene Report
### Hardcoded Dates
- WARNING `frontend/src/stores/analytics.test.ts:42` — `Date.parse("2026-02-17")` used for "recent" window. Use `Date.now() - offset` or `vi.useFakeTimers()`.
### AsyncMock Misuse
- ERROR `backend/tests/unit/test_email_service.py:88` — `AsyncMock` wrapping `httpx.Response.json()` (sync method). Use `MagicMock` instead.
### Cross-Tier Truncates
- ERROR `backend/tests/integration/conftest.py:15` — `autouse=True` fixture truncates `users` table. Drop autouse or gate on `_foreign_tier_present`.
### Envelope Assertions
- ERROR `backend/tests/e2e/test_user_journey.py:203` — `assert "detail" in error_data` against this API. Use `assert "error" in body` per Article IV.
### Singleton Leaks
- WARNING `backend/tests/unit/test_viva_node.py:55` — reads `get_prompt_loader()` without patching. Patch with `@patch("...get_prompt_loader")`.
tests/**, **/*.test.ts, **/*.test.py).