Skip to main content

Classify repository tests and prune cases that fail the value bar

Runs a pool of Pi agents that mark every test case keep, delete, merge, or rewrite against a four-point value bar, then writes a report you apply with a separate CLI step—no code edits during the classification run.

Source facts

Repository
arthurfiorette/tests-diet
Last source activity
October 30, 2026 at 02:14
Detected SKILL.md language
English
Stars
1
Forks
0

Examples

README example of a style-class assertion test that only fails when Card styles change on purpose—cheap, passes, protects nothing—so the agents mark it delete.

Uses

Use when a suite grew faster than the protection it gives and you need an audit before deleting or merging cases. Pair with the writing-tests skill afterward so agents stop adding low-value tests.

Prerequisites

A Node project where you can run npx tests-diet. Optional tests-diet.config.json at the repo root for instructions, model, rubric, and layout globs. Review happens in a browser via .tests-diet/tests-diet.html.

How to use

npx tests-diet plan for groups and token estimates → run --limit 2 to calibrate → full run (resumable) → review the HTML report → delete --dry-run then delete → merge remaining groups from the markdown report → clean unused helpers → run formatter, linter, typecheck, and affected tests.

Limitations

Classification never edits code; applying delete only touches files unchanged since the report. rewrite is left for follow-up. Changing instructions, model, or rubric invalidates earlier results. Unusual layouts need extraLanguages or --match globs.

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
tests-diet
description
Classify a repository's tests with the tests-diet CLI and apply its report. Use to audit, prune or slim down a test suite.
# tests-diet `tests-diet` splits a repository's test files into groups, runs a pool of pi agents that judge every test case against the `writing-tests` value bar, and writes a report. It never edits code during a run; applying the report is a separate step. ## Classify Settings live in `tests-diet.config.json` at the root (`"$schema": "https://arthur.run/tests-diet/schema.json"`); flags override them for one run. ```bash npx tests-diet plan # groups and token estimates, no model calls npx tests-diet run --limit 2 # calibrate on two groups, then review .tests-diet/tests-diet.html npx tests-diet run # classify the rest; resumable, safe to interrupt npx tests-diet status # progress, failures, usage and cost so far ``` - Repo-specific rules (protected areas, house patterns) go in the file named by `instructions`. Changing them, the model or the rubric makes earlier results stale, so a rerun classifies again. - Unusual layouts: `extraLanguages` in the config, or `--match '<glob>[:<content regex>]'` and `--case-start '<regex>'`. ## Apply a report 1. `npx tests-diet delete --dry-run`, then `npx tests-diet delete`. It deletes `delete_file` files and removes every `delete` range, only in files unchanged since they were reported. Add `--only <path>` to go one folder at a time. 2. `.tests-diet/tests-diet.md` lists what is left, per file, with ranges as `startLine-endLine` (1-based, inclusive). It is large on big repositories: every `## <path>` section stands alone, so read it one folder at a time. 3. Merges: cases sharing a merge group become one test (a table, or one flow) that keeps every assertion that matters. Find them by test name, since line numbers moved after step 1. A group whose "covered by" names cases in other files is combined across those files. 4. `rewrite`: leave for a follow-up unless asked. 5. Remove what became unused: imports, helpers, fixtures, mock files, production exports or flags that only those tests used. 6. Run the project's formatter, linter, type checker and the affected test suites. A failure in a kept test means an edit went wrong: restore it. Group the edits by package or area, one change set each, listing removed cases and lines.
View on GitHub