docusaurus
Deep integration with Docusaurus for documentation site development. Configure projects, manage sidebars, versioning, i18n, develop plugins, and optimize builds for React-based documentation.
What this skill does
# Docusaurus Skill
Deep integration with Docusaurus for documentation site development.
## Capabilities
- Generate Docusaurus project configuration
- Create and manage sidebar structures (sidebars.js)
- Configure versioning and i18n
- Develop custom Docusaurus plugins
- MDX component creation and integration
- Build optimization and debugging
- Algolia DocSearch configuration
- Theme customization
## Usage
Invoke this skill when you need to:
- Set up a new Docusaurus documentation site
- Configure sidebars and navigation
- Implement versioned documentation
- Add internationalization (i18n)
- Create custom plugins or themes
## Inputs
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| action | string | Yes | init, configure, sidebar, version, i18n, plugin |
| projectPath | string | Yes | Path to Docusaurus project |
| config | object | No | Configuration options |
| version | string | No | Version tag for versioning |
| locale | string | No | Locale code for i18n |
### Input Example
```json
{
"action": "configure",
"projectPath": "./docs-site",
"config": {
"title": "My Documentation",
"tagline": "Developer documentation for My Product",
"url": "https://docs.example.com",
"organizationName": "my-org",
"projectName": "my-project"
}
}
```
## Project Configuration
### docusaurus.config.js
```javascript
// @ts-check
const { themes } = require('prism-react-renderer');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'My Documentation',
tagline: 'Developer documentation for My Product',
favicon: 'img/favicon.ico',
url: 'https://docs.example.com',
baseUrl: '/',
organizationName: 'my-org',
projectName: 'my-project',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'en',
locales: ['en', 'es', 'ja'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: './sidebars.js',
editUrl: 'https://github.com/my-org/my-project/edit/main/',
showLastUpdateTime: true,
showLastUpdateAuthor: true,
versions: {
current: {
label: 'Next',
path: 'next',
},
},
},
blog: {
showReadingTime: true,
editUrl: 'https://github.com/my-org/my-project/edit/main/',
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/social-card.jpg',
navbar: {
title: 'My Project',
logo: {
alt: 'My Project Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
},
{
type: 'docsVersionDropdown',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/my-org/my-project',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{ label: 'Getting Started', to: '/docs/intro' },
{ label: 'API Reference', to: '/docs/api' },
],
},
{
title: 'Community',
items: [
{ label: 'Discord', href: 'https://discord.gg/example' },
{ label: 'Twitter', href: 'https://twitter.com/example' },
],
},
],
copyright: `Copyright ${new Date().getFullYear()} My Project.`,
},
prism: {
theme: themes.github,
darkTheme: themes.dracula,
additionalLanguages: ['bash', 'json', 'yaml'],
},
algolia: {
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_SEARCH_API_KEY',
indexName: 'my-project',
contextualSearch: true,
},
}),
};
module.exports = config;
```
## Sidebar Configuration
### sidebars.js
```javascript
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
tutorialSidebar: [
'intro',
{
type: 'category',
label: 'Getting Started',
collapsed: false,
items: [
'getting-started/installation',
'getting-started/quick-start',
'getting-started/configuration',
],
},
{
type: 'category',
label: 'Guides',
items: [
'guides/authentication',
'guides/api-usage',
{
type: 'category',
label: 'Advanced',
items: [
'guides/advanced/caching',
'guides/advanced/performance',
],
},
],
},
{
type: 'category',
label: 'API Reference',
link: {
type: 'generated-index',
title: 'API Reference',
description: 'Complete API documentation',
},
items: [
'api/client',
'api/authentication',
'api/resources',
],
},
{
type: 'link',
label: 'GitHub',
href: 'https://github.com/my-org/my-project',
},
],
};
module.exports = sidebars;
```
## Custom Components
### Tabs Component
```jsx
// src/components/CodeTabs.jsx
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
export function CodeTabs({ children, labels = ['JavaScript', 'Python', 'cURL'] }) {
return (
<Tabs groupId="code-examples">
{labels.map((label, index) => (
<TabItem key={label} value={label.toLowerCase()} label={label}>
<CodeBlock language={label.toLowerCase()}>
{children[index]}
</CodeBlock>
</TabItem>
))}
</Tabs>
);
}
```
### API Endpoint Component
```jsx
// src/components/ApiEndpoint.jsx
import React from 'react';
import styles from './ApiEndpoint.module.css';
export function ApiEndpoint({ method, path, description }) {
const methodColors = {
GET: '#61affe',
POST: '#49cc90',
PUT: '#fca130',
DELETE: '#f93e3e',
PATCH: '#50e3c2',
};
return (
<div className={styles.endpoint}>
<span
className={styles.method}
style={{ backgroundColor: methodColors[method] }}
>
{method}
</span>
<code className={styles.path}>{path}</code>
<p className={styles.description}>{description}</p>
</div>
);
}
```
## Versioning
### Creating a Version
```bash
# Create version snapshot
npm run docusaurus docs:version 1.0.0
# Project structure after versioning
docs/
├── intro.md # Current (next) version
├── getting-started/
versioned_docs/
├── version-1.0.0/
│ ├── intro.md
│ └── getting-started/
versioned_sidebars/
├── version-1.0.0-sidebars.json
versions.json
```
### versions.json
```json
[
"2.0.0",
"1.1.0",
"1.0.0"
]
```
## Internationalization (i18n)
### Translation Structure
```
i18n/
├── en/
│ └── docusaurus-plugin-content-docs/
│ └── current/
│ └── intro.md
├── es/
│ └── docusaurus-plugin-content-docs/
│ └── current/
│ └── intro.md
└── ja/
└── docusaurus-plugin-content-docs/
└── current/
└── intro.md
```
### Write Translations Command
```bash
# Generate translation files
npm run write-translations -- --locale es
# Start dev server for locale
npm run start -- --locale es
```
## Custom Plugin
### Plugin Template
```javascript
// plugins/my-plugin/index.js
module.exports = function myPlugin(context, options) {
return {
name: 'my-plugin',
async loadContent() {
// Load custom content
return { /* content Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.