Test Scenario Generator
Generate exhaustive test outlines and executable test code from natural language feature descriptions. The outline serves as "living documentation" — a specification expressed as test case names.
Arguments
| Argument |
Default |
Description |
--framework |
auto-detect |
Test framework override (skips auto-detection) |
--lang |
en |
Language for test case names: ja, en |
--outline-only |
false |
Stop after Phase 2 (produce outline only, skip implementation) |
--test-file |
auto |
Target test file path |
--run-cmd |
auto-detect |
Override test runner command |
Constraints
- NEVER write implementation or production code — create and modify test files only
- Never skip the outline — Phase 2 outline is the "contract" that Phase 3 implements
- Always ask when specs, data flows, or edge cases are unclear
- Strict mode only — no internal module mocking, real database, AAA pattern, Design by Contract
Workflow
Phase 1: Understand & Clarify
Parse the user's feature description. Extract:
- Functional requirements (what the feature does)
- Constraints (limits, ranges, defaults, permissions)
- Data flows (input sources, processing, output destinations)
- UI/API surface (where the feature is exposed)
Detect the project's test framework.
Read references/framework-profiles.md for detection logic and syntax mappings.
- Scan project files to identify the test framework
- Use
--framework override if provided
- Present detection result to user and confirm
Determine test file location:
- If
--test-file provided, use it
- Otherwise, infer from the feature description and project conventions
- If file exists, read it to understand current test coverage
Determine test name language:
- If
--lang provided, use it
- Otherwise, use
en
If anything is unclear, present a numbered question list covering:
- Input/output contracts
- Data sources involved (DB tables, APIs, caches)
- Boundary values and limits
- Error states to handle
- Authentication/authorization requirements
Wait for answers before proceeding. If the user says "use your best judgment", proceed with reasonable assumptions and note them.
Phase 2: Generate Test Outline
Read references/outline-rules.md for the full outline generation rules and per-framework syntax.
Generate a test file with only structure and TODO-marked test cases:
- Use the detected framework's TODO marker syntax
- Organize tests hierarchically by context/precondition
- Each test case name must be self-documenting "living documentation"
Cover all 5 categories:
- Happy Path — normal expected behavior with valid inputs
- Edge Cases — boundary conditions, empty/null/zero values, at-limit values
- Error Handling — invalid inputs, auth failures, service unavailability
- Constraints — business rules, limits, defaults from the spec
- Data Integrity — state before/after operations, rollback on failure
Do NOT create test cases that assume mocking of internal modules.
Present the outline to the user in chat. Ask:
"Does this outline cover all the behaviors you expect? Should I add, remove, or modify any test cases?"
Iterate until the user approves, then write the file.
If --outline-only is set, stop here and report the file path.
Phase 3: Implement Test Code
Read references/implementation-rules.md for the 6 absolute rules with per-framework code examples.
Convert each TODO-marked test case into an executable test following these rules:
- Test Data Lifecycle — create data in setup, clean up in teardown, using framework-appropriate hooks
- AAA Pattern — visually separate Arrange, Act, Assert with blank lines
- No Internal Module Mocking — use real database, Docker-based mock servers for HTTP
- Design by Contract — assert return value AND database state; in error cases, assert error AND unchanged state
- Readability — each test must be self-explanatory in isolation
- Test Utilities — discover and use existing helpers; create new ones if needed
After implementing all tests, run them:
- Detect or use
--run-cmd for the runner command
- For each failure, classify:
- Test code bug (wrong assertion, incomplete setup): fix the test and re-run
- Spec/implementation mismatch (real defect or ambiguous spec): skip the test with a comment explaining the issue, and ask the user
Report results:
"X tests passing, Y tests skipped (awaiting clarification on: [list specific questions])"
Present skipped tests with the specific questions that need answering.
Behavior Scenarios
Scenario: Generate test outline from natural language description
Given the user provides a feature description in natural language
When /test-scenario is invoked
Then detect framework, ask clarifying questions if needed, generate test outline
covering all 5 categories, present for user approval, and write the file
Scenario: Implement test code from approved outline
Given an approved test outline exists
When Phase 3 proceeds
Then convert all TODO markers to executable tests following the 6 absolute rules,
run tests, fix test bugs, skip ambiguous cases for user clarification,
and report results
Scenario: Outline-only mode
Given the --outline-only flag is set
When /test-scenario --outline-only is invoked
Then produce only the test outline and stop after writing the file
Scenario: Ambiguous feature description
Given a vague or incomplete feature description
When Phase 1 parses the input
Then present a numbered list of specific questions and wait for answers
before generating the outline
Scenario: Update existing test file
Given a test file already exists at the target path
When /test-scenario is invoked for the same feature
Then read existing tests, identify gaps in coverage, and add only missing
test cases without duplicating existing ones
Integration with Other Skills
| Skill |
How to use together |
tdd |
Use test-scenario to generate the outline (RED state), then the tdd skill's red-green-refactor loop to implement production code (GREEN) |
orch-qa |
Use orch-qa to identify missing test coverage, then feed gap descriptions to test-scenario as input |
scenario-gen |
Different triggers: scenario-gen works from git diffs (change-driven), test-scenario works from natural language (spec-driven) |
1---2name: test-scenario3description: Generate test outlines (living documentation) and test code from natural language feature descriptions. Supports .NET (xUnit/NUnit/MSTest), Python (pytest), TypeScript (Vitest/Jest). Strict mode: no internal module mocking, real DB, AAA pattern, Design by Contract (DbC). Use when the user asks to generate tests from a feature description, create test cases from requirements, write test outlines, scaffold test files, generate test code from spec, convert TODO tests to real tests, or create tests for a function. Trigger phrases include "test scenario", "テストシナリオ", "generate tests", "テスト生成", "テストケース作成", "write tests for", "scaffold tests", "tests from requirements", "テストアウトライン", "convert todo tests", "implement test outline", "test outline", "test cases from spec".4---56# Test Scenario Generator78Generate exhaustive test outlines and executable test code from natural language feature descriptions. The outline serves as "living documentation" — a specification expressed as test case names.910## Arguments1112| Argument | Default | Description |13|----------|---------|-------------|14| `--framework` | auto-detect | Test framework override (skips auto-detection) |15| `--lang` | `en` | Language for test case names: `ja`, `en` |16| `--outline-only` | `false` | Stop after Phase 2 (produce outline only, skip implementation) |17| `--test-file` | auto | Target test file path |18| `--run-cmd` | auto-detect | Override test runner command |1920## Constraints2122- **NEVER** write implementation or production code — create and modify test files only23- **Never skip the outline** — Phase 2 outline is the "contract" that Phase 3 implements24- **Always ask** when specs, data flows, or edge cases are unclear25- **Strict mode only** — no internal module mocking, real database, AAA pattern, Design by Contract2627## Workflow2829### Phase 1: Understand & Clarify30311. Parse the user's feature description. Extract:32 - Functional requirements (what the feature does)33 - Constraints (limits, ranges, defaults, permissions)34 - Data flows (input sources, processing, output destinations)35 - UI/API surface (where the feature is exposed)36372. Detect the project's test framework.38 Read `references/framework-profiles.md` for detection logic and syntax mappings.39 - Scan project files to identify the test framework40 - Use `--framework` override if provided41 - Present detection result to user and confirm42433. Determine test file location:44 - If `--test-file` provided, use it45 - Otherwise, infer from the feature description and project conventions46 - If file exists, read it to understand current test coverage47484. Determine test name language:49 - If `--lang` provided, use it50 - Otherwise, use `en`51525. If anything is unclear, present a numbered question list covering:53 - Input/output contracts54 - Data sources involved (DB tables, APIs, caches)55 - Boundary values and limits56 - Error states to handle57 - Authentication/authorization requirements5859 Wait for answers before proceeding. If the user says "use your best judgment", proceed with reasonable assumptions and note them.6061### Phase 2: Generate Test Outline6263Read `references/outline-rules.md` for the full outline generation rules and per-framework syntax.64651. Generate a test file with only structure and TODO-marked test cases:66 - Use the detected framework's TODO marker syntax67 - Organize tests hierarchically by context/precondition68 - Each test case name must be self-documenting "living documentation"69702. Cover all 5 categories:71 - **Happy Path** — normal expected behavior with valid inputs72 - **Edge Cases** — boundary conditions, empty/null/zero values, at-limit values73 - **Error Handling** — invalid inputs, auth failures, service unavailability74 - **Constraints** — business rules, limits, defaults from the spec75 - **Data Integrity** — state before/after operations, rollback on failure76773. Do NOT create test cases that assume mocking of internal modules.78794. Present the outline to the user in chat. Ask:80 > "Does this outline cover all the behaviors you expect? Should I add, remove, or modify any test cases?"81825. Iterate until the user approves, then write the file.83846. If `--outline-only` is set, stop here and report the file path.8586### Phase 3: Implement Test Code8788Read `references/implementation-rules.md` for the 6 absolute rules with per-framework code examples.8990Convert each TODO-marked test case into an executable test following these rules:91921. **Test Data Lifecycle** — create data in setup, clean up in teardown, using framework-appropriate hooks932. **AAA Pattern** — visually separate Arrange, Act, Assert with blank lines943. **No Internal Module Mocking** — use real database, Docker-based mock servers for HTTP954. **Design by Contract** — assert return value AND database state; in error cases, assert error AND unchanged state965. **Readability** — each test must be self-explanatory in isolation976. **Test Utilities** — discover and use existing helpers; create new ones if needed9899After implementing all tests, run them:100- Detect or use `--run-cmd` for the runner command101- For each failure, classify:102 - **Test code bug** (wrong assertion, incomplete setup): fix the test and re-run103 - **Spec/implementation mismatch** (real defect or ambiguous spec): skip the test with a comment explaining the issue, and ask the user104105Report results:106> "X tests passing, Y tests skipped (awaiting clarification on: [list specific questions])"107108Present skipped tests with the specific questions that need answering.109110## Behavior Scenarios111112```gherkin113Scenario: Generate test outline from natural language description114 Given the user provides a feature description in natural language115 When /test-scenario is invoked116 Then detect framework, ask clarifying questions if needed, generate test outline117 covering all 5 categories, present for user approval, and write the file118119Scenario: Implement test code from approved outline120 Given an approved test outline exists121 When Phase 3 proceeds122 Then convert all TODO markers to executable tests following the 6 absolute rules,123 run tests, fix test bugs, skip ambiguous cases for user clarification,124 and report results125126Scenario: Outline-only mode127 Given the --outline-only flag is set128 When /test-scenario --outline-only is invoked129 Then produce only the test outline and stop after writing the file130131Scenario: Ambiguous feature description132 Given a vague or incomplete feature description133 When Phase 1 parses the input134 Then present a numbered list of specific questions and wait for answers135 before generating the outline136137Scenario: Update existing test file138 Given a test file already exists at the target path139 When /test-scenario is invoked for the same feature140 Then read existing tests, identify gaps in coverage, and add only missing141 test cases without duplicating existing ones142```143144## Integration with Other Skills145146| Skill | How to use together |147|-------|---------------------|148| `tdd` | Use test-scenario to generate the outline (RED state), then the `tdd` skill's red-green-refactor loop to implement production code (GREEN) |149| `orch-qa` | Use orch-qa to identify missing test coverage, then feed gap descriptions to test-scenario as input |150| `scenario-gen` | Different triggers: scenario-gen works from git diffs (change-driven), test-scenario works from natural language (spec-driven) |