claude-presentation-master 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +763 -0
- package/assets/presentation-engine.css +3057 -0
- package/assets/presentation-knowledge.yaml +6312 -0
- package/bin/cli.js +445 -0
- package/dist/index.d.mts +1209 -0
- package/dist/index.d.ts +1209 -0
- package/dist/index.js +4204 -0
- package/dist/index.mjs +4142 -0
- package/package.json +99 -0
package/README.md
ADDED
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
# Claude Presentation Master
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
**Generate world-class presentations using expert methodologies from the world's best presentation coaches.**
|
|
11
|
+
|
|
12
|
+
[Installation](#installation) •
|
|
13
|
+
[Quick Start](#quick-start) •
|
|
14
|
+
[Documentation](#documentation) •
|
|
15
|
+
[Examples](#examples) •
|
|
16
|
+
[API Reference](#api-reference)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## What is Claude Presentation Master?
|
|
23
|
+
|
|
24
|
+
Claude Presentation Master is a TypeScript/Node.js library that transforms your content into professionally designed presentations. Unlike simple slide generators, it applies proven methodologies from world-renowned presentation experts:
|
|
25
|
+
|
|
26
|
+
- **Nancy Duarte** (Slide:ology, Resonate) - Sparkline narrative structure, STAR moments
|
|
27
|
+
- **Garr Reynolds** (Presentation Zen) - Signal-to-noise ratio, visual simplicity
|
|
28
|
+
- **Carmine Gallo** (Talk Like TED) - Rule of Three, emotional connection
|
|
29
|
+
- **Chris Anderson** (TED Talks) - One powerful idea per presentation
|
|
30
|
+
- **Barbara Minto** (McKinsey) - Pyramid Principle, SCQA structure
|
|
31
|
+
|
|
32
|
+
The library enforces quality through **real visual validation** using Playwright, ensuring your presentations meet a 95/100 minimum quality score before they're considered complete.
|
|
33
|
+
|
|
34
|
+
### Key Differentiators
|
|
35
|
+
|
|
36
|
+
| Feature | Other Tools | Claude Presentation Master |
|
|
37
|
+
|---------|-------------|---------------------------|
|
|
38
|
+
| Quality Control | None or basic linting | Real visual QA with Playwright screenshots |
|
|
39
|
+
| Expert Methods | Generic templates | 40+ expert methodologies encoded |
|
|
40
|
+
| Word Limits | User must count | Automatically enforced per mode |
|
|
41
|
+
| Layout Validation | None | Whitespace %, balance, contrast measured |
|
|
42
|
+
| Accessibility | Often ignored | WCAG AA compliance built-in |
|
|
43
|
+
| API Dependency | Usually required | **Works 100% offline** |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# npm
|
|
51
|
+
npm install claude-presentation-master
|
|
52
|
+
|
|
53
|
+
# yarn
|
|
54
|
+
yarn add claude-presentation-master
|
|
55
|
+
|
|
56
|
+
# pnpm
|
|
57
|
+
pnpm add claude-presentation-master
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Post-Installation
|
|
61
|
+
|
|
62
|
+
The first time you run visual QA, Playwright will download browser binaries:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx playwright install chromium
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
### Option 1: CLI (Command Line)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Generate a keynote-style presentation
|
|
76
|
+
cpm generate my-content.md --mode keynote --format html,pptx
|
|
77
|
+
|
|
78
|
+
# Validate an existing presentation
|
|
79
|
+
cpm validate presentation.html --mode keynote
|
|
80
|
+
|
|
81
|
+
# See all options
|
|
82
|
+
cpm --help
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Option 2: Programmatic API
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { generate } from 'claude-presentation-master';
|
|
89
|
+
import { writeFileSync } from 'fs';
|
|
90
|
+
|
|
91
|
+
const result = await generate({
|
|
92
|
+
content: `
|
|
93
|
+
# Revolutionizing Customer Experience
|
|
94
|
+
|
|
95
|
+
## The Problem
|
|
96
|
+
Today's customers expect instant, personalized service.
|
|
97
|
+
Yet 73% report frustration with current support systems.
|
|
98
|
+
|
|
99
|
+
## Our Solution
|
|
100
|
+
AI-powered support that understands context and delivers
|
|
101
|
+
human-quality responses in seconds, not hours.
|
|
102
|
+
|
|
103
|
+
## The Results
|
|
104
|
+
- 90% faster resolution times
|
|
105
|
+
- 4.8/5 customer satisfaction
|
|
106
|
+
- 60% cost reduction
|
|
107
|
+
|
|
108
|
+
## Next Steps
|
|
109
|
+
Join our pilot program and transform your customer experience.
|
|
110
|
+
`,
|
|
111
|
+
contentType: 'markdown',
|
|
112
|
+
mode: 'keynote',
|
|
113
|
+
format: ['html', 'pptx'],
|
|
114
|
+
title: 'Customer Experience Revolution',
|
|
115
|
+
author: 'Your Name',
|
|
116
|
+
qaThreshold: 95
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Check the quality score
|
|
120
|
+
console.log(`Quality Score: ${result.score}/100`);
|
|
121
|
+
console.log(`Slide Count: ${result.metadata.slideCount}`);
|
|
122
|
+
console.log(`Frameworks Applied: ${result.metadata.frameworks.join(', ')}`);
|
|
123
|
+
|
|
124
|
+
// Save the outputs
|
|
125
|
+
if (result.outputs.html) {
|
|
126
|
+
writeFileSync('presentation.html', result.outputs.html);
|
|
127
|
+
}
|
|
128
|
+
if (result.outputs.pptx) {
|
|
129
|
+
writeFileSync('presentation.pptx', result.outputs.pptx);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## How It Works
|
|
136
|
+
|
|
137
|
+
### The Pipeline
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
141
|
+
│ YOUR CONTENT (Markdown/JSON/YAML) │
|
|
142
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
143
|
+
│
|
|
144
|
+
▼
|
|
145
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
146
|
+
│ 1. CONTENT ANALYSIS │
|
|
147
|
+
│ • Extract SCQA structure (Situation, Complication, Question, │
|
|
148
|
+
│ Answer) using Barbara Minto's Pyramid Principle │
|
|
149
|
+
│ • Identify Sparkline narrative arc (What Is vs What Could Be) │
|
|
150
|
+
│ • Find STAR moments (Something They'll Always Remember) │
|
|
151
|
+
│ • Extract key messages (max 3 - Rule of Three) │
|
|
152
|
+
│ • Generate action titles (McKinsey style) │
|
|
153
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
154
|
+
│
|
|
155
|
+
▼
|
|
156
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
157
|
+
│ 2. SLIDE GENERATION │
|
|
158
|
+
│ • Select appropriate slide types based on content │
|
|
159
|
+
│ • Apply mode constraints (keynote: 6-25 words, business: 40-80)│
|
|
160
|
+
│ • Structure narrative flow with proper pacing │
|
|
161
|
+
│ • Add section dividers, transitions, and closing │
|
|
162
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
163
|
+
│
|
|
164
|
+
▼
|
|
165
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
166
|
+
│ 3. OUTPUT GENERATION │
|
|
167
|
+
│ • HTML: Reveal.js with animations, Chart.js, Mermaid │
|
|
168
|
+
│ • PPTX: PptxGenJS with proper positioning and styling │
|
|
169
|
+
│ • Apply theme colors, typography, and visual hierarchy │
|
|
170
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
171
|
+
│
|
|
172
|
+
▼
|
|
173
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
174
|
+
│ 4. QA VALIDATION │
|
|
175
|
+
│ • Screenshot each slide with Playwright │
|
|
176
|
+
│ • Calculate whitespace percentage (target: 35%+ keynote) │
|
|
177
|
+
│ • Measure layout balance (center of mass analysis) │
|
|
178
|
+
│ • Check contrast ratios (WCAG 4.5:1 minimum) │
|
|
179
|
+
│ • Validate expert principle compliance │
|
|
180
|
+
│ • Generate 0-100 score with detailed breakdown │
|
|
181
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
182
|
+
│
|
|
183
|
+
▼
|
|
184
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
185
|
+
│ 5. THRESHOLD ENFORCEMENT │
|
|
186
|
+
│ • Score >= 95: ✅ Return presentation │
|
|
187
|
+
│ • Score < 95: ❌ Throw QAFailureError with improvement list │
|
|
188
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### The Knowledge Base
|
|
192
|
+
|
|
193
|
+
The package includes a 6,300+ line knowledge base (`presentation-knowledge.yaml`) containing:
|
|
194
|
+
|
|
195
|
+
- **40+ Expert Methodologies**: Encoded principles from presentation masters
|
|
196
|
+
- **Framework Selector**: Automatically chooses the best framework for your audience
|
|
197
|
+
- **Slide Type Definitions**: 20+ slide types with constraints and templates
|
|
198
|
+
- **QA Scoring Rubric**: Detailed validation rules with point values
|
|
199
|
+
- **Mode Configurations**: Keynote vs Business rules and limits
|
|
200
|
+
|
|
201
|
+
This knowledge base powers every decision the engine makes, ensuring expert-level quality without requiring AI API calls.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Presentation Modes
|
|
206
|
+
|
|
207
|
+
### Keynote Mode
|
|
208
|
+
|
|
209
|
+
Optimized for **high-impact presentations** like TED talks, product launches, and keynotes.
|
|
210
|
+
|
|
211
|
+
| Constraint | Value |
|
|
212
|
+
|------------|-------|
|
|
213
|
+
| Words per slide | 6-25 maximum |
|
|
214
|
+
| Whitespace | 35%+ of slide area |
|
|
215
|
+
| Ideas per slide | Exactly 1 |
|
|
216
|
+
| Bullet points | Avoided (use single statements) |
|
|
217
|
+
| Reading time | < 3 seconds per slide |
|
|
218
|
+
|
|
219
|
+
**Best for**: Conferences, product launches, investor pitches, inspirational talks
|
|
220
|
+
|
|
221
|
+
### Business Mode
|
|
222
|
+
|
|
223
|
+
Optimized for **information-rich presentations** like board meetings, strategy reviews, and training.
|
|
224
|
+
|
|
225
|
+
| Constraint | Value |
|
|
226
|
+
|------------|-------|
|
|
227
|
+
| Words per slide | 40-80 |
|
|
228
|
+
| Whitespace | 25%+ of slide area |
|
|
229
|
+
| Ideas per slide | 1-2 maximum |
|
|
230
|
+
| Bullet points | Up to 5 per slide |
|
|
231
|
+
| Data density | Medium to high |
|
|
232
|
+
|
|
233
|
+
**Best for**: Board meetings, quarterly reviews, training sessions, documentation
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Slide Types
|
|
238
|
+
|
|
239
|
+
### Universal Slides (Both Modes)
|
|
240
|
+
|
|
241
|
+
| Type | Description | Use Case |
|
|
242
|
+
|------|-------------|----------|
|
|
243
|
+
| `title` | Opening slide with title and subtitle | Always first |
|
|
244
|
+
| `section-divider` | Section break with dark background | Between major sections |
|
|
245
|
+
| `quote` | Blockquote with attribution | Expert quotes, testimonials |
|
|
246
|
+
| `big-number` | Large statistic with context | Dramatic data points |
|
|
247
|
+
| `cta` | Call to action | Near the end |
|
|
248
|
+
| `thank-you` | Closing slide | Always last |
|
|
249
|
+
|
|
250
|
+
### Keynote-Specific Slides
|
|
251
|
+
|
|
252
|
+
| Type | Description | Use Case |
|
|
253
|
+
|------|-------------|----------|
|
|
254
|
+
| `big-idea` | Single powerful statement, large text | Core message delivery |
|
|
255
|
+
| `single-statement` | One sentence, centered | Key points |
|
|
256
|
+
| `full-image` | Full-bleed image with text overlay | Emotional impact |
|
|
257
|
+
|
|
258
|
+
### Business-Specific Slides
|
|
259
|
+
|
|
260
|
+
| Type | Description | Use Case |
|
|
261
|
+
|------|-------------|----------|
|
|
262
|
+
| `agenda` | Numbered list of topics | After title slide |
|
|
263
|
+
| `bullet-points` | Title with bullet list | Detailed information |
|
|
264
|
+
| `two-column` | Split layout (text + image/data) | Comparison, illustration |
|
|
265
|
+
| `three-column` | Three equal columns | Feature comparison |
|
|
266
|
+
| `comparison` | Side-by-side with divider | Before/after, pros/cons |
|
|
267
|
+
| `timeline` | Chronological events | History, roadmap |
|
|
268
|
+
| `process` | Step-by-step flow with arrows | Workflows, procedures |
|
|
269
|
+
| `metrics-grid` | KPI dashboard layout | Performance data |
|
|
270
|
+
| `screenshot` | Product screenshot with caption | Demo, walkthrough |
|
|
271
|
+
| `screenshot-left` | Screenshot on left, text on right | Feature explanation |
|
|
272
|
+
| `screenshot-right` | Text on left, screenshot on right | Feature explanation |
|
|
273
|
+
| `social-proof` | Customer testimonials | Trust building |
|
|
274
|
+
| `case-study` | Challenge/Solution/Results | Customer success |
|
|
275
|
+
| `pricing` | Pricing table | Sales presentations |
|
|
276
|
+
| `team` | Team member grid | About us |
|
|
277
|
+
| `features` | Feature list with icons | Product overview |
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Themes
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
type ThemeName =
|
|
285
|
+
| 'default' // Clean, professional
|
|
286
|
+
| 'light-corporate' // Traditional business
|
|
287
|
+
| 'modern-tech' // Contemporary tech look
|
|
288
|
+
| 'minimal' // Maximum whitespace, B&W
|
|
289
|
+
| 'warm' // Earthy, approachable
|
|
290
|
+
| 'creative'; // Bold, artistic
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Theme Preview
|
|
294
|
+
|
|
295
|
+
| Theme | Primary | Accent | Best For |
|
|
296
|
+
|-------|---------|--------|----------|
|
|
297
|
+
| `default` | Dark navy | Coral red | General use |
|
|
298
|
+
| `light-corporate` | Slate blue | Ocean blue | Enterprise, finance |
|
|
299
|
+
| `modern-tech` | Deep navy | Electric pink | Startups, tech |
|
|
300
|
+
| `minimal` | Pure black | Black | Design, luxury |
|
|
301
|
+
| `warm` | Brown | Orange | Food, hospitality |
|
|
302
|
+
| `creative` | Purple | Pink | Marketing, design |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## QA Scoring System
|
|
307
|
+
|
|
308
|
+
Every presentation is validated against a 100-point rubric:
|
|
309
|
+
|
|
310
|
+
### Score Breakdown
|
|
311
|
+
|
|
312
|
+
| Category | Weight | What's Checked |
|
|
313
|
+
|----------|--------|----------------|
|
|
314
|
+
| **Visual Quality** | 35% | Whitespace %, layout balance, contrast ratio, font count, color count |
|
|
315
|
+
| **Content Quality** | 30% | Word limits, action titles, glance test, signal-to-noise, one idea rule |
|
|
316
|
+
| **Expert Compliance** | 25% | Duarte, Reynolds, Gallo, Anderson principles |
|
|
317
|
+
| **Accessibility** | 10% | WCAG level, contrast issues, font sizes, color-blind safety |
|
|
318
|
+
|
|
319
|
+
### Grading Scale
|
|
320
|
+
|
|
321
|
+
| Score | Grade | Status |
|
|
322
|
+
|-------|-------|--------|
|
|
323
|
+
| 95-100 | A+ | ✅ Excellent - Ready to present |
|
|
324
|
+
| 90-94 | A | ⚠️ Good - Minor improvements suggested |
|
|
325
|
+
| 85-89 | A- | ⚠️ Acceptable - Several issues to address |
|
|
326
|
+
| 80-84 | B+ | ❌ Below standard - Significant issues |
|
|
327
|
+
| < 80 | B or lower | ❌ Fails - Major redesign needed |
|
|
328
|
+
|
|
329
|
+
### Threshold Enforcement
|
|
330
|
+
|
|
331
|
+
By default, the library **rejects presentations scoring below 95**:
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
try {
|
|
335
|
+
const result = await generate(config);
|
|
336
|
+
} catch (error) {
|
|
337
|
+
if (error instanceof QAFailureError) {
|
|
338
|
+
console.log(`Score: ${error.score}/100`);
|
|
339
|
+
console.log(`Threshold: ${error.threshold}`);
|
|
340
|
+
console.log('Issues to fix:');
|
|
341
|
+
error.getIssues().forEach(issue => console.log(` - ${issue}`));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
You can lower the threshold (not recommended):
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
const result = await generate({
|
|
350
|
+
...config,
|
|
351
|
+
qaThreshold: 80 // Accept lower quality (NOT RECOMMENDED)
|
|
352
|
+
});
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Media Providers
|
|
358
|
+
|
|
359
|
+
All media features work **without API keys**.
|
|
360
|
+
|
|
361
|
+
### Images
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
import { createDefaultImageProvider } from 'claude-presentation-master';
|
|
365
|
+
|
|
366
|
+
// Default: Uses placeholder images (picsum.photos)
|
|
367
|
+
const provider = createDefaultImageProvider();
|
|
368
|
+
|
|
369
|
+
// With local images
|
|
370
|
+
const provider = createDefaultImageProvider({
|
|
371
|
+
localImages: {
|
|
372
|
+
'team-photo': './images/team.jpg',
|
|
373
|
+
'product-screenshot': './images/product.png',
|
|
374
|
+
'logo': './images/logo.svg'
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// With Unsplash (optional API key for better rate limits)
|
|
379
|
+
const provider = createDefaultImageProvider({
|
|
380
|
+
unsplashKey: process.env.UNSPLASH_ACCESS_KEY // Optional
|
|
381
|
+
});
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Image Provider Priority:**
|
|
385
|
+
1. Local images (exact match)
|
|
386
|
+
2. Unsplash API (if key provided)
|
|
387
|
+
3. Unsplash Source (no key needed)
|
|
388
|
+
4. Placeholder (always works)
|
|
389
|
+
|
|
390
|
+
### Charts
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
import { createDefaultChartProvider } from 'claude-presentation-master';
|
|
394
|
+
|
|
395
|
+
const chartProvider = createDefaultChartProvider();
|
|
396
|
+
|
|
397
|
+
// Generate a chart
|
|
398
|
+
const chart = await chartProvider.generateChart({
|
|
399
|
+
type: 'bar',
|
|
400
|
+
data: {
|
|
401
|
+
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
402
|
+
datasets: [{
|
|
403
|
+
label: 'Revenue ($M)',
|
|
404
|
+
data: [10, 15, 22, 31]
|
|
405
|
+
}]
|
|
406
|
+
},
|
|
407
|
+
title: 'Quarterly Revenue Growth',
|
|
408
|
+
palette: 'professional' // 'default' | 'professional' | 'vibrant' | 'monochrome'
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// chart.html - For HTML output (Chart.js canvas)
|
|
412
|
+
// chart.imageUrl - For PPTX output (QuickChart.io URL)
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**Supported Chart Types:**
|
|
416
|
+
- `bar` - Bar chart
|
|
417
|
+
- `line` - Line chart
|
|
418
|
+
- `pie` - Pie chart
|
|
419
|
+
- `doughnut` - Doughnut chart
|
|
420
|
+
- `radar` - Radar chart
|
|
421
|
+
- `polarArea` - Polar area chart
|
|
422
|
+
- `scatter` - Scatter plot
|
|
423
|
+
- `bubble` - Bubble chart
|
|
424
|
+
|
|
425
|
+
### Diagrams (Mermaid)
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
const chartProvider = createDefaultChartProvider();
|
|
429
|
+
|
|
430
|
+
// Generate flowchart
|
|
431
|
+
const flowchart = chartProvider.generateFlowchart([
|
|
432
|
+
{ id: 'A', label: 'Start', next: ['B'] },
|
|
433
|
+
{ id: 'B', label: 'Process', next: ['C', 'D'] },
|
|
434
|
+
{ id: 'C', label: 'Option 1', next: ['E'] },
|
|
435
|
+
{ id: 'D', label: 'Option 2', next: ['E'] },
|
|
436
|
+
{ id: 'E', label: 'End' }
|
|
437
|
+
]);
|
|
438
|
+
|
|
439
|
+
// Generate timeline
|
|
440
|
+
const timeline = chartProvider.generateTimeline([
|
|
441
|
+
{ date: '2020', title: 'Company Founded' },
|
|
442
|
+
{ date: '2021', title: 'Series A' },
|
|
443
|
+
{ date: '2022', title: 'Product Launch' },
|
|
444
|
+
{ date: '2023', title: '1M Users' }
|
|
445
|
+
]);
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## API Reference
|
|
451
|
+
|
|
452
|
+
### `generate(config)`
|
|
453
|
+
|
|
454
|
+
Generate a presentation from content.
|
|
455
|
+
|
|
456
|
+
```typescript
|
|
457
|
+
async function generate(config: PresentationConfig): Promise<PresentationResult>
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Parameters:**
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
interface PresentationConfig {
|
|
464
|
+
// Required
|
|
465
|
+
content: string; // Your content
|
|
466
|
+
contentType: 'markdown' | 'json' | 'yaml' | 'text';
|
|
467
|
+
mode: 'keynote' | 'business';
|
|
468
|
+
format: ('html' | 'pptx')[];
|
|
469
|
+
title: string;
|
|
470
|
+
|
|
471
|
+
// Optional
|
|
472
|
+
theme?: ThemeName; // Default: 'default'
|
|
473
|
+
author?: string;
|
|
474
|
+
subject?: string;
|
|
475
|
+
qaThreshold?: number; // Default: 95
|
|
476
|
+
skipQA?: boolean; // Default: false (NOT RECOMMENDED)
|
|
477
|
+
minify?: boolean; // Minify HTML output
|
|
478
|
+
customCSS?: string; // Additional CSS
|
|
479
|
+
customTemplates?: Record<string, string>; // Handlebars overrides
|
|
480
|
+
}
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
**Returns:**
|
|
484
|
+
|
|
485
|
+
```typescript
|
|
486
|
+
interface PresentationResult {
|
|
487
|
+
outputs: {
|
|
488
|
+
html?: string; // Reveal.js HTML
|
|
489
|
+
pptx?: Buffer; // PowerPoint file
|
|
490
|
+
};
|
|
491
|
+
qaResults: QAResults; // Detailed QA breakdown
|
|
492
|
+
score: number; // 0-100 quality score
|
|
493
|
+
metadata: {
|
|
494
|
+
title: string;
|
|
495
|
+
author: string;
|
|
496
|
+
generatedAt: string;
|
|
497
|
+
mode: 'keynote' | 'business';
|
|
498
|
+
slideCount: number;
|
|
499
|
+
wordCount: number;
|
|
500
|
+
avgWordsPerSlide: number;
|
|
501
|
+
estimatedDuration: number; // Minutes
|
|
502
|
+
frameworks: string[]; // Applied expert frameworks
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### `validate(presentation, options)`
|
|
508
|
+
|
|
509
|
+
Validate an existing HTML presentation.
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
async function validate(
|
|
513
|
+
presentation: string | Buffer,
|
|
514
|
+
options?: {
|
|
515
|
+
mode?: 'keynote' | 'business';
|
|
516
|
+
threshold?: number;
|
|
517
|
+
strictMode?: boolean;
|
|
518
|
+
}
|
|
519
|
+
): Promise<QAResults & { score: number }>
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Error Classes
|
|
523
|
+
|
|
524
|
+
```typescript
|
|
525
|
+
// Thrown when configuration is invalid
|
|
526
|
+
class ValidationError extends Error {
|
|
527
|
+
errors: string[];
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// Thrown when QA score is below threshold
|
|
531
|
+
class QAFailureError extends Error {
|
|
532
|
+
score: number;
|
|
533
|
+
threshold: number;
|
|
534
|
+
qaResults: QAResults;
|
|
535
|
+
|
|
536
|
+
getIssues(): string[]; // List of issues to fix
|
|
537
|
+
}
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## CLI Reference
|
|
543
|
+
|
|
544
|
+
```
|
|
545
|
+
Claude Presentation Master v1.0.0
|
|
546
|
+
|
|
547
|
+
USAGE:
|
|
548
|
+
cpm <command> [options]
|
|
549
|
+
|
|
550
|
+
COMMANDS:
|
|
551
|
+
generate <input> Generate presentation from input file
|
|
552
|
+
validate <file> Validate an existing HTML presentation
|
|
553
|
+
info Show package information
|
|
554
|
+
|
|
555
|
+
OPTIONS:
|
|
556
|
+
-o, --output <dir> Output directory (default: ./output)
|
|
557
|
+
-m, --mode <mode> keynote or business (default: keynote)
|
|
558
|
+
-f, --format <fmt> html, pptx, or html,pptx (default: html)
|
|
559
|
+
-t, --theme <name> Theme name
|
|
560
|
+
--title <title> Presentation title
|
|
561
|
+
--author <name> Author name
|
|
562
|
+
--threshold <num> QA threshold 0-100 (default: 95)
|
|
563
|
+
--skip-qa Skip QA (NOT recommended)
|
|
564
|
+
-h, --help Show help
|
|
565
|
+
-v, --version Show version
|
|
566
|
+
|
|
567
|
+
EXAMPLES:
|
|
568
|
+
cpm generate deck.md -m keynote -f html,pptx
|
|
569
|
+
cpm generate report.yaml -m business -o ./slides
|
|
570
|
+
cpm validate presentation.html --threshold 90
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
---
|
|
574
|
+
|
|
575
|
+
## Examples
|
|
576
|
+
|
|
577
|
+
### Example 1: Investor Pitch (Keynote Mode)
|
|
578
|
+
|
|
579
|
+
```typescript
|
|
580
|
+
const result = await generate({
|
|
581
|
+
content: `
|
|
582
|
+
# Acme AI - Revolutionizing Customer Support
|
|
583
|
+
|
|
584
|
+
## The $400B Problem
|
|
585
|
+
Companies spend $400 billion annually on customer support.
|
|
586
|
+
Yet 67% of customers prefer self-service over speaking to a representative.
|
|
587
|
+
|
|
588
|
+
## Our Solution
|
|
589
|
+
Acme AI delivers human-quality support responses in under 3 seconds,
|
|
590
|
+
handling 80% of inquiries without human intervention.
|
|
591
|
+
|
|
592
|
+
## Traction
|
|
593
|
+
- 50+ enterprise customers
|
|
594
|
+
- $5M ARR (300% YoY growth)
|
|
595
|
+
- 95% customer retention
|
|
596
|
+
|
|
597
|
+
## The Team
|
|
598
|
+
Former leaders from Google, Amazon, and Salesforce
|
|
599
|
+
with 50+ years combined experience in AI and customer success.
|
|
600
|
+
|
|
601
|
+
## The Ask
|
|
602
|
+
$20M Series B to expand into European markets
|
|
603
|
+
and launch our enterprise platform.
|
|
604
|
+
`,
|
|
605
|
+
contentType: 'markdown',
|
|
606
|
+
mode: 'keynote',
|
|
607
|
+
format: ['html', 'pptx'],
|
|
608
|
+
title: 'Acme AI - Series B',
|
|
609
|
+
theme: 'modern-tech'
|
|
610
|
+
});
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### Example 2: Quarterly Business Review (Business Mode)
|
|
614
|
+
|
|
615
|
+
```typescript
|
|
616
|
+
const result = await generate({
|
|
617
|
+
content: `
|
|
618
|
+
# Q4 2024 Business Review
|
|
619
|
+
|
|
620
|
+
## Executive Summary
|
|
621
|
+
Q4 exceeded targets across all key metrics.
|
|
622
|
+
Revenue grew 25% QoQ while maintaining profitability.
|
|
623
|
+
|
|
624
|
+
## Financial Performance
|
|
625
|
+
- Revenue: $12.5M (+25% QoQ)
|
|
626
|
+
- Gross Margin: 72% (+3pp)
|
|
627
|
+
- Operating Expenses: $8.2M (-5%)
|
|
628
|
+
- Net Income: $1.8M (first profitable quarter)
|
|
629
|
+
|
|
630
|
+
## Customer Metrics
|
|
631
|
+
- New Customers: 127 (+40%)
|
|
632
|
+
- Churn Rate: 2.1% (-0.5pp)
|
|
633
|
+
- NPS Score: 72 (+8 points)
|
|
634
|
+
- Average Contract Value: $45,000 (+15%)
|
|
635
|
+
|
|
636
|
+
## Product Updates
|
|
637
|
+
1. Launched AI Assistant v2.0
|
|
638
|
+
2. Released mobile app for iOS and Android
|
|
639
|
+
3. Added 15 new integrations
|
|
640
|
+
4. Improved API response time by 40%
|
|
641
|
+
|
|
642
|
+
## Challenges
|
|
643
|
+
- Hiring senior engineers remains difficult
|
|
644
|
+
- Supply chain issues delayed hardware launch
|
|
645
|
+
- Competitor launched similar feature
|
|
646
|
+
|
|
647
|
+
## Q1 2025 Priorities
|
|
648
|
+
1. Launch enterprise tier
|
|
649
|
+
2. Expand sales team by 5 reps
|
|
650
|
+
3. Open European data center
|
|
651
|
+
4. Achieve SOC 2 Type II certification
|
|
652
|
+
`,
|
|
653
|
+
contentType: 'markdown',
|
|
654
|
+
mode: 'business',
|
|
655
|
+
format: ['html', 'pptx'],
|
|
656
|
+
title: 'Q4 2024 Business Review',
|
|
657
|
+
theme: 'light-corporate'
|
|
658
|
+
});
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### Example 3: With Custom Templates
|
|
662
|
+
|
|
663
|
+
```typescript
|
|
664
|
+
const result = await generate({
|
|
665
|
+
content: myContent,
|
|
666
|
+
contentType: 'markdown',
|
|
667
|
+
mode: 'keynote',
|
|
668
|
+
format: ['html'],
|
|
669
|
+
title: 'Custom Presentation',
|
|
670
|
+
customTemplates: {
|
|
671
|
+
'title': `
|
|
672
|
+
<section class="slide slide-title custom-title">
|
|
673
|
+
<div class="slide-content">
|
|
674
|
+
<div class="logo">YOUR LOGO</div>
|
|
675
|
+
<h1>{{title}}</h1>
|
|
676
|
+
<p class="subtitle">{{subtitle}}</p>
|
|
677
|
+
<p class="date">{{date}}</p>
|
|
678
|
+
</div>
|
|
679
|
+
</section>
|
|
680
|
+
`
|
|
681
|
+
},
|
|
682
|
+
customCSS: `
|
|
683
|
+
.custom-title {
|
|
684
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
685
|
+
}
|
|
686
|
+
.custom-title h1 {
|
|
687
|
+
color: white;
|
|
688
|
+
}
|
|
689
|
+
`
|
|
690
|
+
});
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
---
|
|
694
|
+
|
|
695
|
+
## Troubleshooting
|
|
696
|
+
|
|
697
|
+
### "QA score below threshold"
|
|
698
|
+
|
|
699
|
+
Your presentation didn't meet the 95/100 quality bar. Check the error for specific issues:
|
|
700
|
+
|
|
701
|
+
```typescript
|
|
702
|
+
catch (error) {
|
|
703
|
+
if (error instanceof QAFailureError) {
|
|
704
|
+
console.log('Issues to fix:');
|
|
705
|
+
error.getIssues().forEach(issue => {
|
|
706
|
+
console.log(` - ${issue}`);
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
Common fixes:
|
|
713
|
+
- Reduce word count per slide (keynote: max 25, business: max 80)
|
|
714
|
+
- Increase whitespace (remove clutter)
|
|
715
|
+
- Ensure proper contrast (4.5:1 minimum)
|
|
716
|
+
- Use only 1-2 font families
|
|
717
|
+
- Limit colors to 5 or fewer
|
|
718
|
+
|
|
719
|
+
### "Playwright browsers not found"
|
|
720
|
+
|
|
721
|
+
Run the Playwright installation:
|
|
722
|
+
|
|
723
|
+
```bash
|
|
724
|
+
npx playwright install chromium
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
### "Module not found"
|
|
728
|
+
|
|
729
|
+
Ensure you've built the package:
|
|
730
|
+
|
|
731
|
+
```bash
|
|
732
|
+
npm run build
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
---
|
|
736
|
+
|
|
737
|
+
## Contributing
|
|
738
|
+
|
|
739
|
+
See [CONTRIBUTING.md](./docs/CONTRIBUTING.md) for development setup and guidelines.
|
|
740
|
+
|
|
741
|
+
---
|
|
742
|
+
|
|
743
|
+
## License
|
|
744
|
+
|
|
745
|
+
MIT License - see [LICENSE](./LICENSE) for details.
|
|
746
|
+
|
|
747
|
+
---
|
|
748
|
+
|
|
749
|
+
## Author
|
|
750
|
+
|
|
751
|
+
**Stuart Kerr**
|
|
752
|
+
<stuart@isovision.ai>
|
|
753
|
+
[Isovision.ai](https://isovision.ai)
|
|
754
|
+
|
|
755
|
+
---
|
|
756
|
+
|
|
757
|
+
<div align="center">
|
|
758
|
+
|
|
759
|
+
**Built with expert methodologies from the world's best presentation coaches.**
|
|
760
|
+
|
|
761
|
+
Nancy Duarte • Garr Reynolds • Carmine Gallo • Chris Anderson • Barbara Minto
|
|
762
|
+
|
|
763
|
+
</div>
|