xiaohongshu
xiaohongshu
docusaurus-scaffold
Scaffold and initialize a Docusaurus project with the specific structure for the Physical AI textbook. Agent: BookArchitect
Full skill instructions
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.
# 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
| Option | Description | Default |
|---|---|---|
--title TITLE | Site title | Physical AI Book |
--github-org ORG | GitHub org/username | faiqahm |
--repo NAME | Repository name | hackathon_I_book |
--locales LOCALES | Comma-separated locales | en,ur |
--chapters N | Number of chapters | 3 |
--install | Run npm install after setup | off |
--start | Start dev server (requires --install) | off |
-h, --help | Show help message | - |
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
docusaurus.config.js
sidebars.js
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.
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
};
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;
}
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!")
In this chapter, we covered:
### 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
Edit the generated chapter files in docs/:
docs/intro.md - Welcome pagedocs/chapter-1/index.md - Chapter 1docs/chapter-2/index.md - Chapter 2For Urdu translations, edit files in i18n/ur/docusaurus-plugin-content-docs/current/:
# English
npm start
# Urdu
npm start -- --locale ur
# Build all locales
npm run build
# Deploy to GitHub Pages
npm run deploy
docusaurus.config.js exists with correct settingsdocs/ folder has intro and chaptersi18n/ur/ folder has translation structuresrc/css/custom.css has RTL stylesnpm start works without errorsnpm run build completes successfullyRun the test suite to validate skill functionality:
# Run all tests
.claude/skills/docusaurus-scaffold/scripts/test.sh
| Test | Description | Validates |
|---|---|---|
| 1 | --help flag works | CLI help output |
| 2 | package.json created | Basic scaffold |
| 3 | docusaurus.config.js created | Configuration |
| 4 | sidebars.js created | Sidebar config |
| 5 | docs/intro.md created | Introduction page |
| 6 | Chapter 1 with index.md | Chapter structure |
| 7 | Chapter 2 with index.md | Chapter structure |
| 8 | Chapter 3 with index.md | Chapter structure |
| 9 | Urdu navbar.json created | i18n translations |
| 10 | Urdu intro.md created | i18n content |
| 11 | RTL styles in custom.css | RTL support |
| 12 | Homepage redirect configured | Redirect component |
| 13 | Favicon created | Static assets |
| 14 | --chapters 5 creates 5 chapters | Custom chapter count |
| 15 | GitHub Actions workflow created | CI/CD pipeline |
| 16 | Mermaid in config and package.json | Diagram support |
| 17 | Chapter template has Mermaid | Diagram examples |
| 18 | --no-workflow skips workflow | Flag functionality |
/tmp/docusaurus-scaffold-test-$$━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧪 Docusaurus Scaffold Test Suite
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[TEST] Test 1: --help flag works
[PASS] --help displays usage information
...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Test Results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Passed: 18
Failed: 0
✓ All tests passed!
| Issue | Solution |
|---|---|
| Build fails with broken links | Check internal links use relative paths |
| Urdu text not RTL | Verify direction: 'rtl' in config |
| Sidebar not showing | Check _category_.json in each chapter folder |
| npm start fails | Delete node_modules, run npm install |
| Locale not switching | Clear browser cache, check i18n config |
The default scaffold creates these chapters:
| Chapter | Title | Topics |
|---|---|---|
| Intro | Welcome to Physical AI | Overview, prerequisites, how to use |
| 1 | Introduction to Physical AI & ROS 2 | What is Physical AI, ROS 2 basics |
| 2 | Simulation with Gazebo | Virtual environments, robot simulation |
| 3 | Vision-Language-Action Models | VLA concepts, integration |
github-pages-deploy - Deploy the siteurdu-rtl-styler - Enhanced RTL stylingvercel-fastapi-link - Backend APITest Suite & Bug Fixes
scripts/test.sh) with 18 assertions/tmp directory with automatic cleanupset -e compatibility
((PASSED++)) to PASSED=$((PASSED + 1)).github directory
* doesn't match dot-prefix directoriesrm -rf "$DIR" instead of rm -rf "$DIR"/*Enhanced Deployment & Diagrams
--deploy flag for automated GitHub Pages deployment--build flag to run build after install.github/workflows/deploy.yml)@docusaurus/theme-mermaid)--no-workflow and --no-mermaid flags to skip featuresInitial Release
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
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...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
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...
Display project status, active tracks, and next actions
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.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience