Trim
БесплатноБез исполняемых скриптовНе проверенUse when writing, changing, reviewing the quality of, or sweeping tests - before adding a test, when a suite feels bloated, slow to change, or full of tests…
от escoffier-labs284 установки в других каталогахОб этом скилле
trim
A butcher trims fat so the cut is worth cooking; nobody trims by weight. This skill holds every test to one value bar: a test earns its maintenance cost by protecting behavior, a credible regression, or an independently meaningful contract. Tests that re-assert the source, repeat stronger proof, couple to implementation, or keep test-only production seams alive are fat.
Core principle: optimize for confidence, not deletion count. A deletion without written evidence is a guess, and an uncertain candidate stays.
Three modes, one value bar:
- Authoring gate - every new or changed test, at write time. Runs alongside taste.
- Audit - a focused, read-only-first sweep of one area for junk tests and the seams they demand. Lands as small coherent batches.
- Campaign - prune one whole subsystem's test surface in one pass. Read references/campaign.md before starting one.
Authoring gate
Before adding any test, answer four questions. A missing answer means do not add it yet: redesign the test (a different boundary, a different assertion) until it passes the gate. It never means skipping the test. Under taste, no production code lands until a test passes this gate and fails. If an existing test already fails for the change, that test is the RED step; run it and cite it.
- What does it protect? An observable behavior, invariant, or independent contract.
- What regression makes it fail? Name a credible one.
- Why does existing coverage miss that failure? Each contract has one primary test owner at the strongest boundary. Another layer needs its own distinct risk, such as a transport or lifecycle failure the owner cannot reach. Prefer extending a table-driven case or shared fixture over a near-duplicate test, and consolidate duplicated setup in the refactor step of the same change.
- Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, move the test to the real boundary instead.
Then check it against every junk pattern. A match fails the gate unless the retention bar names the contract it independently guards. A test that would break under a behavior-preserving refactor asserts implementation, not behavior; rewrite it at the owning boundary before landing it.
A bug regression test must fail on the pre-fix code for the intended reason and pass after the fix at the owner boundary. A regression test that never demonstrably failed proves the mock, not the fix. One regression at the owner boundary covers the bug; do not replay the same scenario at every layer it crosses.
Junk patterns
The shared checklist: the gate rejects a new test that matches one, and audits hunt for existing tests that do.
- assertion-free coverage probes;
- self-comparisons and identity copiers;
- copied fixtures, inventories, manifests, or export lists;
- exact source, import, or string greps;
- private predicate or call-shape tests duplicated at real boundaries;
- duplicate invocations of the same contract;
- local replays of a shared helper's tests in each consumer;
- tests whose only purpose is preserving test-only exports, globals, or wrappers;
- tests whose only purpose is exercising production code with no non-test caller (an audit deletes that code too);
- expected values produced by the helper or renderer under test;
- mocks that implement the asserted behavior, or one identical mock standing in for different APIs;
- fixtures that supply the receipt, admission, or callback ordering the owner should produce, or persistence asserted against a store the path never writes;
- capability tests that restate declared flags instead of exercising what the flag promises;
- negative controls that pass for an unrelated reason, such as a denial from a different guard or a rejection the production path never reaches;
- names or fixtures that promise more than the input exercises, such as a "clears the cache" test that asserts the cache was not cleared.
Retention bar
Keep a test when it independently enforces a public API, SDK, protocol, config, migration, storage, security, platform, default, prompt-byte, generated cross-language, package, release, or architecture contract. Also keep:
- call ordering when order is observable behavior;
- regressions with a credible failure mode;
- source inspection when it is the cheapest independent guard: it fails when the contract changes (the user-facing key, byte, or path) and survives an identifier-only rename;
- a retained test that fails on the baseline. Treat it as a possible product bug: reproduce it and hand it to refire instead of deleting it.
Static or slow is not a deletion reason. A test that resembles implementation may still be the only independent contract; prove otherwise before removing it. In an audit, an existing test that must change for a behavior-preserving
Установить Trim в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Trim?
Use when writing, changing, reviewing the quality of, or sweeping tests - before adding a test, when a suite feels bloated, slow to change, or full of tests that break on harmless refactors, when asked to "prune the tests", "cut low-value tests", "audit test quality", or to clean up a whole subsystem's test surface. Also use when a production export, flag, or hook seems to exist only so a test can reach it.
Как установить скилл Trim?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Trim запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic