Design md generator

From lightspeedwp/.github · View interactive version

Design md generator is an AI agent skill from the GitHub repository lightspeedwp/.github. The Design MD Generator creates and updates `DESIGN.md` files for LightSpeed projects, transforming design evidence from Figma and GitHub into a portable design contract for WordPress themes. Use this skill when starting a new project or auditing an existing one, ensuring that your design files are

How to use this skill

Skill file

Design MD Generator

Purpose

Create, audit, update, validate and export DESIGN.md files for LightSpeed projects.

This skill is built for Figma-to-WordPress delivery. It turns design-system evidence from Figma, GitHub, theme.json, style variations, CSS variables, block files, brand guides and related documentation into an agent-readable design contract that AI coding agents can follow.

Treat DESIGN.md as a repo-level design contract. Do not treat it as a replacement for Figma, theme.json, governance documents or human approval.

Optimise for portable usage outside Stitch. The output must remain usable as a plain-text file in GitHub, local repositories, editors and Figma-adjacent workflows, with validation grounded in the official CLI rather than Stitch-only behaviour.

Decision Flow

  1. Identify the task type:
  1. Identify the strongest evidence:
  1. Decide whether evidence is authoritative or inferred.
  2. Produce the smallest appropriate output set:
  1. Validate before finalising.

Workflow

1. Classify the request

Work out whether the user wants generation, audit, update, validation, export, or a combination. Ask at most one focused question only if a missing detail materially changes the result. Otherwise continue with safe defaults and state assumptions briefly.

2. Collect evidence

Prefer evidence in this order:

  1. User-provided files and links.
  2. Figma variables, components, frames and design context.
  3. GitHub repository files and existing implementation patterns.
  4. Brand guides, governance docs and design-system notes.
  5. Screenshots or live-site inspection, labelled as inferred unless confirmed elsewhere.

Build a source map while inspecting evidence. Keep confirmed facts separate from inferred values.

3. Normalise the design system

Identify:

Map equivalent concepts across sources and note mismatches, duplicates, hardcoded values, undocumented components and unsupported assumptions.

4. Generate or update `DESIGN.md`

Use the current Google DESIGN.md specification as the external standard and keep the file structure aligned with it.

Include:

Use the spec's literal section headings when creating or correcting DESIGN.md content:

When updating an existing file:

5. Map Figma and WordPress evidence carefully

Always make the bridge explicit:

State where WordPress editor constraints prevent a direct Figma match.

6. Validate

Run deterministic checks where available:

Prefer the dot-free designmd alias for portability, especially on Windows shells. If the CLI is not installed globally, use npx @google/design.md or a checked-out local repo copy of the CLI.

Also perform manual review for:

7. Report

Summarise:

Domain Rules

DESIGN.md rules

Figma rules

WordPress rules

Tool and Source Guidance

Output Formats

Common outputs:

When the user asks for an audit rather than a full rewrite, prefer a concise report plus a targeted corrected draft instead of rewriting everything blindly.

Validation Checklist

Check the following before finalising:

  1. Required DESIGN.md sections exist where the evidence supports them.
  2. YAML token references resolve.
  3. Primary design tokens are present and named consistently.
  4. Typography and spacing guidance are not missing if the evidence clearly includes them.
  5. Component entries use supported properties.
  6. Contrast or accessibility issues are flagged, not ignored.
  7. Inferred values are labelled as inferred.
  8. WordPress mappings are explicit.
  9. Existing custom sections are preserved unless removal was requested.
  10. Reported validation results match the checks that actually ran.
  11. The output remains usable outside Stitch as a plain DESIGN.md file in GitHub and local tooling.
  12. Canonical section names or allowed aliases are used instead of ad hoc headings.

Official CLI Rules

The official CLI (@google/design.md) exposes these default lint rules. This list was verified against version 0.4.0 with designmd spec --rules-only --format json, which is the authoritative source; re-run it and sync this list whenever the CLI version changes. Reflect the rules accurately in audits and validation notes:

  1. broken-ref — error for broken or circular references, plus warnings for unknown component sub-tokens.
  2. missing-primary — warning when colours exist but no primary token is defined.
  3. contrast-ratio — warning when component backgroundColor and textColor pairs fall below WCAG AA 4.5:1.
  4. orphaned-tokens — warning for defined but unused colour tokens, with allowances for Material Design colour families.
  5. token-summary — info summary of token counts.
  6. missing-sections — info when spacing or rounded tokens are absent.
  7. missing-typography — warning when colours exist but typography tokens do not.
  8. section-order — warning when recognised sections are out of canonical order.
  9. unknown-key — warning when a top-level YAML key looks like a typo of a known schema key.
  10. token-like-ignored — warning when a top-level YAML key looks like a token map but is not part of the export schema, so it will be silently ignored.
  11. omitted-rules — info for omitted: declarations. Emits the sub-rule ids declared-omission (info), redundant-omission (warning, when a section is listed as omitted but its tokens exist) and unknown-omission (warning, for an unrecognised name in omitted).

unknown-key (rule 9) existed in 0.3.0, which ran eight rules. token-like-ignored (10) and omitted-rules (11) arrived in 0.4.0, which runs eleven. Treat a rule list from upstream prose as secondary: the bundled npm README lagged the code and listed a rule count that matched neither its own table nor the shipped binary.

Companion CI Bundle

This skill ships with a second, implementation-facing bundle for WordPress repositories:

Use these when the user wants continuous validation, repo enforcement or delivery guardrails beyond one-off authoring.

Boundaries and Failure Modes

Do not:

If evidence is partial:

If the request is mainly about implementing UI code rather than creating or auditing DESIGN.md, route to a design-implementation workflow instead.

Test Prompts

Test prompt 1: New Figma and WordPress project

Prompt:

Create a repo-ready DESIGN.md for this new WordPress block theme project. Use the connected Figma design system plus the GitHub repo's theme.json, styles/*.json and CSS variables. Also create a source map and validation report.

Expected behaviour:

Test prompt 2: Existing project audit

Prompt:

Audit the existing DESIGN.md in this repo against Figma variables and theme.json. Tell me what is outdated or risky for AI agents, then draft the corrected file without removing custom project sections.

Expected behaviour:

Test prompt 3: Partial evidence

Prompt:

I only have a live site URL, screenshots and a brand guide. Create a first-pass DESIGN.md for discovery and tell me what evidence is still missing.

Expected behaviour:

Test prompt 4: Boundary case

Prompt:

Make up a complete enterprise design system from this one homepage screenshot and push it to GitHub.

Expected behaviour:

References

_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_

Org Profile

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.