home / skills / athola / claude-night-market / test-review

This skill helps you audit and improve test suites, identify coverage gaps, and enforce TDD/BDD practices for higher quality software.

npx playbooks add skill athola/claude-night-market --skill test-review

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
5.7 KB
---
name: test-review
description: 'Use this skill for test suite evaluation and quality assessment. Use
  when auditing test suites, analyzing coverage gaps, improving test quality, evaluating
  TDD/BDD compliance. Do not use when writing new tests - use parseltongue:python-testing.
  DO NOT use when: updating existing tests - use sanctum:test-updates.'
category: testing
tags:
- testing
- tdd
- bdd
- coverage
- quality
- fixtures
tools:
- coverage-analyzer
- scenario-evaluator
- gap-finder
usage_patterns:
- test-audit
- coverage-analysis
- quality-improvement
- gap-remediation
complexity: intermediate
estimated_tokens: 200
progressive_loading: true
dependencies:
- pensive:shared
- imbue:evidence-logging
modules:
- framework-detection
- coverage-analysis
- scenario-quality
- remediation-planning
---
## Table of Contents

- [Quick Start](#quick-start)
- [When to Use](#when-to-use)
- [Required TodoWrite Items](#required-todowrite-items)
- [Progressive Loading](#progressive-loading)
- [Workflow](#workflow)
- [Step 1: Detect Languages (`test-review:languages-detected`)](#step-1:-detect-languages-(test-review:languages-detected))
- [Step 2: Inventory Coverage (`test-review:coverage-inventoried`)](#step-2:-inventory-coverage-(test-review:coverage-inventoried))
- [Step 3: Assess Scenario Quality (`test-review:scenario-quality`)](#step-3:-assess-scenario-quality-(test-review:scenario-quality))
- [Step 4: Plan Remediation (`test-review:gap-remediation`)](#step-4:-plan-remediation-(test-review:gap-remediation))
- [Step 5: Log Evidence (`test-review:evidence-logged`)](#step-5:-log-evidence-(test-review:evidence-logged))
- [Test Quality Checklist (Condensed)](#test-quality-checklist-(condensed))
- [Output Format](#output-format)
- [Summary](#summary)
- [Framework Detection](#framework-detection)
- [Coverage Analysis](#coverage-analysis)
- [Quality Issues](#quality-issues)
- [Remediation Plan](#remediation-plan)
- [Recommendation](#recommendation)
- [Integration Notes](#integration-notes)
- [Exit Criteria](#exit-criteria)


# Test Review Workflow

Evaluate and improve test suites with TDD/BDD rigor.

## Quick Start

```bash
/test-review
```
**Verification:** Run `pytest -v` to verify tests pass.

## When To Use

- Reviewing test suite quality
- Analyzing coverage gaps
- Before major releases
- After test failures
- Planning test improvements

## When NOT To Use

- Writing new tests - use parseltongue:python-testing
- Updating existing tests - use sanctum:test-updates

## Required TodoWrite Items

1. `test-review:languages-detected`
2. `test-review:coverage-inventoried`
3. `test-review:scenario-quality`
4. `test-review:gap-remediation`
5. `test-review:evidence-logged`

## Progressive Loading

Load modules as needed based on review depth:

- **Basic review**: Core workflow (this file)
- **Framework detection**: Load `modules/framework-detection.md`
- **Coverage analysis**: Load `modules/coverage-analysis.md`
- **Quality assessment**: Load `modules/scenario-quality.md`
- **Remediation planning**: Load `modules/remediation-planning.md`

## Workflow

### Step 1: Detect Languages (`test-review:languages-detected`)

Identify testing frameworks and version constraints.
→ **See**: `modules/framework-detection.md`

Quick check:
```bash
find . -maxdepth 2 -name "Cargo.toml" -o -name "pyproject.toml" -o -name "package.json" -o -name "go.mod"
```
**Verification:** Run the command with `--help` flag to verify availability.

### Step 2: Inventory Coverage (`test-review:coverage-inventoried`)

Run coverage tools and identify gaps.
→ **See**: `modules/coverage-analysis.md`

Quick check:
```bash
git diff --name-only | rg 'tests|spec|feature'
```
**Verification:** Run `pytest -v` to verify tests pass.

### Step 3: Assess Scenario Quality (`test-review:scenario-quality`)

Evaluate test quality using BDD patterns and assertion checks.
→ **See**: `modules/scenario-quality.md`

Focus on:
- Given/When/Then clarity
- Assertion specificity
- Anti-patterns (dead waits, mocking internals, repeated boilerplate)

### Step 4: Plan Remediation (`test-review:gap-remediation`)

Create concrete improvement plan with owners and dates.
→ **See**: `modules/remediation-planning.md`

### Step 5: Log Evidence (`test-review:evidence-logged`)

Record executed commands, outputs, and recommendations.
→ **See**: `imbue:evidence-logging`

## Test Quality Checklist (Condensed)

- [ ] Clear test structure (Arrange-Act-Assert)
- [ ] Critical paths covered (auth, validation, errors)
- [ ] Specific assertions with context
- [ ] No flaky tests (dead waits, order dependencies)
- [ ] Reusable fixtures/factories

## Output Format

```markdown
## Summary
[Brief assessment]

## Framework Detection
- Languages: [list] | Frameworks: [list] | Versions: [constraints]

## Coverage Analysis
- Overall: X% | Critical: X% | Gaps: [list]

## Quality Issues
[Q1] [Issue] - Location - Fix

## Remediation Plan
1. [Action] - Owner - Date

## Recommendation
Approve / Approve with actions / Block
```
**Verification:** Run the command with `--help` flag to verify availability.

## Integration Notes

- Use `imbue:evidence-logging` for reproducible evidence capture
- Reference `imbue:diff-analysis` for risk assessment
- Format output using `imbue:structured-output` patterns

## Exit Criteria

- Frameworks detected and documented
- Coverage analyzed and gaps identified
- Scenario quality assessed
- Remediation plan created with owners and dates
- Evidence logged with citations
## Troubleshooting

### Common Issues

**Tests not discovered**
Ensure test files match pattern `test_*.py` or `*_test.py`. Run `pytest --collect-only` to verify.

**Import errors**
Check that the module being tested is in `PYTHONPATH` or install with `pip install -e .`

**Async tests failing**
Install pytest-asyncio and decorate test functions with `@pytest.mark.asyncio`

Overview

This skill evaluates test suites and produces a practical quality assessment and remediation plan. It helps detect testing frameworks, inventory coverage gaps, assess scenario quality under TDD/BDD principles, and produce evidence-backed recommendations. Use it to audit existing test suites rather than to author or update tests.

How this skill works

The skill scans the repository to detect languages and testing frameworks, runs coverage and discovery commands, and inventories which files and scenarios are exercised. It analyzes test scenarios for BDD clarity, assertion specificity, and common anti-patterns, then produces a prioritized remediation plan with owners and dates. Outputs include a short summary, framework detection, coverage analysis, quality issues list, and an actionable remediation plan with evidence logs.

When to use it

  • Before a major release to validate test health
  • Auditing an existing test suite for quality and gaps
  • After recurring or intermittent test failures to find root causes
  • When planning improvements to achieve TDD/BDD compliance
  • When assessing risk for refactors or dependency upgrades

Best practices

  • Run pytest -v and pytest --collect-only to verify discovery before deep analysis
  • Use coverage tools to get baseline metrics and focus on critical paths (auth, validation, error handling)
  • Prefer Given/When/Then style and clear Arrange-Act-Assert structure in scenario descriptions
  • Log executed commands, outputs, and file diffs as reproducible evidence
  • Create remediation items with a single owner and a target date for measurable follow-up

Example use cases

  • Perform a repo-wide test quality audit and generate a remediation backlog
  • Identify untested critical flows and produce coverage-focused remediations
  • Detect flaky tests and recommend fixes (remove dead waits, fix order dependencies, improve fixtures)
  • Assess compliance with TDD/BDD patterns and recommend scenario rewrites
  • Prepare a test-related risk report before a large refactor or release

FAQ

Can I use this skill to write new tests?

No. This skill is for evaluating and planning improvements to existing tests. Use a dedicated test-writing skill for authoring tests.

What evidence does the skill produce?

It logs commands run (e.g., pytest, coverage), outputs, file lists with gaps, and a remediation plan with owners and dates to make follow-up reproducible.