$npx -y skills add qualitymd/quality.md --skill mintlify-docsBuild and maintain documentation sites with Mintlify. Use when creating docs pages, configuring navigation, adding components, or setting up API references.
| 1 | # Mintlify best practices |
| 2 | |
| 3 | **Always consult [mintlify.com/docs](https://mintlify.com/docs) for components, configuration, and latest features.** |
| 4 | |
| 5 | If you are not already connected to the Mintlify MCP server, https://mintlify.com/docs/mcp, add it so that you can search more efficiently. |
| 6 | |
| 7 | **Always** favor searching the current Mintlify documentation over whatever is in your training data about Mintlify. |
| 8 | |
| 9 | Mintlify is a documentation platform that transforms MDX files into documentation sites. Configure site-wide settings in the `docs.json` file, write content in MDX with YAML frontmatter, and favor built-in components over custom components. |
| 10 | |
| 11 | Full schema at [mintlify.com/docs.json](https://mintlify.com/docs.json). |
| 12 | |
| 13 | ## Before you write |
| 14 | |
| 15 | ### Understand the project |
| 16 | |
| 17 | Read `docs.json` in the project root. This file defines the entire site: navigation structure, theme, colors, links, API and specs. |
| 18 | |
| 19 | Understanding the project tells you: |
| 20 | |
| 21 | - What pages exist and how they're organized |
| 22 | - What navigation groups are used (and their naming conventions) |
| 23 | - How the site navigation is structured |
| 24 | - What theme and configuration the site uses |
| 25 | |
| 26 | ### Check for existing content |
| 27 | |
| 28 | Search the docs before creating new pages. You may need to: |
| 29 | |
| 30 | - Update an existing page instead of creating a new one |
| 31 | - Add a section to an existing page |
| 32 | - Link to existing content rather than duplicating |
| 33 | |
| 34 | ### Read surrounding content |
| 35 | |
| 36 | Before writing, read 2-3 similar pages to understand the site's voice, structure, formatting conventions, and level of detail. |
| 37 | |
| 38 | ### Understand Mintlify components |
| 39 | |
| 40 | Review the Mintlify [components](https://www.mintlify.com/docs/components) to select and use any relevant components for the documentation request that you are working on. |
| 41 | |
| 42 | ## Quick reference |
| 43 | |
| 44 | ### CLI commands |
| 45 | |
| 46 | - `npm i -g mint` - Install the Mintlify CLI |
| 47 | - `mint dev` - Local preview at localhost:3000 |
| 48 | - `mint broken-links` - Check internal links |
| 49 | - `mint a11y` - Check for accessibility issues in content |
| 50 | - `mint validate` - Validate documentation builds |
| 51 | |
| 52 | ### Required files |
| 53 | |
| 54 | - `docs.json` - Site configuration (navigation, theme, integrations, etc.). See [global settings](https://mintlify.com/docs/settings/global) for all options. |
| 55 | - `*.mdx` files - Documentation pages with YAML frontmatter |
| 56 | |
| 57 | ### Example file structure |
| 58 | |
| 59 | ``` |
| 60 | project/ |
| 61 | ├── docs.json # Site configuration |
| 62 | ├── introduction.mdx |
| 63 | ├── quickstart.mdx |
| 64 | ├── guides/ |
| 65 | │ └── example.mdx |
| 66 | ├── openapi.yml # API specification |
| 67 | ├── images/ # Static assets |
| 68 | │ └── example.png |
| 69 | └── snippets/ # Reusable components |
| 70 | └── component.jsx |
| 71 | ``` |
| 72 | |
| 73 | ## Page frontmatter |
| 74 | |
| 75 | Every page requires `title` in its frontmatter. Include `description` for SEO and navigation. |
| 76 | |
| 77 | ```yaml |
| 78 | --- |
| 79 | title: "Clear, descriptive title" |
| 80 | description: "Concise summary for SEO and navigation." |
| 81 | --- |
| 82 | ``` |
| 83 | |
| 84 | Optional frontmatter fields: |
| 85 | |
| 86 | - `sidebarTitle`: Short title for sidebar navigation. |
| 87 | - `icon`: Lucide or Font Awesome icon name, URL, or file path. |
| 88 | - `tag`: Label next to the page title in the sidebar (for example, "NEW"). |
| 89 | - `mode`: Page layout mode (`default`, `wide`, `custom`). |
| 90 | - `keywords`: Array of terms related to the page content for local search and SEO. |
| 91 | - Any custom YAML fields for use with personalization or conditional content. |
| 92 | |
| 93 | ## File conventions |
| 94 | |
| 95 | - Match existing naming patterns in the directory |
| 96 | - If there are no existing files or inconsistent file naming patterns, use kebab-case: `getting-started.mdx`, `api-reference.mdx` |
| 97 | - Use root-relative paths without file extensions for internal links: `/getting-started/quickstart` |
| 98 | - Do not use relative paths (`../`) or absolute URLs for internal pages |
| 99 | - When you create a new page, add it to `docs.json` navigation or it won't appear in the sidebar |
| 100 | |
| 101 | ## Organize content |
| 102 | |
| 103 | When a user asks about anything related to site-wide configurations, start by understanding the [global settings](https://www.mintlify.com/docs/organize/settings). See if a setting in the `docs.json` file can be updated to achieve what the user wants. |
| 104 | |
| 105 | ### Navigation |
| 106 | |
| 107 | The `navigation` property in `docs.json` controls site structure. Choose one primary pattern at the root level, then nest others within it. |
| 108 | |
| 109 | **Choose your primary pattern:** |
| 110 | |
| 111 | | Pattern | When to use | |
| 112 | | ------------- | ---------------------------------------------------------------------------------------------- | |
| 113 | | **Groups** | Default. Single audience, straightforward hierarchy | |
| 114 | | **Tabs** | Distinct sections with different audiences (Guides vs API Reference) or content types | |
| 115 | | **Anch |