MicroSim Generator
Overview
This meta-skill routes MicroSim creation requests to the appropriate specialized generator based on visualization requirements. It consolidates 14 individual MicroSim generator skills into a single entry point with on-demand loading of specific implementation guides.
When to Use This Skill
Use this skill when users request:
- Interactive educational visualizations
- Data visualizations (charts, graphs, plots)
- Timelines or chronological displays
- Geographic/map visualizations
- Network diagrams or concept maps
- Flowcharts or workflow diagrams
- Mathematical function plots
- Set diagrams (Venn)
- Priority matrices or bubble charts
- Custom simulations or animations
- Comparison tables with ratings
- Matrix comparisons with expandable cell details
Step 1: Analyze Request and Match Generator
Scan the user's request for trigger keywords and match to the appropriate generator guide.
Quick Reference Routing Table
| Trigger Keywords |
Guide File |
Library |
| timeline, dates, chronological, events, history, schedule, milestones |
references/timeline-guide.md |
vis-timeline |
| map, geographic, coordinates, latitude, longitude, locations, markers |
references/map-guide.md |
Leaflet.js |
| function, f(x), equation, plot, calculus, sine, cosine, polynomial |
references/plotly-guide.md |
Plotly.js |
| network, nodes, edges, graph, dependencies, concept map, knowledge graph |
references/vis-network-guide.md |
vis-network |
| flowchart, workflow, process, state machine, UML, sequence diagram |
references/mermaid-guide.md |
Mermaid.js |
| venn, sets, overlap, intersection, union, categories |
references/venn-guide.md |
Custom |
| chart, bar, line, pie, doughnut, radar, statistics, data |
references/chartjs-guide.md |
Chart.js |
| bubble, priority, matrix, quadrant, impact vs effort, risk vs value |
references/bubble-guide.md |
Chart.js |
| causal, feedback, loop, systems thinking, reinforcing, balancing |
references/causal-loop-guide.md |
vis-network |
| comparison, table, ratings, stars, side-by-side, features |
references/comparison-table-guide.md |
Custom |
| matrix, framework comparison, clickable cells, detail panel, expandable |
references/html-table.md |
Custom |
| animation, celebration, particles, confetti, effects |
references/celebration-guide.md |
p5.js |
| custom, simulation, physics, interactive, bouncing, movement, p5.js |
references/p5-guide.md |
p5.js |
Decision Tree
Has dates/timeline/chronological events?
→ YES: timeline-guide.md
Has geographic coordinates/locations?
→ YES: map-guide.md
Mathematical function f(x) or equation?
→ YES: plotly-guide.md
Nodes and edges/network relationships?
→ YES: vis-network-guide.md (or causal-loop-guide.md if systems thinking)
Flowchart/workflow/process diagram?
→ YES: mermaid-guide.md
Sets with overlaps (2-4 categories)?
→ YES: venn-guide.md
Priority matrix/2x2 quadrant/multi-dimensional?
→ YES: bubble-guide.md
Standard chart (bar/line/pie/radar)?
→ YES: chartjs-guide.md
Comparison table with ratings/stars?
→ YES: comparison-table-guide.md
Matrix comparison with clickable cells/detail panels?
→ YES: html-table.md
Celebration/particles/visual feedback?
→ YES: celebration-guide.md
Custom simulation/animation/physics?
→ YES: p5-guide.md
Step 2: Instructional Design Checkpoint (MANDATORY)
Before loading any generator guide, you MUST complete this checkpoint.
2.1 Identify Learning Objective Details
Extract from the specification:
- Bloom Level: Remember, Understand, Apply, Analyze, Evaluate, or Create
- Bloom Verb: The action verb (explain, demonstrate, calculate, etc.)
- Learning Objective: The full statement of what learners will be able to do
2.2 Match Interaction Pattern to Bloom Level
| Bloom Level |
Appropriate Patterns |
Inappropriate Patterns |
| Remember (L1) |
Flashcards, matching, labeling |
Complex simulations |
| Understand (L2) |
Step-through worked examples, concrete data visibility |
Continuous animation, particle effects |
| Apply (L3) |
Parameter sliders, calculators, practice problems |
Passive viewing only |
| Analyze (L4) |
Network explorers, comparison tools, pattern finders |
Pre-computed results |
| Evaluate (L5) |
Sorting/ranking activities, rubric tools |
No feedback mechanisms |
| Create (L6) |
Builders, editors, canvas tools |
Rigid templates |
2.3 Answer These Questions
Before proceeding, answer these questions:
What specific data must the learner SEE?
- Not "animated particles" but "the tokenized array ['physics', 'ball']"
Does the learner need to PREDICT before observing?
- If YES → Use step-through with Next/Previous buttons
- If YES → Do NOT use continuous animation
What does animation add that static arrows don't?
- If you can't answer this clearly → Don't use animation
Is continuous animation appropriate for this Bloom level?
- For Understand (L2) with verb "explain" → Almost always NO
- For Apply (L3) with real-time feedback → Often YES
2.4 Modify Specification If Needed
If the specification requests animation/effects for an UNDERSTAND level objective:
- Flag this as a potential instructional design issue
- Recommend step-through pattern instead
- Ask user: "The specification requests animation, but for an 'explain' objective, a step-through approach with concrete data visibility typically supports learning better. Should I proceed with step-through instead?"
2.5 Document Your Decision
Add to your response:
Instructional Design Check:
- Bloom Level: [level]
- Bloom Verb: [verb]
- Recommended Pattern: [pattern]
- Specification Alignment: [aligned/modified]
- Rationale: [why this pattern supports the learning objective]
Step 3: Load the Matched Guide
Once you complete the instructional design checkpoint, read the corresponding guide file from the references/ directory and follow its workflow.
Example:
- User asks for "a timeline showing the history of Unix"
- Match:
timeline keyword → Load references/timeline-guide.md
- Follow the timeline-guide.md workflow
Step 5: Execute Generator Workflow
Each guide contains:
- Library-specific requirements
- Directory structure to create
- Step-by-step implementation workflow
- Code templates and patterns
- Best practices for that visualization type
Handling Ambiguous Requests
If the request could match multiple generators:
- Read
references/routing-criteria.md for detailed scoring methodology
- Score top 3 candidates using the 0-100 scale
- Present options to user with reasoning:
Based on your request, I recommend:
1. [Generator A] (Score: 85) - Best for [reason]
2. [Generator B] (Score: 70) - Alternative if you need [feature]
3. [Generator C] (Score: 55) - Possible if [condition]
Which would you prefer?
- Proceed with user's selection
Common Ambiguities
| Ambiguous Term |
Clarification Needed |
| "graph" |
Chart (ChartJS) or Network graph (vis-network)? |
| "diagram" |
Structural (Mermaid), Network (vis-network), or Custom (p5)? |
| "map" |
Geographic (Leaflet) or Concept map (vis-network)? |
| "table" |
Star ratings (comparison-table) or Clickable cells with detail panels (html-table)? |
| "visualization" |
What type of data? What interaction needed? |
Available Generators
Primary Generators
| Generator |
Library |
Best For |
| p5-guide |
p5.js |
Custom simulations, physics, animations |
| chartjs-guide |
Chart.js |
Bar, line, pie, doughnut, radar charts |
| timeline-guide |
vis-timeline |
Chronological events, history, schedules |
| map-guide |
Leaflet.js |
Geographic data, locations, routes |
| vis-network-guide |
vis-network |
Network graphs, dependencies, concept maps |
| mermaid-guide |
Mermaid.js |
Flowcharts, workflows, UML diagrams |
| plotly-guide |
Plotly.js |
Mathematical function plots |
| venn-guide |
Custom |
Set relationships (2-4 sets) |
| bubble-guide |
Chart.js |
Priority matrices, multi-dimensional data |
| causal-loop-guide |
vis-network |
Systems thinking, feedback loops |
| comparison-table-guide |
Custom |
Side-by-side comparisons with ratings |
| html-table |
Custom |
Matrix comparisons with clickable cells, detail panels |
| celebration-guide |
p5.js |
Particle effects, visual feedback |
Shared Standards
All MicroSims follow these standards regardless of generator:
Directory Structure:
docs/sims/<microsim-name>/
├── main.html # Main visualization file
├── index.md # Documentation page
├── *.js or *.css # Supporting files
└── metadata.json # Dublin Core metadata (optional)
URI Scheme for Discoverability:
All MicroSim HTML files MUST include this schema meta tag for global discoverability:
<meta name="schema" content="https://dmccreary.github.io/intelligent-textbooks/ns/microsim/v1">
This enables counting and discovery of MicroSims across GitHub using code search. See the URI Scheme documentation for details.
Integration:
- Embedded via iframe in MkDocs pages
- Width-responsive design
- Non-scrolling iframe container
- Standard height: drawHeight + controlHeight + 2px
- Iframe paths MUST always be relative, NEVER absolute:
- From a sim's own
index.md: <iframe src="main.html" ...>
- From chapter files (
docs/chapters/*/index.md): <iframe src="../../sims/[sim-name]/main.html" ...>
- NEVER use absolute paths like
/sims/... — they break on GitHub Pages where the site is served under a subdirectory (e.g., /geometry-course/)
Quality Checklist:
Examples
Example 1: Timeline Request
User: "Create a timeline showing key events in computer history"
Routing: Keywords "timeline", "events", "history" → references/timeline-guide.md
Action: Read timeline-guide.md and follow its workflow
Example 2: Chart Request
User: "Make a bar chart comparing programming language popularity"
Routing: Keywords "bar chart", "comparing" → references/chartjs-guide.md
Action: Read chartjs-guide.md and follow its workflow
Example 3: Custom Simulation
User: "Build an interactive bouncing ball simulation"
Routing: Keywords "interactive", "bouncing", "simulation" → references/p5-guide.md
Action: Read p5-guide.md and follow its workflow
Example 4: Ambiguous Request
User: "Create a graph of our project dependencies"
Routing: "graph" + "dependencies" suggests network → references/vis-network-guide.md
Action: Read vis-network-guide.md (but clarify if user meant a chart)
Reference Files
For detailed information, consult:
references/routing-criteria.md - Complete scoring methodology for all generators
references/<generator>-guide.md - Specific implementation guide for each generator
assets/templates/ - Shared templates and patterns
Step 6: Auto-Standardization
IMPORTANT: After creating the MicroSim files, automatically run standardization to ensure quality and documentation standards are met.
Why Auto-Standardize?
- Eliminates manual follow-up work
- Ensures consistent quality across all MicroSims
- Adds metadata.json, lesson plans, and references automatically
- Calculates and records quality_score in index.md
Standardization Process
After the generator guide workflow completes (files created in docs/sims/<microsim-name>/):
- Read the standardization guide: Load
../microsim-utils/references/standardization.md
- Run the standardization checklist on the newly created MicroSim directory
- Implement all fixes automatically (skip user confirmation since this is a new MicroSim)
- Generate quality_score and add to index.md frontmatter
What Standardization Adds
The standardization process will add these elements if missing:
- metadata.json - Dublin Core metadata for discoverability
- YAML frontmatter - title, description, quality_score, image paths
- Iframe examples - Copy-paste code for embedding
- Fullscreen button - Link to view MicroSim fullscreen
- Lesson Plan section - Learning objectives, activities, assessment
- References section - Related resources and documentation
Workflow Integration
[User Request]
→ [Route to Guide]
→ [Generate MicroSim Files]
→ [Auto-Standardize] ← NEW STEP
→ [Update mkdocs.yml]
→ [Done]
This eliminates the need to manually run microsim-utils standardization after every MicroSim creation.
mkdocs.yml Integration
After creating and standardizing a MicroSim, update the site navigation.
For single MicroSims, add manually to mkdocs.yml:
nav:
- MicroSims:
- List of MicroSims: sims/index.md
- Existing Sim: sims/existing-sim/index.md
- New MicroSim: sims/new-microsim-name/index.md # Add here
For batch operations, use the update-mkdocs-nav.py utility instead:
python3 src/microsim-utils/update-mkdocs-nav.py --project-dir /path/to/project
This scans docs/sims/ and regenerates the entire MicroSims nav section alphabetically. It is idempotent and safe to run multiple times.
Batch Generation Utilities
When generating MicroSims for multiple chapters, these Python utilities in
src/microsim-utils/ eliminate ~430K tokens of repetitive work per batch run:
| Utility |
Purpose |
Savings |
extract-sim-specs.py |
Parse specs from chapter #### Diagram: headers |
~80K tokens |
generate-sim-scaffold.py |
Create main.html, index.md, metadata.json |
~150K tokens |
update-mkdocs-nav.py |
Regenerate MicroSims nav in mkdocs.yml |
~100K tokens |
add-iframes-to-chapter.py |
Insert missing iframes, fix heights/paths |
~50K tokens |
validate-sims.py |
100-point quality rubric scoring |
~50K tokens |
Batch Workflow
# 1. Extract all diagram/drawing specs from chapters
python3 src/microsim-utils/extract-sim-specs.py \
--project-dir $PROJECT --output /tmp/specs.json \
--status-file docs/sims/sim-status.json --verbose
# 2. Scaffold unbuilt sims (main.html, index.md, metadata.json)
python3 src/microsim-utils/generate-sim-scaffold.py \
--spec-file /tmp/specs.json --project-dir $PROJECT --verbose
# 3. Agent implements .js files (this is where the creative work happens)
# 4. Insert iframes into chapter markdown
python3 src/microsim-utils/add-iframes-to-chapter.py \
--all --project-dir $PROJECT --fix-heights --fix-paths
# 5. Update mkdocs.yml navigation
python3 src/microsim-utils/update-mkdocs-nav.py --project-dir $PROJECT
# 6. Validate quality scores
python3 src/microsim-utils/validate-sims.py --project-dir $PROJECT
sim-status.json Integration
The extract-sim-specs.py --status-file flag generates a lifecycle tracking
file. After a context window fills during batch generation, a new session can
read sim-status.json to resume where it left off:
- specified — has spec in chapter but no sim directory yet
- scaffolded — directory with main.html/index.md but no substantive JS
- implemented — JS file exists and >50 lines
- validated — quality_score >= 70
- deployed — validated + iframe present in chapter
See src/microsim-utils/README.md for full documentation.
1---2name: microsim-generator-23description: Creates interactive educational MicroSims using the best-matched JavaScript library (p5.js, Chart.js, Plotly, Mermaid, vis-network, vis-timeline, Leaflet, Venn.js). Analyzes user requirements to route to the appropriate visualization type and generates complete MicroSim packages with HTML, JavaScript, CSS, documentation, and metadata.4---5
6# MicroSim Generator
7
8## Overview
9
10This meta-skill routes MicroSim creation requests to the appropriate specialized generator based on visualization requirements. It consolidates 14 individual MicroSim generator skills into a single entry point with on-demand loading of specific implementation guides.
11
12## When to Use This Skill
13
14Use this skill when users request:
15
16- Interactive educational visualizations
17- Data visualizations (charts, graphs, plots)
18- Timelines or chronological displays
19- Geographic/map visualizations
20- Network diagrams or concept maps
21- Flowcharts or workflow diagrams
22- Mathematical function plots
23- Set diagrams (Venn)
24- Priority matrices or bubble charts
25- Custom simulations or animations
26- Comparison tables with ratings
27- Matrix comparisons with expandable cell details
28
29## Step 1: Analyze Request and Match Generator
30
31Scan the user's request for trigger keywords and match to the appropriate generator guide.
32
33### Quick Reference Routing Table
34
35| Trigger Keywords | Guide File | Library |
36|------------------|------------|---------|
37| timeline, dates, chronological, events, history, schedule, milestones | `references/timeline-guide.md` | vis-timeline |
38| map, geographic, coordinates, latitude, longitude, locations, markers | `references/map-guide.md` | Leaflet.js |
39| function, f(x), equation, plot, calculus, sine, cosine, polynomial | `references/plotly-guide.md` | Plotly.js |
40| network, nodes, edges, graph, dependencies, concept map, knowledge graph | `references/vis-network-guide.md` | vis-network |
41| flowchart, workflow, process, state machine, UML, sequence diagram | `references/mermaid-guide.md` | Mermaid.js |
42| venn, sets, overlap, intersection, union, categories | `references/venn-guide.md` | Custom |
43| chart, bar, line, pie, doughnut, radar, statistics, data | `references/chartjs-guide.md` | Chart.js |
44| bubble, priority, matrix, quadrant, impact vs effort, risk vs value | `references/bubble-guide.md` | Chart.js |
45| causal, feedback, loop, systems thinking, reinforcing, balancing | `references/causal-loop-guide.md` | vis-network |
46| comparison, table, ratings, stars, side-by-side, features | `references/comparison-table-guide.md` | Custom |
47| matrix, framework comparison, clickable cells, detail panel, expandable | `references/html-table.md` | Custom |
48| animation, celebration, particles, confetti, effects | `references/celebration-guide.md` | p5.js |
49| custom, simulation, physics, interactive, bouncing, movement, p5.js | `references/p5-guide.md` | p5.js |
50
51### Decision Tree
52
53```
54Has dates/timeline/chronological events?
55 → YES: timeline-guide.md
56
57Has geographic coordinates/locations?
58 → YES: map-guide.md
59
60Mathematical function f(x) or equation?
61 → YES: plotly-guide.md
62
63Nodes and edges/network relationships?
64 → YES: vis-network-guide.md (or causal-loop-guide.md if systems thinking)
65
66Flowchart/workflow/process diagram?
67 → YES: mermaid-guide.md
68
69Sets with overlaps (2-4 categories)?
70 → YES: venn-guide.md
71
72Priority matrix/2x2 quadrant/multi-dimensional?
73 → YES: bubble-guide.md
74
75Standard chart (bar/line/pie/radar)?
76 → YES: chartjs-guide.md
77
78Comparison table with ratings/stars?
79 → YES: comparison-table-guide.md
80
81Matrix comparison with clickable cells/detail panels?
82 → YES: html-table.md
83
84Celebration/particles/visual feedback?
85 → YES: celebration-guide.md
86
87Custom simulation/animation/physics?
88 → YES: p5-guide.md
89```
90
91## Step 2: Instructional Design Checkpoint (MANDATORY)
92
93**Before loading any generator guide, you MUST complete this checkpoint.**
94
95### 2.1 Identify Learning Objective Details
96
97Extract from the specification:
98- **Bloom Level**: Remember, Understand, Apply, Analyze, Evaluate, or Create
99- **Bloom Verb**: The action verb (explain, demonstrate, calculate, etc.)
100- **Learning Objective**: The full statement of what learners will be able to do
101
102### 2.2 Match Interaction Pattern to Bloom Level
103
104| Bloom Level | Appropriate Patterns | Inappropriate Patterns |
105|-------------|---------------------|------------------------|
106| Remember (L1) | Flashcards, matching, labeling | Complex simulations |
107| **Understand (L2)** | **Step-through worked examples, concrete data visibility** | **Continuous animation, particle effects** |
108| Apply (L3) | Parameter sliders, calculators, practice problems | Passive viewing only |
109| Analyze (L4) | Network explorers, comparison tools, pattern finders | Pre-computed results |
110| Evaluate (L5) | Sorting/ranking activities, rubric tools | No feedback mechanisms |
111| Create (L6) | Builders, editors, canvas tools | Rigid templates |
112
113### 2.3 Answer These Questions
114
115Before proceeding, answer these questions:
116
1171. **What specific data must the learner SEE?**
118 - Not "animated particles" but "the tokenized array ['physics', 'ball']"
119
1202. **Does the learner need to PREDICT before observing?**
121 - If YES → Use step-through with Next/Previous buttons
122 - If YES → Do NOT use continuous animation
123
1243. **What does animation add that static arrows don't?**
125 - If you can't answer this clearly → Don't use animation
126
1274. **Is continuous animation appropriate for this Bloom level?**
128 - For Understand (L2) with verb "explain" → Almost always NO
129 - For Apply (L3) with real-time feedback → Often YES
130
131### 2.4 Modify Specification If Needed
132
133If the specification requests animation/effects for an UNDERSTAND level objective:
134- **Flag this as a potential instructional design issue**
135- **Recommend step-through pattern instead**
136- **Ask user**: "The specification requests animation, but for an 'explain' objective, a step-through approach with concrete data visibility typically supports learning better. Should I proceed with step-through instead?"
137
138### 2.5 Document Your Decision
139
140Add to your response:
141```
142Instructional Design Check:
143- Bloom Level: [level]
144- Bloom Verb: [verb]
145- Recommended Pattern: [pattern]
146- Specification Alignment: [aligned/modified]
147- Rationale: [why this pattern supports the learning objective]
148```
149
150---
151
152## Step 3: Load the Matched Guide
153
154Once you complete the instructional design checkpoint, **read the corresponding guide file** from the `references/` directory and follow its workflow.
155
156Example:
157- User asks for "a timeline showing the history of Unix"
158- Match: `timeline` keyword → Load `references/timeline-guide.md`
159- Follow the timeline-guide.md workflow
160
161## Step 5: Execute Generator Workflow
162
163Each guide contains:
1641. Library-specific requirements
1652. Directory structure to create
1663. Step-by-step implementation workflow
1674. Code templates and patterns
1685. Best practices for that visualization type
169
170## Handling Ambiguous Requests
171
172If the request could match multiple generators:
173
1741. **Read `references/routing-criteria.md`** for detailed scoring methodology
1752. **Score top 3 candidates** using the 0-100 scale
1763. **Present options to user** with reasoning:
177 ```
178 Based on your request, I recommend:
179 1. [Generator A] (Score: 85) - Best for [reason]
180 2. [Generator B] (Score: 70) - Alternative if you need [feature]
181 3. [Generator C] (Score: 55) - Possible if [condition]
182
183 Which would you prefer?
184 ```
1854. **Proceed with user's selection**
186
187## Common Ambiguities
188
189| Ambiguous Term | Clarification Needed |
190|----------------|---------------------|
191| "graph" | Chart (ChartJS) or Network graph (vis-network)? |
192| "diagram" | Structural (Mermaid), Network (vis-network), or Custom (p5)? |
193| "map" | Geographic (Leaflet) or Concept map (vis-network)? |
194| "table" | Star ratings (comparison-table) or Clickable cells with detail panels (html-table)? |
195| "visualization" | What type of data? What interaction needed? |
196
197## Available Generators
198
199### Primary Generators
200
201| Generator | Library | Best For |
202|-----------|---------|----------|
203| p5-guide | p5.js | Custom simulations, physics, animations |
204| chartjs-guide | Chart.js | Bar, line, pie, doughnut, radar charts |
205| timeline-guide | vis-timeline | Chronological events, history, schedules |
206| map-guide | Leaflet.js | Geographic data, locations, routes |
207| vis-network-guide | vis-network | Network graphs, dependencies, concept maps |
208| mermaid-guide | Mermaid.js | Flowcharts, workflows, UML diagrams |
209| plotly-guide | Plotly.js | Mathematical function plots |
210| venn-guide | Custom | Set relationships (2-4 sets) |
211| bubble-guide | Chart.js | Priority matrices, multi-dimensional data |
212| causal-loop-guide | vis-network | Systems thinking, feedback loops |
213| comparison-table-guide | Custom | Side-by-side comparisons with ratings |
214| html-table | Custom | Matrix comparisons with clickable cells, detail panels |
215| celebration-guide | p5.js | Particle effects, visual feedback |
216
217### Shared Standards
218
219All MicroSims follow these standards regardless of generator:
220
221**Directory Structure:**
222```
223docs/sims/<microsim-name>/
224├── main.html # Main visualization file
225├── index.md # Documentation page
226├── *.js or *.css # Supporting files
227└── metadata.json # Dublin Core metadata (optional)
228```
229
230**URI Scheme for Discoverability:**
231
232All MicroSim HTML files MUST include this schema meta tag for global discoverability:
233
234```html
235<meta name="schema" content="https://dmccreary.github.io/intelligent-textbooks/ns/microsim/v1">
236```
237
238This enables counting and discovery of MicroSims across GitHub using code search. See the [URI Scheme documentation](https://dmccreary.github.io/intelligent-textbooks/uri-scheme/) for details.
239
240**Integration:**
241- Embedded via iframe in MkDocs pages
242- Width-responsive design
243- Non-scrolling iframe container
244- Standard height: drawHeight + controlHeight + 2px
245- **Iframe paths MUST always be relative, NEVER absolute:**
246 - From a sim's own `index.md`: `<iframe src="main.html" ...>`
247 - From chapter files (`docs/chapters/*/index.md`): `<iframe src="../../sims/[sim-name]/main.html" ...>`
248 - **NEVER use absolute paths** like `/sims/...` — they break on GitHub Pages where the site is served under a subdirectory (e.g., `/geometry-course/`)
249
250**Quality Checklist:**
251- [ ] Runs without errors in modern browsers
252- [ ] Responsive to container width
253- [ ] Controls respond immediately
254- [ ] Educational purpose is clear
255- [ ] Code is well-commented
256
257## Examples
258
259### Example 1: Timeline Request
260**User:** "Create a timeline showing key events in computer history"
261**Routing:** Keywords "timeline", "events", "history" → `references/timeline-guide.md`
262**Action:** Read timeline-guide.md and follow its workflow
263
264### Example 2: Chart Request
265**User:** "Make a bar chart comparing programming language popularity"
266**Routing:** Keywords "bar chart", "comparing" → `references/chartjs-guide.md`
267**Action:** Read chartjs-guide.md and follow its workflow
268
269### Example 3: Custom Simulation
270**User:** "Build an interactive bouncing ball simulation"
271**Routing:** Keywords "interactive", "bouncing", "simulation" → `references/p5-guide.md`
272**Action:** Read p5-guide.md and follow its workflow
273
274### Example 4: Ambiguous Request
275**User:** "Create a graph of our project dependencies"
276**Routing:** "graph" + "dependencies" suggests network → `references/vis-network-guide.md`
277**Action:** Read vis-network-guide.md (but clarify if user meant a chart)
278
279## Reference Files
280
281For detailed information, consult:
282
283- `references/routing-criteria.md` - Complete scoring methodology for all generators
284- `references/<generator>-guide.md` - Specific implementation guide for each generator
285- `assets/templates/` - Shared templates and patterns
286
287## Step 6: Auto-Standardization
288
289**IMPORTANT**: After creating the MicroSim files, automatically run standardization to ensure quality and documentation standards are met.
290
291### Why Auto-Standardize?
292
293- Eliminates manual follow-up work
294- Ensures consistent quality across all MicroSims
295- Adds metadata.json, lesson plans, and references automatically
296- Calculates and records quality_score in index.md
297
298### Standardization Process
299
300After the generator guide workflow completes (files created in `docs/sims/<microsim-name>/`):
301
3021. **Read the standardization guide**: Load `../microsim-utils/references/standardization.md`
3032. **Run the standardization checklist** on the newly created MicroSim directory
3043. **Implement all fixes automatically** (skip user confirmation since this is a new MicroSim)
3054. **Generate quality_score** and add to index.md frontmatter
306
307### What Standardization Adds
308
309The standardization process will add these elements if missing:
310
311- **metadata.json** - Dublin Core metadata for discoverability
312- **YAML frontmatter** - title, description, quality_score, image paths
313- **Iframe examples** - Copy-paste code for embedding
314- **Fullscreen button** - Link to view MicroSim fullscreen
315- **Lesson Plan section** - Learning objectives, activities, assessment
316- **References section** - Related resources and documentation
317
318### Workflow Integration
319
320```
321[User Request]
322 → [Route to Guide]
323 → [Generate MicroSim Files]
324 → [Auto-Standardize] ← NEW STEP
325 → [Update mkdocs.yml]
326 → [Done]
327```
328
329This eliminates the need to manually run `microsim-utils standardization` after every MicroSim creation.
330
331## mkdocs.yml Integration
332
333After creating and standardizing a MicroSim, update the site navigation.
334
335For **single MicroSims**, add manually to mkdocs.yml:
336
337```yaml
338nav:
339 - MicroSims:
340 - List of MicroSims: sims/index.md
341 - Existing Sim: sims/existing-sim/index.md
342 - New MicroSim: sims/new-microsim-name/index.md # Add here
343```
344
345For **batch operations**, use the `update-mkdocs-nav.py` utility instead:
346
347```bash
348python3 src/microsim-utils/update-mkdocs-nav.py --project-dir /path/to/project
349```
350
351This scans `docs/sims/` and regenerates the entire MicroSims nav section alphabetically. It is idempotent and safe to run multiple times.
352
353## Batch Generation Utilities
354
355When generating MicroSims for multiple chapters, these Python utilities in
356`src/microsim-utils/` eliminate ~430K tokens of repetitive work per batch run:
357
358| Utility | Purpose | Savings |
359|---------|---------|---------|
360| `extract-sim-specs.py` | Parse specs from chapter `#### Diagram:` headers | ~80K tokens |
361| `generate-sim-scaffold.py` | Create main.html, index.md, metadata.json | ~150K tokens |
362| `update-mkdocs-nav.py` | Regenerate MicroSims nav in mkdocs.yml | ~100K tokens |
363| `add-iframes-to-chapter.py` | Insert missing iframes, fix heights/paths | ~50K tokens |
364| `validate-sims.py` | 100-point quality rubric scoring | ~50K tokens |
365
366### Batch Workflow
367
368```bash
369# 1. Extract all diagram/drawing specs from chapters
370python3 src/microsim-utils/extract-sim-specs.py \
371 --project-dir $PROJECT --output /tmp/specs.json \
372 --status-file docs/sims/sim-status.json --verbose
373
374# 2. Scaffold unbuilt sims (main.html, index.md, metadata.json)
375python3 src/microsim-utils/generate-sim-scaffold.py \
376 --spec-file /tmp/specs.json --project-dir $PROJECT --verbose
377
378# 3. Agent implements .js files (this is where the creative work happens)
379
380# 4. Insert iframes into chapter markdown
381python3 src/microsim-utils/add-iframes-to-chapter.py \
382 --all --project-dir $PROJECT --fix-heights --fix-paths
383
384# 5. Update mkdocs.yml navigation
385python3 src/microsim-utils/update-mkdocs-nav.py --project-dir $PROJECT
386
387# 6. Validate quality scores
388python3 src/microsim-utils/validate-sims.py --project-dir $PROJECT
389```
390
391### sim-status.json Integration
392
393The `extract-sim-specs.py --status-file` flag generates a lifecycle tracking
394file. After a context window fills during batch generation, a new session can
395read `sim-status.json` to resume where it left off:
396
397- **specified** — has spec in chapter but no sim directory yet
398- **scaffolded** — directory with main.html/index.md but no substantive JS
399- **implemented** — JS file exists and >50 lines
400- **validated** — quality_score >= 70
401- **deployed** — validated + iframe present in chapter
402
403See `src/microsim-utils/README.md` for full documentation.