myaidev-method 0.0.8 → 0.2.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.
Files changed (34) hide show
  1. package/.env.example +20 -0
  2. package/COOLIFY_DEPLOYMENT.md +750 -0
  3. package/PUBLISHING_GUIDE.md +521 -0
  4. package/README.md +125 -27
  5. package/WORDPRESS_ADMIN_SCRIPTS.md +474 -0
  6. package/package.json +36 -3
  7. package/src/lib/coolify-utils.js +380 -0
  8. package/src/lib/payloadcms-utils.js +394 -0
  9. package/src/lib/report-synthesizer.js +504 -0
  10. package/src/lib/static-site-utils.js +377 -0
  11. package/src/lib/wordpress-admin-utils.js +703 -0
  12. package/src/scripts/astro-publish.js +209 -0
  13. package/src/scripts/coolify-deploy-app.js +287 -0
  14. package/src/scripts/coolify-list-resources.js +199 -0
  15. package/src/scripts/coolify-status.js +97 -0
  16. package/src/scripts/docusaurus-publish.js +209 -0
  17. package/src/scripts/init-project.js +91 -0
  18. package/src/scripts/mintlify-publish.js +205 -0
  19. package/src/scripts/payloadcms-publish.js +202 -0
  20. package/src/scripts/test-coolify-deploy.js +47 -0
  21. package/src/scripts/wordpress-comprehensive-report.js +325 -0
  22. package/src/scripts/wordpress-health-check.js +175 -0
  23. package/src/scripts/wordpress-performance-check.js +461 -0
  24. package/src/scripts/wordpress-security-scan.js +221 -0
  25. package/src/templates/claude/agents/astro-publish.md +43 -0
  26. package/src/templates/claude/agents/coolify-deploy.md +563 -0
  27. package/src/templates/claude/agents/docusaurus-publish.md +42 -0
  28. package/src/templates/claude/agents/mintlify-publish.md +42 -0
  29. package/src/templates/claude/agents/payloadcms-publish.md +134 -0
  30. package/src/templates/claude/commands/myai-astro-publish.md +54 -0
  31. package/src/templates/claude/commands/myai-coolify-deploy.md +172 -0
  32. package/src/templates/claude/commands/myai-docusaurus-publish.md +45 -0
  33. package/src/templates/claude/commands/myai-mintlify-publish.md +45 -0
  34. package/src/templates/claude/commands/myai-payloadcms-publish.md +45 -0
@@ -0,0 +1,221 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * WordPress Security Scan Script
5
+ * Scriptable security scan with JSON output for agent processing
6
+ *
7
+ * Usage:
8
+ * npx myaidev-method wordpress:security-scan [options]
9
+ * node src/scripts/wordpress-security-scan.js [options]
10
+ */
11
+
12
+ import { WordPressAdminUtils } from '../lib/wordpress-admin-utils.js';
13
+ import { writeFileSync } from 'fs';
14
+ import { resolve } from 'path';
15
+
16
+ const args = process.argv.slice(2);
17
+
18
+ const options = {
19
+ format: 'json', // json or text
20
+ output: null, // file path for output
21
+ verbose: false,
22
+ detailed: false
23
+ };
24
+
25
+ // Parse arguments
26
+ for (let i = 0; i < args.length; i++) {
27
+ switch (args[i]) {
28
+ case '--format':
29
+ options.format = args[++i] || 'json';
30
+ break;
31
+ case '--output':
32
+ case '-o':
33
+ options.output = args[++i];
34
+ break;
35
+ case '--verbose':
36
+ case '-v':
37
+ options.verbose = true;
38
+ break;
39
+ case '--detailed':
40
+ case '-d':
41
+ options.detailed = true;
42
+ break;
43
+ case '--help':
44
+ case '-h':
45
+ printHelp();
46
+ process.exit(0);
47
+ }
48
+ }
49
+
50
+ function printHelp() {
51
+ console.log(`
52
+ WordPress Security Scan Script
53
+
54
+ Usage:
55
+ npx myaidev-method wordpress:security-scan [options]
56
+
57
+ Options:
58
+ --format <type> Output format: json or text (default: json)
59
+ --output <file> Write output to file
60
+ -o <file> Alias for --output
61
+ --verbose Show detailed progress information
62
+ -v Alias for --verbose
63
+ --detailed Include detailed vulnerability information
64
+ -d Alias for --detailed
65
+ --help Show this help message
66
+ -h Alias for --help
67
+
68
+ Environment Variables (from .env):
69
+ WORDPRESS_URL WordPress site URL
70
+ WORDPRESS_USERNAME Admin username
71
+ WORDPRESS_APP_PASSWORD Application password
72
+
73
+ Security Checks:
74
+ ✓ User account security audit
75
+ ✓ Plugin vulnerability detection
76
+ ✓ Outdated software detection
77
+ ✓ Common security misconfigurations
78
+ ✓ Weak password patterns
79
+
80
+ Examples:
81
+ # Run security scan with JSON output
82
+ npx myaidev-method wordpress:security-scan
83
+
84
+ # Save detailed scan to file
85
+ npx myaidev-method wordpress:security-scan --detailed --output security-report.json
86
+
87
+ # Display human-readable text report
88
+ npx myaidev-method wordpress:security-scan --format text
89
+
90
+ # Verbose mode with progress information
91
+ npx myaidev-method wordpress:security-scan --verbose
92
+
93
+ Output Structure (JSON):
94
+ {
95
+ "success": true,
96
+ "timestamp": "2025-10-01T12:00:00.000Z",
97
+ "site": { "name": "...", "url": "..." },
98
+ "security_score": 85,
99
+ "vulnerabilities": [],
100
+ "warnings": [...],
101
+ "summary": {
102
+ "critical_issues": 0,
103
+ "warnings": 2,
104
+ "status": "warning"
105
+ },
106
+ "recommendations": [...]
107
+ }
108
+
109
+ Exit Codes:
110
+ 0 - No security issues found
111
+ 1 - Scan error occurred
112
+ 2 - Security warnings found
113
+ 3 - Critical vulnerabilities found
114
+ `);
115
+ }
116
+
117
+ async function runSecurityScan() {
118
+ try {
119
+ if (options.verbose) {
120
+ console.error('Initializing WordPress connection...');
121
+ }
122
+
123
+ const wpUtils = new WordPressAdminUtils();
124
+
125
+ if (options.verbose) {
126
+ console.error('Running security scan...');
127
+ console.error(' - Auditing user accounts...');
128
+ }
129
+
130
+ const securityData = await wpUtils.runSecurityScan();
131
+
132
+ if (options.verbose) {
133
+ console.error(' - Checking plugin vulnerabilities...');
134
+ console.error(' - Analyzing security configuration...');
135
+ console.error('Security scan completed.');
136
+ }
137
+
138
+ // Remove detailed info if not requested
139
+ if (!options.detailed && securityData.success) {
140
+ // Truncate detailed information for cleaner output
141
+ if (securityData.warnings) {
142
+ securityData.warnings.forEach(warning => {
143
+ if (warning.details && warning.details.length > 5) {
144
+ warning.details = [
145
+ ...warning.details.slice(0, 5),
146
+ `... and ${warning.details.length - 5} more`
147
+ ];
148
+ }
149
+ });
150
+ }
151
+ }
152
+
153
+ // Format output
154
+ let output;
155
+ if (options.format === 'text') {
156
+ output = wpUtils.formatSecurityReport(securityData);
157
+ } else {
158
+ output = JSON.stringify(securityData, null, 2);
159
+ }
160
+
161
+ // Write to file or stdout
162
+ if (options.output) {
163
+ const outputPath = resolve(options.output);
164
+ writeFileSync(outputPath, output, 'utf8');
165
+
166
+ if (options.verbose) {
167
+ console.error(`Report written to: ${outputPath}`);
168
+ }
169
+
170
+ // Also output summary to stdout for piping
171
+ console.log(JSON.stringify({
172
+ success: true,
173
+ output_file: outputPath,
174
+ security_score: securityData.security_score,
175
+ critical_issues: securityData.summary?.critical_issues || 0,
176
+ warnings: securityData.summary?.warnings || 0
177
+ }));
178
+ } else {
179
+ console.log(output);
180
+ }
181
+
182
+ // Exit with appropriate code
183
+ if (!securityData.success) {
184
+ process.exit(1);
185
+ }
186
+
187
+ const criticalIssues = securityData.vulnerabilities?.length || 0;
188
+ const warnings = securityData.warnings?.length || 0;
189
+
190
+ if (criticalIssues > 0) {
191
+ process.exit(3); // Critical vulnerabilities found
192
+ }
193
+
194
+ if (warnings > 0) {
195
+ process.exit(2); // Warnings found
196
+ }
197
+
198
+ process.exit(0); // All clear
199
+ } catch (error) {
200
+ const errorOutput = {
201
+ success: false,
202
+ error: error.message,
203
+ timestamp: new Date().toISOString()
204
+ };
205
+
206
+ if (options.format === 'json') {
207
+ console.log(JSON.stringify(errorOutput, null, 2));
208
+ } else {
209
+ console.error(`ERROR: ${error.message}`);
210
+ }
211
+
212
+ process.exit(1);
213
+ }
214
+ }
215
+
216
+ // Run if called directly
217
+ if (import.meta.url === `file://${process.argv[1]}`) {
218
+ runSecurityScan();
219
+ }
220
+
221
+ export { runSecurityScan };
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: astro-publish
3
+ description: Publish markdown content to Astro sites with content collections
4
+ version: 1.0.0
5
+ capabilities:
6
+ - Astro project detection
7
+ - Content collections publishing
8
+ - Frontmatter transformation
9
+ - Git workflow automation
10
+ ---
11
+
12
+ # Astro Publishing Agent
13
+
14
+ Professional publishing for Astro static sites with content collections support.
15
+
16
+ ## Workflow
17
+
18
+ 1. **Validate Project**: Detect astro.config.mjs and content collections
19
+ 2. **Transform Frontmatter**: Convert to Astro schema (pubDate, draft, etc.)
20
+ 3. **Publish Content**: Write to src/content/{collection}/ or src/pages/
21
+ 4. **Git Operations**: Commit and push changes
22
+
23
+ ## Usage Examples
24
+
25
+ ### Publish to Content Collection
26
+ ```
27
+ /astro-publish "article.md" --collection blog
28
+ ```
29
+ Publishes to src/content/blog/ with proper schema.
30
+
31
+ ### Publish to Pages
32
+ ```
33
+ /astro-publish "about.md" --pages
34
+ ```
35
+ Publishes to src/pages/ directory.
36
+
37
+ ### Full Metadata
38
+ Transforms:
39
+ - `date` → `pubDate` (ISO 8601)
40
+ - `status` → `draft` (boolean)
41
+ - `excerpt` → `description`
42
+
43
+ Use StaticSiteUtils for all operations.