.github/skills/api-test-scenario-generator/SKILL.md
Generate comprehensive REST API test scenarios from a method, endpoint, optional domain hints, and an optional OpenAPI spec. Covers happy path, validation, security, query behavior, state transitions, idempotency, and error contract checks.
npx skillsauth add dneprokos/skills-examples api-test-scenario-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate API test-scenario specs that stay grounded in the endpoint plus any domain context the user provides. When domain details are missing, the skill should infer conservatively from HTTP semantics and list assumptions as warnings instead of inventing facts.
High (H) > Medium (M) > Low (L)Use this command format:
/api-test-scenario-generator {METHOD} {ENDPOINT}
[--fields name:type:constraint,...]
[--states STATE1,STATE2,...]
[--transitions FROM:TO,...]
[--filters name:type,...]
[--sortable field1,field2,...]
[--relations resource:policy,...]
[--openapiSpec PATH_OR_JSON_OR_YAML]
[--openapiOperationId OPERATION_ID]
[additional_context]
--openapiSpec is provided, the skill will attempt to locate the matching OpenAPI operation (by --openapiOperationId when provided, otherwise by {METHOD} {ENDPOINT}) and infer request body fields, possible states (from enums), and query parameters.--fields, --states, --filters, --sortable) take precedence over OpenAPI-derived inference; any missing details are still recorded as warnings/assumptions./api-test-scenario-generator POST /api/users
/api-test-scenario-generator GET /api/users/{id}
/api-test-scenario-generator POST /api/orders \
--fields amount:number:>=0,status:enum:PENDING|CONFIRMED|CANCELLED \
--states PENDING,CONFIRMED,SHIPPED,DELIVERED,CANCELLED \
--transitions PENDING:CONFIRMED,CONFIRMED:SHIPPED,SHIPPED:DELIVERED \
--filters status:string,createdAt:date \
--sortable createdAt,totalAmount \
--relations user:owner-must-exist
/api-test-scenario-generator POST /api/orders \
--openapiSpec ./openapi.json
| Scenario | Test Type | Description | Expected Result | HTTP Status | Priority | Recommended Test Level | | -------- | --------- | ----------- | --------------- | ----------- | -------- | ---------------------- | | ... | ... | ... | ... | ... | ... | ... |
The generated scenarios should consider, when relevant:
401, refresh flow expectations, Admin vs Customer access to other users' resourcesPENDING → CONFIRMED → SHIPPED → DELIVERED, plus invalid transitionsPOST or replayed Idempotency-Key must not create duplicate writes405, 415, 429, 502, 503 where applicableerror.code, error.message, error.requestId, and validation detailsHEAD and OPTIONS when the endpoint contract supports them.md formatrequirements/{main_resource_name}/{method_name}_{resource_path}.md
requirements/users/GET_users_id.md for GET /api/users/{id}requirements/orders/PUT_orders_id_status.md for PUT /api/orders/{id}/statusAdd a dependency graph when the test flow requires prerequisite resources or state transitions.
{
"nodes": ["create_user", "update_user", "delete_user"],
"edges": [
{ "from": "create_user", "to": "update_user" },
{ "from": "create_user", "to": "delete_user" }
]
}
⚠️ for each warningUse the testing pyramid as a heuristic, not a rigid quota:
Do not force 70/20/10 blindly if the system shape suggests a different balance.
The skill uses configuration files to customize test generation:
config/validation-rules.json — validation, auth, query, error, and protocol rulesconfig/test-types.json — test classifications, priority legend, and testing-level guidancetemplates/ — markdown output templatesThis skill analyzes the provided HTTP method, endpoint, and optional context using:
All unknowns must be surfaced explicitly rather than guessed.
data-ai
Install and configure Windows Credential Manager style secret storage for PowerShell using SecretManagement and SecretStore. Use when users ask to install secret manager support, set up Credential Manager for GitHub token storage, or bootstrap GitHubToken for PR skills.
development
Generate a complete, compilable unit test file from an Analyst test plan and Architect strategy. Uses AAA pattern, language-specific frameworks (NUnit, JUnit 5, pytest, Vitest), correct mock/real dependency instantiation, constructor null-guard tests, parameterized tests, and setup/teardown hooks. Input is the Analyst JSON plan plus Architect strategy summary. Use when asked to generate test code, write test implementation, create test file, or implement tests from a plan. Also invoked as Phase 3 by the unit-test-generator agent.
development
Define the mocking strategy and assertion style for a unit test plan. Classifies each dependency as mock or real, resolves assertion framework and test file location from project patterns, lists constructor null-guard tests with expected exception types, and specifies abstraction interfaces for non-deterministic calls. Input is a JSON test plan from ut-analyst. Use when asked to define mocking strategy, plan test architecture, classify dependencies as mock vs real, or design test structure. Also invoked as Phase 2 by the unit-test-generator agent.
testing
Analyze a class or function and produce a structured JSON test plan. Classifies all dependencies (interface, abstract, valueObject, dto, primitive), detects non-deterministic calls, enumerates test cases using black-box techniques (Equivalence Partitioning, Boundary Value Analysis, Decision Table, State Transition), and lists constructor null-guard requirements. Use when asked to analyze a class for testing, create a test plan, classify dependencies, or produce test case inventory. Also invoked as Phase 1 by the unit-test-generator agent.