mimic_discover_ds
Discovers design system variables, text styles, and components from a Figma file in two steps. Validates community libraries to ensure complete discovery before enabling build tools.
Instructions
Complete DS discovery in two steps. Step 1: call with fileKey — discovers variables, text styles, components via plugin API, caches everything, stays at Phase 1. Step 2: call again with communitySearchResults (library names from Figma MCP search_design_system) — verifies no community libraries were missed, then advances to Phase 2 (build-ready). Build tools are BLOCKED until Step 2 completes. If a community library's variables are not discoverable via the plugin API (communityVariablesRequired response), fetch them via Figma MCP search_design_system and pass as externalVariables.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileKey | Yes | Figma file key to discover DS from. | |
| libraryKey | No | Library key to use when multiple DS libraries are available. Returned from a previous call that detected multiple libraries. | |
| skipRestApi | No | Skip REST API component discovery (e.g. for community libraries where the file key is unavailable). Discovery proceeds with plugin-only data; use Figma MCP search_design_system + mimic_map_components to find components. | |
| libraryFileKey | No | Library file key (alphanumeric string from the Figma URL of the library file). Prompted once per library, cached permanently. | |
| externalVariables | No | Variables fetched via Figma MCP search_design_system for community libraries whose variables are not discoverable via the plugin API. Pass after receiving a communityVariablesRequired response. | |
| identityDriftChoice | No | Answer to a library-identity-drift prompt (name-keyed community library where most previously-known components vanished). "same" keeps learning under the existing history; "different" starts a fresh bucket for this library. | |
| communitySearchResults | No | Unique library names found via Figma MCP search_design_system (query "color", includeVariables: true). Required after initial discovery to verify no community libraries were missed. Pass only non-null libraryName values. | |
| communitySearchVariableKeys | No | Map of libraryName → one sample variable key from search results. Used to validate which libraries are actually enabled in the file. Extract one key per library from the color search results. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| phase | No | ||
| _stopBuild | No | True when the build must not proceed until the returned instructions are followed. | |
| phaseLabel | No | ||
| _userPrompt | No | Present this to the user verbatim when a decision is required. | |
| enforcement | No | ||
| completenessWarnings | No | ||
| communityLibraryCheckRequired | No |