/selamy-skills:test-designfrom selamy-skills
Use when writing or reviewing tests: how to STRUCTURE and NAME them, what one test should cover, and when to split versus parameterize versus use soft assertions. Covers test structure and design, not the red-green-refactor workflow.
Ships in selamy-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
How to design tests that localize failures and read like a spec. This complements — does not duplicate — the upstream TDD-workflow skills (red→green→refactor) and pairs with the code-style foundation: those cover when/how you drive code with tests; this covers what a good test looks like.
Principles are language-agnostic; per-language bindings are at the end.
Every test visibly separates Arrange → Act → Assert (Given/When/Then), by blank line or comment. The three phases should be findable at a glance. A test where setup, action, and verification are tangled is a test you can't read at failure time.
Each test verifies ONE behavior, so a failure localizes precisely and the test name describes exactly one thing.
assertSoftly / assertAll / expect.soft) to check several properties of one result and report all failures at once — strictly better than splitting into N tests that each re-run the same arrange/act.The name is the spec. returns_404_when_run_id_is_unknown, not test3. A reader should know what broke from the failed test's name alone, without opening the body.
For a workflow or transition test, invoke the production entrypoint and its real collaborators through the boundary named by the test. Keep relevant adapters, parsers and predicates composed; fake external effects at their boundary (see [[prefer-fakes-over-mocks]]). Separate helper tests, source-text order checks and fixtures never passed to the entrypoint do not prove that composition. Choose inputs that expose a broken hand-off, and keep each test's name and conclusion within the boundary it actually exercises.
Optimize tests for readability-at-failure, not DRY elegance. Inline repetition in tests is fine and often better. DAMP ≠ no helpers — do use test-data builders/factories where they aid clarity — just never hide the AAA behind abstraction layers. A test you must trace through three helpers to understand is a bad test even if it's DRY.
The test name and AAA structure tell the story. Reserve comments for the WHY — business-rule rationale, non-obvious edge cases — not a play-by-play of the WHAT. Density is language-dependent: expressive languages (e.g. Kotlin) need very few; if the code reads like English, comment only business logic / non-obvious implementation. Don't go heavy.
Single-concept tests multiply the test count → more suite time + maintenance. State the tradeoff; don't pretend it's free. Mitigate with: parameterization (one method, many cases), cheap arrange (builders, fixtures), and soft assertions (one arrange/act, many checks). The goal is precise failure localization at acceptable cost — not maximum test count.
Test replay after a lost response both while the original operation is pending and after its effect has committed or completed. Assert recovery of the original operation identity and outcome without applying its effect again. Also leave a context with unresolved work, visit another, then return; verify that recovery remains available in its original context. Keep controls for a deliberate new operation and a foreign context, so replay safety does not collapse distinct operations or reuse another context's state.
@pytest.mark.parametrize with ids=[...] for labels; soft checks via pytest.raises/pytest-check or grouping asserts on one object; descriptive test_<behavior>_when_<condition> names.`returns 404 when run id unknown`); assertAll {} (JUnit) / assertSoftly {} (Kotest) for one-concept multi-property; @ParameterizedTest + @MethodSource with named args; comments rare.describe/it('returns 404 when ...'); expect.soft(...) for multi-property one-concept; it.each([...]) (table) with a label template.t.Run(tc.name, ...); each case named; t.Run subtests localize failures; require for fatal preconditions, assert for soft checks.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub selamy-labs/agent-skills --plugin selamy-skills111 skills in this plugin
/adaptive-estimationUse when tracking a slowly-varying latent quantity from noisy measurements with quantifiable uncertainty — a drifting metric, capacity, latency trend, or confidence. Prefer a Kalman-style adaptive estimator over fixed moving averages or static thresholds./adaptive-loop-budgetingUse when an autonomous loop needs explicit limits on attempts, time, cost, tool calls, verification depth, or risk, and a clear stop, continue, yield, or escalate decision./adopt-and-deleteUse when adopting a shared module, library, chart, or service, or doing any consolidation, migration, or refactor that supersedes existing code. The change that adds the replacement must REMOVE what it replaced, in the same atomic change.Other plugins' skills for the same job