derive-test-name-from-behavior
Produce a single test name in "should <observable behavior>" form from a goal statement. Use when starting the red phase of a TDD cycle and you need a precise, testable name.
SKILL.mdplugin/skills/derive-test-name-from-behavior/SKILL.md
GitHubDerive a test name from a behavior
Given a behavior description, produce one test name that asserts a single observable outcome.
Rules
- Start with
should. - Describe the observable outcome, not the implementation.
should reject empty usernameis observable;should call validateUsernameis implementation-detail leakage. - Be specific about input shape and expected output.
should return ValidationError when username is emptybeatsshould validate username. - One test = one assertion target. If you find yourself joining clauses with
and, split into two tests.
Examples
Behavior: "username validation"
- Bad:
should validate username - Better:
should reject empty username - Better still:
should reject empty username with a ValidationError
- Bad:
Behavior: "OAuth flow"
- Bad:
should handle OAuth - Better:
should redirect to provider when no token is present - Better still:
should redirect to /oauth/authorize with the configured client_id
- Bad:
Reusable outside TDD
Coverage-gap workflows use this when proposing tests for uncovered branches.