prune-test-suite
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
Review the test suite for relevance against current source code, pruning stale tests and adding missing coverage
In this repository24 other files it gives its agents.
- audit-fixSkill
- auditSkill
- commitSkill
- deps-auditSkill
- digestSkill
- flowchartSkill
- git-undoSkill
- handoffSkill
- hone-skillSkill
- kickoffSkill
- math-researchSkill
- new-skillSkill
- next-stepsSkill
- prompt-engineerSkill
- release-notesSkill
- repo-adoptSkill
- repo-issue-scoutSkill
- resolve-tester-bugsSkill
- scaffold-auditSkill
- session-reportSkill
- sidebarSkill
- sync-profile-readmeSkill
- rename-to-match-folderSkill
- worktree-cleanupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 23
Import paths within the test (e.g., import { foo } from '../utils')
- Distinctive: line 31
Do not modify any source file.
- Distinctive: line 38
Read the test file in full.
- Distinctive: line 39
Read every source file listed for that test.
- Very specific: line 47
Check each of the following for every test or describe block:
- Distinctive: line 69
If logic requires a database client, HTTP call, framework hook, or rendering context to execute, it does not qualify — skip it.
- Distinctive: line 76
Write a numbered list of concrete changes.
- Distinctive: line 81
Do not apply changes yet. Print the list, then stop and ask the user to confirm before proceeding.
- Distinctive: line 91
Only after the user has confirmed the change list (or pre-approved auto-apply):
- Very specific: line 93
DELETE: Remove the individual it(...) / test(...) block.
- Very specific: line 96
ADD: Add new test blocks inside an appropriate describe, or create a new describe if none fits.
- Distinctive: line 104
Do not add test infrastructure (new configs, new packages, new scripts) unless the project has no test runner at all — in that case, ask …
- Distinctive: line 109
If a test file uses inline simulation functions (re-implementing source logic inside the test rather than importing it), verify those …
- Very specific: line 111
If a source function depends on Date.now() or new Date(), use a fixed reference date in the test and document the assumption in a comment.
- Distinctive: line 120
After applying all changes for all test files, print a summary table:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: prune-test-suite
Review and prune the test suite for this project. For each test file, verify its logic against the current production source, then apply all necessary changes.
Step 0 — Discover scope
- Find all test files in this project:
Excludeglob **/*.test.{ts,tsx,js,jsx} **/*.spec.{ts,tsx,js,jsx} **/__tests__/**/*.{ts,tsx,js,jsx}node_modules,dist,.next, and build output directories. - For each test file, determine which source file(s) it mirrors by examining:
- Import paths within the test (e.g.,
import { foo } from '../utils') - Inline simulation functions that replicate logic from a source file (match function names, regex patterns, or constants against the codebase via grep)
- File naming conventions (e.g.,
foo.test.tstestsfoo.ts)
- Import paths within the test (e.g.,
- Build a scope table mapping each test file to its source file(s). Print the table before proceeding.
Do not modify any source file. Do not touch node_modules, dist directories, or generated files.
Step 1 — Read both files
For each row in the scope table:
- Read the test file in full.
- Read every source file listed for that test.
Complete Steps 1-4 for each test file before moving to the next.
Step 2 — Audit
Check each of the following for every test or describe block:
- Logic match — Does the test's logic (imported or inlined) exactly match the corresponding production code? Flag any line in the test that copies a constant, regex, branch condition, function body, or message string that differs from the current source.
- Stale behaviour — Does the test assert something the source no longer does? (e.g., a branch that was removed, a string that changed, a parameter that was renamed, a function signature that was updated.)
- Dead test — Does the test import or reference a symbol, function, or type that no longer exists in the source? Does it test a code path that was deleted?
Missing coverage — Does the source contain pure, deterministic logic that has no corresponding test? Count logic as "pure" only if it can be exercised without mocking external services, databases, network calls, or framework internals. Examples:
- Regex patterns and validation functions
- Date/string/number formatting or parsing
- State machine transitions and boundary arithmetic
- Pure transform/filter/map logic
- Error message construction
If logic requires a database client, HTTP call, framework hook, or rendering context to execute, it does not qualify — skip it.
Step 3 — Produce a change list
Write a numbered list of concrete changes. Each item must specify:
- The action: DELETE test / UPDATE test / ADD test
- The file,
describeblock, andit(...)name affected - One sentence explaining why
Do not apply changes yet. Print the list, then stop and ask the user to confirm before proceeding. This list can include test deletions, which are only recoverable through git history, not through this skill - do not apply any change until the user approves the list, or has explicitly pre-approved auto-apply for this session.
Step 4 — Apply changes
Only after the user has confirmed the change list (or pre-approved auto-apply):
- DELETE: Remove the individual
it(...)/test(...)block. If an entiredescribeblock becomes empty, remove it too. - UPDATE: Edit only the specific lines that are wrong. Do not rewrite surrounding tests.
- ADD: Add new test blocks inside an appropriate
describe, or create a newdescribeif none fits. Follow the style and conventions of the existing test file (import patterns, assertion style, naming conventions). Do not introduce new testing libraries or dependencies.
Constraints
- Do not add test infrastructure (new configs, new packages, new scripts) unless the project has no test runner at all — in that case, ask before proceeding.
- Preserve every test that is still correct. Do not rewrite passing tests for style.
- Match the exact regex literal, exact error message string, and exact arithmetic from the source. Copy character-for-character; do not paraphrase.
- If a test file uses inline simulation functions (re-implementing source logic inside the test rather than importing it), verify those inline functions match the source exactly.
- If a source function depends on
Date.now()ornew Date(), use a fixed reference date in the test and document the assumption in a comment. - Edit the minimum number of lines necessary. If a diff would exceed 20 lines for a single test update, explain why before proceeding.
Output
After applying all changes for all test files, print a summary table:
| Test file | Tests deleted | Tests updated | Tests added | Notes |
| ... | ... | ... | ... | ... |
Then run the project's test suite using whatever test command is configured (check package.json
scripts for test, test:unit, etc.). Report whether all tests pass. If any fail, read the
failure output, fix the cause, and re-run until the suite is green.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

