myaidev-method 0.2.19 → 0.2.23

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 (57) hide show
  1. package/CHANGELOG.md +123 -5
  2. package/README.md +205 -13
  3. package/TECHNICAL_ARCHITECTURE.md +64 -2
  4. package/USER_GUIDE.md +453 -48
  5. package/bin/cli.js +187 -2
  6. package/content-rules.example.md +80 -0
  7. package/dist/mcp/mcp-config.json +138 -1
  8. package/dist/mcp/mcp-launcher.js +237 -0
  9. package/dist/mcp/openstack-server.js +1607 -0
  10. package/dist/server/.tsbuildinfo +1 -1
  11. package/dist/server/auth/layers.d.ts +1 -1
  12. package/dist/server/auth/services/AuthService.d.ts +1 -1
  13. package/dist/server/auth/services/TokenService.js.map +1 -1
  14. package/dist/server/auth/services/example.d.ts +5 -5
  15. package/package.json +17 -17
  16. package/src/config/workflows.js +532 -0
  17. package/src/index.js +21 -8
  18. package/src/lib/payloadcms-utils.js +206 -0
  19. package/src/lib/update-manager.js +2 -1
  20. package/src/lib/visual-config-utils.js +321 -295
  21. package/src/lib/visual-generation-utils.js +1080 -740
  22. package/src/lib/workflow-installer.js +512 -0
  23. package/src/libs/security/authorization-checker.js +606 -0
  24. package/src/mcp/openstack-server.js +1607 -0
  25. package/src/scripts/configure-wordpress-mcp.js +8 -3
  26. package/src/scripts/generate-visual-cli.js +365 -235
  27. package/src/scripts/openstack-setup.sh +110 -0
  28. package/src/scripts/ping.js +250 -0
  29. package/src/scripts/security/environment-detect.js +425 -0
  30. package/src/scripts/wordpress/publish-to-wordpress.js +165 -0
  31. package/src/server/auth/services/TokenService.ts +1 -1
  32. package/src/templates/claude/agents/content-rules-setup.md +657 -0
  33. package/src/templates/claude/agents/content-writer.md +328 -1
  34. package/src/templates/claude/agents/openstack-vm-manager.md +281 -0
  35. package/src/templates/claude/agents/osint-researcher.md +1075 -0
  36. package/src/templates/claude/agents/penetration-tester.md +908 -0
  37. package/src/templates/claude/agents/security-auditor.md +244 -0
  38. package/src/templates/claude/agents/security-setup.md +1094 -0
  39. package/src/templates/claude/agents/visual-content-generator.md +182 -4
  40. package/src/templates/claude/agents/webapp-security-tester.md +581 -0
  41. package/src/templates/claude/commands/myai-configure.md +85 -1
  42. package/src/templates/claude/commands/myai-content-rules-setup.md +204 -0
  43. package/src/templates/claude/commands/myai-openstack.md +229 -0
  44. package/src/templates/claude/commands/sc:security-exploit.md +464 -0
  45. package/src/templates/claude/commands/sc:security-recon.md +281 -0
  46. package/src/templates/claude/commands/sc:security-report.md +756 -0
  47. package/src/templates/claude/commands/sc:security-scan.md +441 -0
  48. package/src/templates/claude/commands/sc:security-setup.md +501 -0
  49. package/src/templates/codex/commands/myai-content-rules-setup.md +85 -0
  50. package/src/templates/gemini/commands/myai-content-rules-setup.toml +57 -0
  51. package/.claude/mcp/sparc-orchestrator-server.js +0 -607
  52. package/.claude/mcp/wordpress-server.js +0 -1277
  53. package/src/agents/content-writer-prompt.md +0 -164
  54. package/src/agents/content-writer.json +0 -70
  55. package/src/templates/claude/mcp_config.json +0 -30
  56. package/src/templates/claude/slash_commands.json +0 -166
  57. package/src/templates/scripts/configure-wordpress-mcp.js +0 -181
@@ -70,13 +70,30 @@ Collect information from the user:
70
70
 
71
71
  **Required Information:**
72
72
  - **Prompt/Description**: What should the image/video depict?
73
- - **Type**: hero, illustration, diagram, screenshot, video
73
+ - **Type**: See Image Type Reference below
74
74
 
75
75
  **Optional Information:**
76
- - **Preferred Service**: gemini, imagen, dalle, veo (or auto-select)
77
- - **Quality**: standard, hd (for DALL-E)
76
+ - **Preferred Service**: gemini, imagen, gpt-image-1.5, flux2-pro, veo3 (or auto-select)
77
+ - **Quality**: low, medium, high (affects cost and detail)
78
78
  - **Size**: 1024x1024, 1792x1024, 1024x1792
79
79
 
80
+ ### Image Type Reference
81
+
82
+ | Type | Description | Best Service | Use Case |
83
+ |------|-------------|--------------|----------|
84
+ | `hero` | Article header, main theme | Gemini/Imagen | Blog posts, landing pages |
85
+ | `illustration` | Abstract concepts, metaphors | FLUX 2 Pro | Explanatory content |
86
+ | `diagram` | Technical workflows, architecture | Gemini | Documentation |
87
+ | `screenshot` | UI mockups, interface designs | GPT Image 1.5 | Tutorials |
88
+ | `infographic-data` | Statistics, metrics, charts | GPT Image 1.5 | Data-driven articles |
89
+ | `infographic-process` | Step flows, workflows | FLUX 2 Pro | How-to guides |
90
+ | `infographic-comparison` | Side-by-side comparisons | GPT Image 1.5 | Comparison articles |
91
+ | `infographic-timeline` | Chronological events | FLUX 2 Pro | History, roadmaps |
92
+ | `architecture-diagram` | System design, tech stacks | Gemini | Technical docs |
93
+ | `flowchart` | Decision trees, processes | Gemini | Process documentation |
94
+ | `sequence-diagram` | API/service interactions | Gemini | API documentation |
95
+ | `video` | Product demos, tutorials | Veo 3 | Marketing, tutorials |
96
+
80
97
  **Example Interaction:**
81
98
  ```
82
99
  User: Generate a hero image for an article about AI development
@@ -407,16 +424,177 @@ Always enhance user prompts for better results:
407
424
  ```javascript
408
425
  const enhancePrompt = (userPrompt, type) => {
409
426
  const prefixes = {
427
+ // Standard types
410
428
  hero: 'Professional hero image, high quality, visually striking:',
411
429
  illustration: 'Clean illustration, professional style:',
412
430
  diagram: 'Technical diagram, clear labels, easy to understand:',
413
- screenshot: 'Professional screenshot, clean interface:'
431
+ screenshot: 'Professional screenshot, clean interface:',
432
+
433
+ // Infographic types (use GPT Image 1.5 for best text rendering)
434
+ 'infographic-data': 'Clean data visualization infographic with clear typography, color-coded sections, modern flat design. Include title area, data callouts with numbers, and clean layout:',
435
+ 'infographic-process': 'Step-by-step process infographic with numbered steps, icons for each step, connecting arrows, clean modern design. Each step clearly labeled:',
436
+ 'infographic-comparison': 'Side-by-side comparison infographic with two columns, clear headers, checkmarks and X marks, comparison points aligned, professional business style:',
437
+ 'infographic-timeline': 'Horizontal timeline infographic with dated milestones, icons at each point, connecting line, clean modern design, clear labels:',
438
+
439
+ // Technical diagram types
440
+ 'architecture-diagram': 'Technical system architecture diagram with labeled boxes, connection arrows, cloud/server/database icons, legend area, isometric or flat technical style:',
441
+ 'flowchart': 'Professional flowchart with decision diamonds, process rectangles, start/end ovals, clear yes/no paths, labeled arrows:',
442
+ 'sequence-diagram': 'Technical sequence diagram showing component interactions, lifelines, arrows with labels, participant boxes at top:'
414
443
  };
415
444
 
416
445
  return `${prefixes[type] || ''} ${userPrompt}`;
417
446
  };
418
447
  ```
419
448
 
449
+ ### Infographic Generation Guidelines
450
+
451
+ When generating infographics, follow these practices:
452
+
453
+ **For Data Infographics (`infographic-data`):**
454
+ ```javascript
455
+ // Best service: GPT Image 1.5 (excellent text rendering)
456
+ const prompt = buildDataInfographicPrompt({
457
+ title: "5 Key Authentication Metrics",
458
+ metrics: [
459
+ { label: "API Latency", value: "< 50ms" },
460
+ { label: "Uptime", value: "99.99%" },
461
+ { label: "Daily Requests", value: "10M+" }
462
+ ],
463
+ style: "modern flat design, blue and white color scheme"
464
+ });
465
+
466
+ // Example output prompt:
467
+ // "Clean data visualization infographic: Title '5 Key Authentication Metrics'.
468
+ // Show 3 metrics with large numbers: API Latency < 50ms, Uptime 99.99%,
469
+ // Daily Requests 10M+. Modern flat design, blue and white, clear typography."
470
+ ```
471
+
472
+ **For Process Infographics (`infographic-process`):**
473
+ ```javascript
474
+ // Best service: FLUX 2 Pro (excellent detail)
475
+ const prompt = buildProcessInfographicPrompt({
476
+ title: "JWT Authentication Flow",
477
+ steps: [
478
+ "1. User submits credentials",
479
+ "2. Server validates and generates JWT",
480
+ "3. Client stores token",
481
+ "4. Client sends token with requests",
482
+ "5. Server verifies token"
483
+ ],
484
+ style: "numbered steps with icons, arrows connecting each step"
485
+ });
486
+ ```
487
+
488
+ **For Comparison Infographics (`infographic-comparison`):**
489
+ ```javascript
490
+ // Best service: GPT Image 1.5 (best for text-heavy visuals)
491
+ const prompt = buildComparisonInfographicPrompt({
492
+ title: "JWT vs Session Authentication",
493
+ items: [
494
+ { category: "Scalability", optionA: "Excellent", optionB: "Good" },
495
+ { category: "Server Storage", optionA: "None", optionB: "Required" },
496
+ { category: "Mobile Support", optionA: "Native", optionB: "Complex" }
497
+ ],
498
+ style: "two-column layout, checkmarks for advantages"
499
+ });
500
+ ```
501
+
502
+ **For Architecture Diagrams (`architecture-diagram`):**
503
+ ```javascript
504
+ // Best service: Gemini (fast, good for technical diagrams)
505
+ const prompt = buildArchitectureDiagramPrompt({
506
+ title: "Microservices Architecture",
507
+ components: ["API Gateway", "Auth Service", "User Service", "Database"],
508
+ connections: ["Gateway → Auth", "Gateway → User", "Services → Database"],
509
+ style: "isometric 3D blocks, labeled, connection arrows"
510
+ });
511
+ ```
512
+
513
+ ### Service Selection by Type
514
+
515
+ Use this guide to auto-select the best service:
516
+
517
+ ```javascript
518
+ function getRecommendedService(type) {
519
+ const recommendations = {
520
+ // Text-heavy visuals → GPT Image 1.5 (best text rendering)
521
+ 'infographic-data': 'gpt-image-1.5',
522
+ 'infographic-comparison': 'gpt-image-1.5',
523
+ 'screenshot': 'gpt-image-1.5',
524
+
525
+ // Detailed illustrations → FLUX 2 Pro (best detail)
526
+ 'infographic-process': 'flux2-pro',
527
+ 'infographic-timeline': 'flux2-pro',
528
+ 'illustration': 'flux2-pro',
529
+ 'hero': 'flux2-pro',
530
+
531
+ // Technical diagrams → Gemini (fast, cost-effective)
532
+ 'diagram': 'gemini',
533
+ 'architecture-diagram': 'gemini',
534
+ 'flowchart': 'gemini',
535
+ 'sequence-diagram': 'gemini',
536
+
537
+ // Video → Veo 3 (only option)
538
+ 'video': 'veo3'
539
+ };
540
+
541
+ return recommendations[type] || 'gemini';
542
+ }
543
+ ```
544
+
545
+ ### Batch Generation for Articles
546
+
547
+ Generate all visuals for an article efficiently:
548
+
549
+ ```javascript
550
+ async function generateArticleVisuals(articlePlan) {
551
+ const visuals = [];
552
+
553
+ // Hero image
554
+ if (articlePlan.heroImage) {
555
+ visuals.push({
556
+ type: 'hero',
557
+ prompt: articlePlan.heroImage.concept,
558
+ service: 'flux2-pro'
559
+ });
560
+ }
561
+
562
+ // Diagrams
563
+ for (const diagram of articlePlan.diagrams || []) {
564
+ visuals.push({
565
+ type: diagram.type || 'diagram',
566
+ prompt: diagram.description,
567
+ service: getRecommendedService(diagram.type)
568
+ });
569
+ }
570
+
571
+ // Infographics
572
+ for (const infographic of articlePlan.infographics || []) {
573
+ visuals.push({
574
+ type: infographic.type,
575
+ prompt: buildInfographicPrompt(infographic),
576
+ service: getRecommendedService(infographic.type)
577
+ });
578
+ }
579
+
580
+ // Estimate total cost before generating
581
+ const totalCost = visuals.reduce((sum, v) => sum + estimateCost(v.service), 0);
582
+ console.log(`📊 Generating ${visuals.length} visuals. Estimated cost: $${totalCost.toFixed(2)}`);
583
+
584
+ // Generate all (with budget check)
585
+ const results = [];
586
+ for (const visual of visuals) {
587
+ const result = await generateImage(visual.prompt, {
588
+ preferredService: visual.service,
589
+ type: visual.type
590
+ });
591
+ results.push(result);
592
+ }
593
+
594
+ return results;
595
+ }
596
+ ```
597
+
420
598
  ### Quality vs Cost
421
599
 
422
600
  ```javascript