| name | yaml_case_linter |
| description | Lint YAML API test cases generated by yaml_case_generator, checking structure, variables, assertions, auth headers, risk controls, and flow variable passing before execution. |
YAML Case Linter
Use this skill after yaml_case_generator to validate YAML API test case quality before committing cases or running them with a pytest/API runner.
Goal
This skill checks whether generated YAML API cases are structured, maintainable, and safe to execute. It does not call APIs or mutate test data.
Inputs
Supported inputs:
- A single YAML case file.
- A directory containing
.yaml / .yml case files.
Typical pipeline:
python3 skills/yaml_case_generator/scripts/generate_yaml_cases.py \
--openapi openapi.yaml \
--contract confirmed_contract.yaml \
--output cases/auth/auth_cases.yaml
python3 skills/yaml_case_linter/scripts/lint_yaml_cases.py \
--input cases/auth/auth_cases.yaml \
--output-dir output/yaml-lint
Lint a whole cases directory:
python3 skills/yaml_case_linter/scripts/lint_yaml_cases.py \
--input cases \
--output-dir output/yaml-lint
Outputs
The script writes:
yaml_lint_report.md
yaml_lint_report.json
yaml_lint_summary.json
Checks
The default rules cover:
- YAML parseability.
- Root document must be a list of cases or an object containing
cases.
- Required fields:
id, name, module, priority, enabled, type, request, asserts.
- Unique
id across all linted files.
request.method must be one of GET, POST, PUT, PATCH, DELETE.
request.path must start with /api/ by default.
enabled and needs_contract must be boolean when present.
priority must be one of P0, P1, P2, P3.
- Each case must contain at least one
status_code assertion.
${variable} references must come from configured global roots, same-case extracts, or previous flow step extracts.
- Token-dependent interfaces must include
Authorization.
- Login cases must extract
accessToken, refreshToken, and sessionId.
- Refresh-token cases must use
${refreshToken}.
- High-risk delete/deactivate/account-cancel cases must not be
enabled: true.
- Flow cases must contain ordered
steps, valid step requests, step assertions, and valid variable passing.
Issue Fields
Each issue contains:
issueId
severity: High, Medium, or Low
caseId
caseName
issueType
issueDesc
suggestion
file
Usage
python3 skills/yaml_case_linter/scripts/lint_yaml_cases.py \
--input cases \
--output-dir output/yaml-lint
Use a custom rule file:
python3 skills/yaml_case_linter/scripts/lint_yaml_cases.py \
--input cases \
--rules skills/yaml_case_linter/rules/yaml_lint_rules.yaml \
--output-dir output/yaml-lint
Dependencies
python3 -m pip install pyyaml
Chain Position
openapi_api_analyzer
-> api_contract_checker
-> yaml_case_generator
-> yaml_case_linter