Skip to content

tld validate & check

View Markdown

Two commands for quality assurance. validate checks your YAML. check goes further, it verifies symbols against source code and catches stale diagrams.

Validates the structure of your workspace. Catches problems before you try to plan or apply.

Terminal window
tld validate
  • Missing elements: A connector references an element that doesn’t exist
  • Duplicate refs: Two elements with the same key
  • Invalid types: An element kind that isn’t recognized
  • Circular parent references: A diagram that’s its own ancestor
  • Broken view references: Connectors pointing to views that don’t exist

Everything good:

✓ Workspace valid: 42 elements, 12 diagrams, 35 connectors

Problems found:

✗ Validation errors:
- element "payment-svc" not found (referenced by connector payment-svc:gateway:calls)
- circular parent reference detected: api-gateway -> api-gateway
2 validation error(s)

After structural validation, tld validate also runs the same architectural analysis as tld plan:

## Architectural Warnings (Level 2: Standard)
[isolated-object] Isolated Object (1 violations)
Consider removing or connecting these standalone objects.
* cache-redis has no connectors in its view
[high-density] High Density (1 violations)
Consider splitting this view or moving detail into child diagrams.
* root has 17 elements (max recommended: 12)
Terminal window
# Standard (default)
tld validate --strictness 2
# Minimal checks
tld validate --strictness 1
# Strict , checks labels, descriptions, naming
tld validate --strictness 3
# Verbose , show full violation details
tld validate --strictness 3 --verbose

tld validate also verifies that element refs match actual source paths (when has_source: true is set). It checks your exclude patterns, verifies git link URLs actually point to valid places, and makes sure your diagrams reference real code.

Use tld validate before tld plan or tld apply. Use tld check in CI or as a pre-commit hook.

Terminal window
# Structural check
tld validate
# Strict quality gate
tld validate --strictness 3