Technical Presentation & Article Generator
Generate Reveal.js HTML presentations and Markdown technical deep-dive articles from complex technical projects or papers. All content in Chinese by default.
Core Principles
- Logic First: Establish overall architecture before diving into details. No fragmented info dumps.
- Visualization Driven: Use diagrams (Mermaid, architecture charts) over plain text whenever possible.
- Code-Theory Alignment: Every formula/diagram must map to concrete code implementation.
- Deep Dive via "What-Why-How-Code": For each core component, follow the 5-step pattern: Concept → Motivation → Mechanism → Code → Comparison.
- User Friendly: Leverage HTML/JS features for code highlighting, speaker notes, and interactivity.
Workflow: HTML Presentation Generation
Step 1: Analyze Source Material
Read the project/paper thoroughly. Collect:
- Model configs (yaml/json) for precise parameters
- Core model code for architecture details and tensor shapes
- Training code for loss design
- Inference code for inference flow
- README / paper for high-level overview
All technical details (parameter values, shapes, formulas) must come from source code, not guesswork.
Step 2: Plan Content Structure
Organize slides into these modules:
- Cover & Context — Title, pain points, one-line innovation summary
- High-Level Architecture — System overview, data flow, module interactions
- Core Component Deep Dives (~50%+ of slides) — Detailed breakdown per module
- Training & Inference Pipelines (AI model/algorithm only) — See Step 4.5 below
- Performance & Optimization — Experiments, speedup strategies, latency
- Summary & Future Work — Contributions, open problems
Step 3: Generate Single-File HTML
Produce a self-contained HTML file using Reveal.js via CDN. Must include:
- MathJax/KaTeX for LaTeX formulas
- highlight.js for code syntax highlighting
- Mermaid.js for diagrams (with manual rendering fix)
- Speaker notes (
<aside class="notes">) on every slide — conversational style, explain "why" not "what"
Reveal.js Config (mandatory):
Reveal.initialize({
width: 1920,
height: 960, // 2:1 aspect ratio for widescreen
margin: 0.1,
minScale: 0.2,
maxScale: 1.5,
center: true,
});
Centering CSS (mandatory):
.reveal .slides { text-align: center; }
.reveal .slides section {
display: flex; flex-direction: column;
justify-content: center; align-items: center;
width: 100%; height: 100%;
padding: 20px 40px; box-sizing: border-box;
}
.grid-2, .grid-3 { max-width: 1700px; width: 100%; }
.reveal .slides section > * { max-width: 100%; box-sizing: border-box; }
Step 4: Apply Deep Dive Pattern for Each Core Component
For every core module, follow this 5-step structure:
- What: Definition, input/output
- Why: Design motivation, what problem does it solve
- How: Algorithm flowchart, core formulas (MathJax), shape flow (e.g.,
(B,C,T) → (B,2C,1))
- Code: Key code snippet with line-level comments and highlighting
- Comparison: Table comparing old vs new approach
Step 4.5: Training vs Inference Split (AI Model/Algorithm Projects)
When the project involves an AI model or algorithm, the training and inference pipelines MUST be presented as separate, clearly distinguished sections. Do NOT merge them into a single "model overview" slide.
Detection Criteria
If the source material contains ANY of the following, apply this step:
- Training scripts (train.py, trainer.py, fit(), loss functions)
- Inference scripts (infer.py, predict.py, generate())
- Distinct training-only components (data augmentation, loss design, learning rate schedule, gradient accumulation)
- Distinct inference-only components (beam search, sampling strategy, post-processing, quantization, TensorRT)
- Model behavior differences between training and inference (e.g., dropout, batch norm, teacher forcing vs autoregressive)
Required Slide Structure
Slide Group A: Training Pipeline (2-4 slides)
- Training Architecture Overview — Training-specific data flow diagram showing: Dataset → Preprocessing → Model (train mode) → Loss → Optimizer → Update
- Training Core Details — Loss function design (formulas + code), optimizer config, LR schedule, regularization strategies
- Training Data Flow — Shape transformations specific to training (include batch dimension, label handling)
- Training Tricks & Optimization (optional) — Mixed precision, gradient accumulation, distributed training, curriculum learning
Slide Group B: Inference Pipeline (2-4 slides)
- Inference Architecture Overview — Inference-specific data flow diagram showing: Input → Preprocessing → Model (eval mode) → Post-processing → Output
- Inference Core Details — Decoding strategy (greedy/beam/sampling), post-processing, confidence thresholds
- Inference Data Flow — Shape transformations specific to inference (note differences from training: no labels, potentially different batch handling)
- Inference Optimization (optional) — Quantization, pruning, caching (KV-cache), batching strategies, latency benchmarks
Slide Group C: Training vs Inference Comparison (1 slide)
Must include a comparison table:
| Aspect |
Training |
Inference |
| Mode |
model.train() |
model.eval() |
| Data |
Labeled dataset + augmentation |
Raw input only |
| Dropout/BN |
Active / running stats update |
Disabled / frozen stats |
| Output |
Loss value |
Predictions |
| Batch Size |
Large (throughput) |
Small/1 (latency) |
| Key Metric |
Training loss, validation accuracy |
Latency, throughput, quality |
| Unique Components |
Loss fn, optimizer, scheduler |
Decoder, post-processor, cache |
Visual Differentiation
- Use distinct color schemes: Training slides use 🔵 blue tones (
#e3f2fd, #1976d2), Inference slides use 🟢 green tones (#e8f5e9, #388e3c)
- Use labeled section headers: "🏋️ Training Pipeline" and "🚀 Inference Pipeline"
- Mermaid/flowchart diagrams for training and inference should be separate diagrams, not a single combined one
- Highlight components that only exist in one phase (e.g., loss function is training-only; beam search is inference-only)
Step 5: Quality Checklist
Before delivering, verify:
Workflow: Markdown Technical Article
Follow the article structure template in references/article-template.md.
Key principles:
- Table-driven: Use tables for parameter comparisons, model comparisons, shape references
- Code as documentation: Every core module needs code snippet + line comments
- Formula-code alignment: LaTeX symbols must match code variable names
- "Why" over "What": Explain design motivation for every decision
Workflow: Matplotlib Architecture Diagrams
See references/matplotlib-guide.md for the complete matplotlib diagram generation methodology.
Critical rules:
FancyBboxPatch pad must be proportional: min(w, h) * 0.15
- Line height based on box height:
h * 0.75 / n_lines
- Long-distance connections use polylines, not arcs
- Never use
set_aspect('equal')
- macOS fonts:
Arial Unicode MS > Heiti TC > STHeiti
- No emoji in matplotlib (not supported)
Common Pitfalls Quick Reference
| Issue |
Root Cause |
Fix |
| Slide content overflow |
Too much content per slide |
Use scrollable containers or split slides |
| Content off-center |
Missing Flexbox centering CSS |
Apply mandatory centering CSS above |
| Mermaid not rendering on hidden slides |
startOnLoad: true only renders visible |
Set startOnLoad: false, manual render on ready + slidechanged |
| Vertical flowchart overflow |
Too many nodes in HTML/CSS flowchart |
Compress gap/padding/font-size, see references/revealjs-fixes.md |
| Matplotlib boxes distorted |
pad in data coordinates, not pixels |
Use proportional pad calculation |
| Chinese not showing in matplotlib |
Wrong font |
Use Arial Unicode MS / Heiti TC |
| Training/Inference merged into one slide |
AI model specifics lost |
Split into separate slide groups with distinct color themes (blue=train, green=infer) |
Prompt Template
For generating presentations with maximum quality, see references/prompt-template.md for a proven C.R.I.S.P principle prompt.
Slide Template
See assets/slide-template.html for a starter HTML template with all required configs pre-set.
1---
2name: presentation-generator
3description: "Generate high-quality technical HTML presentations (Reveal.js) and Markdown technical deep-dive articles from projects or papers. Covers architecture diagrams, code walkthroughs, math formulas, and speaker notes. Use when users say: 'make a presentation', 'create slides', 'generate HTML slides', 'technical presentation', 'paper presentation', 'Reveal.js slides', 'write a technical deep-dive article', 'create tech blog from code', 'generate architecture diagrams with matplotlib'. Triggers on requests to: (1) Convert a project/paper into an HTML slide deck, (2) Write a Markdown technical analysis article, (3) Generate matplotlib architecture diagrams for documentation."
4metadata:
5 source: https://skillmd.com/skills/modbender/presentation-generator
6---
7
8# Technical Presentation & Article Generator
9
10Generate Reveal.js HTML presentations and Markdown technical deep-dive articles from complex technical projects or papers. All content in Chinese by default.
11
12## Core Principles
13
14- **Logic First**: Establish overall architecture before diving into details. No fragmented info dumps.
15- **Visualization Driven**: Use diagrams (Mermaid, architecture charts) over plain text whenever possible.
16- **Code-Theory Alignment**: Every formula/diagram must map to concrete code implementation.
17- **Deep Dive via "What-Why-How-Code"**: For each core component, follow the 5-step pattern: Concept → Motivation → Mechanism → Code → Comparison.
18- **User Friendly**: Leverage HTML/JS features for code highlighting, speaker notes, and interactivity.
19
20## Workflow: HTML Presentation Generation
21
22### Step 1: Analyze Source Material
23
24Read the project/paper thoroughly. Collect:
25- Model configs (yaml/json) for precise parameters
26- Core model code for architecture details and tensor shapes
27- Training code for loss design
28- Inference code for inference flow
29- README / paper for high-level overview
30
31**All technical details (parameter values, shapes, formulas) must come from source code, not guesswork.**
32
33### Step 2: Plan Content Structure
34
35Organize slides into these modules:
36
371. **Cover & Context** — Title, pain points, one-line innovation summary
382. **High-Level Architecture** — System overview, data flow, module interactions
393. **Core Component Deep Dives** (~50%+ of slides) — Detailed breakdown per module
404. **Training & Inference Pipelines** (AI model/algorithm only) — See Step 4.5 below
415. **Performance & Optimization** — Experiments, speedup strategies, latency
426. **Summary & Future Work** — Contributions, open problems
43
44### Step 3: Generate Single-File HTML
45
46Produce a self-contained HTML file using Reveal.js via CDN. Must include:
47- MathJax/KaTeX for LaTeX formulas
48- highlight.js for code syntax highlighting
49- Mermaid.js for diagrams (with manual rendering fix)
50- Speaker notes (`<aside class="notes">`) on every slide — conversational style, explain "why" not "what"
51
52**Reveal.js Config (mandatory):**
53```javascript
54Reveal.initialize({
55 width: 1920,
56 height: 960, // 2:1 aspect ratio for widescreen
57 margin: 0.1,
58 minScale: 0.2,
59 maxScale: 1.5,
60 center: true,
61});
62```
63
64**Centering CSS (mandatory):**
65```css
66.reveal .slides { text-align: center; }
67.reveal .slides section {
68 display: flex; flex-direction: column;
69 justify-content: center; align-items: center;
70 width: 100%; height: 100%;
71 padding: 20px 40px; box-sizing: border-box;
72}
73.grid-2, .grid-3 { max-width: 1700px; width: 100%; }
74.reveal .slides section > * { max-width: 100%; box-sizing: border-box; }
75```
76
77### Step 4: Apply Deep Dive Pattern for Each Core Component
78
79For every core module, follow this 5-step structure:
80
811. **What**: Definition, input/output
822. **Why**: Design motivation, what problem does it solve
833. **How**: Algorithm flowchart, core formulas (MathJax), shape flow (e.g., `(B,C,T) → (B,2C,1)`)
844. **Code**: Key code snippet with line-level comments and highlighting
855. **Comparison**: Table comparing old vs new approach
86
87### Step 4.5: Training vs Inference Split (AI Model/Algorithm Projects)
88
89**When the project involves an AI model or algorithm, the training and inference pipelines MUST be presented as separate, clearly distinguished sections.** Do NOT merge them into a single "model overview" slide.
90
91#### Detection Criteria
92If the source material contains ANY of the following, apply this step:
93- Training scripts (train.py, trainer.py, fit(), loss functions)
94- Inference scripts (infer.py, predict.py, generate())
95- Distinct training-only components (data augmentation, loss design, learning rate schedule, gradient accumulation)
96- Distinct inference-only components (beam search, sampling strategy, post-processing, quantization, TensorRT)
97- Model behavior differences between training and inference (e.g., dropout, batch norm, teacher forcing vs autoregressive)
98
99#### Required Slide Structure
100
101**Slide Group A: Training Pipeline (2-4 slides)**
1021. **Training Architecture Overview** — Training-specific data flow diagram showing: Dataset → Preprocessing → Model (train mode) → Loss → Optimizer → Update
1032. **Training Core Details** — Loss function design (formulas + code), optimizer config, LR schedule, regularization strategies
1043. **Training Data Flow** — Shape transformations specific to training (include batch dimension, label handling)
1054. **Training Tricks & Optimization** (optional) — Mixed precision, gradient accumulation, distributed training, curriculum learning
106
107**Slide Group B: Inference Pipeline (2-4 slides)**
1081. **Inference Architecture Overview** — Inference-specific data flow diagram showing: Input → Preprocessing → Model (eval mode) → Post-processing → Output
1092. **Inference Core Details** — Decoding strategy (greedy/beam/sampling), post-processing, confidence thresholds
1103. **Inference Data Flow** — Shape transformations specific to inference (note differences from training: no labels, potentially different batch handling)
1114. **Inference Optimization** (optional) — Quantization, pruning, caching (KV-cache), batching strategies, latency benchmarks
112
113**Slide Group C: Training vs Inference Comparison (1 slide)**
114
115Must include a comparison table:
116
117| Aspect | Training | Inference |
118|--------|----------|----------|
119| Mode | `model.train()` | `model.eval()` |
120| Data | Labeled dataset + augmentation | Raw input only |
121| Dropout/BN | Active / running stats update | Disabled / frozen stats |
122| Output | Loss value | Predictions |
123| Batch Size | Large (throughput) | Small/1 (latency) |
124| Key Metric | Training loss, validation accuracy | Latency, throughput, quality |
125| Unique Components | Loss fn, optimizer, scheduler | Decoder, post-processor, cache |
126
127#### Visual Differentiation
128- Use **distinct color schemes**: Training slides use 🔵 blue tones (`#e3f2fd`, `#1976d2`), Inference slides use 🟢 green tones (`#e8f5e9`, `#388e3c`)
129- Use **labeled section headers**: "🏋️ Training Pipeline" and "🚀 Inference Pipeline"
130- Mermaid/flowchart diagrams for training and inference should be **separate diagrams**, not a single combined one
131- Highlight components that **only exist in one phase** (e.g., loss function is training-only; beam search is inference-only)
132
133### Step 5: Quality Checklist
134
135Before delivering, verify:
136- [ ] Every slide fits within viewport (no overflow/truncation)
137- [ ] Font sizes appropriate (code not too small)
138- [ ] Every "Why" is explained, not just "What"
139- [ ] Core components have code correspondence
140- [ ] Shape transformations clearly annotated
141- [ ] Complex formulas have intuitive explanations
142- [ ] All user-raised questions are addressed
143- [ ] (AI model projects) Training and inference pipelines are presented separately with distinct visual styles
144- [ ] (AI model projects) Training-only and inference-only components are clearly marked
145- [ ] (AI model projects) A Training vs Inference comparison table is included
146
147## Workflow: Markdown Technical Article
148
149Follow the article structure template in [references/article-template.md](references/article-template.md).
150
151Key principles:
152- **Table-driven**: Use tables for parameter comparisons, model comparisons, shape references
153- **Code as documentation**: Every core module needs code snippet + line comments
154- **Formula-code alignment**: LaTeX symbols must match code variable names
155- **"Why" over "What"**: Explain design motivation for every decision
156
157## Workflow: Matplotlib Architecture Diagrams
158
159See [references/matplotlib-guide.md](references/matplotlib-guide.md) for the complete matplotlib diagram generation methodology.
160
161Critical rules:
162- `FancyBboxPatch` pad must be proportional: `min(w, h) * 0.15`
163- Line height based on box height: `h * 0.75 / n_lines`
164- Long-distance connections use polylines, not arcs
165- Never use `set_aspect('equal')`
166- macOS fonts: `Arial Unicode MS` > `Heiti TC` > `STHeiti`
167- No emoji in matplotlib (not supported)
168
169## Common Pitfalls Quick Reference
170
171| Issue | Root Cause | Fix |
172|-------|-----------|-----|
173| Slide content overflow | Too much content per slide | Use scrollable containers or split slides |
174| Content off-center | Missing Flexbox centering CSS | Apply mandatory centering CSS above |
175| Mermaid not rendering on hidden slides | `startOnLoad: true` only renders visible | Set `startOnLoad: false`, manual render on `ready` + `slidechanged` |
176| Vertical flowchart overflow | Too many nodes in HTML/CSS flowchart | Compress gap/padding/font-size, see [references/revealjs-fixes.md](references/revealjs-fixes.md) |
177| Matplotlib boxes distorted | `pad` in data coordinates, not pixels | Use proportional pad calculation |
178| Chinese not showing in matplotlib | Wrong font | Use `Arial Unicode MS` / `Heiti TC` |
179| Training/Inference merged into one slide | AI model specifics lost | Split into separate slide groups with distinct color themes (blue=train, green=infer) |
180
181## Prompt Template
182
183For generating presentations with maximum quality, see [references/prompt-template.md](references/prompt-template.md) for a proven C.R.I.S.P principle prompt.
184
185## Slide Template
186
187See [assets/slide-template.html](assets/slide-template.html) for a starter HTML template with all required configs pre-set.