Skip to content
docusaurus-scaffold logo

Docusaurus Scaffold

docusaurus-scaffold

Scaffold and initialize a Docusaurus project with the specific structure for the Physical AI textbook. Agent: BookArchitect

SKILL.md

Full skill instructions

Docusaurus Scaffold

Agent: BookArchitect

Scaffold and initialize a Docusaurus project with the specific structure for the Physical AI textbook. Creates a complete documentation site with chapters, i18n support, and GitHub Pages deployment configuration.

Quick Setup

# Full setup with defaults
.claude/​skills/​docusaurus-scaffold/​scripts/​setup.sh

# Custom configuration
.claude/​skills/​docusaurus-scaffold/​scripts/​setup.sh \
  --title "Physical AI Book" \
  --github-org faiqahm \
  --repo hackathon_I_book \
  --locales "en,ur" \
  --chapters 5

# Initialize and install dependencies
.claude/​skills/​docusaurus-scaffold/​scripts/​setup.sh --install

# Initialize, install, and start dev server
.claude/​skills/​docusaurus-scaffold/​scripts/​setup.sh --install --start

Command Options

OptionDescriptionDefault
--title TITLESite titlePhysical AI Book
--github-org ORGGitHub org/​usernamefaiqahm
--repo NAMERepository namehackathon_I_book
--locales LOCALESComma-separated localesen,ur
--chapters NNumber of chapters3
--installRun npm install after setupoff
--startStart dev server (requires --install)off
-h, --helpShow help message-

What It Creates

1. Project Structure

project/
├── docs/
│   ├── intro.md                 # Introduction/​Welcome page
│   ├── chapter-1/
│   │   ├── _category_.json      # Chapter metadata
│   │   ├── index.md             # Chapter overview
│   │   ├── lesson-1.md          # Lesson content
│   │   └── lesson-2.md
│   ├── chapter-2/
│   │   └── ...
│   └── chapter-3/
│       └── ...
├── i18n/
│   └── ur/
│       ├── docusaurus-theme-classic/
│       │   ├── navbar.json
│       │   └── footer.json
│       └── docusaurus-plugin-content-docs/
│           └── current/
│               ├── intro.md
│               └── chapter-1/
│                   └── ...
├── src/
│   ├── css/
│   │   └── custom.css           # RTL support for Urdu
│   └── pages/
│       └── index.js             # Homepage redirect
├── static/
│   └── img/
│       └── favicon.svg
├── docusaurus.config.js         # Main configuration
├── sidebars.js                  # Sidebar configuration
└── package.json

2. Configuration Files

docusaurus.config.js

  • GitHub Pages deployment settings
  • i18n with RTL support for Urdu
  • Navbar with locale dropdown
  • Dark/​light theme support

sidebars.js

  • Auto-generated sidebar from docs folder
  • Chapter organization with collapsible sections

3. Textbook Structure

Each chapter follows this structure:

# Chapter N: Title

## Learning Objectives
- Objective 1
- Objective 2

## Prerequisites
- Prerequisite 1

## Content
(Main lesson content)

## Exercises
1. Exercise 1
2. Exercise 2

## Summary
Key takeaways from this chapter.

## Next Steps
Link to next chapter or related content.

4. i18n Support

  • English (en): Default locale, LTR
  • Urdu (ur): RTL support with custom CSS
  • Translation files for navbar/​footer
  • Translated chapter content structure

Bundled Resources

1. Docusaurus Configuration

File: docusaurus.config.js

const config = {
  title: 'Physical AI Book',
  tagline: 'Learn Physical AI, ROS 2, and Robotics',
  favicon: 'img/​favicon.svg',

  // GitHub Pages deployment
  url: 'https://faiqahm.github.io',
  baseUrl: '/​hackathon_I_book/',
  organizationName: 'faiqahm',
  projectName: 'hackathon_I_book',

  // Enable Mermaid for Diagrams
  markdown: {
    mermaid: true,
  },
  themes: ['@docusaurus/​theme-mermaid'],

  // i18n configuration
  i18n: {
    defaultLocale: 'en',
    locales: ['en', 'ur'],
    localeConfigs: {
      en: { label: 'English', direction: 'ltr' },
      ur: { label: 'اردو', direction: 'rtl', htmlLang: 'ur-PK' },
    },
  },
  // ... rest of config
};

2. RTL Styles for Urdu

File: src/​css/​custom.css

/​* RTL Support for Urdu */
html[dir='rtl'] {
  direction: rtl;
}

html[dir='rtl'] .navbar__items {
  flex-direction: row-reverse;
}

html[dir='rtl'] .markdown {
  text-align: right;
}

/​* Urdu font family */
html[lang='ur'] {
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
}

3. Chapter Template

File: docs/​chapter-N/​index.md

---
sidebar_position: N
---

# Chapter N: [Title]

## Learning Objectives

By the end of this chapter, you will be able to:
- [ ] Objective 1
- [ ] Objective 2
- [ ] Objective 3

## Prerequisites

Before starting this chapter, ensure you understand:
- Prerequisite 1
- Prerequisite 2

## Introduction

[Chapter introduction content]

## Key Concepts

### Concept 1
[Explanation]

### Concept 2
[Explanation]

## Hands-On Exercise

```python
# Example code
print("Hello, Physical AI!")

Summary

In this chapter, we covered:

  • Point 1
  • Point 2
  • Point 3

Further Reading


### 4. Input Variables

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `site_title` | No | `Physical AI Book` | Site title in navbar |
| `github_org` | No | `faiqahm` | GitHub organization |
| `repo_name` | No | `hackathon_I_book` | Repository name |
| `locales` | No | `en,ur` | Supported locales |
| `num_chapters` | No | `3` | Chapters to scaffold |

## Usage Instructions

### Step 1: Run Setup

```bash
.claude/​skills/​docusaurus-scaffold/​scripts/​setup.sh --install

Step 2: Add Content

Edit the generated chapter files in docs/:

  • docs/​intro.md - Welcome page
  • docs/​chapter-1/​index.md - Chapter 1
  • docs/​chapter-2/​index.md - Chapter 2
  • etc.

Step 3: Add Translations

For Urdu translations, edit files in i18n/​ur/​docusaurus-plugin-content-docs/​current/:

  • Copy English content
  • Translate to Urdu
  • RTL styling is automatic

Step 4: Test Locally

# English
npm start

# Urdu
npm start -- --locale ur

Step 5: Build & Deploy

# Build all locales
npm run build

# Deploy to GitHub Pages
npm run deploy

Verification Checklist

  • docusaurus.config.js exists with correct settings
  • docs/ folder has intro and chapters
  • i18n/​ur/ folder has translation structure
  • src/​css/​custom.css has RTL styles
  • npm start works without errors
  • npm run build completes successfully
  • Locale switcher appears in navbar

Automated Testing

Run the test suite to validate skill functionality:

# Run all tests
.claude/​skills/​docusaurus-scaffold/​scripts/​test.sh

Test Suite (18 assertions)

TestDescriptionValidates
1--help flag worksCLI help output
2package.json createdBasic scaffold
3docusaurus.config.js createdConfiguration
4sidebars.js createdSidebar config
5docs/​intro.md createdIntroduction page
6Chapter 1 with index.mdChapter structure
7Chapter 2 with index.mdChapter structure
8Chapter 3 with index.mdChapter structure
9Urdu navbar.json createdi18n translations
10Urdu intro.md createdi18n content
11RTL styles in custom.cssRTL support
12Homepage redirect configuredRedirect component
13Favicon createdStatic assets
14--chapters 5 creates 5 chaptersCustom chapter count
15GitHub Actions workflow createdCI/​CD pipeline
16Mermaid in config and package.jsonDiagram support
17Chapter template has MermaidDiagram examples
18--no-workflow skips workflowFlag functionality

Test Script Features

  • Isolated execution: Tests run in /​tmp/​docusaurus-scaffold-test-$$
  • Automatic cleanup: Directory removed on exit via trap
  • Color-coded output: PASS (green), FAIL (red), TEST (blue)
  • Summary report: Pass/​fail counts with exit code

Example Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧪 Docusaurus Scaffold Test Suite
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[TEST] Test 1: --help flag works
[PASS] --help displays usage information
...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Test Results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Passed: 18
  Failed: 0

✓ All tests passed!

Troubleshooting

IssueSolution
Build fails with broken linksCheck internal links use relative paths
Urdu text not RTLVerify direction: 'rtl' in config
Sidebar not showingCheck _category_.json in each chapter folder
npm start failsDelete node_modules, run npm install
Locale not switchingClear browser cache, check i18n config

Requirements

  • Node.js 18+
  • npm 8+
  • Git (for deployment)

Physical AI Textbook Chapters

The default scaffold creates these chapters:

ChapterTitleTopics
IntroWelcome to Physical AIOverview, prerequisites, how to use
1Introduction to Physical AI & ROS 2What is Physical AI, ROS 2 basics
2Simulation with GazeboVirtual environments, robot simulation
3Vision-Language-Action ModelsVLA concepts, integration

Related

Changelog

v1.2.0 (2026-01-02)

Test Suite & Bug Fixes

  • Add comprehensive test suite (scripts/​test.sh) with 18 assertions
  • Tests run in isolated /​tmp directory with automatic cleanup
  • Color-coded test output with pass/​fail summary
  • Bug fixes discovered during testing:
    • Fix bash counter increment syntax for set -e compatibility
      • Changed ((PASSED++)) to PASSED=$((PASSED + 1))
      • Prevents script exit when incrementing from 0
    • Fix test cleanup to properly remove .github directory
      • Glob pattern * doesn't match dot-prefix directories
      • Use rm -rf "$DIR" instead of rm -rf "$DIR"/​*

v1.1.0 (2026-01-01)

Enhanced Deployment & Diagrams

  • Add --deploy flag for automated GitHub Pages deployment
  • Add --build flag to run build after install
  • Bundle GitHub Actions workflow (.github/​workflows/​deploy.yml)
  • Add Mermaid diagram support (@docusaurus/​theme-mermaid)
  • Add example Mermaid diagrams in chapter templates
  • Add --no-workflow and --no-mermaid flags to skip features

v1.0.0 (2026-01-01)

Initial Release

  • Docusaurus project scaffolding
  • Physical AI textbook chapter structure
  • i18n support (English + Urdu RTL)
  • GitHub Pages deployment configuration
  • Custom CSS for RTL languages
  • Chapter templates with learning objectives

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View