Skip to content

Commit ecb2b95

Browse files
authored
Merge Complete Module 1 ROS2 Foundations pull request #3 from mjunaidca/003-module-1-chapters
feat(content): Complete Module 1 ROS2 Foundations - 7 Chapters, 25 Lessons
2 parents 12c27d7 + 1bd68ef commit ecb2b95

File tree

60 files changed

+18079
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+18079
-55
lines changed

.claude/agents/authoring/content-implementer.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,60 @@ educational-validator runs 4 constitutional checks
171171

172172
**Prevention**: This mandatory check ensures constitutional compliance BEFORE generation, not after.
173173

174+
### Learning from Module 1 ROS 2 Implementation (2025-11-29)
175+
176+
**Why this section exists**: Module 1 implementation required 8 file extension fixes, 10 mermaid removals, 3 MDX syntax corrections, and metadata standardization across 25 lessons.
177+
178+
**Platform-Specific Failures Identified**:
179+
- 25 files used `.mdx` extension instead of `.md`
180+
- 8 files used `index.md` instead of `README.md`
181+
- 10 files contained Mermaid diagrams (plugin not installed)
182+
- 3 files had `<` characters in prose (MDX parsing errors)
183+
- 8 files used `cefr_level` instead of `proficiency_level`
184+
- 8 files used `duration` instead of `duration_minutes`
185+
- 12 files missing `id`, `sidebar_label`, or `description`
186+
187+
**Root cause**: Agents generated content without following platform-specific Docusaurus conventions.
188+
189+
**Prevention**: See Step 5 below - Docusaurus Platform Check.
190+
191+
### Step 5: Docusaurus Platform Check (MANDATORY for RoboLearn)
192+
193+
**Before creating ANY file**, verify:
194+
195+
#### 5.1 File Naming
196+
- [ ] Extension is `.md` (NOT `.mdx`)
197+
- [ ] Index files named `README.md` (NOT `index.md`)
198+
- [ ] Lesson files use `NN-descriptive-name.md` pattern
199+
200+
#### 5.2 MDX Syntax Safety
201+
- [ ] No `<` characters in prose (use "less than", "under")
202+
- [ ] No `>` characters in prose (use "more than", "over")
203+
- [ ] Comparison operators only inside code blocks
204+
205+
#### 5.3 Diagram Constraints
206+
- [ ] NO Mermaid diagrams (plugin not configured)
207+
- [ ] Use ASCII text for simple diagrams
208+
- [ ] Use images for complex diagrams
209+
210+
#### 5.4 Metadata Fields
211+
- [ ] `proficiency_level` (NOT `cefr_level`)
212+
- [ ] `duration_minutes` (NOT `duration` or `estimated_time`)
213+
- [ ] `id` unique and follows `lesson-{chapter}-{lesson}-{slug}` pattern
214+
- [ ] `sidebar_label` short and follows `"{C}.{L} {Title}"` pattern
215+
- [ ] `description` one-line for SEO
216+
- [ ] `skills` array populated
217+
- [ ] `hardware_tier` specified (1-4)
218+
219+
#### 5.5 Internal Links
220+
- [ ] Use `.md` extension (NOT `.mdx`)
221+
- [ ] Use `README.md` (NOT `index.md`)
222+
- [ ] Relative paths from current file
223+
224+
**Reference**: See `.claude/skills/authoring/docusaurus-conventions/SKILL.md` for complete guidelines.
225+
226+
**Self-check**: Run `npm run build` after creating files. Expected: `[SUCCESS] Generated static files`
227+
174228
---
175229

176230
## II. Persona: Think Like Master Teacher + Curriculum Designer
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
---
2+
name: docusaurus-conventions
3+
description: Docusaurus file naming, syntax, and structure conventions for RoboLearn platform
4+
domain: authoring
5+
version: 1.0.0
6+
created: 2025-11-29
7+
triggers:
8+
- Creating lesson files
9+
- Creating module/chapter structure
10+
- Writing MDX content
11+
- Fixing Docusaurus build errors
12+
learned_from:
13+
- Module 1 ROS 2 implementation (2025-11-29)
14+
- 8 file extension fixes, 10 mermaid removals, 3 MDX syntax errors
15+
---
16+
17+
# Docusaurus Conventions Skill
18+
19+
## Persona
20+
21+
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.
22+
23+
---
24+
25+
## Pre-Flight Questions
26+
27+
Before creating or modifying any Docusaurus content, ask yourself:
28+
29+
### 1. File Naming
30+
- **Q**: What file extension should I use?
31+
- **A**: Always `.md` (NOT `.mdx`)
32+
- **Why**: The project doesn't use MDX components; `.mdx` causes unnecessary complexity
33+
34+
- **Q**: What should chapter/module index files be named?
35+
- **A**: Always `README.md` (NOT `index.md`)
36+
- **Why**: Docusaurus resolves `README.md` as the index; `index.md` can cause duplicate ID errors
37+
38+
- **Q**: What naming pattern for lesson files?
39+
- **A**: `NN-descriptive-name.md` (e.g., `01-digital-to-physical.md`)
40+
- **Why**: Numeric prefix ensures correct ordering; descriptive name aids navigation
41+
42+
### 2. MDX Syntax Safety
43+
- **Q**: Does my content contain `<` characters outside of code blocks?
44+
- **A**: Replace with spelled-out alternatives
45+
- **Examples**:
46+
- `<2 seconds``less than 2 seconds`
47+
- `<10 hours``under 10 hours`
48+
- `[<10 hrs``[under 10 hrs`
49+
- **Why**: MDX parser interprets `<` as JSX tag start, causing build errors
50+
51+
- **Q**: Am I using comparison operators in prose?
52+
- **A**: Use words instead of symbols
53+
- **Examples**:
54+
- `latency < 100ms``latency under 100ms` or use inline code: `latency < 100ms`
55+
- `if (x < 5)` in code block is fine (code blocks are not parsed as MDX)
56+
57+
### 3. Diagrams
58+
- **Q**: Am I using Mermaid diagrams?
59+
- **A**: NO - Mermaid plugin is not configured
60+
- **Alternatives**:
61+
- ASCII text diagrams for simple flows
62+
- Image files for complex diagrams
63+
- Code blocks showing structure
64+
- **Example replacement**:
65+
```
66+
# Instead of mermaid:
67+
```mermaid
68+
graph TD
69+
A --> B
70+
```
71+
72+
# Use ASCII:
73+
```
74+
A → B → C
75+
└── D
76+
```
77+
```
78+
79+
### 4. Internal Links
80+
- **Q**: How should I link to other lessons?
81+
- **A**: Use relative paths with `.md` extension
82+
- **Examples**:
83+
- Same chapter: `[Next](./02-next-lesson.md)`
84+
- Different chapter: `[Overview](../chapter-2-topic/README.md)`
85+
- Module root: `[Module](../README.md)`
86+
- **Never use**: `.mdx` extension or `index.md`
87+
88+
---
89+
90+
## Principles
91+
92+
### Principle 1: Build-First Validation
93+
**Before committing any content, verify it builds.**
94+
95+
```bash
96+
npm run build 2>&1 | tail -30
97+
```
98+
99+
Expected: `[SUCCESS] Generated static files in "build"`
100+
101+
If errors:
102+
1. Check for duplicate doc IDs (two files with same `id` frontmatter)
103+
2. Check for MDX syntax errors (unexpected character errors)
104+
3. Check for broken links (file not found warnings)
105+
106+
### Principle 2: Consistent File Structure
107+
108+
**Module structure:**
109+
```
110+
docs/module-N-name/
111+
├── README.md # Module overview (NOT index.md)
112+
├── chapter-1-topic/
113+
│ ├── README.md # Chapter overview
114+
│ ├── 01-first-lesson.md
115+
│ ├── 02-second-lesson.md
116+
│ └── ...
117+
├── chapter-2-topic/
118+
│ └── ...
119+
└── ...
120+
```
121+
122+
### Principle 3: Frontmatter ID Uniqueness
123+
124+
**Every lesson must have unique `id`:**
125+
```yaml
126+
---
127+
id: lesson-1-1-digital-to-physical # Unique across entire docs folder
128+
title: "Lesson 1.1: From ChatGPT to Walking Robots"
129+
---
130+
```
131+
132+
**ID pattern**: `lesson-{chapter}-{lesson}-{slug}`
133+
- `lesson-1-1-digital-to-physical`
134+
- `lesson-3-2-turtlesim-action`
135+
- `custom-messages` (for standalone topics)
136+
137+
### Principle 4: Safe Text Patterns
138+
139+
**Avoid these patterns in prose (outside code blocks):**
140+
141+
| Pattern | Problem | Solution |
142+
|---------|---------|----------|
143+
| `<N` | JSX parsing | `less than N`, `under N` |
144+
| `>N` | JSX parsing | `more than N`, `over N` |
145+
| `{var}` | JSX interpolation | Use code: `` `{var}` `` |
146+
| `<Component>` | JSX component | Use code or escape |
147+
148+
**Safe in code blocks:**
149+
```python
150+
if x < 5: # This is fine - inside code block
151+
pass
152+
```
153+
154+
---
155+
156+
## Checklist (Use Before Every Lesson Creation)
157+
158+
- [ ] File extension is `.md` (not `.mdx`)
159+
- [ ] Index files named `README.md` (not `index.md`)
160+
- [ ] Unique `id` in frontmatter
161+
- [ ] No `<` or `>` in prose outside code blocks
162+
- [ ] No Mermaid diagrams (use ASCII or images)
163+
- [ ] Internal links use `.md` extension
164+
- [ ] Internal links use `README.md` not `index.md`
165+
- [ ] Build passes: `npm run build`
166+
167+
---
168+
169+
## Recovery Patterns
170+
171+
### Fix: Duplicate Doc ID Error
172+
```
173+
Error: The docs plugin found docs sharing the same id
174+
```
175+
**Solution**:
176+
1. Delete one of the duplicate files
177+
2. Or change the `id` in frontmatter to be unique
178+
179+
### Fix: MDX Syntax Error
180+
```
181+
Unexpected character 'N' (U+004E) before name
182+
```
183+
**Solution**:
184+
1. Find the `<` character in prose
185+
2. Replace with word equivalent (`less than`, `under`)
186+
3. Or wrap in inline code
187+
188+
### Fix: Mermaid Not Rendering
189+
**Solution**:
190+
1. Replace mermaid block with ASCII text diagram
191+
2. Or create image and reference it
192+
193+
---
194+
195+
## Version History
196+
197+
| Version | Date | Change |
198+
|---------|------|--------|
199+
| 1.0.0 | 2025-11-29 | Initial skill from Module 1 lessons learned |

0 commit comments

Comments
 (0)