Carbon Design System

Prompts

Last updated Sep 28, 2026

A prompt is how you tell an AI what to build, in plain language. Clear, specific prompts get better results in fewer tries and use fewer tokens.

Prompts

About prompts

A prompt is how you communicate with an AI in plain language. Each message you send and the AI's response is a turn. The size of each turn is measured in tokens, the small units of text an AI reads and generates.

When an AI is connected to Carbon MCP, writing clear and specific prompts reduces the number of turns and tokens needed, and improves the quality of the code the AI generates. This practice is called prompt engineering.

Best practices

The following practices help you get consistent, accurate Carbon output from your AI.

Use the carbon-builder skill

Install the carbon-builder skill and tell your AI to use it. The skill carries Carbon's conventions for tools, tokens, components, accessibility, and imports. Without it, your AI guesses at Carbon from training data, which is often out of date.

Clearly describe what you want

Give your AI enough detail to work from without ambiguity. A well-formed prompt includes:

  • UI goal and purpose.
  • Framework: Carbon React v11 or Carbon Web Components v11.
  • Libraries needed: Core, IBM Products, icons, pictograms.
  • Full component list: Grid, Header, Button, Tile, Form, and so on.
  • Layout: columns, spacing, alignment, breakpoints.
  • Sample data.
  • Exact file list to output.

The more detail you provide, the better the output. For example, "Build a dashboard" is too vague for an AI to act on. Specify the components, layout, data, and files you want.

Ask questions and propose a plan

Ask your AI to raise any clarifying questions and propose a plan before it writes code. This surfaces misunderstandings early and avoids a full rewrite later.

Do not accept invented components or props

If your AI is not sure something exists in Carbon, it should confirm through Carbon MCP rather than guess. Challenge any component or prop that does not look familiar and ask the AI to verify it against the Carbon documentation.

Do not ask for files you do not need

Without a clear file list, the AI generates tests, READMEs, and config files you did not ask for. List the exact files you want to keep the output focused.

Sample prompts

The following prompts are starting points. Adapt them to your task, change the component names, framework, file list, or any other detail to match what you are building. Do not use them verbatim unless your task matches exactly.

Build a UI

Mandatory: Use the carbon-builder skill and Carbon MCP to help complete the following task:
Build a small, runnable Carbon React v11 page with a UI Shell header, a three-tile grid, and a contact form.
Ask me any clarifying questions before you begin.
Be token-efficient: don't restate tool results, and output only package.json,
index.html, src/main.jsx, src/App.jsx, and src/styles.scss.

Apply usage and accessibility guidance

Mandatory: Use the carbon-builder skill and Carbon MCP to help complete the following task:
Check my [component or screen] against Carbon's usage and accessibility guidance.
Ask me any clarifying questions before you begin.
Be token-efficient: don't restate tool results. Give me a short, prioritized list of changes rather than a full rewrite.

Build a chart

Mandatory: Use the carbon-builder skill and Carbon MCP to help complete the following task:
Build a runnable Carbon Charts [bar] chart in [React] using my sample data.
Ask me any clarifying questions before you begin.
Be token-efficient: don't restate tool results, and output only the files needed to run it.

Use a Carbon Labs component

Mandatory: Use the carbon-builder skill and Carbon MCP to help complete the following task:
Add the Carbon Labs [Resizer] component to my Carbon React app.
Ask me any clarifying questions before you begin.
Be token-efficient: don't restate tool results, and output only the files you
change. Note that Carbon Labs components are experimental.

Audit existing code

Mandatory: Use the carbon-builder skill and Carbon MCP to help complete the following task:
Audit the project code against Carbon guidelines for tokens, components,
accessibility, and layout.
Ask me any clarifying questions before you begin.
Be token-efficient: don't restate tool results. Return issues grouped by severity with the fix for each, not a full rewrite.