Prompts · Publisher repository

DESIGN.md

An open format and local CLI from Google Labs Code that combines structured design tokens with written design principles to give coding agents persistent, checkable interface constraints.

28.6k StarsApache-2.0TypeScriptUpdated 1 months ago
01

Project overview

DESIGN.md puts colors, typography, radii, spacing, and component tokens in YAML frontmatter, then uses Markdown for visual direction, interaction principles, and anti-patterns. A coding agent can repeatedly read the same project-level design context instead of relying on a one-off prompt. The companion CLI can lint the format, compare versions, and export common token formats.

02

Core capabilities

01

Structured design context

Stores design tokens and design principles in one file, giving agents both parseable constraints and semantic guidance.

02

Design specification linting

The lint command reads a file or stdin, checks structure, references, contrast, and other rules, then reports findings as JSON or Markdown.

03

Version diff and regression detection

The diff command compares token additions, removals, and modifications and marks a regression when error or warning counts increase.

04

Design token export

The export command emits Tailwind v3 JSON, Tailwind v4 CSS, DTCG JSON, or CSS custom properties.

03

Access and usage

Install @google/design.md in a Node.js 18+ environment, create or copy a DESIGN.md file, lint it first, and then provide it to a coding agent that can read project Markdown.

AI AGENT INSTALL

Let an AI Agent install it

Send this prompt to Codex, Claude Code, or another AI agent that can work with your local environment.

Set up Google Labs Code's DESIGN.md in the current project. First read the README, docs/spec.md, and examples at https://github.com/google-labs-code/design.md. Confirm that Node.js is at least version 18, then install @google/design.md. Describe which files you plan to create or change before acting. Ask before overwriting an existing DESIGN.md, changing the npm registry, writing exported files, or installing dependencies. Finally, run npx @google/design.md lint DESIGN.md and report errors, warnings, and any design decisions that still need human review. Do not treat a successful export as a passed lint check.
01Before you start
  • Node.js 18 or later
  • npm configured with access to the public registry
  • A local project where DESIGN.md will be added
02Copy the install command or configuration
npm install @google/design.md
03Complete the setup steps
  1. 1
    Create a minimal DESIGN.md

    Start from the closest example. Keep the name, colors, typography, rounded, spacing, and components sections in YAML frontmatter, then describe visual direction and anti-patterns in Markdown.

  2. 2
    Run the structural checks

    Run npx @google/design.md lint DESIGN.md. Read findings and summary, fix errors first, and decide whether each warning represents a real design risk.

  3. 3
    Give the context to an agent

    Tell the coding agent to read DESIGN.md before implementing or changing an interface. The host must be able to read the project file.

  4. 4
    Compare design-system changes

    Keep the previous file and run npx @google/design.md diff before.md DESIGN.md. If the result marks a regression, inspect new errors, warnings, and token changes.

  5. 5
    Export tokens when needed

    Run npx @google/design.md export DESIGN.md with css-tailwind, json-tailwind, dtcg, or css-vars, then redirect stdout to a target file. Run lint separately before exporting.

How to verify the setup

Run npx @google/design.md lint DESIGN.md. The command should print JSON with findings and summary. A summary.errors value of 0 means there are no lint errors; warnings still require review.

Before using it
  • On Windows, use npx -p @google/design.md designmd lint DESIGN.md if the .md command name collides with file-extension handling.
  • For ENOVERSIONS, check npm config get registry; the package is published to the public npm registry.
  • The format is alpha, so read release notes and run diff before upgrading.
04

Use cases

SCENARIO 01

Keep agent-generated interfaces consistent

Version brand colors, typography, spacing, and component rules so agents working on different tasks read the same constraints.

SCENARIO 02

Review design-system changes

Use lint and diff before a commit to catch broken token references, contrast problems, or increases in warning counts.

SCENARIO 03

Reuse design tokens

Export Tailwind, DTCG, or CSS variables from DESIGN.md for an existing frontend toolchain.

05

Assessment

Its strongest idea is turning visual guidance for agents into a versioned, lintable, exportable project asset. The specification, source, and examples are enough for evaluation, but the alpha format, lack of a declared host-specific integration, and absence of local functional testing make a small single-project trial the sensible adoption path.

Why it may be useful

  • The specification, CLI source, and three complete examples are public
  • The local-file workflow does not require an account or runtime secret
  • lint, diff, and multiple export formats cover the main authoring and review loop
  • The Apache-2.0 license is clear

What to know first

  • The format is still alpha and compatibility may change
  • No official integration with a specific coding-agent host is claimed
  • export does not replace lint or human visual review
  • The repository has no SECURITY.md and is outside the Google OSS VRP
06

README

DESIGN.md


Overview

An open format and local CLI from Google Labs Code that combines structured design tokens with written design principles to give coding agents persistent, checkable interface constraints. A format specification for describing a visual identity to coding agents. DESIGN.md gives agents a persistent, structured understanding of a design system.

Getting started

  • Install @google/design.md in a Node.js 18+ environment, create or copy a DESIGN.md file, lint it first, and then provide it to a coding agent that can read project Markdown.
  • A DESIGN.md file combines YAML frontmatter for machine-readable tokens with a Markdown body for design intent that humans and agents can interpret.
  • The CLI provides lint, diff, export, and spec commands. lint produces structured findings, diff reports token changes and regressions, and export supports Tailwind, DTCG, and CSS variables.
  • Run npx @google/design.md lint DESIGN.md. The command should print JSON with findings and summary. A summary.errors value of 0 means there are no lint errors; warnings still require review.

Configuration

npm install @google/design.md
Read the complete README on GitHub →