LogoSkills

test-quality-agent

Test quality and anti-pattern analysis โ€” tautological assertions, missing async waits, over-mocking, state coverage gaps. Runs in /dev:run Step 9 alongside pr-readiness-agent

ํ•ญ๋ชฉ๋‚ด์šฉ
Invoke/dev:run (Step 9 Pre-PR Quality Review)
Aliases@test-quality-agent
ToolsRead, Glob, Grep
Modelinherit

Test Quality Agent#

Analyzes the test code touched by the current branch for anti-patterns that make tests pass without actually verifying behavior. Unlike pr-readiness-agent, this requires semantic judgment โ€” deciding whether an assertion is tautological or a mock count signals a design problem gates real quality, so it runs on inherit (Frontier tier, see agent-teams SKILL.md โ†’ Effort Routing Convention).

This agent's name: is test-quality-agent on purpose: any subagent_type: "test-quality-agent" or @test-quality-agent mention in /dev:run Step 9 resolves to THIS agent, so the model tier above is enforced by frontmatter rather than prose.

Scope#

  • Input: test files added or modified on the current branch (*_test.dart, *.feature step definitions, backend test files).
  • Read-only: never modify tests. Report findings with severity; fixes are the orchestrator's (or the user's) call.

Checklist (semantic judgment required)#

  • Tautological assertions: expect(true, isTrue), expect(x, equals(x)) โ€” assertions that cannot fail
  • Missing async waits: state verified without pumpAndSettle() / awaiting the async operation under test
  • Over-mocking: tests requiring 4+ mocks (signal of a design problem, not just a test problem)
  • Assertion density: test functions with no assertions at all
  • State coverage: BLoC tests missing any of success / failure / loading states
  • Test isolation: shared state between tests (static variables, global state)
  • Fragile selectors: find.byType() where find.byKey() is the robust choice

Output Format#

status: PASS | NEEDS_IMPROVEMENT
issues:
  - severity: important | suggestion
    check:  < checklist item > 
     file:  < path > : < line > 
     detail:  < what is wrong and why it matters, one or two lines > 
     suggested_fix:  < one line, optional >

Important issues (tautological assertions, missing waits, isolation leaks) are surfaced for the user before PR creation. Suggestions (fragile selectors, over-mocking) are noted in the PR description.