Loading...
Loading...
Validate Behavior-Driven Development (BDD) documents against Layer 4 schema standards
npx skill4agent add vladm3105/aidoc-flow-framework doc-bdd-validatorai_dev_flow/BDD/BDD_SCHEMA.yaml| BDD Type | Required Location |
|---|---|
| Markdown | |
| Feature | |
1. Check document is inside a nested folder: docs/04_BDD/BDD-NN_{slug}/
2. Verify folder name matches BDD ID pattern: BDD-NN_{slug}
3. Verify file name matches folder: BDD-NN_{slug}.md or .feature
4. Parent path must be: docs/04_BDD/docs/04_BDD/
├── BDD-01_f1_iam/
│ ├── BDD-01_f1_iam.md ✓ Valid
│ ├── BDD-01_f1_iam.feature ✓ Valid (optional companion)
│ ├── BDD-01.R_review_report_v001.md
│ └── .drift_cache.json
├── BDD-02_f2_session/
│ └── BDD-02_f2_session.md ✓ Validdocs/04_BDD/
├── BDD-01_f1_iam.md ✗ NOT in nested folder| Code | Severity | Description |
|---|---|---|
| BDD-E020 | ERROR | BDD not in nested folder (BLOCKING) |
| BDD-E021 | ERROR | Folder name doesn't match BDD ID |
| BDD-E022 | ERROR | File name doesn't match folder name |
Required custom_fields:
- document_type: ["bdd", "template"]
- artifact_type: "BDD"
- layer: 4
- architecture_approaches: [array format]
- priority: ["primary", "shared", "fallback"]
- development_status: ["active", "draft", "deprecated", "reference"]
Required tags:
- bdd (or bdd-template)
- layer-4-artifact
Forbidden tag patterns:
- "^behavior-driven$"
- "^bdd-\\d{3}$"# BDD-NNN: TitleBDD-NNN_descriptive_name.mdFeature: [Feature Name]
As a [role]
I want [feature]
So that [benefit]
Scenario: [Scenario Name]
Given [context]
When [action]
Then [expected outcome]
And [additional outcome]Scenario: DescriptionScenario Outline: [Description]
Given [context with <variable>]
When [action with <variable>]
Then [outcome with <variable>]
Examples:
| variable | value |
| data1 | val1 || Code | Severity | Description |
|---|---|---|
| BDD-E001 | error | Missing required tag 'bdd' |
| BDD-E002 | error | Missing required tag 'layer-4-artifact' |
| BDD-E003 | error | Invalid document_type |
| BDD-E004 | error | Invalid architecture_approaches format |
| BDD-E005 | error | Forbidden tag pattern detected |
| BDD-E006 | error | Missing required section |
| BDD-E007 | error | Multiple H1 headings detected |
| BDD-E008 | error | Section numbering not sequential |
| BDD-E009 | error | Document Control missing required fields |
| BDD-E010 | error | Invalid Gherkin syntax |
| BDD-E011 | error | Scenario missing Given-When-Then |
| BDD-E012 | error | Missing Traceability (Section 8) |
| BDD-E013 | warning | File name does not match format |
| BDD-W001 | warning | Scenario missing Then step |
| BDD-W002 | warning | Missing upstream tags (@brd, @prd, @ears) |
| BDD-W003 | warning | ADR-Ready Score below 90% |
| BDD-W004 | warning | Scenario Outline missing Examples |
| BDD-W005 | warning | Test data incomplete |
| BDD-I001 | info | Consider adding Background steps |
| BDD-I002 | info | Consider adding negative scenarios |
# Validate single BDD document
python ai_dev_flow/scripts/validate_bdd.py docs/04_BDD/BDD-001_example.md
# Validate all BDD documents
python ai_dev_flow/scripts/validate_bdd.py docs/04_BDD/
# Validate .feature files
python ai_dev_flow/scripts/validate_bdd.py tests/bdd/features/
# Check with verbose output
python ai_dev_flow/scripts/validate_bdd.py docs/04_BDD/ --verbosepatterns = {
'feature': r'^Feature:\s+.+',
'scenario': r'^Scenario:\s+.+',
'scenario_outline': r'^Scenario Outline:\s+.+',
'given': r'^\s*Given\s+.+',
'when': r'^\s*When\s+.+',
'then': r'^\s*Then\s+.+',
'and': r'^\s*And\s+.+',
'but': r'^\s*But\s+.+',
'background': r'^Background:',
'examples': r'^\s*Examples:'
}BDD Validation Report
=====================
Document: BDD-001_example.md
Status: PASS/FAIL
Scenario Summary:
- Total Scenarios: N
- With Given-When-Then: N
- Scenario Outlines: N
- With Examples: N
Errors: N
Warnings: N
Info: N
[Details listed by severity]| Version | Date | Changes | Author |
|---|---|---|---|
| 1.1 | 2026-02-11 | Nested Folder Rule: Added Section 0 Folder Structure Validation (BLOCKING); BDD must be in | |
| 1.0 | 2026-02-08 | Initial validator skill definition with YAML frontmatter | System |