myaidev-method 0.2.23 → 0.2.24-1

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 (30) hide show
  1. package/bin/cli.js +218 -38
  2. package/dist/server/.tsbuildinfo +1 -1
  3. package/package.json +10 -5
  4. package/src/config/workflows.js +28 -44
  5. package/src/lib/ascii-banner.js +214 -0
  6. package/src/lib/config-manager.js +470 -0
  7. package/src/lib/content-generator.js +427 -0
  8. package/src/lib/html-conversion-utils.js +843 -0
  9. package/src/lib/seo-optimizer.js +515 -0
  10. package/src/lib/wordpress-client.js +633 -0
  11. package/src/lib/workflow-installer.js +3 -3
  12. package/src/scripts/html-conversion-cli.js +526 -0
  13. package/src/scripts/init/configure.js +436 -0
  14. package/src/scripts/init/install.js +460 -0
  15. package/src/scripts/utils/file-utils.js +404 -0
  16. package/src/scripts/utils/logger.js +300 -0
  17. package/src/scripts/utils/write-content.js +293 -0
  18. package/src/templates/claude/agents/visual-content-generator.md +129 -4
  19. package/src/templates/claude/commands/myai-convert-html.md +186 -0
  20. package/src/templates/diagrams/architecture.d2 +52 -0
  21. package/src/templates/diagrams/flowchart.d2 +42 -0
  22. package/src/templates/diagrams/sequence.d2 +47 -0
  23. package/src/templates/docs/content-creation-guide.md +164 -0
  24. package/src/templates/docs/deployment-guide.md +336 -0
  25. package/src/templates/docs/visual-generation-guide.md +248 -0
  26. package/src/templates/docs/wordpress-publishing-guide.md +208 -0
  27. package/src/templates/infographics/comparison-table.html +347 -0
  28. package/src/templates/infographics/data-chart.html +268 -0
  29. package/src/templates/infographics/process-flow.html +365 -0
  30. /package/src/scripts/{wordpress-health-check.js → wordpress/wordpress-health-check.js} +0 -0
@@ -0,0 +1,248 @@
1
+ # Visual Generation Guide
2
+
3
+ A guide to generating visual content (images, diagrams, videos) with the MyAIDev Method.
4
+
5
+ ## Overview
6
+
7
+ The visual content generation workflow integrates with multiple AI image and video generation services to create professional visuals for your content.
8
+
9
+ ## Prerequisites
10
+
11
+ - Visual workflow installed (`npx myaidev-method visual --claude`)
12
+ - API keys for at least one visual generation service
13
+
14
+ ## Supported Services
15
+
16
+ ### Image Generation
17
+
18
+ | Service | Best For | API Required |
19
+ |---------|----------|--------------|
20
+ | Gemini | General images, diagrams | Google AI API |
21
+ | Imagen | High-quality photographs | Google Cloud |
22
+ | FLUX | Creative, artistic images | Replicate/fal.ai |
23
+
24
+ ### Video Generation
25
+
26
+ | Service | Best For | API Required |
27
+ |---------|----------|--------------|
28
+ | Veo | Professional video content | Google AI API |
29
+
30
+ ## Configuration
31
+
32
+ ### Setting Up API Keys
33
+
34
+ Add to your `.env` file:
35
+
36
+ ```env
37
+ # Google AI (Gemini, Imagen, Veo)
38
+ GOOGLE_AI_API_KEY=your-google-ai-key
39
+
40
+ # Replicate (FLUX)
41
+ REPLICATE_API_TOKEN=your-replicate-token
42
+
43
+ # fal.ai (FLUX alternative)
44
+ FAL_KEY=your-fal-key
45
+ ```
46
+
47
+ ## Generating Images
48
+
49
+ ### Basic Usage
50
+
51
+ ```bash
52
+ /myai-generate-visual "A modern office workspace with natural lighting" --type image
53
+ ```
54
+
55
+ ### With Options
56
+
57
+ ```bash
58
+ /myai-generate-visual "Product photography of a smartphone" \
59
+ --type image \
60
+ --service imagen \
61
+ --aspect-ratio 1:1 \
62
+ --style photorealistic
63
+ ```
64
+
65
+ ### Image Options
66
+
67
+ | Option | Description | Values |
68
+ |--------|-------------|--------|
69
+ | `--service` | Generation service | gemini, imagen, flux |
70
+ | `--aspect-ratio` | Output ratio | 1:1, 16:9, 4:3, 9:16 |
71
+ | `--style` | Visual style | photorealistic, artistic, diagram |
72
+ | `--output` | Output filename | Custom filename |
73
+
74
+ ## Generating Diagrams
75
+
76
+ ### Technical Diagrams
77
+
78
+ ```bash
79
+ /myai-generate-visual "System architecture diagram showing microservices" \
80
+ --type diagram \
81
+ --format mermaid
82
+ ```
83
+
84
+ ### Flowcharts
85
+
86
+ ```bash
87
+ /myai-generate-visual "User authentication flow" \
88
+ --type flowchart \
89
+ --format svg
90
+ ```
91
+
92
+ ### Diagram Types
93
+
94
+ - Architecture diagrams
95
+ - Flowcharts
96
+ - Sequence diagrams
97
+ - Entity relationship diagrams
98
+ - Mind maps
99
+ - Organizational charts
100
+
101
+ ## Generating Videos
102
+
103
+ ### Basic Video
104
+
105
+ ```bash
106
+ /myai-generate-visual "A timelapse of clouds moving across a mountain landscape" \
107
+ --type video \
108
+ --duration 10
109
+ ```
110
+
111
+ ### Video Options
112
+
113
+ | Option | Description | Values |
114
+ |--------|-------------|--------|
115
+ | `--duration` | Video length | 5-60 seconds |
116
+ | `--resolution` | Output quality | 720p, 1080p |
117
+ | `--fps` | Frame rate | 24, 30, 60 |
118
+
119
+ ## Prompt Engineering
120
+
121
+ ### Effective Image Prompts
122
+
123
+ **Good:**
124
+ ```
125
+ Professional headshot of a business executive,
126
+ soft studio lighting, neutral background,
127
+ sharp focus, high resolution
128
+ ```
129
+
130
+ **Less Effective:**
131
+ ```
132
+ Person photo
133
+ ```
134
+
135
+ ### Key Elements
136
+
137
+ 1. **Subject** - What is the main focus?
138
+ 2. **Style** - Photorealistic? Illustration? Diagram?
139
+ 3. **Composition** - Close-up? Wide shot? Angle?
140
+ 4. **Lighting** - Natural? Studio? Dramatic?
141
+ 5. **Quality** - Resolution, detail level
142
+ 6. **Mood** - Professional? Casual? Energetic?
143
+
144
+ ## Integration with Content
145
+
146
+ ### Automatic Image Generation
147
+
148
+ When writing content, request images inline:
149
+
150
+ ```markdown
151
+ ## Introduction
152
+
153
+ [Generate: Hero image showing AI-assisted content creation]
154
+
155
+ The future of content creation...
156
+ ```
157
+
158
+ ### Batch Generation
159
+
160
+ ```bash
161
+ # Generate all images for an article
162
+ /myai-generate-visual --from-content ./content/my-article.md
163
+ ```
164
+
165
+ ## Best Practices
166
+
167
+ ### For Blog Posts
168
+
169
+ - Hero images: 16:9 ratio, high quality
170
+ - In-article images: Relevant, not stock-looking
171
+ - Diagrams: Clear, labeled, consistent style
172
+
173
+ ### For Social Media
174
+
175
+ - Square images (1:1) for Instagram
176
+ - Wide images (16:9) for Twitter/X
177
+ - Vertical (9:16) for Stories/Reels
178
+
179
+ ### For Documentation
180
+
181
+ - Diagrams: SVG or PNG with transparent background
182
+ - Screenshots: Annotated, cropped appropriately
183
+ - Icons: Consistent style throughout
184
+
185
+ ## Troubleshooting
186
+
187
+ ### Generation Failed
188
+
189
+ **Symptoms:** API error or timeout
190
+
191
+ **Solutions:**
192
+ 1. Check API key validity
193
+ 2. Verify service is available
194
+ 3. Simplify prompt
195
+ 4. Try different service
196
+
197
+ ### Poor Quality Output
198
+
199
+ **Symptoms:** Blurry, wrong subject, artifacts
200
+
201
+ **Solutions:**
202
+ 1. Be more specific in prompt
203
+ 2. Add style keywords
204
+ 3. Try different aspect ratio
205
+ 4. Use higher quality service
206
+
207
+ ### Content Policy Violations
208
+
209
+ **Symptoms:** Request rejected
210
+
211
+ **Solutions:**
212
+ 1. Review content policies
213
+ 2. Rephrase prompt
214
+ 3. Avoid restricted content
215
+
216
+ ## API Reference
217
+
218
+ ### VisualGenerator
219
+
220
+ ```javascript
221
+ import { VisualGenerator } from 'myaidev-method';
222
+
223
+ const generator = new VisualGenerator();
224
+
225
+ // Generate image
226
+ const image = await generator.generateImage({
227
+ prompt: 'Description of image',
228
+ service: 'imagen',
229
+ aspectRatio: '16:9'
230
+ });
231
+
232
+ // Generate diagram
233
+ const diagram = await generator.generateDiagram({
234
+ prompt: 'System architecture',
235
+ format: 'mermaid'
236
+ });
237
+
238
+ // Generate video
239
+ const video = await generator.generateVideo({
240
+ prompt: 'Video description',
241
+ duration: 10
242
+ });
243
+ ```
244
+
245
+ ## Related Documentation
246
+
247
+ - [Content Creation Guide](content-creation-guide.md)
248
+ - [WordPress Publishing Guide](wordpress-publishing-guide.md)
@@ -0,0 +1,208 @@
1
+ # WordPress Publishing Guide
2
+
3
+ A guide to publishing content to WordPress using the MyAIDev Method.
4
+
5
+ ## Overview
6
+
7
+ The MyAIDev Method integrates directly with WordPress REST API, allowing you to publish content without leaving your development environment.
8
+
9
+ ## Prerequisites
10
+
11
+ - WordPress site with REST API enabled
12
+ - Application Password created for your user
13
+ - MyAIDev Method WordPress workflow installed
14
+
15
+ ## Configuration
16
+
17
+ ### Setting Up Credentials
18
+
19
+ Run the configuration wizard:
20
+
21
+ ```bash
22
+ /myai-configure wordpress
23
+ ```
24
+
25
+ Or manually set environment variables in `.env`:
26
+
27
+ ```env
28
+ WORDPRESS_URL=https://your-site.com
29
+ WORDPRESS_USERNAME=your-username
30
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
31
+ WORDPRESS_DEFAULT_STATUS=draft
32
+ ```
33
+
34
+ ### Creating an Application Password
35
+
36
+ 1. Log into WordPress admin
37
+ 2. Go to Users → Profile
38
+ 3. Scroll to "Application Passwords"
39
+ 4. Enter a name (e.g., "MyAIDev Method")
40
+ 5. Click "Add New Application Password"
41
+ 6. Copy the generated password (spaces are OK)
42
+
43
+ ## Publishing Content
44
+
45
+ ### Basic Publishing
46
+
47
+ ```bash
48
+ /myai-wordpress-publish ./content/my-article.md
49
+ ```
50
+
51
+ ### With Options
52
+
53
+ ```bash
54
+ /myai-wordpress-publish ./content/my-article.md --status publish --categories "Technology,AI"
55
+ ```
56
+
57
+ ### Publishing Options
58
+
59
+ | Option | Description | Default |
60
+ |--------|-------------|---------|
61
+ | `--status` | Post status (draft, publish, pending) | draft |
62
+ | `--categories` | Comma-separated categories | None |
63
+ | `--tags` | Comma-separated tags | None |
64
+ | `--featured-image` | Path to featured image | None |
65
+
66
+ ## Content Format
67
+
68
+ ### Frontmatter
69
+
70
+ The publisher reads YAML frontmatter from your markdown files:
71
+
72
+ ```yaml
73
+ ---
74
+ title: Your Article Title
75
+ description: Meta description for SEO
76
+ date: 2024-01-15
77
+ author: Your Name
78
+ categories:
79
+ - Technology
80
+ - AI
81
+ tags:
82
+ - machine-learning
83
+ - automation
84
+ status: draft
85
+ ---
86
+ ```
87
+
88
+ ### Supported Markdown
89
+
90
+ - Headings (H1-H6)
91
+ - Bold and italic text
92
+ - Links and images
93
+ - Code blocks
94
+ - Bullet and numbered lists
95
+ - Blockquotes
96
+
97
+ ## Batch Publishing
98
+
99
+ ### Using Content Coordinator
100
+
101
+ ```bash
102
+ # Verify and publish all approved content
103
+ /myai-coordinate-content ./content-queue/
104
+ ```
105
+
106
+ ### Workflow
107
+
108
+ 1. Place markdown files in queue directory
109
+ 2. Run coordinator to verify quality
110
+ 3. Approved content publishes automatically
111
+ 4. Reports generated with URLs and status
112
+
113
+ ## Managing Posts
114
+
115
+ ### Search Posts
116
+
117
+ ```javascript
118
+ // Via WordPress client
119
+ const client = new WordPressClient();
120
+ const results = await client.searchPosts('keyword');
121
+ ```
122
+
123
+ ### Update Existing Post
124
+
125
+ ```bash
126
+ /myai-wordpress-publish ./content/updated-article.md --post-id 123
127
+ ```
128
+
129
+ ### Get Categories
130
+
131
+ ```bash
132
+ # List available categories
133
+ /myai-wordpress-publish --list-categories
134
+ ```
135
+
136
+ ## Troubleshooting
137
+
138
+ ### Authentication Failed
139
+
140
+ **Symptoms:** 401 or 403 errors
141
+
142
+ **Solutions:**
143
+ 1. Verify username is correct
144
+ 2. Regenerate Application Password
145
+ 3. Check user has publish permissions
146
+ 4. Ensure REST API is enabled
147
+
148
+ ### Connection Refused
149
+
150
+ **Symptoms:** ECONNREFUSED or timeout
151
+
152
+ **Solutions:**
153
+ 1. Verify site URL is correct
154
+ 2. Check if site is accessible
155
+ 3. Try with/without `www.`
156
+ 4. Check for firewall blocks
157
+
158
+ ### Content Not Publishing
159
+
160
+ **Symptoms:** Draft created but not published
161
+
162
+ **Solutions:**
163
+ 1. Check `--status` flag
164
+ 2. Verify user has publish capability
165
+ 3. Check for required fields (title, content)
166
+
167
+ ## Security Best Practices
168
+
169
+ 1. **Use Application Passwords** - Never use your main password
170
+ 2. **Limit Permissions** - Create a dedicated publishing user
171
+ 3. **Secure Storage** - Keep credentials in `.env` (add to `.gitignore`)
172
+ 4. **Regular Rotation** - Regenerate passwords periodically
173
+ 5. **HTTPS Only** - Always use HTTPS for your WordPress site
174
+
175
+ ## API Reference
176
+
177
+ ### WordPressClient
178
+
179
+ ```javascript
180
+ import { WordPressClient } from 'myaidev-method';
181
+
182
+ const client = new WordPressClient({
183
+ siteUrl: 'https://your-site.com',
184
+ username: 'your-username',
185
+ appPassword: 'your-app-password'
186
+ });
187
+
188
+ // Publish post
189
+ const result = await client.publishPost({
190
+ title: 'My Article',
191
+ content: 'Article content...',
192
+ status: 'draft'
193
+ });
194
+
195
+ // Search posts
196
+ const posts = await client.searchPosts('keyword');
197
+
198
+ // Update post
199
+ await client.updatePost(postId, { title: 'New Title' });
200
+
201
+ // Get categories
202
+ const categories = await client.getCategories();
203
+ ```
204
+
205
+ ## Related Documentation
206
+
207
+ - [Content Creation Guide](content-creation-guide.md)
208
+ - [Visual Generation Guide](visual-generation-guide.md)