justifiable-tests
БесплатноБез исполняемых скриптовНе проверенTest code for meaningful failures that survive refactors. Use when writing or reviewing tests.
от devon-systems★ 250 звёзд на GitHubОб этом скилле
Justifiable tests
Add or retain a test when it catches a plausible failure that affects required behavior. Name the behavior in the test. Add a comment only when the reason is not obvious.
- Derive expected results from requirements, documented contracts, or examples worked out independently of the implementation. Do not copy the implementation's logic into assertions.
- Test observable behavior through the narrowest interface that exposes the failure. Keep assertions valid when a refactor preserves that behavior.
- Assert exact strings, structure, or call order only when the contract requires them. Avoid checks of incidental wording or source text. Use snapshots only when the captured output is the behavior under test.
- Cover distinct failure modes. Extend existing tests before adding overlapping cases. Prioritize regressions, consequential boundaries, and error paths. For a regression, verify that the test fails for the original defect and passes with the fix when feasible.
- Keep setup deterministic and readable. Inject or fake the clock and random seed; never sleep to await async work. Log seeds on failure so randomized failures reproduce from logs alone. Reuse fixtures when they clarify the scenario. Mock external boundaries only as needed.
- Follow explicit test requirements. Otherwise, skip tests whose maintenance cost exceeds the failures they are likely to catch. Briefly explain significant behavior left untested.
When examples are weak
Reach for these only when their maintenance cost still passes the rule above.
- Prefer property tests over more examples when you can state a property without copying the implementation's logic: parse/print or encode/decode round-trips, idempotence, order-independence, invariant preservation, monotonicity. Favor empty, single, duplicate, unsorted, max-size, and Unicode inputs. Commit shrunk counterexamples as example regressions; generators may miss them later. Use an existing property library. Never add a dependency for one test.
- When direct assertions are hard, compare against a reference too simple to share the bug: brute-force scans for optimized queries, trivial cache models, or the old implementation during refactoring.
- For caches, queues, state machines, and other lifecycle code, compare random operation sequences against a simple model, such as a map. Catch ordering and interleaving bugs that single-operation examples miss.
- When storage backends, API clients, or fakes must agree, run one parametrized conformance suite against all implementations. Prefer a fake verified by the real implementation's tests to a mock.
- Assert error postconditions, not just failure: unchanged state, no partial writes, idempotent retries. Check error kinds or codes rather than messages.
- For storage and wire formats, commit payloads from old versions and verify current code reads them. Never regenerate compatibility fixtures with current code; that tests the code against itself.
- Fuzz parsers, decoders, and deserializers that accept untrusted input. Assert they neither crash nor hang. Seed the corpus with past regressions.
If expected behavior is unclear, check existing requirements and conventions. Ask the user only when unresolved ambiguity changes what the test should assert.
Установить justifiable-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл justifiable-tests?
Test code for meaningful failures that survive refactors. Use when writing or reviewing tests.
Как установить скилл justifiable-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл justifiable-tests запускает скрипты?
Нет, скилл состоит только из инструкций (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