Skip to main content
The Ditto MCP server exposes tools; your agent still needs to know when to use them. Give it standing instructions in a project-level file such as CLAUDE.md (Claude Code), AGENTS.md (Codex and others), or .cursor/rules (Cursor). Everything on this page assumes the server is connected; see Connect the Ditto MCP. If you installed the Ditto plugin, the block below is already loaded at the start of every session. Committing it to the repo as well means agents without the plugin behave the same way.

The block to commit

Paste this into CLAUDE.md or AGENTS.md at the repo root:
For Cursor, put the same text in a rule file with alwaysApply: true.

Prompts by task

Each prompt below works as a one-off message or as a line in your instructions file. The “what happens” notes describe the tool calls a correctly instructed agent makes.

Generate UI with compliant text

What happens: the agent calls get_styleguide_rules once before writing any user-facing string, then applies the rules (for example, sentence case for buttons, no exclamation marks in errors) to the text it writes.

Audit existing strings

What happens: the agent fetches your rules, finds user-facing strings in the code, and proposes edits where text does not match. With the plugin, /ditto-audit src/ does the same and returns a fix-list in the form file:line: rule "current" → "suggested" (why).

Reuse text when generating UI

What happens: when the agent needs a button label, heading, or message, it calls search_ditto_text first and references the existing text (by developer ID) when a match is found.

Replace hardcoded strings with Ditto text

What happens: the agent searches Ditto for each string (it can batch several searches in one search_ditto_text call) and suggests replacements where equivalent text already exists.

Review a diff before committing

What happens: with the plugin, /ditto-review collects the diff, extracts added or changed user-facing strings, fetches rules once, checks each string for rule violations and reuse opportunities, and ends with N strings checked, M findings.

Turn a code review comment into a rule

What happens: the agent calls list_styleguides to find the target style guide and its section IDs, optionally get_workspace_tags to tag the rule, then create_styleguide_rules.

Refine or remove a rule

What happens: the agent calls get_styleguide_rules to find the rule ID, then update_styleguide_rules or delete_styleguide_rules.

Add translations for a locale

What happens: the agent calls list_variants to find the variant’s developer ID and locale code, writes German text with update_text_items (passing the variant developer ID), and checks it against any German-scoped style guide with suggest_edit. See Set up localization. The prompt for this task is on Connect Figma files. It takes your Ditto project URL and Figma file URL and walks the agent through four steps, each confirmed with you before it acts, and the guide shows how to store it as a skill your team runs by name. What happens: the agent reads the file’s text nodes through the Figma MCP, matches each one to a text item in the project with search_ditto_text (exact matches only) and links it with link_figma_nodes_to_text_item, creating text items with create_text_items where none exist. It then attaches exact library matches with link_text_items_to_component and reports the counts.

Spin up a project from a prototype

What happens: the agent calls create_ditto_project, search_ditto_text for each string, create_text_items for the new ones (with developerId and a status from list_statuses), and link_text_items_to_component for strings that already exist as library components.

Consolidate near-duplicates into components

What happens: the agent calls search_ditto_text (several queries in one call), get_styleguide_rules to pick the compliant wording, publish_library_component to turn the winning text item into a component (or create_library_components if none fits), and link_text_items_to_component to attach the others.

Clean up after a style guide change

What happens: the agent calls get_styleguide_rules, search_ditto_text with a status or tag filter to narrow the set, suggest_edit on each candidate, and update_text_items with the accepted edits.

Reorganize the component library

What happens: the agent calls list_component_folders, proposes a tree, waits for your approval, then uses create_component_folders, update_component_folders (to move or rename folders), and update_library_components (to change each component’s folderId).

Combine instructions

For most repos, three lines are enough:

Skills from the plugin

If you installed the Ditto plugin, these slash commands are available in Claude Code and Cursor: The Specs skills need Ditto Specs set up in the repo.