skills/test-scenario/SKILL.md
Creates E2E test scenarios based on the project's existing work context. Analyzes blueprints, DB design, routes, and API endpoints to generate comprehensive test scenarios for integration testing.
npx skillsauth add astra-technology-company-limited/astra-methodology test-scenarioInstall 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.
Analyzes the project's existing work context (blueprints, DB design, routes, API endpoints, existing code) to generate comprehensive E2E test scenarios in docs/tests/test-cases/sprint-{N}/.
Test scenarios are organized by sprint directory. Each sprint has its own subdirectory under docs/tests/test-cases/.
Refer to e2e-scenario-guide.md in the same directory as this skill for scenario design guidelines and patterns.
Determine the current sprint number for file output:
docs/sprints/ for directories matching sprint-{N}-{name}/ (e.g., sprint-1-auth/, sprint-2-workspace/){N} from each directory name (the number before the second hyphen){N} is the current sprint numbersprint-1{SPRINT_N} for use in subsequent stepsGather project-level context to understand the overall architecture:
CLAUDE.md to identify tech stack, project structure, and conventionsdocs/tests/test-strategy.md to understand test levels, coverage goals, and naming rulesdocs/tests/test-cases/sprint-*/ for existing test case files across all sprints to avoid duplicationdocs/database/database-design.md to understand the data modelScan the project to identify all testable features:
1. Glob docs/blueprints/[0-9][0-9][0-9]-*/blueprint.md
2. For each blueprint directory, extract:
- Feature name from directory name (strip NNN- prefix, e.g., 001-auth → auth)
- Feature description from blueprint.md
- User stories / functional requirements
- API endpoints referenced
- DB tables referenced
- Dependencies on other features
1. Scan for page/route files:
- Next.js: src/app/**/page.tsx, src/pages/**/*.tsx
- React: src/routes/, src/pages/
- Vue: src/views/, src/pages/
- Angular: src/app/**/*routing*
2. Build a page inventory with URL paths
1. Scan for API controllers/route handlers:
- Spring Boot: @RestController, @RequestMapping, @GetMapping, @PostMapping, etc.
- NestJS: @Controller, @Get, @Post, etc.
- Express/Fastify: router.get, router.post, app.get, app.post
- FastAPI: @app.get, @app.post, @router.get
- Next.js API: src/app/api/**/route.ts, src/pages/api/**/*.ts
2. Build an endpoint inventory with HTTP methods and paths
1. Read docs/database/database-design.md for the SSoT table list
2. Cross-reference with entity/model files in source code
3. Identify CRUD operations per table
Determine which features to generate scenarios for based on $ARGUMENTS:
| Argument | Behavior |
|----------|----------|
| {feature-name} | Generate scenarios for the specified feature only |
| all | Generate scenarios for all discovered features |
| (empty) | Show discovered feature list and ask user to select with AskUserQuestion |
When asking the user, present the discovered features as a numbered list with brief descriptions:
Discovered features:
1. auth - Authentication (login, signup, token refresh)
2. order - Order management (create, cancel, status)
3. payment - Payment processing (pay, refund)
Which features should I generate E2E scenarios for?
Before generating new scenarios, check for existing coverage:
docs/tests/test-cases/sprint-*/{feature-name}* for each selected feature (search across all sprints)For each selected feature, design scenarios following the user journey approach.
1. Read the feature's blueprint (docs/blueprints/{NNN}-{feature-name}/blueprint.md)
2. Identify:
- Primary user journeys (Happy Path)
- Alternative paths (valid but non-standard flows)
- Edge cases (boundary values, empty states, concurrent access)
- Error paths (invalid input, unauthorized access, server errors)
3. Map each journey to specific pages, API calls, and DB operations
Organize scenarios into logical groups based on user journeys:
Scenario Group: {User Journey Name}
├── Happy Path scenarios (Critical/High priority)
├── Alternative Path scenarios (Medium priority)
├── Edge Case scenarios (Medium/Low priority)
└── Error Path scenarios (High/Medium priority)
For each scenario, specify:
E2E-{NNN} (sequential within the feature)e2e-scenario-guide.md for criteria)Test scenario files are written directly to the current branch of the current worktree. The previous policy of forcing a switch to dev is no longer needed in the sprint worktree model.
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(ls -d ~/.claude/plugins/cache/*/astra-methodology/* 2>/dev/null | sort -V | tail -1)}"
if [ -z "$PLUGIN_ROOT" ] || [ ! -f "$PLUGIN_ROOT/scripts/worktree-helpers.sh" ]; then
echo "ERROR: CLAUDE_PLUGIN_ROOT not found. Check the plugin cache path." >&2
exit 1
fi
source "$PLUGIN_ROOT/scripts/worktree-helpers.sh"
CURRENT_BRANCH=$(git branch --show-current)
Branches:
astra_is_isolated_worktree true): Write directly to the current sprint branch (e.g., feat/sprint-<N>-<name>). Do not merge into dev — merging is /pr-merge's responsibility.Note: In previous v4.x, there was a main-worktree guard and forced switch to
dev. v5.0+ moved to the sprint worktree model and removed the guard.
Write scenario files to docs/tests/test-cases/sprint-{SPRINT_N}/ using the following format:
File naming: {feature-name}-e2e-scenarios.md
File template:
# {Feature Name} E2E Test Scenarios
## Overview
- **Feature**: {feature description from blueprint}
- **Related Modules**: {dependent modules}
- **API Endpoints**: {related endpoints}
- **DB Tables**: {related tables}
- **Blueprint**: docs/blueprints/{NNN}-{feature-name}/blueprint.md
## Scenario Group 1: {User Journey Name}
### E2E-001: {Scenario Title}
- **Type**: Happy Path
- **Priority**: Critical
- **Preconditions**: {required state}
- **User Journey**:
1. Navigate to {page URL}
2. {action with specific UI element}
3. {action}
- **Expected Results**:
- UI: {expected screen state}
- API: {expected API calls and responses}
- DB: {expected data changes}
- Server Log: {expected log entries}
- **Verification Method**: snapshot / network
- **Test Data**: {required test data}
### E2E-002: {Scenario Title}
- **Type**: Error Path
- **Priority**: High
...
## Scenario Group 2: {User Journey Name}
...
---
## Summary
| Type | Count |
|------|-------|
| Happy Path | {n} |
| Alternative Path | {n} |
| Edge Case | {n} |
| Error Path | {n} |
| **Total** | **{n}** |
Create the docs/tests/test-cases/sprint-{SPRINT_N}/ directory if it does not exist.
If multiple features are selected (or all), generate cross-feature integration scenarios:
Identify feature dependencies from blueprints and shared DB tables
Design end-to-end user journey scenarios that span multiple features
Example: Sign up -> Login -> Browse products -> Add to cart -> Checkout -> Payment -> Order confirmation
Write to docs/tests/test-cases/sprint-{SPRINT_N}/cross-feature-e2e-scenarios.md using the same format as Step 6
Skip this step if only a single feature is selected.
Present the generated scenarios to the user for review:
## Generated E2E Test Scenarios
### {Feature 1 Name}
- File: docs/tests/test-cases/sprint-{SPRINT_N}/{feature-1}-e2e-scenarios.md
- Scenarios: {N} total ({n} Happy, {n} Alternative, {n} Edge, {n} Error)
### {Feature 2 Name}
- File: docs/tests/test-cases/sprint-{SPRINT_N}/{feature-2}-e2e-scenarios.md
- Scenarios: {N} total
### Cross-feature (if applicable)
- File: docs/tests/test-cases/sprint-{SPRINT_N}/cross-feature-e2e-scenarios.md
- Scenarios: {N} total
Would you like to review or modify any scenarios?
If the user requests changes, edit the corresponding scenario files accordingly.
After user confirmation, output a final summary:
## E2E Test Scenario Generation Complete
### Statistics
| Feature | Happy Path | Alt Path | Edge Case | Error Path | Total |
|---------|-----------|----------|-----------|------------|-------|
| {feature-1} | {n} | {n} | {n} | {n} | {n} |
| {feature-2} | {n} | {n} | {n} | {n} | {n} |
| Cross-feature | {n} | {n} | {n} | {n} | {n} |
| **Total** | **{n}** | **{n}** | **{n}** | **{n}** | **{n}** |
### Generated Files
- docs/tests/test-cases/sprint-{SPRINT_N}/{feature-1}-e2e-scenarios.md
- docs/tests/test-cases/sprint-{SPRINT_N}/{feature-2}-e2e-scenarios.md
- docs/tests/test-cases/sprint-{SPRINT_N}/cross-feature-e2e-scenarios.md
### Next Steps
1. Run `/test-run` to execute the generated scenarios in a real browser
2. Run test-coverage-analyzer agent to verify test coverage against test-strategy.md
3. Iterate: add missing scenarios as new edge cases are discovered during testing
# Generate E2E scenarios for a specific feature
/test-scenario auth
# Generate E2E scenarios for all discovered features
/test-scenario all
# Interactive mode — discover features and let user choose
/test-scenario
/test-run skille2e-scenario-guide.mdtools
Runs UAT (User Acceptance Testing) cases in TRUE PARALLEL using Playwright Test runner with isolated browser contexts per worker (separate cookies, localStorage, sessionStorage). Solves the two main limits of /user-test: (1) sequential single-page execution that does not scale beyond a few cases, and (2) one stuck case blocking the rest of the run. Reuses 100% of the /user-test UAT case Markdown+YAML format under docs/tests/uat-cases/, runs them via `npx playwright test --workers=N`, and emits the same report layout (index.html + issues.md + session.json + screenshots/) under docs/tests/uat-reports/. Use when the user asks to "run UAT in parallel", "speed up UAT", "test multi-user", "song song", "uat parallel", or runs /uat-parallel. Distinct from /user-test (sequential Chrome MCP, supports interactive mode), /test-run (developer integration tests), /test-scenario (scenario authoring).
tools
Performs end-user UAT (User Acceptance Testing) by driving a real browser through Chrome MCP, self-verifying each step with hard assertions (DOM / Network / URL / Console), auto-assigning severity on failure, and emitting an HTML report plus issues.md into a timestamped session folder. Supports two modes: interactive (URL + Vietnamese natural-language flow description) and --auto (batch-run pre-authored test cases under docs/tests/uat-cases/). Use when the user asks for "UAT", "user acceptance test", "kiểm thử người dùng", "regression test", or runs /user-test, /uat. Distinct from /test-run (developer-authored technical integration testing) and /test-scenario (scenario authoring from blueprints).
tools
Authors and validates LLM tool descriptions and input schemas (Anthropic Tool Use, MCP servers, LangChain @tool, Pydantic, Zod). Use when the user mentions "tool description", "function calling", "MCP tool", "Pydantic schema", "Zod schema", "@tool decorator", "input_schema", "tool spec", "툴 정의", "함수 호출 스키마", or when editing files that define LLM tool surfaces. Enforces the six required attributes (one-line summary, anti-pattern, synonyms, parameter examples, enum constraints, return shape) and blocks the seven known failure modes — wrong-tool selection, skipped tool, malformed arguments, retry loops, user-intent bypass, wrong side-effect, and un-auditable traces. For authoring ASTRA SKILL.md files use /skill-author instead — this skill is for *runtime* LLM tool surfaces, not for skill files themselves.
development
Creates new SKILL.md files or refactors existing skills to comply with the ASTRA skill best practices guide (docs/development/skill-best-practices.md). Use when user mentions "new skill", "create skill", "SKILL.md", "skill authoring", "스킬 작성", "스킬 만들기", or when editing any file matching skills/**/SKILL.md.