Skip to content

Diagram Linting Rules

When you run tld plan or tld validate, the CLI performs a series of quality checks to help you maintain a clean and professional architectural map. These rules prevent your diagrams from turning into cluttered “walls of boxes” and ensure they serve as a useful “navigatable atlas” for your team.

You can calibrate the strictness of these checks using the --strictness=[1-3] flag or by configuring your .tld.yaml file:

.tld.yaml
validation:
level: 2 # Standard (Default)

Focus: Basic navigation and documentation. Best for initial exploration and rapid prototyping.

RuleTriggerWhy it matters
Isolated ObjectObject has no connections in a diagramIf an object isn’t talking to anything, it either doesn’t belong on this view or a critical connection is missing.
High Density> 15 objects on one diagramHuman cognitive load peaks at ~12 items. Beyond 15, relationships become impossible to track effectively.
Depth MismatchHierarchy is < 2 levels deepA flat map of 100 objects is overwhelming. Aim for a hierarchy that allows users to “zoom in” to details.
Low Insight RatioFewer connections than objectsA diagram with many boxes but few lines is “shallow”-it shows an inventory, but not how the system actually works.
Dead-End DrilldownObject has a link but no sub-diagramPrevents “broken links” when navigating through the architecture.
Circular ParentsDiagram is its own ancestor(Hard Error) Prevents infinite loops in navigation and rendering.

Focus: Technical detail and architectural insight. Recommended for day-to-day engineering and onboarding.

RuleTriggerWhy it matters
Generic LabelsLabels like “calls”, “uses”, or “connects”These are “low-signal” labels. Use descriptive verbs like “validates JWT”, “publishes event”, or “SQL Query”.
Missing TechNo technology field (e.g., Go, React)Knowing the stack is critical for understanding the “how” of a system.
High Density> 12 objects on one diagramKeeping diagrams under 12 objects ensures they are readable at a glance without mental strain.

Focus: Structural integrity and absolute clarity. Use this for production-grade documentation and system handovers.

RuleTriggerWhy it matters
Missing Descriptiondescription field is emptyA one-sentence summary helps a reader understand a component’s responsibility without having to dive into code.
Generic NamingNames like “Module 1” or “Stuff”Vague names make the map harder to search, navigate, and understand.
Missing LabelConnection has no labelAn edge without a label tells the reader that a connection exists, but not what it does.
Missing TypeObject has no typeTypes (service, db, queue) provide immediate visual context for the role of the component.

The goal of tld is to move beyond static, flat images. By following these guidelines, your diagrams become a living documentation system that is:

  1. Navigatable: Easy to drill down from high-level services to low-level implementation details.
  2. Searchable: Meaningful names and descriptions make it easier to find components in large systems.
  3. Professional: Consistent labeling and metadata (technology, types) ensure the maps are useful for both engineers and stakeholders.

You can toggle specific rules off in your .tld.yaml if they don’t fit your current workflow:

.tld.yaml
validation:
level: 2
allow_low_insight: true # Disables the "Low Insight Ratio" check