Skip to main content

Build Style Guides for AI Workflows

Ditto's AI content system connects your style guide to everything your team writes — flagging violations as they happen, generating first drafts in design context, and helping AI coding agents use your approved copy.


Step 1: Build your style guide

Your style guide is the foundation of the AI system. It holds the rules and context Ditto’s AI content systems draws from.

💡 Already have a style guide? Use Ditto’s MCP tools to create and upload your style guide into Ditto!

Generate a style guide from your codebase

If you don't have a style guide yet, run Ditto's CLI Scan on your codebase to generate one inferred from your existing production copy. This is a good way to get a working style guide in place without creating it entirely from scratch.

Generate a style guide with Scan:

  1. Run Ditto's CLI Scan on your codebase

  2. Check the banner linking to your generated style guide, or open the Style guide tab to find it directly

  3. Review the inferred rules and edit or remove any that don't fit

Build a style guide from scratch

Create a style guide:

  1. Click + New style guide

  2. Name your style guide and click Create

💡 You can set commonly used style guides to be enabled by default so it’s rules are applied in all projects

Create a rule:

  1. Click + Add rule in your style guide

  2. Add a name, section, and description

  3. [Optional] Add target tags so the AI knows which text items to apply this rule to. If no tags are included, the rule will be applied to all text items in your project

  4. Provide at least one example, then click Add rule


Step 2: Enforce content rules with Magic Edit

Once your style guide is enabled in a project, Magic Edit checks your copy against the rules automatically and surfaces suggested fixes inline.

Respond to a suggested edit:

  1. Select a text item and click suggested edits

  2. See the rule that contribute to the suggestion and preview the edit

  3. Accept or reject the suggestion. Accepting the suggestion will apply the edit to the text item and create the text item in your project

Ditto also proactively scans all text items in your project and surfaces every style guide suggestion in one place — so you can work through them in bulk without selecting items one by one.

Review style guide suggestions:

  1. Navigate to Projects → Suggestions → Style Guide and see all style guide suggestions

  2. Step through each suggestion using the carousel. Each card shows the suggested edit and the rules behind it

  3. Choose to Accept, Reject, or Skip for now

    • Accept applies the edit to the text item

    • Reject dismisses the suggestion

    • Skip for now moves to the next suggestion without taking action — you can come back to it later


Step 3: Draft copy with Magic Draft

Magic Draft generates copy directly in your Figma designs, using your style guide rules, the surrounding text, and your broader Ditto workspace as context.

Generate copy using Magic Draft:

  1. Select one or more text layers, and click Magic Draft

  2. Enter a prompt into the chat window the click enter. The more specific your prompt is, the better the result will be

  3. Accept (✓) or reject (✕) the suggestion. The generated copy is displaced directly in your design so you can preview the results

💡 Magic Draft is limited to 20 text layers at a time. Select a subset of the text layers if you’re hitting the limit

Refine copy using Magic Draft:

  • Reject all: start the drafting process from scratch with the original copy

  • Refine: building off of the generated draft with a new prompt

  • Try again: returns to the last prompt and previous suggestions to have another go


Step 4: Connect Ditto to AI agents

Pull approved copy and style guidelines into AI agents like Claude Code and Cursor with Ditto's MCP so agents always have the latest context on your content system and product text. Set up in minutes, and let your agents audit, generate, and translate on-brand UI text before it hits your codebase.

Generate UI with compliant text

Add this to your agent instructions to apply style guide rules whenever the agent creates new UI:

Use the style guides in Ditto to generate UI with compliant text.

The agent will call get_styleguide_rules before writing any user-facing strings, and apply those rules to the text it generates.

Audit existing strings

You can also use the tool to check and fix text that already exists in your codebase:

Check my existing user-facing strings and update them so they comply with style guide rules in Ditto.

The agent will fetch your rules, scan your code for user-facing strings, and suggest updates where the text doesn’t match your guidelines.

Turn a code review comment into a rule

When you notice a recurring content issue, ask the agent to capture it as a rule so future text follows it automatically:

We keep shipping error messages that blame the user. Add a Ditto style guide rule that error messages should be neutral and solution-oriented, with an example like "You entered an invalid email" → "Enter a valid email address."

The agent calls get_styleguide_rules to find the target style guide and section, calls get_workspace_tags if it wants to tag the rule, then calls create_styleguide_rules.

💡 Find more examples on how to instruct AI agents to use Ditto’s style guidelines to generate compliant copy, reuse approved text, and keep your style guides up-to-date


Step 5: Measure and improve your style guide

Now that your team and AI agents are using your style guides, you can see how well it's working. Style guide analytics show how often your rules shape your copy, whether that happens in Figma, in the web app, or through an AI agent using the MCP. They also show how often your team accept the suggestions those rules produce.

Check how your style guide is performing:

  1. Open the style guide and expand the Analytics tab and choose a time range

  2. Select a rule and expand its Analytics panel to see how that rule is doing

💡 The Agents column shows how often AI agents applied your rules through the MCP. It's an easy way to check that your agent setup from Step 4 is working.

Use analytics to improve your style guide

  • A rule with many attributions but a low acceptance rate may need clearer wording or better examples. See the tips below.

  • A rule with few or no attributions may be too narrow, targeted at the wrong tags, or no longer relevant.

Did this answer your question?