What Are the DESIGN.md Linting Rules and Their Severity Levels?

The DESIGN.md linter enforces 11 validation rules across three severity levels—error, warning, and info—with each rule implemented as a TypeScript module in packages/cli/src/linter/linter/rules/.

The google-labs-code/design.md repository provides a specification and CLI tool for documenting design systems. A core component of this CLI is the built-in linter, which validates DESIGN.md files against a canonical schema. According to the source code, the linter aggregates rules defined in individual files and assigns each a default severity that determines whether an issue blocks validation or merely alerts the developer.

Where the Linting Rules Are Defined

All linting logic resides in the packages/cli/src/linter/linter/rules/ directory. The entry point, packages/cli/src/linter/linter/rules/index.ts, exports a DEFAULT_RULES array that registers every rule by importing the rule modules. You can view the complete list of rule files with:

ls packages/cli/src/linter/linter/rules/

Each .ts file (e.g., unknown-key.ts, contrast-ratio.ts) exports a descriptor object containing the rule’s identifier, default severity, and validation logic.

Error-Level Linting Rules

Rules marked as error are blocking issues that must be resolved for the DESIGN.md file to be considered valid. Five rules ship with this severity by default:

Warning-Level Linting Rules

Rules marked as warning highlight best-practice violations or potential mistakes that do not prevent the file from validating. Five rules default to this level:

Info-Level Linting Rules

The linter also provides non-blocking informational feedback:

Customizing Rule Severity

While the defaults above are hard-coded in the rule descriptors found in packages/cli/src/linter/linter/rules/, the CLI exposes a --rules command-line option that allows developers to override severities at runtime. This accepts a mapping of rule identifiers to desired severity levels, enabling you to downgrade unknown-key to a warning or elevate contrast-ratio to an error to match your team's requirements.

Summary

  • The linter contains 11 built-in rules located in packages/cli/src/linter/linter/rules/.
  • Severities are partitioned into three buckets: error (5 rules), warning (5 rules), and info (1 rule).
  • Error-level rules (broken-ref, missing-primary, missing-sections, missing-typography, unknown-key) block validation until fixed.
  • Warning-level rules address accessibility, ordering, spelling, and unused tokens without blocking builds.
  • The token-summary rule provides informational feedback only.
  • All defaults can be overridden via the CLI’s --rules option.

Frequently Asked Questions

What are the DESIGN.md linting rules?

The DESIGN.md linting rules are a set of 11 validation checks defined in the google-labs-code/design.md CLI. They verify specification compliance, token integrity, section ordering, and accessibility criteria, each implemented as a TypeScript module in packages/cli/src/linter/linter/rules/.

How do I change the severity of a specific rule?

You can override the default severity using the --rules command-line option when invoking the linter. This accepts a mapping of rule identifiers to desired severity levels (e.g., error, warning, info), allowing you to tailor the validation strictness to your project needs.

Which rules are considered blocking errors?

Five rules default to the error severity and will block validation until resolved: broken-ref, missing-primary, missing-sections, missing-typography, and unknown-key. These enforce core specification requirements such as valid token references and mandatory sections.

Where can I find the source code for the token-summary rule?

The token-summary rule is implemented in packages/cli/src/linter/linter/rules/token-summary.ts. This file exports the rule descriptor that assigns the info severity and defines the logic for aggregating token usage statistics.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →