myaidev-method 0.2.23 → 0.2.24-2

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.
Files changed (60) hide show
  1. package/.claude-plugin/plugin.json +251 -0
  2. package/PLUGIN_ARCHITECTURE.md +276 -0
  3. package/README.md +204 -0
  4. package/USER_GUIDE.md +436 -9
  5. package/bin/cli.js +370 -38
  6. package/dist/server/.tsbuildinfo +1 -1
  7. package/extension.json +174 -0
  8. package/hooks/hooks.json +221 -0
  9. package/marketplace.json +179 -0
  10. package/package.json +24 -7
  11. package/skills/content-verifier/SKILL.md +178 -0
  12. package/skills/content-writer/SKILL.md +151 -0
  13. package/skills/coolify-deployer/SKILL.md +207 -0
  14. package/skills/openstack-manager/SKILL.md +213 -0
  15. package/skills/security-auditor/SKILL.md +180 -0
  16. package/skills/security-tester/SKILL.md +171 -0
  17. package/skills/sparc-architect/SKILL.md +146 -0
  18. package/skills/sparc-coder/SKILL.md +136 -0
  19. package/skills/sparc-documenter/SKILL.md +195 -0
  20. package/skills/sparc-reviewer/SKILL.md +179 -0
  21. package/skills/sparc-tester/SKILL.md +156 -0
  22. package/skills/visual-generator/SKILL.md +147 -0
  23. package/skills/wordpress-publisher/SKILL.md +150 -0
  24. package/src/config/workflows.js +28 -44
  25. package/src/lib/ascii-banner.js +214 -0
  26. package/src/lib/config-manager.js +470 -0
  27. package/src/lib/content-coordinator.js +2562 -0
  28. package/src/lib/content-generator.js +427 -0
  29. package/src/lib/html-conversion-utils.js +843 -0
  30. package/src/lib/installation-detector.js +266 -0
  31. package/src/lib/seo-optimizer.js +515 -0
  32. package/src/lib/visual-config-utils.js +1 -1
  33. package/src/lib/visual-generation-utils.js +34 -14
  34. package/src/lib/wordpress-client.js +633 -0
  35. package/src/lib/workflow-installer.js +3 -3
  36. package/src/scripts/generate-visual-cli.js +39 -10
  37. package/src/scripts/html-conversion-cli.js +526 -0
  38. package/src/scripts/init/configure.js +436 -0
  39. package/src/scripts/init/install.js +460 -0
  40. package/src/scripts/ping.js +0 -1
  41. package/src/scripts/utils/file-utils.js +404 -0
  42. package/src/scripts/utils/logger.js +300 -0
  43. package/src/scripts/utils/write-content.js +293 -0
  44. package/src/templates/claude/agents/content-production-coordinator.md +689 -15
  45. package/src/templates/claude/agents/visual-content-generator.md +129 -4
  46. package/src/templates/claude/commands/myai-content-enrichment.md +227 -0
  47. package/src/templates/claude/commands/myai-content-writer.md +48 -37
  48. package/src/templates/claude/commands/myai-convert-html.md +186 -0
  49. package/src/templates/claude/commands/myai-coordinate-content.md +347 -11
  50. package/src/templates/diagrams/architecture.d2 +52 -0
  51. package/src/templates/diagrams/flowchart.d2 +42 -0
  52. package/src/templates/diagrams/sequence.d2 +47 -0
  53. package/src/templates/docs/content-creation-guide.md +164 -0
  54. package/src/templates/docs/deployment-guide.md +336 -0
  55. package/src/templates/docs/visual-generation-guide.md +248 -0
  56. package/src/templates/docs/wordpress-publishing-guide.md +208 -0
  57. package/src/templates/infographics/comparison-table.html +347 -0
  58. package/src/templates/infographics/data-chart.html +268 -0
  59. package/src/templates/infographics/process-flow.html +365 -0
  60. /package/src/scripts/{wordpress-health-check.js → wordpress/wordpress-health-check.js} +0 -0
@@ -683,6 +683,130 @@ console.log(`\nReview the image and confirm it meets your requirements.`);
683
683
  - Execute using standard Node.js commands
684
684
  - All features available
685
685
 
686
+ ## HTML Conversion Mode (Precise Visuals)
687
+
688
+ For data-driven visuals requiring pixel-perfect accuracy, use HTML conversion instead of AI image generation.
689
+
690
+ ### When to Use HTML Conversion
691
+
692
+ | Use Case | Recommended Tool |
693
+ |----------|-----------------|
694
+ | Infographics with exact numbers/data | **HTML Conversion** |
695
+ | Creative/artistic images | AI Image Generation |
696
+ | Diagrams with specific text labels | **HTML/D2 Conversion** |
697
+ | Photorealistic scenes | AI Image Generation |
698
+ | Presentation slides (PPTX) | **HTML → PPTX** |
699
+ | Charts and graphs | **HTML Conversion** |
700
+ | Architecture diagrams | **D2 Conversion** |
701
+
702
+ ### HTML Conversion Benefits
703
+
704
+ - **Perfect text accuracy** - No AI hallucinations on text/numbers
705
+ - **Reproducible** - Same input = identical output every time
706
+ - **Free** - No API costs (local Puppeteer rendering)
707
+ - **Fast** - Renders in < 1 second
708
+ - **Editable** - Modify source HTML to update
709
+
710
+ ### Available Templates
711
+
712
+ **HTML Templates:**
713
+ - `data-chart` - Bar/pie charts from data
714
+ - `comparison-table` - Side-by-side comparisons
715
+ - `process-flow` - Step-by-step processes (vertical/horizontal/timeline)
716
+
717
+ **D2 Diagram Templates:**
718
+ - `architecture` - System architecture diagrams
719
+ - `flowchart` - Decision flowcharts
720
+ - `sequence` - Sequence diagrams
721
+
722
+ ### Using HTML Conversion
723
+
724
+ ```javascript
725
+ const {
726
+ templateToVisual,
727
+ d2TemplateToVisual,
728
+ htmlToPng,
729
+ htmlToPdf,
730
+ htmlToPptx
731
+ } = require('./src/lib/html-conversion-utils.js');
732
+
733
+ // Generate infographic from template
734
+ const result = await templateToVisual('data-chart', {
735
+ title: 'Q4 Revenue by Region',
736
+ chartType: 'bar',
737
+ items: [
738
+ { label: 'North America', value: '$2.4M', percentage: 85, color: '#3b82f6' },
739
+ { label: 'Europe', value: '$1.8M', percentage: 64, color: '#10b981' }
740
+ ]
741
+ }, 'png');
742
+
743
+ console.log(`Generated: ${result.path}`);
744
+ console.log(`Cost: $0.00 (local rendering)`);
745
+
746
+ // Generate D2 architecture diagram
747
+ const diagram = await d2TemplateToVisual('architecture', {
748
+ title: 'System Architecture',
749
+ components: [
750
+ { id: 'user', label: 'User', shape: 'person' },
751
+ { id: 'api', label: 'API Gateway' },
752
+ { id: 'db', label: 'Database', shape: 'cylinder' }
753
+ ],
754
+ connections: [
755
+ { from: 'user', to: 'api', label: 'HTTPS' },
756
+ { from: 'api', to: 'db', label: 'SQL' }
757
+ ]
758
+ }, 'png');
759
+ ```
760
+
761
+ ### CLI Usage
762
+
763
+ ```bash
764
+ # List available templates
765
+ node src/scripts/html-conversion-cli.js list
766
+
767
+ # Generate from HTML template
768
+ node src/scripts/html-conversion-cli.js template data-chart \
769
+ --data '{"title":"Sales Report","items":[...]}' \
770
+ --format png
771
+
772
+ # Generate D2 diagram
773
+ node src/scripts/html-conversion-cli.js d2 "user -> api -> db" --format png
774
+
775
+ # Generate PPTX presentation
776
+ node src/scripts/html-conversion-cli.js pptx ./slides/ --output presentation.pptx
777
+ ```
778
+
779
+ ### Decision Guide: AI vs HTML
780
+
781
+ **Choose AI Image Generation when:**
782
+ - Creative/artistic output needed
783
+ - Photorealistic imagery
784
+ - Abstract concepts without specific data
785
+ - Unique visual styles
786
+
787
+ **Choose HTML Conversion when:**
788
+ - Specific numbers, statistics, or data
789
+ - Text must be accurate (company names, metrics)
790
+ - Architecture/technical diagrams
791
+ - Process flows with exact steps
792
+ - Comparison tables with specific features
793
+ - Presentation decks from data
794
+
795
+ ### Example: Hybrid Approach
796
+
797
+ For articles, combine both methods:
798
+
799
+ ```javascript
800
+ // Hero image → AI (creative)
801
+ const hero = await generateImage(prompt, { type: 'hero' });
802
+
803
+ // Data chart → HTML (accurate)
804
+ const chart = await templateToVisual('data-chart', chartData, 'png');
805
+
806
+ // Architecture diagram → D2 (precise)
807
+ const arch = await d2TemplateToVisual('architecture', archData, 'png');
808
+ ```
809
+
686
810
  ## Summary
687
811
 
688
812
  You are responsible for:
@@ -690,9 +814,10 @@ You are responsible for:
690
814
  2. ✅ Gathering user requirements (prompt, type, service preferences)
691
815
  3. ✅ Estimating costs and checking budgets
692
816
  4. ✅ Generating images/videos using appropriate APIs
693
- 5. ✅ Saving to organized directory structure
694
- 6. ✅ Tracking usage and costs
695
- 7. ✅ Returning markdown references
696
- 8. ✅ Providing helpful error messages and alternatives
817
+ 5. ✅ **Using HTML conversion for data-driven/precise visuals**
818
+ 6. ✅ Saving to organized directory structure
819
+ 7. ✅ Tracking usage and costs
820
+ 8. ✅ Returning markdown references
821
+ 9. ✅ Providing helpful error messages and alternatives
697
822
 
698
823
  Always prioritize user experience, cost transparency, and quality results.
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: myai-content-enrichment
3
+ description: Enrich existing articles with real-time data and AI-generated visuals
4
+ tools: Read, Write, Edit, Bash, SlashCommand
5
+ ---
6
+
7
+ Enhance existing articles with real-time data from enrichment apps and optionally add context-aware visuals.
8
+
9
+ ## Task
10
+
11
+ Enrich the article at: $ARGUMENTS
12
+
13
+ ## What This Does
14
+
15
+ **Does NOT write new content.** Takes existing markdown and:
16
+ - Runs data enrichment apps (network latency, brand extraction)
17
+ - Updates content with real, current data
18
+ - Optionally generates visuals using enrichment context (via `/myai-generate-visual`)
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ # Add network data to article
24
+ /myai-content-enrichment "article.md" --app network ashburn-va
25
+
26
+ # Extract branding + generate branded visuals
27
+ /myai-content-enrichment "article.md" --app branding https://example.com --with-images
28
+
29
+ # Full enrichment (auto-detect apps + visuals)
30
+ /myai-content-enrichment "article.md" --app all --with-images --auto
31
+ ```
32
+
33
+ ## Flags
34
+
35
+ **Data Apps:**
36
+ - `--app branding <url>` - Extract brand colors/styling
37
+ - `--app network <location>` - Run latency tests (ashburn-va, los-angeles, chicago, europe, asia)
38
+ - `--app all` - Auto-detect and run relevant apps
39
+ - `--auto` - Skip confirmation prompts
40
+
41
+ **Visuals:**
42
+ - `--with-images` - Generate visuals with enrichment data
43
+ - `--regenerate-images` - Replace existing images
44
+ - `--no-images` - Skip visuals (default if not specified)
45
+
46
+ **Options:**
47
+ - `--preserve-original` - Backup before modifying
48
+
49
+ ## Workflow
50
+
51
+ ### 1. Parse & Validate
52
+ - Read target article
53
+ - Parse flags
54
+ - Confirm apps to run (unless `--auto`)
55
+
56
+ ### 2. Run Data Apps
57
+ **Network App** (`--app network <location>`):
58
+ - Execute: `node src/scripts/ping.js 'location'`
59
+ - Save: `./data/latency-test-YYYYMMDD.md`
60
+ - Extract metrics for content
61
+
62
+ **Branding App** (`--app branding <url>`):
63
+ - Check cache: `brand_design_guidelines.md`
64
+ - If not cached: Navigate → Screenshot → Analyze → Cache
65
+ - Store brand colors/style for visuals
66
+
67
+ ### 3. Update Content
68
+ - Find relevant sections (e.g., performance data)
69
+ - Inject real metrics
70
+ - Add data citations
71
+ - Preserve original voice/style
72
+
73
+ ### 4. Generate Visuals (Optional)
74
+ **If `--with-images` or `--regenerate-images`:**
75
+ - Analyze article sections needing visuals
76
+ - Build enriched prompts:
77
+ - Base: Article context
78
+ - Add brand: `primary #2245C4, accent #19FFF4, modern professional style`
79
+ - Add data: `Ashburn 24.5ms, Chicago 31.4ms, LA 45.2ms`
80
+ - Delegate to `/myai-generate-visual` with enriched prompt
81
+ - Embed generated images with captions
82
+
83
+ See `/myai-generate-visual --help` for visual generation details.
84
+
85
+ ### 5. Finalize
86
+ - Save enriched article (backup if `--preserve-original`)
87
+ - Report what was enriched
88
+
89
+ ## Data Apps Reference
90
+
91
+ ### Network Latency
92
+
93
+ **Script:** `src/scripts/ping.js`
94
+ **Locations:** ashburn-va, los-angeles, chicago, europe, asia
95
+ **Output:** `./data/latency-test-YYYYMMDD.md`
96
+
97
+ ```bash
98
+ node src/scripts/ping.js 'ashburn-va' 'europe'
99
+ ```
100
+
101
+ ### Brand Extraction
102
+
103
+ **Cache:** `brand_design_guidelines.md`
104
+ **Process:** Playwright screenshot → Color/style analysis → Cache
105
+ **Reuse:** Once cached, reused for all future enrichments
106
+
107
+ ## Example
108
+
109
+ **Before:**
110
+ ```markdown
111
+ # Cloud Hosting Performance
112
+ Performance varies by location.
113
+ ```
114
+
115
+ **Command:**
116
+ ```bash
117
+ /myai-content-enrichment "article.md" --app network ashburn-va --app branding https://mycompany.com --with-images --auto
118
+ ```
119
+
120
+ **After:**
121
+ ```markdown
122
+ # Cloud Hosting Performance
123
+
124
+ Performance varies by location. Our real-time tests show:
125
+
126
+ - **Ashburn, VA**: 24.5ms average latency
127
+ - **Chicago, IL**: 31.4ms average latency
128
+
129
+ ![Network Performance](./content-assets/images/2026-01-16/infographic-network-latency-123456.png)
130
+ *Real-time tests conducted 2026-01-16. Source: ./data/latency-test-20260116.md*
131
+ ```
132
+
133
+ **Visual:** Infographic with your brand colors showing exact latency on US map.
134
+
135
+ ## Output Report
136
+
137
+ ```
138
+ ✅ Enrichment Complete: cloud-hosting-guide.md
139
+
140
+ Apps Run:
141
+ • Network: ashburn-va, chicago
142
+ • Branding: https://mycompany.com (cached)
143
+
144
+ Data Updated:
145
+ • Performance section: +2 real metrics
146
+ • Added data citation
147
+
148
+ Visuals Generated:
149
+ • Network infographic (via /myai-generate-visual)
150
+ File: ./content-assets/images/2026-01-16/infographic-network-latency.png
151
+ Cost: $0.02
152
+
153
+ File: ./cloud-hosting-guide.md
154
+ Backup: ./cloud-hosting-guide.original.md
155
+ ```
156
+
157
+ ## Use Cases
158
+
159
+ **Refresh old data:**
160
+ ```bash
161
+ /myai-content-enrichment "old-article.md" --app network ashburn-va --update-data
162
+ ```
163
+
164
+ **Add brand to generic content:**
165
+ ```bash
166
+ /myai-content-enrichment "guide.md" --app branding https://mycompany.com --with-images
167
+ ```
168
+
169
+ **Rebrand existing content:**
170
+ ```bash
171
+ /myai-content-enrichment "article.md" --app branding https://newsite.com --regenerate-images
172
+ ```
173
+
174
+ **Full pipeline:**
175
+ ```bash
176
+ /myai-content-enrichment "article.md" --app all --with-images --auto
177
+ ```
178
+
179
+ ## Integration
180
+
181
+ **Content Pipeline:**
182
+ ```bash
183
+ # 1. Write
184
+ /myai-content-writer "Cloud Hosting" word_count:2000
185
+
186
+ # 2. Enrich
187
+ /myai-content-enrichment "cloud-hosting.md" --app network ashburn-va --with-images
188
+
189
+ # 3. Publish
190
+ /myai-wordpress-publish "cloud-hosting.md"
191
+ ```
192
+
193
+ **Visual Delegation:**
194
+ ```bash
195
+ # Enrichment calls this internally:
196
+ /myai-generate-visual "Network infographic showing Ashburn 24.5ms, use brand #2245C4" --type illustration
197
+ ```
198
+
199
+ ## Technical Notes
200
+
201
+ **Visual Generation (Stage 4):**
202
+ 1. Build enriched prompt from context + app data
203
+ 2. Invoke: `SlashCommand('/myai-generate-visual "prompt" --type illustration')`
204
+ 3. Parse output for image path
205
+ 4. Embed: `![alt](path)\n*caption*`
206
+
207
+ **Prompt Enhancement Pattern:**
208
+ ```javascript
209
+ const prompt = `${baseDescription}, use brand colors: ${brand.primary} ${brand.accent}, show latency: ${network.metrics}`;
210
+ ```
211
+
212
+ ## Related Commands
213
+
214
+ - `/myai-content-writer` - Write articles
215
+ - `/myai-generate-visual` - Generate visuals standalone
216
+ - `/myai-wordpress-publish` - Publish to WordPress
217
+
218
+ ## Error Handling
219
+
220
+ **Article not found:** Check file path
221
+ **App fails:** Check network/URL accessibility
222
+ **Visual fails:** Ensure `/myai-configure visual` is set up
223
+ **Budget exceeded:** Visual generation has cost limits
224
+
225
+ ---
226
+
227
+ **Philosophy:** Enrichment enhances, it doesn't replace. Preserve the original article's voice and intent.
@@ -1,35 +1,14 @@
1
1
  ---
2
2
  name: myai-content-writer
3
- description: Professional content writer for SEO-optimized articles with optional AI-generated visuals
4
- tools: Read, Write, Edit, WebSearch, WebFetch, Task, Bash
3
+ description: Professional content writer for SEO-optimized articles and blog posts
4
+ tools: Read, Write, Edit, WebSearch, WebFetch, Task
5
5
  ---
6
6
 
7
- You are a professional content writer specializing in creating high-quality, engaging, and SEO-optimized content with optional AI-generated visual content.
7
+ You are a professional content writer specializing in creating high-quality, engaging, and SEO-optimized content.
8
8
 
9
9
  ## Task
10
- Create comprehensive, well-researched content based on the provided topic: $ARGUMENTS
11
-
12
- ## Visual Content Generation (New!)
13
-
14
- The MyAIDev Method now supports AI-powered visual content generation. Use the `--with-images` flag to automatically generate:
15
- - Hero images for article headers
16
- - Illustrations for concepts
17
- - Diagrams for technical workflows
18
- - Supporting visual content
19
-
20
- **Example Usage:**
21
- ```bash
22
- /myai-content-writer "Microservices Architecture" --with-images
23
- /myai-content-writer "AI Best Practices" --with-images --service=dalle
24
- /myai-content-writer "Developer Guide" --with-images --word-count=1500
25
- ```
26
10
 
27
- **Prerequisites**: User must configure visual generation APIs first:
28
- ```bash
29
- /myai-configure visual
30
- ```
31
-
32
- **Available Services**: Gemini 2.5 Flash ($0.02), Imagen 3 ($0.03), DALL-E 3 ($0.04-0.12), Veo 2 ($0.10 for video)
11
+ Create comprehensive, well-researched content based on the provided topic: $ARGUMENTS
33
12
 
34
13
  ## Core Competencies
35
14
 
@@ -62,6 +41,20 @@ The MyAIDev Method now supports AI-powered visual content generation. Use the `-
62
41
  5. **Optimization**: Review for clarity, accuracy, and SEO
63
42
  6. **Formatting**: Ensure proper Markdown formatting
64
43
 
44
+ ## Parameters Supported
45
+
46
+ - Topic (required): Main subject matter
47
+ - `--word-count`: Target length (default: 800)
48
+ - `--tone`: professional, casual, technical, conversational, academic
49
+ - `--audience`: Target reader demographic
50
+ - `--keywords`: Primary and secondary keywords
51
+ - `--publish-wordpress`: Auto-publish as draft (true/false)
52
+
53
+ **Example:**
54
+ ```bash
55
+ /myai-content-writer "Machine Learning Best Practices" word_count:1500 tone:technical
56
+ ```
57
+
65
58
  ## Output Requirements
66
59
 
67
60
  Save the content as a markdown file with the following structure:
@@ -80,24 +73,42 @@ category: [Primary category]
80
73
  [Content with proper heading hierarchy]
81
74
  ```
82
75
 
83
- ## Parameters Supported
76
+ ## Content Enrichment (Post-Writing)
84
77
 
85
- - Topic (required): Main subject matter
86
- - `--word-count`: Target length (default: 800)
87
- - `--tone`: professional, casual, technical, conversational, academic
88
- - `--audience`: Target reader demographic
89
- - `--keywords`: Primary and secondary keywords
90
- - `--publish-wordpress`: Auto-publish as draft (true/false)
91
- - `--with-images`: Generate AI-powered visual content (new!)
92
- - `--service`: Preferred image generation service (gemini, imagen, dalle)
93
- - `--image-count`: Number of images to generate (default: auto-determined)
78
+ After creating your article, you can enhance it with real-time data and AI-generated visuals using the enrichment command:
79
+
80
+ ```bash
81
+ /myai-content-enrichment "your-article.md" --app network ashburn-va --with-images
82
+ ```
83
+
84
+ **Enrichment Features:**
85
+ - Add real network latency data to infrastructure/hosting articles
86
+ - Extract brand colors/styling for consistent illustrations
87
+ - Generate context-aware visuals with enrichment data
88
+ - Update existing articles with fresh data
89
+
90
+ See `/myai-content-enrichment --help` for full documentation.
94
91
 
95
92
  ## WordPress Integration
96
93
 
97
- If publish_to_wordpress is requested:
94
+ If `--publish-wordpress` is requested:
98
95
  1. Save the content locally first
99
96
  2. Check for WordPress configuration in environment variables
100
97
  3. Use the WordPress MCP to create a draft post
101
98
  4. Report the draft URL to the user
102
99
 
103
- Always prioritize user value over keyword density. Write for humans first, search engines second.
100
+ ## Workflow
101
+
102
+ **Typical usage:**
103
+ ```bash
104
+ # Step 1: Write the article
105
+ /myai-content-writer "Cloud Hosting Guide" word_count:2000 tone:professional
106
+
107
+ # Step 2: (Optional) Enrich with data and visuals
108
+ /myai-content-enrichment "cloud-hosting-guide.md" --app network ashburn-va --with-images --auto
109
+
110
+ # Step 3: (Optional) Publish to WordPress
111
+ /myai-wordpress-publish "cloud-hosting-guide.md" --status draft
112
+ ```
113
+
114
+ Always prioritize user value over keyword density. Write for humans first, search engines second.
@@ -0,0 +1,186 @@
1
+ ---
2
+ name: myai-convert-html
3
+ description: Convert HTML templates to PNG, PDF, or PPTX formats for precise visual content
4
+ ---
5
+
6
+ # HTML Conversion Tool
7
+
8
+ Convert HTML templates and D2 diagrams to images, PDFs, and presentations with pixel-perfect accuracy.
9
+
10
+ ## When to Use This Tool
11
+
12
+ Use HTML conversion when you need:
13
+ - **Data-driven infographics** with precise numbers and text
14
+ - **Comparison tables** with exact formatting
15
+ - **Process diagrams** with specific labels
16
+ - **Architecture diagrams** using D2 language
17
+ - **Presentation slides** (PPTX) from HTML content
18
+
19
+ ## Available Commands
20
+
21
+ ### List Templates
22
+ ```bash
23
+ node src/scripts/html-conversion-cli.js list
24
+ ```
25
+
26
+ ### Convert HTML Template
27
+ ```bash
28
+ # Basic usage
29
+ node src/scripts/html-conversion-cli.js template data-chart --data '{"title":"Sales Report","items":[...]}' --format png
30
+
31
+ # With output file
32
+ node src/scripts/html-conversion-cli.js template comparison-table --data data.json --output comparison.png
33
+ ```
34
+
35
+ ### Convert D2 Diagram
36
+ ```bash
37
+ # From inline script
38
+ node src/scripts/html-conversion-cli.js d2 "user -> api -> database" --format png
39
+
40
+ # From file
41
+ node src/scripts/html-conversion-cli.js d2 diagram.d2 --format svg --theme 200
42
+ ```
43
+
44
+ ### Convert D2 Template
45
+ ```bash
46
+ node src/scripts/html-conversion-cli.js d2-template architecture --data '{"title":"System Design",...}' --format svg
47
+ ```
48
+
49
+ ### Convert Raw HTML
50
+ ```bash
51
+ node src/scripts/html-conversion-cli.js html custom.html --format pdf
52
+ ```
53
+
54
+ ### Generate PPTX
55
+ ```bash
56
+ # From directory of HTML slides
57
+ node src/scripts/html-conversion-cli.js pptx ./slides/ --output presentation.pptx
58
+
59
+ # From JSON configuration
60
+ node src/scripts/html-conversion-cli.js pptx slides.json --title "Q4 Report" --author "Team"
61
+ ```
62
+
63
+ ## Built-in Templates
64
+
65
+ ### HTML Templates
66
+
67
+ 1. **data-chart** - Bar/pie charts with data visualization
68
+ ```json
69
+ {
70
+ "title": "Revenue by Region",
71
+ "chartType": "bar",
72
+ "items": [
73
+ {"label": "North America", "value": 45, "percentage": 90, "color": "#3b82f6"},
74
+ {"label": "Europe", "value": 32, "percentage": 64, "color": "#10b981"}
75
+ ]
76
+ }
77
+ ```
78
+
79
+ 2. **comparison-table** - Side-by-side feature comparisons
80
+ ```json
81
+ {
82
+ "title": "Plan Comparison",
83
+ "layout": "table",
84
+ "columns": [{"name": "Basic"}, {"name": "Pro", "highlight": true}],
85
+ "rows": [{"feature": "Users", "values": [{"text": "5"}, {"text": "Unlimited"}]}]
86
+ }
87
+ ```
88
+
89
+ 3. **process-flow** - Step-by-step process diagrams
90
+ ```json
91
+ {
92
+ "title": "Development Workflow",
93
+ "layout": "vertical",
94
+ "steps": [
95
+ {"number": 1, "title": "Planning", "description": "Define requirements"}
96
+ ]
97
+ }
98
+ ```
99
+
100
+ ### D2 Templates
101
+
102
+ 1. **architecture** - System architecture diagrams
103
+ 2. **flowchart** - Decision flowcharts
104
+ 3. **sequence** - Sequence diagrams
105
+
106
+ ## HTML vs AI Image Generation
107
+
108
+ | Use Case | Recommended Tool |
109
+ |----------|-----------------|
110
+ | Infographics with exact data | HTML Conversion |
111
+ | Creative/artistic images | AI Image Generation |
112
+ | Diagrams with specific text | HTML/D2 Conversion |
113
+ | Photorealistic scenes | AI Image Generation |
114
+ | Presentations/slides | HTML → PPTX |
115
+ | Charts and graphs | HTML Conversion |
116
+
117
+ ## Example Workflow
118
+
119
+ 1. **Create data file** (data.json):
120
+ ```json
121
+ {
122
+ "title": "Q4 Performance Report",
123
+ "subtitle": "Year over Year Growth",
124
+ "chartType": "bar",
125
+ "items": [
126
+ {"label": "Revenue", "value": "$2.4M", "percentage": 85, "color": "#3b82f6"},
127
+ {"label": "Users", "value": "150K", "percentage": 72, "color": "#10b981"},
128
+ {"label": "Retention", "value": "94%", "percentage": 94, "color": "#f59e0b"}
129
+ ],
130
+ "source": "Internal Analytics"
131
+ }
132
+ ```
133
+
134
+ 2. **Generate PNG**:
135
+ ```bash
136
+ node src/scripts/html-conversion-cli.js template data-chart --data data.json --format png --output q4-report.png
137
+ ```
138
+
139
+ 3. **Generate PDF**:
140
+ ```bash
141
+ node src/scripts/html-conversion-cli.js template data-chart --data data.json --format pdf --output q4-report.pdf
142
+ ```
143
+
144
+ ## D2 Diagram Quick Reference
145
+
146
+ D2 is a declarative diagram language. Quick syntax:
147
+
148
+ ```d2
149
+ # Nodes
150
+ user: User {shape: person}
151
+ api: API Server
152
+ db: Database {shape: cylinder}
153
+
154
+ # Connections
155
+ user -> api: HTTP
156
+ api -> db: SQL
157
+
158
+ # Grouping
159
+ backend: Backend {
160
+ api
161
+ db
162
+ }
163
+ ```
164
+
165
+ Install D2: `curl -fsSL https://d2lang.com/install.sh | sh`
166
+
167
+ ## Tips
168
+
169
+ 1. **Preview templates** before generating final output:
170
+ ```bash
171
+ node src/scripts/html-conversion-cli.js preview data-chart
172
+ ```
173
+
174
+ 2. **Use high DPI** for print quality:
175
+ ```bash
176
+ node src/scripts/html-conversion-cli.js template data-chart --data data.json --scale 3
177
+ ```
178
+
179
+ 3. **Custom styling** via template data:
180
+ ```json
181
+ {
182
+ "accentColor": "#6366f1",
183
+ "accentGradient": "#4f46e5",
184
+ "backgroundColor": "#fafafa"
185
+ }
186
+ ```