Agent skill
docusaurus-plugins
Use when creating Docusaurus plugins (remark, rehype, theme, content, lifecycle) to extend markdown, modify HTML, or add custom functionality
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/docusaurus-plugins
SKILL.md
Docusaurus Plugin Guide
Quick Start
// Remark plugin - transforms markdown AST
module.exports = function remarkPlugin(options = {}) {
return async function transformer(ast, vfile) {
const { visit } = require('unist-util-visit');
visit(ast, 'link', (node) => {
// Transform nodes
node.data = node.data || {};
node.data.hProperties = { className: 'custom' };
});
return ast;
};
};
// In docusaurus.config.js:
// remarkPlugins: [require('./plugins/my-plugin')]
Core Principles
- 5 Plugin Types: Remark (markdown), Rehype (HTML), Lifecycle (routes/webpack), Theme (components), Content (custom data)
- Remark: Transforms markdown before HTML conversion, use
unist-util-visitfor AST traversal - Rehype: Transforms HTML after compilation, processes HAST (HTML AST)
- Lifecycle: Most flexible, implements hooks like
loadContent(),contentLoaded(),postBuild() - Export function: Returns transformer (remark/rehype) or plugin object (lifecycle)
Reference Files
Detailed guides for each plugin type:
- references/remark-plugins.md - Markdown transformation
- references/rehype-plugins.md - HTML processing
- references/lifecycle-plugins.md - Routes, webpack, global data
- references/theme-plugins.md - Themes and swizzling
- references/content-plugins.md - Custom content types
- references/package-structure.md - Publishing and config
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?