test-pruning-advisor
БесплатноБез исполняемых скриптовНе проверен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…
от izumin5210★ 32 звезды на GitHubОб этом скилле
Test Pruning Advisor
Skill for identifying tests that should be considered for removal based on the project's testing guidelines.
Purpose
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.
Deletion Consideration Criteria
Based on project testing guidelines (AGENTS.md / CLAUDE.md):
- Golden file test replaceable unit tests: Function-level unit tests for code analysis, schema generation, or code generation logic that could be covered by testdata golden file tests
- Trivial tests: Tests for simple getters/setters, direct value passthrough, or obvious behavior that provides minimal value
- Implementation-coupled tests: Tests that are tightly coupled to internal implementation details and would break with reasonable refactoring
- Orphaned tests: Tests for code or features that no longer exist in the codebase
Workflow
Step 1: Select Review Target
When the review target is not explicitly specified, ask the user (using the runtime's available interaction mechanism) to choose from the following options:
- Branch/PR changes: Review only test files added/modified in current branch vs main
- All tests: Review all
*.test.tsfiles in the codebase - Specific pattern: Review tests matching a specific path or pattern
Getting Test Files by Target
# 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/*"
Step 2: Categorize Test Files
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 |
Step 3: Launch Subagents for Analysis
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:
- Design each review unit as an independent subtask with explicit input/output.
- Execute independent subtasks in parallel when supported by the runtime.
- Pass only minimal required context to each subtask (target file(s), related source files, and evaluation criteria) to keep context isolated.
- Do not provide full repository-wide context to every subtask; keep context scoped to the review unit.
- Normalize and aggregate subtask outputs in the final report.
Subagent Prompt
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 cover
Step 4: Aggregate Results and Generate Report
After all subagents complete:
- Parse JSON results from each subagent
- Generate summary table showing all test files:
## 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 impleme
Установить test-pruning-advisor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл test-pruning-advisor?
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.
Как установить скилл test-pruning-advisor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-pruning-advisor запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic