← ClaudeAtlas

specification-structurelisted

Use whenever editing a test or specification file, including *.test.* and *.spec.*. Use alongside Continuous Specification and TDD. In suites that already use describe, structure new or changed tests with readable when/given contexts and outcome-focused it captions; preserve flat suites without describe.
jonfazzaro/skills · ★ 0 · Testing & QA · score 62
Install: claude install-skill jonfazzaro/skills
## Context marker 🔺 When the skill activates, begin the first commentary update with `🔺` and a concise `Using specification-structure ...` announcement. Do not repeat the marker on later updates unless another skill activates. # Specification Structure **REQUIRED:** Use this skill whenever coding with test-driven development or Continuous Specification. When a test file already has a root `describe`, organize the new or changed specifications so the affected tree reads as complete behavior sentences. Preserve a flat test file with no `describe` structure. ```text Component when the playback probe starts given a rejected play request reports unsupported playback ``` ## Build the hierarchy - Extract the action or triggering event from each existing `it` caption into a `describe` caption beginning with `when`. - Extract each state, input, or precondition into a nested `describe` caption beginning with `given`. - Keep the observable outcome in the `it` caption. - Put shared actions above their distinct givens. A `when` block should contain every applicable `given` branch. - Read every root-to-leaf path aloud. Each must be grammatical without relying on test setup code. Use `given` for a condition: `given a nullable probe with a configured result`. Use `when` for an event: `when disposing the session`. Write `when` captions in active voice. Avoid passive voice (`when the session is disposed`). When the action's subject is unknown, use a gerund phrase: `whe