test-spec
Generate BDD test specifications for story in 6 categories (API, UI, Load, Infrastructure, Security, Integration). Use when user wants to create test cases or…
от rakovi4★ 54 звезды на GitHub
Установить test-spec в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Generate Test Specifications
Generate BDD-style test specifications for a story in 6 categories — one file per
category under tests/. The drafted scenarios are then split by consequence of
failure into three tiers (.claude/templates/spec/tier-ladder.md): Tiers 1 and 2
are implemented in that order, Tier 3 is recorded in tests/tier3/ and never built.
Usage
/test-spec "Story name"
/test-spec 5 # By MVP story number
/test-spec # Interactive selection
Workflow
Phase 1: Context & Story Selection
Parse input first — by name ("Login/Logout"), by number (5), or interactive (list and ask) — since the reads below are scoped to the resolved story and the areas it touches.
Read before generating: ProductSpecification/BriefProductDescription.md, ProductSpecification/stories.md, ProductSpecification/ExpectedLoad.md, and the target story's folder: mockups/, its spec *.md, endpoints.md, interview.md. Resolve that folder stories/NN-story-name/ first, then stories/done/NN-story-name/ (.claude/rules/workflow.md, "Resolving a story folder") — these reads tolerate absence, so an unresolved archived folder is indistinguishable from a story that has no interview, and generation proceeds from the spec alone.
For what the product already does in the areas this story touches — so a drafted scenario neither re-specifies shipped behavior nor contradicts it — read the acceptance tests of those areas: test class names, scenario descriptions, Statements. Never sweep the other story folders to reconstruct it (.claude/rules/workflow.md, "Where the Current State Lives"). Only enabled tests count as shipped — one still carrying its disable/skip marker is a pending increment, not shipped behavior. Where the suite is silent about an area, read that area's production code — silence is not evidence of absence. In a repo with no acceptance suite yet, say so explicitly and fall back to the story folders. Open an earlier story's folder only for a named precedent: the decision behind a rule this story extends — under stories/ or stories/done/, a closed story being the usual home of a settled rule (.claude/rules/workflow.md, "Resolving a story folder").
If interview.md exists, extract:
- Business rules and constraints → map to API test scenarios
- Explicit edge cases (state transitions, ordering, concurrent edits) → map to scenarios like any other; whether one is a bounded, acceptable degradation is Phase 4's call, not a decision made while reading the interview
- External API error modes → map to integration tests
- Rate limits and performance constraints → map to load tests when they exercise the project's declared Load Challenge Profile (read
ExpectedLoad.mdto identify it); skip constraints that don't match the project's profile
Prerequisite analysis (mandatory): Read the story's Prerequisites section and Validation Rules table. For each prerequisite, generate guard scenarios in BOTH API and UI tests following the Prerequisite Guard Checklist in test-spec-format.md — its rules cover extraction, per-endpoint coverage, and which two sources an established blocker pattern is read from — never a sweep of the other story folders.
Side-effect & idempotency analysis (mandatory): Scan the story spec and interview.md for operations that move money, call an external system, send email, or mutate persisted state in a batch. For each one that can be re-run (scheduled job, webhook, user retry), generate re-run-safety scenarios in BOTH directions — inbound duplicate-event and outbound re-attempt-after-partial-failure — following the Side-Effect & Idempotency Guard Checklist in test-spec-format.md. Phase 2 stamps their idem provenance; the tier itself is Phase 4's call.
Phase 2: Generate Test Files
Load .claude/templates/spec/test-spec-format.md for category formats, ordering principles, and BDD rules.
Trace the primary user's journey from the earliest in-scope entry through first value, any required constraint, value capture when in scope, and restored or continued value. Draft focused scenarios for its observable checkpoints in the relevant categories. Give each scenario its own complete context and assertions; never assume another scenario ran first or combine checkpoints just because they belong to the same journey.
Create files in the tests/ directory of the folder the story resolved to — ProductSpecification/stories/NN-story-name/tests/, or stories/done/NN-story-name/tests/ for a story that has closed (.claude/rules/workflow.md, "Resolving a story folder"):
01_API_Tests.md,02_UI_Tests.md,03_Load_Tests.md04_Infrastructure_Tests.md,05_Security_Tests.md,06_Integration_Tests.md
Author no extended/ file. A nice-to-have scenario is drafted into its category
file like every other one and reaches tests/tier3/ only if Phase 4's comparative
pass puts it there. Existing extended/ direc
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-spec?
Generate BDD test specifications for story in 6 categories (API, UI, Load, Infrastructure, Security, Integration). Use when user wants to create test cases or mentions /test-spec command.
Как установить скилл test-spec?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-spec запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…