|
| 1 | +<div class="sideNavContent" id="aiToolsContent"> |
| 2 | + <div class="spectrum-Typography"> |
| 3 | + <h1 class="spectrum-Heading spectrum-Heading--sizeXXL spectrum-Heading--heavy">AI tooling</h1> |
| 4 | + <hr class="spectrum-Divider spectrum-Divider--sizeM" /> |
| 5 | + <p class="spectrum-Body spectrum-Body--sizeL"> |
| 6 | + Leonardo provides three layers of AI tooling so developers and LLMs can get contextual help building accessible color systems. |
| 7 | + </p> |
| 8 | + |
| 9 | + <h2 class="spectrum-Heading spectrum-Heading--sizeXL spectrum-Heading--heavy" id="ai-tools-llms-txt"><code>llms.txt</code></h2> |
| 10 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 11 | + 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. |
| 12 | + </p> |
| 13 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 14 | + <strong>Location:</strong> <code>llms.txt</code> at the repo root. See the <a href="https://github.com/adobe/leonardo/blob/main/llms.txt" class="spectrum-Link" target="_blank" rel="noopener">file on GitHub</a>. |
| 15 | + </p> |
| 16 | + |
| 17 | + <h2 class="spectrum-Heading spectrum-Heading--sizeXL spectrum-Heading--heavy" id="ai-tools-agent-skill">Agent Skill</h2> |
| 18 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 19 | + A structured skill following the <a href="https://agentskills.io/specification" class="spectrum-Link" target="_blank" rel="noopener">agentskills.io</a> spec so tools like Cursor can activate targeted guidance when helping with <code>@adobe/leonardo-contrast-colors</code>. 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). |
| 20 | + </p> |
| 21 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 22 | + <strong>Location:</strong> <code>skills/leonardo-colors/</code> in the repo (<code>SKILL.md</code> and <code>references/api.md</code>). Install with: |
| 23 | + </p> |
| 24 | + <pre><code class="lang-bash">npx skills add https://github.com/adobe/leonardo |
| 25 | + </code></pre> |
| 26 | + |
| 27 | + <h2 class="spectrum-Heading spectrum-Heading--sizeXL spectrum-Heading--heavy" id="ai-tools-mcp">MCP server</h2> |
| 28 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 29 | + <code>@adobe/leonardo-mcp</code> 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. |
| 30 | + </p> |
| 31 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 32 | + <strong>Tools:</strong> |
| 33 | + </p> |
| 34 | + <ul class="spectrum-Body spectrum-Body--sizeM"> |
| 35 | + <li><strong>generate-theme</strong> — Color definitions + background, lightness, contrast, etc. → <code>theme.contrastColors</code> JSON</li> |
| 36 | + <li><strong>check-contrast</strong> — Foreground and background colors → ratio and WCAG 2 AA/AAA pass/fail or APCA Lc</li> |
| 37 | + <li><strong>convert-color</strong> — Color value + target format → converted string</li> |
| 38 | + <li><strong>create-palette</strong> — Color keys + colorspace + steps → interpolated color array</li> |
| 39 | + </ul> |
| 40 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 41 | + <strong>Run locally (from repo root):</strong> |
| 42 | + </p> |
| 43 | + <pre><code class="lang-bash">npx @adobe/leonardo-mcp |
| 44 | + </code></pre> |
| 45 | + <p class="spectrum-Body spectrum-Body--sizeM"> |
| 46 | + For Cursor, add the Leonardo MCP server in <code>.cursor/mcp.json</code>; see the repo’s <a href="https://github.com/adobe/leonardo/blob/main/.cursor/mcp.json" class="spectrum-Link" target="_blank" rel="noopener">example config</a>. |
| 47 | + </p> |
| 48 | + </div> |
| 49 | + |
| 50 | + {{> footer }} |
| 51 | +</div> |
0 commit comments