claude-presentation-master 3.9.0 → 4.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/README.md CHANGED
@@ -20,25 +20,38 @@
20
20
 
21
21
  ---
22
22
 
23
- ## What's New in v3.0.2
24
-
25
- - **🖼️ Automatic Background Images** Every slide now has a contextual background image from Unsplash (free, no API key)
26
- - **Smart Image Matching** — Images are selected based on slide type and content keywords
27
- - **Cinematic Dark Overlay** — 40% opacity images with gradient overlay for guaranteed text readability
28
- - **Playwright Visual QA** Screenshot verification of every slide to ensure visual quality
29
- - **QA Image Verification** Visual QA now validates that background images are present
30
-
31
- ### Previous in v3.0.1
32
-
33
- - **Knowledge-Driven Orchestration** — All decisions route through RuVector knowledge base (6,300+ lines of expert methodology)
34
- - **VisionQA Engine** — Optional Claude multimodal visual analysis for slide rendering validation
35
- - **NanoBanana Pro Integration** — AI image generation using Google Gemini (optional, with GOOGLE_AI_API_KEY)
36
- - **Multi-Agent Consensus Validation** — Expert agents (Duarte, Reynolds, Minto, Tufte, Gallo, Anderson) provide weighted assessments
37
- - **Semantic Completeness Validator** — Ensures presentation covers all key topics from source content
38
- - **7 Specialized Presentation Types** — TED Keynote, Sales Pitch, Consulting Deck, Investment Banking, Investor Pitch, Technical Presentation, All Hands
39
- - **Investment Banking Charts** — Football field, waterfall, sources & uses tables, comparable companies analysis
40
- - **Professional Typography** Google Fonts for each presentation type
41
- - **100% Zero Cost by Default** — No API keys required, optional AI features when keys available
23
+ ## What's New in v4.0.0 — True Knowledge-Driven Architecture
24
+
25
+ **The Knowledge Base now DRIVES everything at runtime no more hardcoded specs.**
26
+
27
+ ### Breaking Changes
28
+ - `PresentationEngineV2` now requires Knowledge Base YAML at runtime
29
+ - All design specs loaded from KB, not constants in code
30
+
31
+ ### New Features
32
+ - **📚 Runtime KB Loading** — The 6,300+ line YAML knowledge base is parsed at runtime, not duplicated in code
33
+ - **🎯 H3 Action Title Extraction** — Markdown H3 headings become slide titles (McKinsey "so what" principle)
34
+ - **📊 Tables Preserved Correctly** — Tables stay as tables, never mangled into metric cards
35
+ - **🚫 No Orphan Slides** — Minimum 3 bullets per slide, balanced distribution
36
+ - **✅ 95+ Quality Threshold** — Engine fails if quality score below 95/100
37
+
38
+ ### Knowledge Base Integration
39
+ - Word limits from `presentation_types.{type}.validation_rules.words_per_slide`
40
+ - Bullet limits from `presentation_types.{type}.validation_rules.bullets_per_slide`
41
+ - Theme from `presentation_types.{type}.color_palette`
42
+ - Experts from `presentation_types.{type}.primary_experts`
43
+ - Scoring weights from `presentation_types.{type}.scoring_weights`
44
+
45
+ ### 7 Specialized Presentation Types
46
+ | Type | Theme | Words/Slide | Key Experts |
47
+ |------|-------|-------------|-------------|
48
+ | `ted_keynote` | Dark | 1-15 | Duarte, Reynolds, Anderson |
49
+ | `sales_pitch` | Modern | 10-30 | Cialdini, Heath |
50
+ | `consulting_deck` | McKinsey | 40-80 | Minto, McKinsey, BCG |
51
+ | `investment_banking` | McKinsey | 60-120 | Wall Street Prep |
52
+ | `investor_pitch` | Startup | 5-30 | Sequoia, YC |
53
+ | `technical_presentation` | Dark | 40-100 | Tufte, C4 Model |
54
+ | `all_hands` | Minimal | 15-40 | Internal Comms |
42
55
 
43
56
  ---
44
57
 
package/dist/index.d.mts CHANGED
@@ -904,17 +904,15 @@ declare function createRendererV2(presentationType?: PresentationType, themeOver
904
904
  *
905
905
  * This engine orchestrates the ENTIRE presentation creation flow:
906
906
  * 1. Analyze content to detect presentation type
907
- * 2. Load design specs from Knowledge Base
907
+ * 2. Load design specs from Knowledge Base (YAML)
908
908
  * 3. Generate slides following expert methodologies
909
909
  * 4. Enhance with images (optional, needs API key)
910
910
  * 5. Review ruthlessly (must score 95/100+)
911
911
  * 6. Output ONLY if quality passes
912
912
  *
913
- * The Knowledge Base drives EVERYTHING:
914
- * - Presentation type detection
915
- * - Design specs (colors, fonts, spacing)
916
- * - Slide structure and word limits
917
- * - Quality criteria and scoring
913
+ * CRITICAL: The Knowledge Base drives EVERYTHING.
914
+ * The KnowledgeGateway reads from presentation-knowledge.yaml at runtime.
915
+ * NO hardcoded fallbacks - if KB is missing data, we fail loudly.
918
916
  */
919
917
 
920
918
  interface DesignSpecs {
@@ -923,18 +921,30 @@ interface DesignSpecs {
923
921
  max: number;
924
922
  ideal: number;
925
923
  };
926
- whitespace: string;
924
+ whitespace: {
925
+ min: number;
926
+ max?: number;
927
+ ideal: number;
928
+ };
927
929
  bulletPoints: {
928
930
  max: number;
929
931
  };
930
932
  fonts: {
931
- title: number;
932
- body: number;
933
- minimum: number;
933
+ title: string;
934
+ body: string;
935
+ maxFonts: number;
934
936
  };
935
937
  theme: ThemeStyle;
936
938
  structure: string;
937
939
  experts: string[];
940
+ actionTitlesRequired: boolean;
941
+ sourcesRequired: boolean;
942
+ scoringWeights: {
943
+ visual_quality: number;
944
+ content_quality: number;
945
+ expert_compliance: number;
946
+ accessibility: number;
947
+ };
938
948
  }
939
949
  interface SlideReview {
940
950
  slideIndex: number;
@@ -977,11 +987,15 @@ interface EngineResult {
977
987
  }
978
988
  declare class PresentationEngineV2 {
979
989
  private options;
990
+ private kb;
980
991
  constructor(options?: EngineOptions);
981
992
  private log;
982
993
  /**
983
994
  * Generate a world-class presentation from markdown content.
984
995
  * Follows knowledge base specs and demands 95+ quality score.
996
+ *
997
+ * CRITICAL: All specs come from the Knowledge Base YAML at runtime.
998
+ * No hardcoded fallbacks - if KB is missing data, we fail loudly.
985
999
  */
986
1000
  generate(markdown: string, title?: string): Promise<EngineResult>;
987
1001
  /**
package/dist/index.d.ts CHANGED
@@ -904,17 +904,15 @@ declare function createRendererV2(presentationType?: PresentationType, themeOver
904
904
  *
905
905
  * This engine orchestrates the ENTIRE presentation creation flow:
906
906
  * 1. Analyze content to detect presentation type
907
- * 2. Load design specs from Knowledge Base
907
+ * 2. Load design specs from Knowledge Base (YAML)
908
908
  * 3. Generate slides following expert methodologies
909
909
  * 4. Enhance with images (optional, needs API key)
910
910
  * 5. Review ruthlessly (must score 95/100+)
911
911
  * 6. Output ONLY if quality passes
912
912
  *
913
- * The Knowledge Base drives EVERYTHING:
914
- * - Presentation type detection
915
- * - Design specs (colors, fonts, spacing)
916
- * - Slide structure and word limits
917
- * - Quality criteria and scoring
913
+ * CRITICAL: The Knowledge Base drives EVERYTHING.
914
+ * The KnowledgeGateway reads from presentation-knowledge.yaml at runtime.
915
+ * NO hardcoded fallbacks - if KB is missing data, we fail loudly.
918
916
  */
919
917
 
920
918
  interface DesignSpecs {
@@ -923,18 +921,30 @@ interface DesignSpecs {
923
921
  max: number;
924
922
  ideal: number;
925
923
  };
926
- whitespace: string;
924
+ whitespace: {
925
+ min: number;
926
+ max?: number;
927
+ ideal: number;
928
+ };
927
929
  bulletPoints: {
928
930
  max: number;
929
931
  };
930
932
  fonts: {
931
- title: number;
932
- body: number;
933
- minimum: number;
933
+ title: string;
934
+ body: string;
935
+ maxFonts: number;
934
936
  };
935
937
  theme: ThemeStyle;
936
938
  structure: string;
937
939
  experts: string[];
940
+ actionTitlesRequired: boolean;
941
+ sourcesRequired: boolean;
942
+ scoringWeights: {
943
+ visual_quality: number;
944
+ content_quality: number;
945
+ expert_compliance: number;
946
+ accessibility: number;
947
+ };
938
948
  }
939
949
  interface SlideReview {
940
950
  slideIndex: number;
@@ -977,11 +987,15 @@ interface EngineResult {
977
987
  }
978
988
  declare class PresentationEngineV2 {
979
989
  private options;
990
+ private kb;
980
991
  constructor(options?: EngineOptions);
981
992
  private log;
982
993
  /**
983
994
  * Generate a world-class presentation from markdown content.
984
995
  * Follows knowledge base specs and demands 95+ quality score.
996
+ *
997
+ * CRITICAL: All specs come from the Knowledge Base YAML at runtime.
998
+ * No hardcoded fallbacks - if KB is missing data, we fail loudly.
985
999
  */
986
1000
  generate(markdown: string, title?: string): Promise<EngineResult>;
987
1001
  /**
package/dist/index.js CHANGED
@@ -95505,133 +95505,69 @@ function createRendererV2(presentationType = "consulting_deck", themeOverride) {
95505
95505
 
95506
95506
  // src/core/PresentationEngineV2.ts
95507
95507
  var import_fs9 = require("fs");
95508
- var KNOWLEDGE_BASE = {
95509
- // TED/Keynote - Minimal words, maximum impact
95510
- ted_keynote: {
95511
- wordsPerSlide: { min: 6, max: 25, ideal: 10 },
95512
- whitespace: "40%+",
95513
- bulletPoints: { max: 3 },
95514
- fonts: { title: 72, body: 42, minimum: 36 },
95515
- theme: "dark",
95516
- structure: "Sparkline (What Is / What Could Be)",
95517
- experts: ["Nancy Duarte", "Garr Reynolds", "Carmine Gallo", "Chris Anderson"]
95518
- },
95519
- // Sales Pitch - Persuasive, emotional, clear CTA
95520
- sales_pitch: {
95521
- wordsPerSlide: { min: 10, max: 35, ideal: 20 },
95522
- whitespace: "35%+",
95523
- bulletPoints: { max: 4 },
95524
- fonts: { title: 56, body: 32, minimum: 28 },
95525
- theme: "dark",
95526
- structure: "SPIN (Situation, Problem, Implication, Need-Payoff)",
95527
- experts: ["Cialdini", "Challenger Sale", "Oren Klaff"]
95528
- },
95529
- // Consulting Deck - Data-driven, McKinsey style
95530
- consulting_deck: {
95531
- wordsPerSlide: { min: 40, max: 80, ideal: 60 },
95532
- whitespace: "25-30%",
95533
- bulletPoints: { max: 7 },
95534
- fonts: { title: 44, body: 22, minimum: 18 },
95535
- theme: "mckinsey",
95536
- structure: "Pyramid Principle (MECE, SCR)",
95537
- experts: ["Barbara Minto", "McKinsey", "BCG", "Bain"]
95538
- },
95539
- // Investment Banking - Dense, financial, formal
95540
- investment_banking: {
95541
- wordsPerSlide: { min: 60, max: 120, ideal: 90 },
95542
- whitespace: "20-25%",
95543
- bulletPoints: { max: 8 },
95544
- fonts: { title: 28, body: 12, minimum: 10 },
95545
- theme: "mckinsey",
95546
- structure: "Situation-Complication-Hypothesis",
95547
- experts: ["Wall Street Prep", "Analyst Academy"]
95548
- },
95549
- // Investor Pitch - Concise, startup-friendly
95550
- investor_pitch: {
95551
- wordsPerSlide: { min: 5, max: 30, ideal: 15 },
95552
- whitespace: "35%+",
95553
- bulletPoints: { max: 4 },
95554
- fonts: { title: 48, body: 28, minimum: 24 },
95555
- theme: "startup",
95556
- structure: "Problem \u2192 Solution \u2192 Market \u2192 Traction \u2192 Team \u2192 Ask",
95557
- experts: ["Sequoia", "Y Combinator", "DocSend"]
95558
- },
95559
- // Technical Presentation - Clear diagrams, code-friendly
95560
- technical_presentation: {
95561
- wordsPerSlide: { min: 40, max: 100, ideal: 75 },
95562
- whitespace: "25%+",
95563
- bulletPoints: { max: 6 },
95564
- fonts: { title: 44, body: 20, minimum: 14 },
95565
- theme: "dark",
95566
- structure: "TL;DR \u2192 Problem \u2192 Architecture \u2192 Tradeoffs \u2192 Next Steps",
95567
- experts: ["Edward Tufte", "C4 Model", "Google Design Docs"]
95568
- },
95569
- // All Hands - Accessible, clear, motivational
95570
- all_hands: {
95571
- wordsPerSlide: { min: 15, max: 40, ideal: 25 },
95572
- whitespace: "30%+",
95573
- bulletPoints: { max: 5 },
95574
- fonts: { title: 52, body: 28, minimum: 24 },
95575
- theme: "minimal",
95576
- structure: "Updates \u2192 Wins \u2192 Challenges \u2192 What's Next",
95577
- experts: ["Internal Communications Best Practices"]
95578
- }
95508
+ var PALETTE_TO_THEME = {
95509
+ dark_executive: "dark",
95510
+ modern_business: "startup",
95511
+ consulting_classic: "mckinsey",
95512
+ executive_professional: "mckinsey",
95513
+ strategy_growth: "minimal"
95579
95514
  };
95580
- var QUALITY_CRITERIA = {
95581
- ted_keynote: {
95582
- glanceTestSeconds: 3,
95583
- minScore: 95,
95584
- wordLimitStrict: true,
95585
- requireActionTitles: false,
95586
- requireDataSources: false
95587
- },
95588
- sales_pitch: {
95589
- glanceTestSeconds: 3,
95590
- minScore: 95,
95591
- wordLimitStrict: true,
95592
- requireActionTitles: true,
95593
- requireDataSources: false
95594
- },
95595
- consulting_deck: {
95596
- glanceTestSeconds: 5,
95597
- minScore: 95,
95598
- wordLimitStrict: false,
95599
- // Consulting allows denser slides
95600
- requireActionTitles: true,
95601
- // Titles should state the "so what"
95602
- requireDataSources: true
95603
- },
95604
- investment_banking: {
95605
- glanceTestSeconds: 10,
95606
- minScore: 95,
95607
- wordLimitStrict: false,
95608
- requireActionTitles: true,
95609
- requireDataSources: true
95610
- },
95611
- investor_pitch: {
95612
- glanceTestSeconds: 3,
95613
- minScore: 95,
95614
- wordLimitStrict: true,
95615
- requireActionTitles: true,
95616
- requireDataSources: true
95617
- },
95618
- technical_presentation: {
95619
- glanceTestSeconds: 5,
95620
- minScore: 95,
95621
- wordLimitStrict: false,
95622
- requireActionTitles: false,
95623
- requireDataSources: true
95624
- },
95625
- all_hands: {
95626
- glanceTestSeconds: 3,
95627
- minScore: 95,
95628
- wordLimitStrict: true,
95629
- requireActionTitles: false,
95630
- requireDataSources: false
95515
+ async function loadDesignSpecsFromKB(kb, type) {
95516
+ const typeConfig = kb.queryRequired(`presentation_types.${type}`);
95517
+ const validationRules = typeConfig.value.validation_rules;
95518
+ const wordsPerSlide = validationRules.words_per_slide;
95519
+ const whitespace = validationRules.whitespace;
95520
+ const bulletsPerSlide = validationRules.bullets_per_slide;
95521
+ const typography = typeConfig.value.typography;
95522
+ const primaryExperts = typeConfig.value.primary_experts;
95523
+ const colorPalette = typeConfig.value.color_palette || "consulting_classic";
95524
+ const theme = PALETTE_TO_THEME[colorPalette] || "mckinsey";
95525
+ const scoringWeights = typeConfig.value.scoring_weights;
95526
+ let structure = "General presentation structure";
95527
+ if (primaryExperts.some((e) => e.includes("Minto") || e.includes("McKinsey"))) {
95528
+ structure = "Pyramid Principle (MECE, SCR)";
95529
+ } else if (primaryExperts.some((e) => e.includes("Duarte"))) {
95530
+ structure = "Sparkline (What Is / What Could Be)";
95531
+ } else if (primaryExperts.some((e) => e.includes("Cialdini"))) {
95532
+ structure = "Persuasion-driven (SPIN, Challenger)";
95631
95533
  }
95632
- };
95534
+ return {
95535
+ wordsPerSlide,
95536
+ whitespace,
95537
+ bulletPoints: { max: bulletsPerSlide?.max || 5 },
95538
+ fonts: {
95539
+ title: typography?.titles || "44px, Bold",
95540
+ body: typography?.body || "22px",
95541
+ maxFonts: typography?.max_fonts || 2
95542
+ },
95543
+ theme,
95544
+ structure,
95545
+ experts: primaryExperts,
95546
+ actionTitlesRequired: validationRules.action_titles_required || false,
95547
+ sourcesRequired: validationRules.sources_required || false,
95548
+ scoringWeights: scoringWeights || {
95549
+ visual_quality: 30,
95550
+ content_quality: 30,
95551
+ expert_compliance: 30,
95552
+ accessibility: 10
95553
+ }
95554
+ };
95555
+ }
95556
+ function getQualityCriteria(specs, type) {
95557
+ const isKeynote = type === "ted_keynote" || type === "sales_pitch";
95558
+ const isConsulting = type === "consulting_deck" || type === "investment_banking";
95559
+ return {
95560
+ glanceTestSeconds: isKeynote ? 3 : isConsulting ? 5 : 3,
95561
+ minScore: 95,
95562
+ wordLimitStrict: isKeynote,
95563
+ // Keynotes have strict word limits
95564
+ requireActionTitles: specs.actionTitlesRequired,
95565
+ requireDataSources: specs.sourcesRequired
95566
+ };
95567
+ }
95633
95568
  var PresentationEngineV2 = class {
95634
95569
  options;
95570
+ kb = null;
95635
95571
  constructor(options = {}) {
95636
95572
  this.options = {
95637
95573
  presentationType: options.presentationType || "consulting_deck",
@@ -95650,19 +95586,26 @@ var PresentationEngineV2 = class {
95650
95586
  /**
95651
95587
  * Generate a world-class presentation from markdown content.
95652
95588
  * Follows knowledge base specs and demands 95+ quality score.
95589
+ *
95590
+ * CRITICAL: All specs come from the Knowledge Base YAML at runtime.
95591
+ * No hardcoded fallbacks - if KB is missing data, we fail loudly.
95653
95592
  */
95654
95593
  async generate(markdown, title) {
95655
95594
  const warnings = [];
95595
+ this.log("Step 0: Loading Knowledge Base...");
95596
+ this.kb = await initKB();
95597
+ this.log(` KB v${this.kb.getVersion()} loaded`);
95656
95598
  this.log("Step 1: Detecting presentation type...");
95657
95599
  const detectedType = this.detectPresentationType(markdown);
95658
95600
  const presentationType = this.options.presentationType || detectedType;
95659
95601
  this.log(` Using type: ${presentationType} (detected: ${detectedType})`);
95660
95602
  this.log("Step 2: Loading design specs from Knowledge Base...");
95661
- const designSpecs = KNOWLEDGE_BASE[presentationType];
95662
- const qualityCriteria = QUALITY_CRITERIA[presentationType];
95603
+ const designSpecs = await loadDesignSpecsFromKB(this.kb, presentationType);
95604
+ const qualityCriteria = getQualityCriteria(designSpecs, presentationType);
95663
95605
  this.log(` Theme: ${designSpecs.theme}`);
95664
95606
  this.log(` Structure: ${designSpecs.structure}`);
95665
95607
  this.log(` Words/slide: ${designSpecs.wordsPerSlide.min}-${designSpecs.wordsPerSlide.max}`);
95608
+ this.log(` Experts: ${designSpecs.experts.slice(0, 2).join(", ")}...`);
95666
95609
  this.log("Step 3: Generating slides...");
95667
95610
  const generator = createSlideGeneratorV2(presentationType);
95668
95611
  let slides = generator.generate(markdown, title);
@@ -95990,7 +95933,6 @@ SUCCESS: Generated ${slides.length} slides scoring ${review.overallScore}/100`);
95990
95933
  * Assess the flow and narrative structure of the deck.
95991
95934
  */
95992
95935
  assessFlow(slides, type) {
95993
- const specs = KNOWLEDGE_BASE[type];
95994
95936
  let score = 100;
95995
95937
  const types = slides.map((s) => s.type);
95996
95938
  if (types[0] !== "title") score -= 10;
package/dist/index.mjs CHANGED
@@ -3789,133 +3789,69 @@ function createRendererV2(presentationType = "consulting_deck", themeOverride) {
3789
3789
 
3790
3790
  // src/core/PresentationEngineV2.ts
3791
3791
  import { writeFileSync as writeFileSync2 } from "fs";
3792
- var KNOWLEDGE_BASE = {
3793
- // TED/Keynote - Minimal words, maximum impact
3794
- ted_keynote: {
3795
- wordsPerSlide: { min: 6, max: 25, ideal: 10 },
3796
- whitespace: "40%+",
3797
- bulletPoints: { max: 3 },
3798
- fonts: { title: 72, body: 42, minimum: 36 },
3799
- theme: "dark",
3800
- structure: "Sparkline (What Is / What Could Be)",
3801
- experts: ["Nancy Duarte", "Garr Reynolds", "Carmine Gallo", "Chris Anderson"]
3802
- },
3803
- // Sales Pitch - Persuasive, emotional, clear CTA
3804
- sales_pitch: {
3805
- wordsPerSlide: { min: 10, max: 35, ideal: 20 },
3806
- whitespace: "35%+",
3807
- bulletPoints: { max: 4 },
3808
- fonts: { title: 56, body: 32, minimum: 28 },
3809
- theme: "dark",
3810
- structure: "SPIN (Situation, Problem, Implication, Need-Payoff)",
3811
- experts: ["Cialdini", "Challenger Sale", "Oren Klaff"]
3812
- },
3813
- // Consulting Deck - Data-driven, McKinsey style
3814
- consulting_deck: {
3815
- wordsPerSlide: { min: 40, max: 80, ideal: 60 },
3816
- whitespace: "25-30%",
3817
- bulletPoints: { max: 7 },
3818
- fonts: { title: 44, body: 22, minimum: 18 },
3819
- theme: "mckinsey",
3820
- structure: "Pyramid Principle (MECE, SCR)",
3821
- experts: ["Barbara Minto", "McKinsey", "BCG", "Bain"]
3822
- },
3823
- // Investment Banking - Dense, financial, formal
3824
- investment_banking: {
3825
- wordsPerSlide: { min: 60, max: 120, ideal: 90 },
3826
- whitespace: "20-25%",
3827
- bulletPoints: { max: 8 },
3828
- fonts: { title: 28, body: 12, minimum: 10 },
3829
- theme: "mckinsey",
3830
- structure: "Situation-Complication-Hypothesis",
3831
- experts: ["Wall Street Prep", "Analyst Academy"]
3832
- },
3833
- // Investor Pitch - Concise, startup-friendly
3834
- investor_pitch: {
3835
- wordsPerSlide: { min: 5, max: 30, ideal: 15 },
3836
- whitespace: "35%+",
3837
- bulletPoints: { max: 4 },
3838
- fonts: { title: 48, body: 28, minimum: 24 },
3839
- theme: "startup",
3840
- structure: "Problem \u2192 Solution \u2192 Market \u2192 Traction \u2192 Team \u2192 Ask",
3841
- experts: ["Sequoia", "Y Combinator", "DocSend"]
3842
- },
3843
- // Technical Presentation - Clear diagrams, code-friendly
3844
- technical_presentation: {
3845
- wordsPerSlide: { min: 40, max: 100, ideal: 75 },
3846
- whitespace: "25%+",
3847
- bulletPoints: { max: 6 },
3848
- fonts: { title: 44, body: 20, minimum: 14 },
3849
- theme: "dark",
3850
- structure: "TL;DR \u2192 Problem \u2192 Architecture \u2192 Tradeoffs \u2192 Next Steps",
3851
- experts: ["Edward Tufte", "C4 Model", "Google Design Docs"]
3852
- },
3853
- // All Hands - Accessible, clear, motivational
3854
- all_hands: {
3855
- wordsPerSlide: { min: 15, max: 40, ideal: 25 },
3856
- whitespace: "30%+",
3857
- bulletPoints: { max: 5 },
3858
- fonts: { title: 52, body: 28, minimum: 24 },
3859
- theme: "minimal",
3860
- structure: "Updates \u2192 Wins \u2192 Challenges \u2192 What's Next",
3861
- experts: ["Internal Communications Best Practices"]
3862
- }
3792
+ var PALETTE_TO_THEME = {
3793
+ dark_executive: "dark",
3794
+ modern_business: "startup",
3795
+ consulting_classic: "mckinsey",
3796
+ executive_professional: "mckinsey",
3797
+ strategy_growth: "minimal"
3863
3798
  };
3864
- var QUALITY_CRITERIA = {
3865
- ted_keynote: {
3866
- glanceTestSeconds: 3,
3867
- minScore: 95,
3868
- wordLimitStrict: true,
3869
- requireActionTitles: false,
3870
- requireDataSources: false
3871
- },
3872
- sales_pitch: {
3873
- glanceTestSeconds: 3,
3874
- minScore: 95,
3875
- wordLimitStrict: true,
3876
- requireActionTitles: true,
3877
- requireDataSources: false
3878
- },
3879
- consulting_deck: {
3880
- glanceTestSeconds: 5,
3881
- minScore: 95,
3882
- wordLimitStrict: false,
3883
- // Consulting allows denser slides
3884
- requireActionTitles: true,
3885
- // Titles should state the "so what"
3886
- requireDataSources: true
3887
- },
3888
- investment_banking: {
3889
- glanceTestSeconds: 10,
3890
- minScore: 95,
3891
- wordLimitStrict: false,
3892
- requireActionTitles: true,
3893
- requireDataSources: true
3894
- },
3895
- investor_pitch: {
3896
- glanceTestSeconds: 3,
3897
- minScore: 95,
3898
- wordLimitStrict: true,
3899
- requireActionTitles: true,
3900
- requireDataSources: true
3901
- },
3902
- technical_presentation: {
3903
- glanceTestSeconds: 5,
3904
- minScore: 95,
3905
- wordLimitStrict: false,
3906
- requireActionTitles: false,
3907
- requireDataSources: true
3908
- },
3909
- all_hands: {
3910
- glanceTestSeconds: 3,
3911
- minScore: 95,
3912
- wordLimitStrict: true,
3913
- requireActionTitles: false,
3914
- requireDataSources: false
3799
+ async function loadDesignSpecsFromKB(kb, type) {
3800
+ const typeConfig = kb.queryRequired(`presentation_types.${type}`);
3801
+ const validationRules = typeConfig.value.validation_rules;
3802
+ const wordsPerSlide = validationRules.words_per_slide;
3803
+ const whitespace = validationRules.whitespace;
3804
+ const bulletsPerSlide = validationRules.bullets_per_slide;
3805
+ const typography = typeConfig.value.typography;
3806
+ const primaryExperts = typeConfig.value.primary_experts;
3807
+ const colorPalette = typeConfig.value.color_palette || "consulting_classic";
3808
+ const theme = PALETTE_TO_THEME[colorPalette] || "mckinsey";
3809
+ const scoringWeights = typeConfig.value.scoring_weights;
3810
+ let structure = "General presentation structure";
3811
+ if (primaryExperts.some((e) => e.includes("Minto") || e.includes("McKinsey"))) {
3812
+ structure = "Pyramid Principle (MECE, SCR)";
3813
+ } else if (primaryExperts.some((e) => e.includes("Duarte"))) {
3814
+ structure = "Sparkline (What Is / What Could Be)";
3815
+ } else if (primaryExperts.some((e) => e.includes("Cialdini"))) {
3816
+ structure = "Persuasion-driven (SPIN, Challenger)";
3915
3817
  }
3916
- };
3818
+ return {
3819
+ wordsPerSlide,
3820
+ whitespace,
3821
+ bulletPoints: { max: bulletsPerSlide?.max || 5 },
3822
+ fonts: {
3823
+ title: typography?.titles || "44px, Bold",
3824
+ body: typography?.body || "22px",
3825
+ maxFonts: typography?.max_fonts || 2
3826
+ },
3827
+ theme,
3828
+ structure,
3829
+ experts: primaryExperts,
3830
+ actionTitlesRequired: validationRules.action_titles_required || false,
3831
+ sourcesRequired: validationRules.sources_required || false,
3832
+ scoringWeights: scoringWeights || {
3833
+ visual_quality: 30,
3834
+ content_quality: 30,
3835
+ expert_compliance: 30,
3836
+ accessibility: 10
3837
+ }
3838
+ };
3839
+ }
3840
+ function getQualityCriteria(specs, type) {
3841
+ const isKeynote = type === "ted_keynote" || type === "sales_pitch";
3842
+ const isConsulting = type === "consulting_deck" || type === "investment_banking";
3843
+ return {
3844
+ glanceTestSeconds: isKeynote ? 3 : isConsulting ? 5 : 3,
3845
+ minScore: 95,
3846
+ wordLimitStrict: isKeynote,
3847
+ // Keynotes have strict word limits
3848
+ requireActionTitles: specs.actionTitlesRequired,
3849
+ requireDataSources: specs.sourcesRequired
3850
+ };
3851
+ }
3917
3852
  var PresentationEngineV2 = class {
3918
3853
  options;
3854
+ kb = null;
3919
3855
  constructor(options = {}) {
3920
3856
  this.options = {
3921
3857
  presentationType: options.presentationType || "consulting_deck",
@@ -3934,19 +3870,26 @@ var PresentationEngineV2 = class {
3934
3870
  /**
3935
3871
  * Generate a world-class presentation from markdown content.
3936
3872
  * Follows knowledge base specs and demands 95+ quality score.
3873
+ *
3874
+ * CRITICAL: All specs come from the Knowledge Base YAML at runtime.
3875
+ * No hardcoded fallbacks - if KB is missing data, we fail loudly.
3937
3876
  */
3938
3877
  async generate(markdown, title) {
3939
3878
  const warnings = [];
3879
+ this.log("Step 0: Loading Knowledge Base...");
3880
+ this.kb = await initKB();
3881
+ this.log(` KB v${this.kb.getVersion()} loaded`);
3940
3882
  this.log("Step 1: Detecting presentation type...");
3941
3883
  const detectedType = this.detectPresentationType(markdown);
3942
3884
  const presentationType = this.options.presentationType || detectedType;
3943
3885
  this.log(` Using type: ${presentationType} (detected: ${detectedType})`);
3944
3886
  this.log("Step 2: Loading design specs from Knowledge Base...");
3945
- const designSpecs = KNOWLEDGE_BASE[presentationType];
3946
- const qualityCriteria = QUALITY_CRITERIA[presentationType];
3887
+ const designSpecs = await loadDesignSpecsFromKB(this.kb, presentationType);
3888
+ const qualityCriteria = getQualityCriteria(designSpecs, presentationType);
3947
3889
  this.log(` Theme: ${designSpecs.theme}`);
3948
3890
  this.log(` Structure: ${designSpecs.structure}`);
3949
3891
  this.log(` Words/slide: ${designSpecs.wordsPerSlide.min}-${designSpecs.wordsPerSlide.max}`);
3892
+ this.log(` Experts: ${designSpecs.experts.slice(0, 2).join(", ")}...`);
3950
3893
  this.log("Step 3: Generating slides...");
3951
3894
  const generator = createSlideGeneratorV2(presentationType);
3952
3895
  let slides = generator.generate(markdown, title);
@@ -4274,7 +4217,6 @@ SUCCESS: Generated ${slides.length} slides scoring ${review.overallScore}/100`);
4274
4217
  * Assess the flow and narrative structure of the deck.
4275
4218
  */
4276
4219
  assessFlow(slides, type) {
4277
- const specs = KNOWLEDGE_BASE[type];
4278
4220
  let score = 100;
4279
4221
  const types = slides.map((s) => s.type);
4280
4222
  if (types[0] !== "title") score -= 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-presentation-master",
3
- "version": "3.9.0",
3
+ "version": "4.0.0",
4
4
  "description": "Generate world-class presentations using expert methodologies from Duarte, Reynolds, Gallo, and Anderson. Enforces rigorous quality standards through real visual validation.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",