# yaml-language-server: $schema=https://raw.githubusercontent.com/jackchuka/mdschema/main/schema.json

# SPEC TIER 3 (primary navigation structure)
# Business flow file: business-flow/<flow-name>/README.md
# Stories are nested: business-flow/<flow-name>/story/<actor>--<story-name>.md
# Defines end-to-end business processes

structure:
  - heading:
      pattern: "# [a-zA-Z0-9_\\-]+"
    children:
      # Brief description of this business flow - REQUIRED
      - heading: "## Overview"

      # Who initiates and participates in this flow - REQUIRED
      - heading: "## Actors Involved"
        description: |
          List actors that participate in this business flow.
          Link to actor docs. ie. ../../actor/<actor-name>.md
        lists:
          - min: 1
            type: unordered
            min_items: 1

      # Diagram representing this flow - REQUIRED
      - heading: "## Flow Diagram"
        description: |
          Mermaid sequence diagram showing actor interactions across the flow.
          Use actors from "Actors Involved" as participants.
        code_blocks:
          - min: 1
            lang: mermaid

      # Links to user stories nested under this flow - REQUIRED
      - heading: "## Stories"
        description: |
          Link to story docs in ./story/ folder that comprise this business flow.
          Format: ./story/<actor>--<story-name>.md
        lists:
          - min: 1
            type: unordered
            min_items: 1

# Link validation
links:
  validate_internal: true
  validate_files: true

# Heading rules
heading_rules:
  no_skip_levels: true
  unique: true
  max_depth: 3
