If you ran a scan, your product strings are already in your Ditto component library. The agent matches Figma text layers against them and links the matches, so the layer, the component, and the key in your string files share one developer ID.
Step 1: Connect the Ditto MCP and the Figma MCP
Your agent talks to both Ditto and Figma to accomplish tasks. Ditto is used to search, create, and link text, and Figma is used to read the text layers in your file.- Ditto MCP server: Setup.
- Figma MCP server: Figma’s MCP catalog.
Step 2: Create the Ditto project from your Figma file
A Ditto project is where your team works on the copy for a feature, product area, or Figma file. Creating it from the file connects the two. This step happens in Figma, once, in the Ditto plugin:- In Figma, open the Ditto plugin (Actions › Plugins & widgets › Ditto) and log in.
- Paste your Figma file’s URL into the plugin.
- Select Start a new project, click Continue, and add the frames you want in Ditto.
Step 3: Instruct your agent
Paste this prompt into your agent with your Ditto project URL and your Figma file URL. The agent tells you what it is about to do at each step and waits for your confirmation before it changes anything.Save the prompt as a skill
Store the prompt as a skill so anyone on the team runs it by name instead of pasting it. Create aSKILL.md with this frontmatter and the prompt above as the body, at the path for your agent, and commit it. Leave the two placeholder lines in place; the agent fills them from the URLs you pass when you run it.
- Claude Code
- Cursor
- Codex
Path:
.claude/skills/ditto-figma-link/SKILL.md. Run it with /ditto-figma-link, followed by the project URL and the file URL.What the agent does
At each step of the prompt, and the tools it calls:- Identify the project and file.
list_projectsresolves the project from its URL, and the Figma MCP returns the file’s text nodes. The agent works from each node’s rendered text, not its layer name. - Link Figma text nodes to project text items. For each node,
search_ditto_textwithprojectIdsset to the project andmatchType: "anyWord", then a strict trimmed, case-sensitive comparison of the candidates. A match is linked withlink_figma_nodes_to_text_item, up to 50 node IDs per call (figma.branchIdfor a Figma branch). No match:create_text_items, then link. Identical text on several nodes links to one text item. - Link project text items to library components.
search_ditto_textwithentityTypes: ["libraryComponent"], exact matches only.link_text_items_to_componentattaches each match, and the text item takes on the component’s text, properties, variants, and developer ID. No new components, no fuzzy links. - Report back. Counts of nodes linked to existing items, items created, and items attached to components, plus anything ambiguous (near-duplicate text, empty nodes) for you to decide.
link_figma_nodes_to_text_item returns one result per node:
Step 4: What you have now
- Your Figma text layers are linked to text items. A text item holds the copy and its status, tags, notes, and comments. Linking does not change the Figma file; from now on, edits to the text item in Ditto and edits to the layer in Figma sync to each other, and frame previews in the web app refresh on sync.
- Repeated copy points at one text item. A string that appears on several screens is one text item, so an edit to any instance applies to all of them.
- Reused text is attached to your components. Each matched text item carries the component’s text, properties, variants, and developer ID, so the Figma layer, the component, and the key in your string files resolve to one ID. Edit the component and every instance updates.
Link a single layer
For one layer, give the agent the layer’s link instead of the file’s. In Figma, select the text layer, choose Copy link, and tell the agent which string it should show:list_projects, searches for “Create account” with search_ditto_text, and links the node with link_figma_nodes_to_text_item.
After linking
- Namespaced developer IDs. Project-only text items keep auto-generated IDs such as
welcome-to-dittopay-7. Ask the agent to rename them into a scheme (onboarding.welcome.title) withupdate_text_itemsandnewDeveloperId. Leave component-linked items alone; that ID is the component’s, shared across every project that uses it. - Undo a wrong link.
unlink_text_items_from_componentdetaches a text item (every instance carrying that developer ID, or only those in oneprojectId) and gives it a fresh developer ID. - Keep in sync.
npx -y @dittowords/cli@latest pullbrings design-side edits into code; re-runningscanon the same repository lets Ditto match code-side changes against the earlier scan; theTextItem_Base_Text_Changedwebhook fires when linked text changes. Filterpullby status or the integrated flag so in-progress design copy never reaches production (CLI configuration).