From jaan-to
Generates BDD/Gherkin test cases from acceptance criteria using ISTQB techniques (equivalence partitioning, BVA, decision tables). Supports direct text, PRD files, Jira stories, and OpenAPI contracts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jaan-to:qa-test-casesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Generate production-ready BDD/Gherkin test cases from acceptance criteria.
Generate production-ready BDD/Gherkin test cases from acceptance criteria.
$JAAN_LEARN_DIR/jaan-to-qa-test-cases.learn.md - Past lessons (loaded in Pre-Execution)$JAAN_TEMPLATES_DIR/jaan-to-qa-test-cases.template.md - BDD/Gherkin template$JAAN_TEMPLATES_DIR/jaan-to-qa-test-cases-quality-checklist.template.md - Quality checklist template$JAAN_OUTPUTS_DIR/research/50-qa-test-cases.md - ISTQB standards, test design techniques${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocolAcceptance Criteria Source: $ARGUMENTS
Input modes:
Contract parsing: If --contract present, extract path first, validate file exists and contains openapi: or swagger: key, then parse remaining arguments by modes 1-4 above.
IMPORTANT: The input above is your starting point. Determine mode and proceed accordingly.
MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md
Skill name: qa-test-cases
Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)
Also read the comprehensive research document:
$JAAN_OUTPUTS_DIR/research/50-qa-test-cases.md
This provides:
If files do not exist, continue without them.
Read and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md
Override field for this skill: language_qa-test-cases
Check $ARGUMENTS to identify input mode:
Mode A - Direct Text Input: If $ARGUMENTS contains acceptance criteria text:
Mode B - PRD File Path: If $ARGUMENTS contains file path pattern (e.g., ".md" or "$JAAN_OUTPUTS_DIR/"):
EXTRACTED ACCEPTANCE CRITERIA
──────────────────────────────
1. {ac_1}
2. {ac_2}
3. {ac_3}
Mode C - Jira MCP Integration: If $ARGUMENTS matches pattern "PROJ-123" or "JIRA-123":
Mode D - Interactive Wizard: If $ARGUMENTS is empty:
[1] Paste AC text directly [2] Provide PRD file path [3] Enter Jira story ID
Ambiguity Resolution (from research Section 4):
If AC is vague, ask these questions before proceeding:
When an API contract is provided:
minLength, maxLength, enum, required constraints from schemaReference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/openapi-integration-reference.mdfor contract discovery patterns.
For each acceptance criterion, analyze using research Section 3 methodologies:
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/qa-test-cases-reference.mdsection "Test Design Techniques" for Equivalence Partitioning, Boundary Value Analysis, Edge Case Categorization (5 priority categories), and Test Generation Ratio (minimum 10 tests per AC).
Calculate totals and show plan:
TEST GENERATION PLAN
────────────────────────────────────────
Acceptance Criteria: {n} criteria
Test Breakdown (per AC):
- Positive tests: {n} × 3 = {total}
- Negative tests: {n} × 3 = {total}
- Boundary tests: {n} × 2 = {total}
- Edge case tests: {n} × 2 = {total}
Total Test Cases: {grand_total}
Edge Case Distribution:
- Empty/Null States: {count}
- Boundary Values: {count}
- Error Conditions: {count}
- Concurrent Operations: {count}
- State Transitions: {count}
Coverage Targets (Research Section 5):
- Positive: 30%
- Negative: 40%
- Edge: 30%
- Industry standard: 70-80% coverage
Ask: "Proceed with test case generation? [y/edit]"
Show complete plan before generating:
FINAL CONFIRMATION
──────────────────────────────────────
Source: {input_mode}
Acceptance Criteria: {n} criteria
Total Test Cases: {count}
Output Format: BDD/Gherkin (with ISTQB conversion notes)
Output Folder: $JAAN_OUTPUTS_DIR/qa/cases/{id}-{slug}/
Main File: {id}-test-cases-{slug}.md
Quality Checklist: {id}-test-cases-quality-checklist-{slug}.md
Process:
1. Generate BDD/Gherkin scenarios using research patterns
2. Apply concrete test data values (no placeholders)
3. Add @tags for traceability and filtering
4. Include ISTQB conversion notes (research Section 2)
5. Generate quality checklist (research Section 6)
6. Preview before writing
"Proceed with test case generation? [y/n]"
Do NOT proceed to Phase 2 without explicit approval.
Optimize test case generation throughput:
Batch BDD Processing: Group related ACs (2-3) into a single reasoning pass. Generate all scenarios for the batch before moving to the next group. This reduces context-switching overhead by batching related work.
Few-Shot Seeding: Pre-seed generation with 2-3 successful examples from $JAAN_LEARN_DIR/ if available. Past high-quality scenarios reduce hallucination and improve consistency.
Coverage-Driven Priority: Adjust generation depth based on existing test coverage:
Incremental Generation: When re-running for updated ACs, preserve passing test cases and only regenerate for changed or new ACs. Compare AC text hashes to detect changes.
Following research Section 2 patterns and Section 4 worked examples.
CRITICAL: All scenarios MUST use declarative style (describe BEHAVIOR, not UI actions).
BAD (Imperative -- NEVER use):
When I click the "Login" button
When I enter "test@example.com" in the email field
When I scroll down to the footer
When I select "Option A" from the dropdown
GOOD (Declarative -- ALWAYS use):
When the user submits valid credentials
When the user requests password reset
When the user selects their preferred plan
When the user completes the checkout process
Rule: NEVER use imperative UI interaction steps. Describe BEHAVIOR, not UI actions. Steps should be understandable by non-technical stakeholders.
Scenario Outline with Examples tables when 3+ input combinations exist for the same behavior pattern.Example Scenario Outline:
Scenario Outline: User login with various credential types
Given a registered user with <credential_type>
When the user submits valid credentials
Then the user should be authenticated within 3 seconds
Examples:
| credential_type |
| email and password |
| social login |
| SSO token |
Use these declarative patterns as starting points:
Given a {entity} exists with {attribute} "{value}"Given the user is authenticated as {role}When the user {action} the {entity}When the user submits {valid/invalid} {data_type}Then the {entity} should have {attribute} "{value}"Then the user should see {feedback_type}Then the system should {expected_behavior}@{test-type} @priority-{level} @REQ-{id}
Feature: {Feature Name}
As a {role}
I want {goal}
So that {benefit}
Common preconditions shared across scenarios:
Background:
Given {common_precondition_1 with concrete data}
And {common_precondition_2}
And {system_state}
Positive Tests (3 per AC):
@smoke @positive @priority-critical @REQ-{id}
Scenario: {Main happy path}
Given I am on the {page_name} page
When I enter "{concrete_value}" in the {field_name} field
And I enter "{concrete_value}" in the {field_name} field
And I click the "{button_label}" button
Then I should be redirected to {path} within {n} seconds
And I should see "{exact_message}" in the {element}
@regression @positive @priority-high @REQ-{id}
Scenario: {Alternative happy path}
Given {different_valid_state}
When {valid_action_variation}
Then {expected_outcome_with_threshold}
Negative Tests (3 per AC):
@regression @negative @priority-high @REQ-{id}
Scenario: {Invalid input scenario}
Given {precondition}
When I enter "{invalid_concrete_value}" in the {field} field
And I click the "{button}" button
Then I should see error "{exact_error_text}"
And I should remain on the {page} page
And {system_state_unchanged}
Boundary Tests (2 per AC):
@boundary @edge-case @priority-medium @REQ-{id}
Scenario: {Minimum boundary}
Given {setup}
When I enter "{min_value}" in the {field} field
Then {expected_result_at_boundary}
@boundary @edge-case @priority-medium @REQ-{id}
Scenario: {Maximum boundary}
Given {setup}
When I enter "{max_value}" in the {field} field
Then {expected_result_at_boundary}
Edge Case Tests (2 per AC from priority categories):
@edge-case @empty-state @priority-low @REQ-{id}
Scenario: {Empty/null handling}
Given {setup}
When I leave {field} field empty
Then I should see validation error "{exact_text}"
@edge-case @concurrent @priority-high @REQ-{id}
Scenario: {Concurrent operation}
Given {multi_user_state}
When {user_1_action} and {user_2_action} occur simultaneously
Then {system_prevents_race_condition}
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/qa-test-cases-reference.mdsection "Test Data Standards" for concrete value examples, BAD/GOOD patterns, and standard test data values.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/qa-test-cases-reference.mdsection "Tagging Strategy" for systematic tag application guidelines (@smoke, @regression, @priority, @REQ, etc.).
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/qa-test-cases-reference.mdsection "ISTQB Field Mapping" for the BDD-to-ISTQB field mapping table and example conversion from Gherkin to ISTQB format.
Before preview, validate against 10-point checklist:
Universal Checks:
AI Failure Mode Checks (Research Section 8):
If any check fails, fix before proceeding.
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/qa/cases"
mkdir -p "$SUBDOMAIN_DIR"
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
Generate slug:
Template:
Production-ready BDD/Gherkin test cases for {feature_name} covering {n} acceptance criteria with {total_tests} test scenarios. Includes {positive_count} positive tests, {negative_count} negative tests, {boundary_count} boundary tests, and {edge_count} edge case tests across 5 priority categories (empty/null, boundary, error, concurrent, state transition). All tests use concrete test data values and include traceability tags.
OUTPUT PREVIEW
──────────────────────────────────────
ID: {NEXT_ID}
Folder: $JAAN_OUTPUTS_DIR/qa/cases/{NEXT_ID}-{slug}/
Main: {NEXT_ID}-test-cases-{slug}.md
Checklist: {NEXT_ID}-test-cases-quality-checklist-{slug}.md
# Test Cases: {Feature Name}
## Executive Summary
{executive_summary}
## Metadata
- Acceptance Criteria: {n}
- Total Test Cases: {count}
- Coverage: Positive {pct}%, Negative {pct}%, Edge {pct}%
[Show first 3 scenarios as preview]
@smoke @positive @priority-critical @REQ-001
Scenario: Successful login with valid credentials
Given I am on the login page
When I enter "test@example.com" in the email field
And I enter "ValidP@ss123!" in the password field
And I click the "Login" button
Then I should be redirected to the dashboard within 3 seconds
And I should see "Welcome, Test User" in the header
[Full output contains {total_tests} scenarios]
Ask: "Write these output files? [y/n]"
If approved:
OUTPUT_FOLDER="$JAAN_OUTPUTS_DIR/qa/cases/${NEXT_ID}-${slug}"
mkdir -p "$OUTPUT_FOLDER"
Path: $OUTPUT_FOLDER/${NEXT_ID}-test-cases-${slug}.md
Use template from: $JAAN_TEMPLATES_DIR/jaan-to-qa-test-cases.template.md
Fill sections:
Path: $OUTPUT_FOLDER/${NEXT_ID}-test-cases-quality-checklist-${slug}.md
Use template from: $JAAN_TEMPLATES_DIR/jaan-to-qa-test-cases-quality-checklist.template.md
Fill sections:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
"$SUBDOMAIN_DIR/README.md" \
"$NEXT_ID" \
"${NEXT_ID}-${slug}" \
"{Feature Name} Test Cases" \
"{Executive Summary}"
✅ TEST CASES GENERATED
───────────────────────────────────
ID: {NEXT_ID}
Folder: $JAAN_OUTPUTS_DIR/qa/cases/{NEXT_ID}-{slug}/
Main: {NEXT_ID}-test-cases-{slug}.md
Checklist: {NEXT_ID}-test-cases-quality-checklist-{slug}.md
Index: Updated $JAAN_OUTPUTS_DIR/qa/cases/README.md
Total: {count} test cases
Coverage: {positive_pct}% positive, {negative_pct}% negative, {edge_pct}% edge
Ask: "Any feedback on the test cases? [y/n]"
If yes:
"[1] Fix now [2] Learn [3] Both"
Option 1 - Fix now:
Option 2 - Learn:
/jaan-to:learn-add qa-test-cases "{feedback}"Option 3 - Both:
If no: Complete
tech.md detection$JAAN_OUTPUTS_DIR path{id}-{slug}/{id}-test-cases-{slug}.md{id}-test-cases-quality-checklist-{slug}.mdnpx claudepluginhub parhumm/jaan-to --plugin jaan-toGenerates Gherkin BDD feature files from structured use case flows using Clark's UC2.0-to-Gherkin algorithm. Analyzes test coverage completeness against use case steps.
Guides writing BDD scenarios in Gherkin with acceptance criteria, edge cases, tags, and organization. Use for defining behavior specs, test coverage, and requirements.
Generates Gherkin (Given/When/Then) acceptance criteria from user stories or requirements. Covers happy paths, alternatives, negative scenarios, edge cases, and errors for automated tests.