spec-test-usecase
Original:🇨🇳 Chinese
Translated
Use when you need to generate or update `{FEATURE_DIR}/verification/usecase.md` (test cases) during the verification phase of the Spec Pack, and require AC traceability and a structure that supports automated script generation.
2installs
Sourcezixun-github/aisdlc
Added on
NPX Install
npx skill4agent add zixun-github/aisdlc spec-test-usecaseTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Spec Test Cases (V2: Usecase)
Convert the acceptance criteria (AC) in / into an executable, determinable, traceable, machine-extractable manual test case structure.
requirements/solution.mdrequirements/prd.mdAuthoritative specification:
design/aisdlc_spec_verification.mdHard Access Control (Must Comply)
- Locate path first before reading/writing: You must first run to get and echo
spec-context; stop immediately if it fails, guessing paths is prohibited.FEATURE_DIR=... - Must read project-level memory: ,
project/memory/product.md,project/memory/tech.md; writeproject/memory/glossary.mdif any of them cannot be read.CONTEXT GAP - Minimum requirement-level input: At least one of or
{FEATURE_DIR}/requirements/solution.mdmust exist; otherwise stop and write{FEATURE_DIR}/requirements/prd.md.CONTEXT GAP - Mandatory structuring: Each test case must meet the minimum structure of "ID/type/steps + assertion points/traceability/suite", free prose is not allowed as a replacement.
- Unauthorized routing prohibited: Only output after completion, the next step is decided by
ROUTER_SUMMARY.using-aisdlc
Red Flag Checklist (Stop if Any Item Occurs)
- Start writing test cases without echoing
FEATURE_DIR=... - Try to use descriptions like "cover login/cover payment" to replace executable steps
TC-* - Try to write "expected results" as subjective judgments (such as "looks normal") instead of observable assertion points
- Try to use to replace AC traceability links
TBD/to be supplemented
The Only Operation Method (PowerShell)
1) Get FEATURE_DIR
FEATURE_DIRpowershell
. ".\skills\spec-context\scripts\spec-common.ps1"
$context = Get-SpecContext
$FEATURE_DIR = $context.FEATURE_DIR
Write-Host "FEATURE_DIR=$FEATURE_DIR"2) Target Output Path
powershell
$out = Join-Path $FEATURE_DIR "verification/usecase.md"
Write-Host "OUTPUT=$out"Test Case Structure (Mandatory, Automation Friendly)
Each test case must include:
- Stable ID: (example:
TC-<DOMAIN>-<NNN>). Do not change the ID randomly after release.TC-AUTH-001 - Priority: P0 / P1 / P2
- Type: UI / API / Integration / Regression (can be extended as needed, but must be enumerable)
- Tags: Impact scope/module/risk (in array format)
- Traceability: Link to at least 1 AC (from )
solution/prd - Suite: Mark at least /
smoke(you can also markregressionif applicable)targeted - Preconditions: Preparable and executable (including account/permission/switch/environment)
- Test data: Provide sample values or generation methods ("prepare by yourself" is prohibited)
- Steps: Numbered step by step; each step must include expected results (observable assertion points)
- Post conditions/Cleanup: Must be clearly written when data will be polluted
Minimum Template (Single Test Case)
markdown
## TC-XXX-001: [Title]
**Priority:** P0 | P1 | P2
**Type:** UI | API | Integration | Regression
**Tags:** [tag1, tag2]
**Traceability:** AC-001 (`requirements/prd.md#...` or `requirements/solution.md#...`)
**Suite:** smoke, regression
### Objective
[One sentence stating what to verify]
### Preconditions
- ...
### Test Data
- ...
### Test Steps
1. ...
**Expected:** ...
2. ...
**Expected:** ...
### Post conditions/Cleanup
- ...DoD Self-Check (V2-DoD)
- All P0/P1 test cases are "executable": preconditions and data are not missing
- Each step has "expected results" (observable, determinable)
- AC coverage relationship is clear (at least can answer "which AC are covered by which test cases")
- Test case structure meets the minimum information requirements for subsequent automated generation (ID/type/steps/assertion points)
Output and Automatic Routing After Completion (Must Be Executed)
After is saved to disk, must complete the following actions (in order, cannot be omitted):
usecase.md- Output ROUTER_SUMMARY (in YAML format, for Router decision making):
yaml
ROUTER_SUMMARY:
stage: V2
artifacts:
- "{FEATURE_DIR}/verification/usecase.md"
needs_human_review: false
blocked: false
block_reason: ""
notes: "Soft checkpoint: Test cases have been generated/updated; Router can continue to automatically advance to V3 (spec-test-suites) or V4 (spec-test-execute)"-
Executeimmediately: Pass the above
using-aisdlcas routing input to using-aisdlc, the Router will decide the next step and advance automatically (no need to wait for the user to say "continue").ROUTER_SUMMARY- If the Router determines that automatic continuous running is possible: Continue to execute the next worker skill in the same round of conversation (such as V3, V4, etc.)
- If the Router triggers a hard interrupt: Stop and output the blocking reason, required input, and candidate next steps
-
Conversation output: Before calling using-aisdlc, you can briefly state "The product of this phase has been saved to disk, calling using-aisdlc to route the next step."
name: spec-test-usecase description: Use when you need to generate or update V2 test cases (verification/usecase.md) for the verification phase in the Spec Pack of sdlc-dev, and must ensure the test case structure is executable, each step has expected results, and AC is traceable.
Spec Test Cases (V2: verification/usecase.md)
Overview
This skill is a verification phase worker skill, only responsible for:
- Access control verification (first locate , then read necessary inputs)
{FEATURE_DIR} - Generate/update
{FEATURE_DIR}/verification/usecase.md - Self-check according to V2-DoD (executable + traceable + automation friendly structure)
- Output and return to
ROUTER_SUMMARYusing-aisdlc
Hard Access Control (Cannot Be Bypassed)
1) Locate FEATURE_DIR first (guessing paths is prohibited)
powershell
. ".\skills\spec-context\scripts\spec-common.ps1"
$context = Get-SpecContext
$FEATURE_DIR = $context.FEATURE_DIR
Write-Host "FEATURE_DIR=$FEATURE_DIR"Stop immediately if it fails.
2) Must read project-level Memory (write CONTEXT GAP if missing)
.aisdlc/project/memory/product.md.aisdlc/project/memory/tech.md.aisdlc/project/memory/glossary.md
If any is missing: Explicitly write in (and explain the impact on test case specifications).
CONTEXT GAPusecase.md3) At least one AC source exists
Must read one of them as the acceptance criteria source:
- or
{FEATURE_DIR}/requirements/solution.md {FEATURE_DIR}/requirements/prd.md
If neither exists: Stop and return to .
using-aisdlc4) Test plan is recommended as constraint input
If already exists: Read it to constrain scope/environment/priority specifications; if it does not exist: Write in and put the gap into risk/blocking items (do not leave it hanging with ).
{FEATURE_DIR}/verification/test-plan.mdCONTEXT GAPusecase.mdTBDOutput (Save to Disk)
{FEATURE_DIR}/verification/usecase.md
usecase.md
Structure Requirements (Mandatory)
usecase.mdID Specification
- Stable ID: (for example
TC-<DOMAIN>-<NNN>)TC-AUTH-001 - Do not change the ID randomly after release and collaboration
- Self-created ID systems such as ,
UC-001are prohibitedCASE-1
Minimum Template for Single Test Case (Required Fields Must Be Complete)
markdown
## TC-XXX-001: [Title]
**Priority:** P0 | P1 | P2
**Type:** UI | API | Integration | Regression
**Tags:** [tag1, tag2]
**Traceability:** AC-001 (`requirements/solution.md#...` or `requirements/prd.md#...`)
**Suite:** smoke, regression
### Objective
[One sentence stating what to verify]
### Preconditions
- ...
### Test Data
- ...
### Test Steps
1. ...
**Expected:** ... (observable, determinable)
2. ...
**Expected:** ...
### Post conditions/Cleanup
- ...Minimum Standard for "Observable Expectations"
Expectations must point to determinable signals, for example (choose one, the more specific the better):
- UI copy/control state/jump path
- HTTP status code/response body fields
- Whether data records are created/updated (including key fields)
- Log keywords/audit events
Undeterminable wording such as "success/normal/meets expectations" is prohibited.
V2-DoD Self-Check
- P0/P1 test cases are executable (preconditions and data are not missing)
- Each step has observable expected results (can determine pass/fail)
- AC coverage relationship is answerable (which AC are covered by which test cases)
- Test case IDs are stable, and the structure is available for subsequent automated generation
Anti-patterns (Must Be Avoided)
| Anti-pattern | Why it is not allowed | Correct practice |
|---|---|---|
Use | Test cases are not executable | Put missing items into risk/blocking items and explain the impact |
| No expected results for each step | Cannot determine pass/fail | Write observable assertion points for each step |
| Only write titles that "cover many aspects" | Not executable | Must complete preconditions/data/step/expectations besides the title |
Red Flag STOP
- Start writing without echoing
usecase.mdFEATURE_DIR=... - Test case ID system deviates from
TC-<DOMAIN>-<NNN> - Undeterminable wording such as "success/normal/meets expectations" appears in step expectations
Output and Automatic Routing After Completion (Must Be Executed)
After is saved to disk, must complete the following actions (in order, cannot be omitted):
usecase.md- Output ROUTER_SUMMARY (in YAML format, for Router decision making):
yaml
ROUTER_SUMMARY:
stage: V2
artifacts:
- "{FEATURE_DIR}/verification/usecase.md"
needs_human_review: false
blocked: false
block_reason: ""
notes: "Soft checkpoint: Test cases have been generated/updated; Router can continue to automatically advance to V3 (spec-test-suites) or V4 (spec-test-execute)"-
Executeimmediately: Pass the above
using-aisdlcas routing input to using-aisdlc, the Router will decide the next step and advance automatically (no need to wait for the user to say "continue").ROUTER_SUMMARY- If the Router determines that automatic continuous running is possible: Continue to execute the next worker skill in the same round of conversation (such as V3, V4, etc.)
- If the Router triggers a hard interrupt: Stop and output the blocking reason, required input, and candidate next steps
-
Conversation output: Before calling using-aisdlc, you can briefly state "The product of this phase has been saved to disk, calling using-aisdlc to route the next step."