Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "material-ui",
"interface": {
"displayName": "Material UI"
},
"plugins": [
{
"name": "material-ui",
"source": {
"source": "local",
"path": "./skills"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Developer Tools"
}
]
}
36 changes: 36 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "material-ui",
"owner": {
"name": "MUI",
"url": "https://mui.com"
},
"description": "Material UI agent skills",
"plugins": [
{
"name": "material-ui",
"displayName": "Material UI",
"description": "Material UI agent skills for styling (sx, styled, theme overrides, global CSS), theming and design tokens (createTheme, colorSchemes, CSS variables), Next.js App/Pages Router integration, and Tailwind CSS v4/v3 interoperability. Use when building or customizing @mui/material UI.",
"source": "./skills",
"author": {
"name": "MUI",
"url": "https://mui.com"
},
"homepage": "https://mui.com/material-ui/",
"repository": "https://github.com/mui/material-ui",
"license": "MIT",
"keywords": [
"material-ui",
"mui",
"react",
"material-design",
"design-system",
"styling",
"theming",
"nextjs",
"tailwind",
"coding-agents"
],
"category": "development"
}
]
}
27 changes: 27 additions & 0 deletions docs/data/material/getting-started/coding-agents/coding-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Coding agents

<p class="description">Install Material UI agent skills in your coding agent.</p>

Material UI ships agent skills for common integration topics—`material-ui-nextjs`, `material-ui-styling`, `material-ui-tailwind`, and `material-ui-theming`—in the repository's `skills/` folder.

## Installation

Install the skills with your coding agent:

<codeblock storageKey="coding-agent">

```bash Claude
claude plugin marketplace add mui/material-ui
claude plugin install material-ui@material-ui
```

```bash Codex
codex plugin marketplace add mui/material-ui
codex plugin add material-ui@material-ui
```

```bash Other
npx skills add mui/material-ui
```

</codeblock>
5 changes: 5 additions & 0 deletions docs/data/material/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ const pages: MuiPage[] = [
children: [
{ pathname: '/material-ui/getting-started', title: 'Overview' },
{ pathname: '/material-ui/getting-started/installation' },
{
pathname: '/material-ui/getting-started/coding-agents',
newFeature: true,
title: 'Coding agents',
},
{ pathname: '/material-ui/getting-started/usage' },
{ pathname: '/material-ui/getting-started/mcp', newFeature: true, title: 'MCP' },
{ pathname: '/material-ui/llms.txt', newFeature: true, title: 'llms.txt' },
Expand Down
6 changes: 6 additions & 0 deletions docs/pages/material-ui/getting-started/coding-agents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { MarkdownDocs } from '@mui/internal-core-docs/MarkdownDocs';
import * as pageProps from 'docs/data/material/getting-started/coding-agents/coding-agents.md?muiMarkdown';

export default function Page() {
return <MarkdownDocs {...pageProps} />;
}
1 change: 1 addition & 0 deletions docs/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"/material-ui/getting-started-group": "Getting started",
"/material-ui/getting-started": "Overview",
"/material-ui/getting-started/installation": "Installation",
"/material-ui/getting-started/coding-agents": "Coding agents",
"/material-ui/getting-started/usage": "Usage",
"/material-ui/getting-started/mcp": "MCP",
"/material-ui/llms.txt": "llms.txt",
Expand Down
66 changes: 59 additions & 7 deletions packages-internal/markdown/parseMarkdown.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,58 @@ function getDescription(markdown) {
return matches[1].trim().replace(/`/g, '');
}

/**
* Parse the tab title from a `<codeblock>` fence header.
* Accepts a single unquoted word (`npm`) or a quoted multi-word title (`"Claude Code"`).
* @param {string} language
* @param {string} meta - Remainder of the fence line after the language.
* @returns {string}
*/
function parseCodeblockTabTitle(language, meta) {
const trimmed = meta.trim();
const fencePreview = `\`\`\`${language}${meta}`;

if (!trimmed) {
throw new Error(
[
'docs-infra: Missing codeblock tab title.',
`The fence ${fencePreview} is missing a tab title.`,
'Add a single-word title (e.g. ```bash npm) or a quoted multi-word title (e.g. ```bash "Claude Code").',
'',
].join('\n'),
);
}

const quotedMatch = trimmed.match(/^(["'])([\s\S]*?)\1$/);
if (quotedMatch) {
const title = quotedMatch[2];
if (title.length === 0) {
throw new Error(
[
'docs-infra: Empty codeblock tab title.',
`The fence ${fencePreview} has an empty quoted tab title.`,
'Provide a non-empty title (e.g. ```bash "Claude Code").',
'',
].join('\n'),
);
}
return title;
}

if (/^\S+$/.test(trimmed)) {
return trimmed;
}

throw new Error(
[
'docs-infra: Invalid codeblock tab title.',
`The fence ${fencePreview} has a tab title that could not be parsed.`,
'Use a single word (e.g. ```bash Claude) or quote multi-word titles (e.g. ```bash "Claude Code").',
'',
].join('\n'),
);
}

function getCodeblock(content) {
if (!content.startsWith('<codeblock')) {
return undefined;
Expand All @@ -214,13 +266,13 @@ function getCodeblock(content) {
const storageKey = content.match(
/^<codeblock (?!<codeblock )[^>]*storageKey=["|'](?!storageKey=["|'])(\S*)["|'].*>/m,
)?.[1];
const blocks = [...content.matchAll(/^```(\S*) (\S*)\n(.*?)\n```/gmsu)].map(
([, language, tab, code]) => ({ language, tab, code }),
);

const blocksData = blocks.filter(
(block) => block.tab !== undefined && !emptyRegExp.test(block.code),
);
const blocksData = [...content.matchAll(/^```(\S*)([^\n]*)\n(.*?)\n```/gmsu)]
.map(([, language, meta, code]) => ({
language,
tab: parseCodeblockTabTitle(language, meta),
code,
}))
.filter((block) => !emptyRegExp.test(block.code));

return {
type: 'codeblock',
Expand Down
91 changes: 91 additions & 0 deletions packages-internal/markdown/parseMarkdown.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,97 @@ title: "Our docs just got a major upgrade—here's what that means for you"
],
});
});

it('should accept quoted multi-word tab titles', () => {
const codeblock = getCodeblock(
[
'<codeblock storageKey="coding-agent">',
'',
'```bash "Claude Code"',
'claude plugin marketplace add mui/material-ui',
'```',
'',
"```bash 'OpenAI Codex'",
'codex plugin add material-ui@material-ui',
'```',
'',
'</codeblock>',
].join('\n'),
);
expect(codeblock).to.deep.equal({
type: 'codeblock',
storageKey: 'coding-agent',
data: [
{
language: 'bash',
tab: 'Claude Code',
code: 'claude plugin marketplace add mui/material-ui',
},
{
language: 'bash',
tab: 'OpenAI Codex',
code: 'codex plugin add material-ui@material-ui',
},
],
});
});

it('should throw on unquoted multi-word tab titles', () => {
expect(() => {
getCodeblock(
[
'<codeblock storageKey="coding-agent">',
'',
'```bash Claude Code',
'claude plugin marketplace add mui/material-ui',
'```',
'',
'</codeblock>',
].join('\n'),
);
}).to.throw(`docs-infra: Invalid codeblock tab title.
The fence \`\`\`bash Claude Code has a tab title that could not be parsed.
Use a single word (e.g. \`\`\`bash Claude) or quote multi-word titles (e.g. \`\`\`bash "Claude Code").
`);
});

it('should throw when the tab title is missing', () => {
expect(() => {
getCodeblock(
[
'<codeblock storageKey="package-manager">',
'',
'```bash',
'npm install @mui/material',
'```',
'',
'</codeblock>',
].join('\n'),
);
}).to.throw(`docs-infra: Missing codeblock tab title.
The fence \`\`\`bash is missing a tab title.
Add a single-word title (e.g. \`\`\`bash npm) or a quoted multi-word title (e.g. \`\`\`bash "Claude Code").
`);
});

it('should throw on empty quoted tab titles', () => {
expect(() => {
getCodeblock(
[
'<codeblock storageKey="package-manager">',
'',
'```bash ""',
'npm install @mui/material',
'```',
'',
'</codeblock>',
].join('\n'),
);
}).to.throw(`docs-infra: Empty codeblock tab title.
The fence \`\`\`bash "" has an empty quoted tab title.
Provide a non-empty title (e.g. \`\`\`bash "Claude Code").
`);
});
});

describe('renderMarkdown', () => {
Expand Down
17 changes: 17 additions & 0 deletions skills/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "material-ui",
"description": "Material UI agent skills for styling, theming, Next.js, and Tailwind CSS integration.",
"author": {
"name": "MUI",
"url": "https://mui.com"
},
"homepage": "https://mui.com/material-ui/",
"repository": "https://github.com/mui/material-ui",
"license": "MIT",
"skills": [
"./material-ui-nextjs",
"./material-ui-styling",
"./material-ui-tailwind",
"./material-ui-theming"
]
}
50 changes: 50 additions & 0 deletions skills/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "material-ui",
"description": "Material UI agent skills for styling, theming, Next.js, and Tailwind CSS integration.",
"author": {
"name": "MUI",
"url": "https://mui.com"
},
"homepage": "https://mui.com/material-ui/",
"repository": "https://github.com/mui/material-ui",
"license": "MIT",
"keywords": [
"material-ui",
"mui",
"react",
"material-design",
"design-system",
"styling",
"theming",
"nextjs",
"tailwind"
],
"skills": [
"./material-ui-nextjs",
"./material-ui-styling",
"./material-ui-tailwind",
"./material-ui-theming"
],
"interface": {
"displayName": "Material UI",
"shortDescription": "Build UI with Material UI styling, theming, Next.js, and Tailwind",
"longDescription": "Material UI is a React component library that implements Material Design. This plugin packages the repository's agent skills so coding agents can follow official guidance when working with @mui/material.\n\nUse it when choosing among sx, styled(), theme overrides, and global CSS; building or extending themes with createTheme, colorSchemes, and CSS variables; wiring Material UI into Next.js App or Pages Router with @mui/material-nextjs; or combining Material UI with Tailwind CSS v4 layers (and v3 interoperability).\n\nThe skills point agents at the documented decision order and APIs — not at reading package source. Each skill's SKILL.md is the entry point; AGENTS.md is the full guide.",
"developerName": "MUI",
"category": "Developer Tools",
"capabilities": [
"Styling guidance (sx, styled, theme overrides)",
"Theming and design tokens",
"Next.js integration",
"Tailwind CSS interoperability"
],
"websiteURL": "https://mui.com/material-ui/",
"defaultPrompt": [
"Style a Material UI Card with the right sx vs styled approach",
"Add light and dark color schemes to my Material UI theme",
"Set up Material UI with Next.js App Router and Emotion cache"
],
"brandColor": "#007FFF",
"composerIcon": "./assets/logo.svg",
"logo": "./assets/logo.svg"
}
}
1 change: 1 addition & 0 deletions skills/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading