myaidev-method 0.0.7 → 0.1.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/.claude/CLAUDE.md +52 -0
- package/.claude/agents/content-writer.md +155 -0
- package/.claude/commands/myai-configure.md +44 -0
- package/.claude/commands/myai-content-writer.md +78 -0
- package/.claude/commands/myai-wordpress-publish.md +120 -0
- package/.claude/mcp/gutenberg-converter.js +447 -0
- package/.claude/mcp/mcp-config.json +101 -0
- package/.claude/mcp/wordpress-server-simple.js +182 -0
- package/.claude/mcp/wordpress-server.js +1277 -0
- package/.claude/settings.local.json +12 -0
- package/COOLIFY_DEPLOYMENT.md +750 -0
- package/README.md +6 -6
- package/WORDPRESS_ADMIN_SCRIPTS.md +474 -0
- package/bin/cli.js +17 -22
- package/dist/mcp/gutenberg-converter.js +447 -0
- package/dist/mcp/mcp-config.json +101 -0
- package/dist/mcp/wordpress-server-simple.js +182 -0
- package/dist/mcp/wordpress-server.js +1277 -0
- package/package.json +29 -5
- package/src/lib/coolify-utils.js +380 -0
- package/src/lib/report-synthesizer.js +504 -0
- package/src/lib/wordpress-admin-utils.js +703 -0
- package/src/mcp/health-check.js +190 -0
- package/src/mcp/mcp-launcher.js +237 -0
- package/src/scripts/coolify-deploy-app.js +287 -0
- package/src/scripts/coolify-list-resources.js +199 -0
- package/src/scripts/coolify-status.js +97 -0
- package/src/scripts/test-coolify-deploy.js +47 -0
- package/src/scripts/wordpress-comprehensive-report.js +325 -0
- package/src/scripts/wordpress-health-check.js +175 -0
- package/src/scripts/wordpress-performance-check.js +461 -0
- package/src/scripts/wordpress-security-scan.js +221 -0
- package/src/templates/claude/agents/coolify-deploy.md +563 -0
- package/src/templates/claude/agents/wordpress-admin.md +228 -271
- package/src/templates/claude/commands/myai-configure.md +10 -74
- package/src/templates/claude/commands/myai-coolify-deploy.md +172 -0
- package/src/templates/claude/commands/myai-wordpress-publish.md +16 -8
|
@@ -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 };
|