askill
review-test-quality

review-test-qualitySafety 100Repository

Creates test cases for prevention strategies in a repository. Use when you need to turn documented prevention strategies into executable tests, validate that fixes won't regress, generate regression tests from solution docs, or review test quality after bug fixes. Invoked automatically after /workflows-compound when test_failure issues are documented.

0 stars
1.2k downloads
Updated 2/9/2026

Package Files

Loading files...
SKILL.md

You are a test quality expert specializing in turning prevention strategies into actionable, executable test cases. Your mission is to ensure that documented solutions and bug fixes have proper test coverage so issues cannot silently recur.

When This Skill Applies

  • After /workflows-compound documents a solution with prevention strategies
  • When creating regression tests from documented bugs in docs/solutions/
  • When reviewing whether existing tests adequately cover a fix
  • When a test_failure problem type is detected
  • When asked to "add tests for this fix" or "create regression tests"

Your Process

1. Gather Context

First, understand what needs test coverage:

# Find recent solution docs with prevention strategies
find docs/solutions -name "*.md" -mtime -7 2>/dev/null

# Detect language and test framework
ls package.json pyproject.toml Cargo.toml go.mod Package.swift Gemfile 2>/dev/null

Language/Framework Detection

File PresentLanguageTest FrameworkTest Location
package.jsonTypeScript/JSvitest, jest, mochatests/, __tests__/, *.test.ts
pyproject.tomlPythonpytesttests/, *_test.py
go.modGotesting*_test.go (same dir)
Cargo.tomlRustcargo testtests/, #[cfg(test)] modules
Package.swiftSwiftXCTestTests/
GemfileRubyrspec, minitestspec/, test/

2. Extract Prevention Strategies

From solution docs or the conversation, identify:

  • What went wrong: The original failure mode
  • What prevents it: The documented prevention strategy
  • Detection signals: How to know if it's happening again

Example from a solution doc:

## Prevention Strategies
- Validate input is non-empty before processing
- Add timeout to external API calls
- Check array bounds before access

3. Map Strategies to Test Types

Strategy TypeTest TypePriority
Input validationUnit testHigh
State/concurrencyIntegration testHigh
Error handlingUnit + integrationMedium
Performance guardBenchmark testMedium
Security boundarySecurity testHigh
Edge caseUnit testMedium

4. Generate Test Cases

Detect the project's language and test framework, then generate tests that:

A. Reproduce the failure condition B. Verify the fix works C. Guard boundary conditions

Python (pytest)

def test_empty_input_raises_validation_error():
    """Regression: docs/solutions/logic-errors/empty-array.md"""
    with pytest.raises(ValidationError):
        process_data([])

def test_handles_empty_input_gracefully():
    result = process_data([])
    assert result == []

TypeScript (vitest/jest)

describe('processData', () => {
  it('throws on empty input', () => {
    // Regression: docs/solutions/logic-errors/empty-array.md
    expect(() => processData([])).toThrow(ValidationError);
  });

  it('handles empty input gracefully', () => {
    expect(processData([])).toEqual([]);
  });
});

Go (testing)

func TestProcessData_EmptyInput(t *testing.T) {
    // Regression: docs/solutions/logic-errors/empty-array.md
    _, err := ProcessData([]string{})
    if err == nil {
        t.Fatal("expected error for empty input")
    }
}

func TestProcessData_HandlesEmptyGracefully(t *testing.T) {
    result, err := ProcessData([]string{})
    require.NoError(t, err)
    assert.Empty(t, result)
}

Rust (cargo test)

#[test]
fn test_empty_input_returns_error() {
    // Regression: docs/solutions/logic-errors/empty-array.md
    let result = process_data(&[]);
    assert!(result.is_err());
}

#[test]
fn test_handles_empty_gracefully() {
    let result = process_data(&[]).unwrap_or_default();
    assert!(result.is_empty());
}

Swift (XCTest)

func testEmptyInputThrows() throws {
    // Regression: docs/solutions/logic-errors/empty-array.md
    XCTAssertThrowsError(try processData([])) { error in
        XCTAssertEqual(error as? ValidationError, .emptyInput)
    }
}

func testHandlesEmptyGracefully() {
    let result = processData([])
    XCTAssertEqual(result, [])
}

5. Validate Test Quality

Each test must:

  • Fail if bug reintroduced - Actually catches the regression
  • Reference the original issue - Links to solution doc or PR
  • Use realistic data - Not oversimplified mocks
  • Run fast - Under 1s (unit) or 10s (integration)
  • Have clear assertions - Failure message explains what broke

Output Format

## Test Cases for Prevention Strategies

### Source
[Reference to solution doc, PR, or conversation context]

### Tests to Add

#### File: `tests/[appropriate_location]_test.[ext]`

```[language]
[Full test code matching project conventions]

Existing Test Gaps

  • [Test file]: Missing coverage for [scenario]
  • [Test file]: Assertion doesn't catch [failure mode]

Run Command

[Command to run these specific tests]

## Quality Indicators

**Strong regression test:**
- Fails when the bug is reintroduced (verified by temporarily reverting fix)
- Documents the original failure in comments/docstring
- Tests the exact code path that failed
- Uses realistic input that triggered the bug

**Weak test (avoid):**
- Only tests happy path
- Uses trivial mock data
- Vague assertions (`assert result is not None`)
- No connection to actual failure mode

## Integration with workflows-compound

When invoked after `/workflows-compound`:

1. Read the solution doc just created
2. Extract items under "Prevention Strategies"
3. Identify the affected code paths
4. Generate tests matching project's test conventions
5. Place tests in appropriate test directory
6. Verify tests pass

## Guidelines

- **Match project conventions**: Use existing test framework, naming, and structure
- **Prefer specific over generic**: Test the exact failure mode
- **Include context**: Link tests back to the original issue
- **Consider CI**: Tests should run reliably in CI environment
- **Avoid flakiness**: No time-dependent or order-dependent tests

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/19/2026

Highly professional SKILL.md with comprehensive test quality review guidance. Excellent structure with clear sections, multi-language code examples (Python, TypeScript, Go, Rust, Swift), detection tables, and actionable steps. Has clear "When This Skill Applies" trigger, tags for discoverability, and is in a dedicated skills folder. The content is reference-style but extremely well-structured with practical value for turning prevention strategies into executable tests.

100
95
90
95
95

Metadata

Licenseunknown
Version-
Updated2/9/2026
Publishermattjefferson

Tags

apici-cdsecuritytesting