---
title: tld validate & check
description: Ensure your workspace YAML is correct and your diagrams are up to
  date. Two complementary quality commands.
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

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


## tld validate

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

```bash
tld validate
```

### What it catches

- **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

### Output

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)
```

### Architectural warnings

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)
```

### Strictness levels

```bash
# 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
```

### Symbol verification

`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.

## Quick reference

```bash
# Structural check
tld validate

# Strict quality gate
tld validate --strictness 3

```