Use when asked to "review tests for deletion", "find redundant tests", "cleanup tests", "identify low-value tests", or wants to identify tests that should be considered for removal based on project testing guidelines.
Skill for identifying tests that should be considered for removal based on the project's testing guidelines.
Analyze test files to identify redundant, low-value, or obsolete tests that may be candidates for deletion. This skill follows the project's testing philosophy which prioritizes golden file tests over function-level unit tests.
Based on project testing guidelines (AGENTS.md / CLAUDE.md):
When the review target is not explicitly specified, ask the user (using the runtime's available interaction mechanism) to choose from the following options:
*.test.ts files in the codebase# Branch/PR changes - test files added or modified
git diff main --name-only -- '**/*.test.ts' | grep -v testdata
# All test files (excluding testdata golden tests which are reviewed by golden-test-reviewer)
find packages -name "*.test.ts" -not -path "*/testdata/*" -not -path "*/__generated__/*"
# Specific pattern
find packages -name "*.test.ts" -path "*/<pattern>/*" -not -path "*/testdata/*"
Group test files by their purpose:
| Category | Path Pattern | Notes |
|----------|--------------|-------|
| Type extraction | packages/cli/src/type-extractor/*.test.ts | May overlap with golden tests |
| Resolver extraction | packages/cli/src/resolver-extractor/*.test.ts | May overlap with golden tests |
| Schema generation | packages/cli/src/schema-generator/*.test.ts | May overlap with golden tests |
| Auto-type generation | packages/cli/src/auto-type-generator/*.test.ts | May overlap with golden tests |
| Shared utilities | packages/cli/src/shared/*.test.ts | Utility functions |
| Config loading | packages/cli/src/config-loader/*.test.ts | Configuration handling |
| Runtime | packages/runtime/src/*.test.ts | Runtime utilities |
| Golden tests | packages/cli/src/gen-orchestrator/golden.test.ts | Main golden test runner |
For each test file (or cohesive batch of closely related files), create a separate subtask with an isolated context (subagent/subtask model) using the runtime's available execution mechanism (1 review unit = 1 isolated subtask).
IMPORTANT:
Read the prompt template from references/subagent-prompt.md and use it for each subagent.
Replace placeholders:
{test-file-path} - path to the test file{category} - category from the table above{related-source-files} - source files that the tests coverAfter all subagents complete:
## Review Summary
| Test File | Category | Tests | Deletable | Reason |
|-----------|----------|-------|-----------|--------|
| type-extractor/scanner.test.ts | Type extraction | 15 | 3 | Golden test overlap |
| shared/utils.test.ts | Utilities | 8 | 0 | - |
List deletion candidates by reason:
Note: Cross-file synthesis (e.g., overlap and priority decisions across multiple categories) must be done during aggregation, not inside isolated subtasks.
## Deletion Candidates
### Golden File Test Replaceable (High Confidence)
- **file.test.ts**: `describe("feature X")` - Covered by testdata/feature-x-basic/
- Specific tests: `it("should handle...")`, `it("should convert...")`
### Trivial Tests (Medium Confidence)
- **file.test.ts**: `it("should return input")` - Tests obvious passthrough behavior
### Implementation-Coupled (Review Recommended)
- **file.test.ts**: `it("internal state...")` - Depends on internal implementation detail
### Orphaned Tests (High Confidence)
- **file.test.ts**: `describe("OldFeature")` - OldFeature no longer exists
Provide confidence levels:
Summary statistics:
## Summary
- Total test files analyzed: X
- Total test cases: Y
- Deletion candidates: Z
- High confidence: A
- Medium confidence: B
- Low confidence: C
- Estimated test reduction: Z/Y (XX%)
golden-test-reviewer for thatreferences/subagent-prompt.md - Prompt template for subagent analysisreferences/evaluation-criteria.md - Detailed evaluation criteria with examplesSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer