agentleFS
miapremiapre/mimic-ai/.cursor/rules/mimic-ai.mdc

mimic-ai / rules

Cursor rule13 starsChanged 5 months agoMITView on GitHub

Golden workflow for building or editing Figma designs with the Mimic AI MCP server (mimic_status, mimic_discover_ds, figma_create_frame, figma_insert_component, mimic_build_table, mimic_build_chart, and related tools).

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this mimic-ai.mdc into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Build component-first: If the DS has a component for an element, use it, even if the layout doesn't match exactly.

    line 37
  2. Distinctive:

    Content fidelity is non-negotiable: Every label, heading, value, and CTA in Figma matches the HTML/prompt source exactly.

    line 56
  3. Very specific:

    Do not switch to the official Figma MCP, use_figma, or any other Figma-writing tool as a substitute: they bypass DS enforcement completely.

    line 70
  4. Distinctive:

    Feedback iterates the existing artboard: Never delete an artboard to start over.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
mimic-ai.mdc
---
description: Golden workflow for building or editing Figma designs with the Mimic AI MCP server (mimic_status, mimic_discover_ds, figma_create_frame, figma_insert_component, mimic_build_table, mimic_build_chart, and related tools).
globs:
alwaysApply: false
---

# Mimic AI: building Figma with the user's design system

Mimic AI enforces design-system compliance at write time. Never bypass
the gate, never skip discovery, never end a build without a report.

## The sequence, every build

1. **`mimic_status`** first, every session. Read the current phase and
   session state from the response, never assume it.

2. **Discovery, two steps, both required:**
   - Step 1: `mimic_discover_ds(fileKey)`. Discovers variables, text
     styles, components via the plugin. Stops at Phase 1
     (`communityLibraryCheckRequired`), not build-ready yet.
   - Step 2 (do not skip): call Figma MCP `search_design_system` with
     query `"color"` on the same fileKey, collect distinct `libraryName`
     values and one sample variable key per library, then re-call
     `mimic_discover_ds` with `communitySearchResults` and
     `communitySearchVariableKeys`. This unlocks Phase 2. If a
     `_userPrompt` comes back (multiple libraries), show it verbatim and
     wait for the user's pick.

3. **`mimic_map_components`** with the section-level element types
   (header, footer, sidebar, card, table, badge, button, input, etc.).
   With `FIGMA_TOKEN` set, one call resolves found components and
   confirmed gaps. Without it: call once, search missing types via Figma
   MCP `search_design_system`, call again with `librarySearchResults` to
   confirm gaps. Only after that second pass are missing types real
   gaps you can build as primitives.

4. **Build component-first.** If the DS has a component for an element,
   use it, even if the layout doesn't match exactly. Shell elements
   (header, footer, sidebar) and common patterns (buttons, badges,
   inputs, table cells, tabs, dropdowns, avatars) are never raw frames
   if the DS has them: the plugin gate blocks it. Custom frames only
   for things with no DS equivalent, and even then every fill, stroke,
   spacing, and radius binds to a DS variable; raw hex, raw px, and
   non-DS fonts get rejected. After every `figma_insert_component`, read
   `configurationChecklist` and complete it: re-enable booleans the HTML
   shows (labels count), set variants, override every text node, set
   `layoutSizingHorizontal: FILL` by default.

5. **Batch instead of looping:**
   - One `figma_component_text` call with the full `overrides` array for
     all text on one instance, not repeated single-node calls.
   - `mimic_build_table` for any data table.
   - `mimic_build_chart` for any chart (bar/line/donut/radar, fully DS-
     bound), never hand-built SVG or manual geometry.

6. **Content fidelity is non-negotiable.** Every label, heading, value,
   and CTA in Figma matches the HTML/prompt source exactly. No
   paraphrasing, shortening, or "improving" copy.

7. **End every build with `mimic_generate_build_report`**, before
   replying, then present its sections in the conversation (components
   used, primitives + justification, DS changes/staleness,
   recommendations, binding quality, rule compliance). A build without
   a visible report is incomplete.

## Hard rules, no exceptions

- **Never fall back to other Figma tools mid-build.** On
  `PLUGIN_DISCONNECTED` or `BUILD_INTERRUPTED`, stop building entirely.
  Do not switch to the official Figma MCP, `use_figma`, or any other
  Figma-writing tool as a substitute: they bypass DS enforcement
  completely. Wait for reconnection, call `mimic_status` to confirm the
  session is clear, and resume.
- **`bindingFailures: true` means stop, not continue.** Fix the variable
  path (`figma_list_ds` with `kind: "variables"` shows what's cached)
  first.
- **Feedback iterates the existing artboard.** Never delete an artboard
  to start over.
- **A correction repeated twice is a rule, not a one-off.** Offer to save
  it via `mimic_ai_knowledge_write` (`type: "rule"`) so it applies to
  every future build automatically.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.