Claude-skill-registry docusaurus-conventions
Docusaurus file naming, syntax, and structure conventions for RoboLearn platform
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/docusaurus-conventions" ~/.claude/skills/majiayu000-claude-skill-registry-docusaurus-conventions && rm -rf "$T"
skills/data/docusaurus-conventions/SKILL.mdDocusaurus Conventions Skill
Persona
Think like a Docusaurus expert who ensures all content builds successfully on the first attempt. You understand the quirks of MDX parsing, file naming conventions, and how Docusaurus resolves document IDs.
Pre-Flight Questions
Before creating or modifying any Docusaurus content, ask yourself:
1. File Naming
-
Q: What file extension should I use?
- A: Always
(NOT.md
).mdx - Why: The project doesn't use MDX components;
causes unnecessary complexity.mdx
- A: Always
-
Q: What should chapter/module index files be named?
- A: Always
(NOTREADME.md
)index.md - Why: Docusaurus resolves
as the index;README.md
can cause duplicate ID errorsindex.md
- A: Always
-
Q: What naming pattern for lesson files?
- A:
(e.g.,NN-descriptive-name.md
)01-digital-to-physical.md - Why: Numeric prefix ensures correct ordering; descriptive name aids navigation
- A:
2. MDX Syntax Safety
-
Q: Does my content contain
characters outside of code blocks?<- A: Replace with spelled-out alternatives
- Examples:
→<2 secondsless than 2 seconds
→<10 hoursunder 10 hours
→[<10 hrs[under 10 hrs
- Why: MDX parser interprets
as JSX tag start, causing build errors<
-
Q: Am I using comparison operators in prose?
- A: Use words instead of symbols
- Examples:
→latency < 100ms
or use inline code:latency under 100mslatency < 100ms
in code block is fine (code blocks are not parsed as MDX)if (x < 5)
3. Diagrams
- Q: Am I using Mermaid diagrams?
-
A: NO - Mermaid plugin is not configured
-
Alternatives:
- ASCII text diagrams for simple flows
- Image files for complex diagrams
- Code blocks showing structure
-
Example replacement:
# Instead of mermaid: ```mermaid graph TD A --> BUse ASCII:
A → B → C └── D
-
4. Internal Links
- Q: How should I link to other lessons?
- A: Use relative paths with
extension.md - Examples:
- Same chapter:
[Next](./02-next-lesson.md) - Different chapter:
[Overview](../chapter-2-topic/README.md) - Module root:
[Module](../README.md)
- Same chapter:
- Never use:
extension or.mdxindex.md
- A: Use relative paths with
Principles
Principle 1: Build-First Validation
Before committing any content, verify it builds.
npm run build 2>&1 | tail -30
Expected:
[SUCCESS] Generated static files in "build"
If errors:
- Check for duplicate doc IDs (two files with same
frontmatter)id - Check for MDX syntax errors (unexpected character errors)
- Check for broken links (file not found warnings)
Principle 2: Consistent File Structure
Module structure:
docs/module-N-name/ ├── README.md # Module overview (NOT index.md) ├── chapter-1-topic/ │ ├── README.md # Chapter overview │ ├── 01-first-lesson.md │ ├── 02-second-lesson.md │ └── ... ├── chapter-2-topic/ │ └── ... └── ...
Principle 3: Frontmatter ID Uniqueness
Every lesson must have unique
:id
--- id: lesson-1-1-digital-to-physical # Unique across entire docs folder title: "Lesson 1.1: From ChatGPT to Walking Robots" ---
ID pattern:
lesson-{chapter}-{lesson}-{slug}
lesson-1-1-digital-to-physicallesson-3-2-turtlesim-action
(for standalone topics)custom-messages
Principle 4: Safe Text Patterns
Avoid these patterns in prose (outside code blocks):
| Pattern | Problem | Solution |
|---|---|---|
| JSX parsing | , |
| JSX parsing | , |
| JSX interpolation | Use code: |
| JSX component | Use code or escape |
Safe in code blocks:
if x < 5: # This is fine - inside code block pass
Checklist (Use Before Every Lesson Creation)
- File extension is
(not.md
).mdx - Index files named
(notREADME.md
)index.md - Unique
in frontmatterid - No
or<
in prose outside code blocks> - No Mermaid diagrams (use ASCII or images)
- Internal links use
extension.md - Internal links use
notREADME.mdindex.md - Build passes:
npm run build
Recovery Patterns
Fix: Duplicate Doc ID Error
Error: The docs plugin found docs sharing the same id
Solution:
- Delete one of the duplicate files
- Or change the
in frontmatter to be uniqueid
Fix: MDX Syntax Error
Unexpected character 'N' (U+004E) before name
Solution:
- Find the
character in prose< - Replace with word equivalent (
,less than
)under - Or wrap in inline code
Fix: Mermaid Not Rendering
Solution:
- Replace mermaid block with ASCII text diagram
- Or create image and reference it
Version History
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2025-11-29 | Initial skill from Module 1 lessons learned |