Diff two DESIGN.md files for token changes and lint regressions
diff_design_mdCompares two versions of a DESIGN.md file the way npx @google/design.md diff does. Best for: deciding whether a DESIGN.md change is breaking before it is merged. Pass the whole old file in base_text and the whole new file in target_text, each including the YAML front matter; a file path or URL will not work. Returns: every added, removed and modified token in colors, typography, rounded, spacing and components with its old and new value, breaking (true when a token was removed), regression (true when the new file has more lint errors or warnings), the lint counts before and after, and a markdown summary. Do not use for: checking a single file (use lint_design_md) or comparing two websites (run extract_design_md on each first).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_text | Yes | The whole old (current) DESIGN.md file contents, including the YAML front matter between --- lines. Not a file path or URL. Example: "--- name: Paper colors: primary: "#1D1D1B" ---". Both files together must stay under 64 KB. | |
| target_text | Yes | The whole new (proposed) DESIGN.md file contents, including the YAML front matter, to compare against base_text. Not a file path or URL. Example: "--- name: Paper colors: primary: "#0B5CAD" ---". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokens | Yes | Token names added, removed and modified per group, as `npx @google/design.md diff` reports them | |
| changes | Yes | ||
| breaking | Yes | True when a token was removed, so references to it stop resolving | |
| findings | Yes | ||
| regression | Yes | True when the target has more lint errors or warnings than the base | |
| changesCount | Yes | ||
| markdownSummary | Yes | The changes as a short markdown report |