Leonardo

AI tooling


Leonardo provides three layers of AI tooling so developers and LLMs can get contextual help building accessible color systems.

llms.txt

A lightweight file at the repository root that lets any LLM orient itself to Leonardo’s purpose, package structure, and API without reading source. It covers the public API, supported colorspaces and output formats, contrast methods (WCAG 2 and APCA), and a quick usage example.

Location: llms.txt at the repo root. See the file on GitHub.

Agent Skill

A structured skill following the agentskills.io spec so tools like Cursor can activate targeted guidance when helping with @adobe/leonardo-contrast-colors. The skill covers installation, creating colors and themes, reading output, mutating themes at runtime, utility functions, and common accessibility recipes (AA, AAA, large text, APCA).

Location: skills/leonardo-colors/ in the repo (SKILL.md and references/api.md). Install with:

npx skills add https://github.com/adobe/leonardo
                    

MCP server

@adobe/leonardo-mcp is a runtime MCP (Model Context Protocol) server that wraps the library. AI assistants can call tools to generate themes, check contrast, convert colors, and create palettes—producing verified, runnable output instead of guessing from docs.

Tools:

  • generate-theme — Color definitions + background, lightness, contrast, etc. → theme.contrastColors JSON
  • check-contrast — Foreground and background colors → ratio and WCAG 2 AA/AAA pass/fail or APCA Lc
  • convert-color — Color value + target format → converted string
  • create-palette — Color keys + colorspace + steps → interpolated color array

Run locally (from repo root):

npx @adobe/leonardo-mcp
                    

For Cursor, add the Leonardo MCP server in .cursor/mcp.json; see the repo’s example config.