myaidev-method 0.0.8 → 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/README.md CHANGED
@@ -62,11 +62,11 @@ npx myaidev-method init --codex
62
62
  npx myaidev-method init
63
63
  ```
64
64
 
65
- **That's it!** No authentication, no complex setup, no additional configuration needed.
65
+ **That's it!** No complex setup.
66
66
 
67
67
  ### Requirements
68
68
 
69
- - Node.js >= 18.0.0
69
+ - Node.js >= 20.0.0
70
70
  - Claude Code >= 1.0.0 (for Claude features)
71
71
  - WordPress site with REST API enabled (optional, for WordPress features)
72
72
  - SSH access to server (optional, for advanced WordPress admin features)
@@ -0,0 +1,474 @@
1
+ # WordPress Admin Scripts
2
+
3
+ Reusable Node.js utilities for WordPress administration tasks with predictable JSON output for agent processing.
4
+
5
+ ## Overview
6
+
7
+ The MyAIDev Method package includes scriptable WordPress admin utilities that can be:
8
+ - Run directly via `npm run` commands
9
+ - Called via `npx myaidev-method` commands
10
+ - Used by the `wordpress-admin` agent for automated analysis
11
+ - Integrated into CI/CD pipelines for monitoring
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install myaidev-method
17
+ # or
18
+ npx myaidev-method init --claude
19
+ ```
20
+
21
+ ## Configuration
22
+
23
+ All scripts use WordPress REST API credentials from `.env`:
24
+
25
+ ```bash
26
+ WORDPRESS_URL=https://your-site.com
27
+ WORDPRESS_USERNAME=admin_username
28
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx
29
+ ```
30
+
31
+ Create WordPress Application Password:
32
+ 1. Go to WordPress Admin → Users → Your Profile
33
+ 2. Scroll to "Application Passwords"
34
+ 3. Enter name (e.g., "MyAIDev Scripts") and click "Add New"
35
+ 4. Copy the generated password to `.env`
36
+
37
+ ## Available Scripts
38
+
39
+ ### 1. Health Check
40
+
41
+ Comprehensive WordPress site health assessment.
42
+
43
+ **Usage:**
44
+ ```bash
45
+ # Via npm
46
+ npm run wordpress:health-check
47
+
48
+ # Via npx
49
+ npx myaidev-method wordpress:health-check
50
+
51
+ # With options
52
+ npm run wordpress:health-check -- --format text --output health-report.txt
53
+ npx myaidev-method wordpress:health-check -- --verbose
54
+ ```
55
+
56
+ **Options:**
57
+ - `--format <type>` - Output format: `json` (default) or `text`
58
+ - `--output <file>` / `-o <file>` - Write output to file
59
+ - `--verbose` / `-v` - Show detailed progress
60
+ - `--help` / `-h` - Show help
61
+
62
+ **Checks performed:**
63
+ - WordPress version status
64
+ - Plugin health and updates
65
+ - Content health (posts, media, cleanup needs)
66
+ - User security audit
67
+ - Performance metrics
68
+
69
+ **Output Structure (JSON):**
70
+ ```json
71
+ {
72
+ "success": true,
73
+ "timestamp": "2025-10-01T12:00:00.000Z",
74
+ "site": { "name": "...", "url": "..." },
75
+ "overall_health": {
76
+ "score": 85,
77
+ "grade": "B",
78
+ "status": "healthy"
79
+ },
80
+ "checks": [...],
81
+ "summary": {
82
+ "total_checks": 5,
83
+ "passed": 4,
84
+ "warnings": 1,
85
+ "critical": 0
86
+ },
87
+ "recommendations": [...]
88
+ }
89
+ ```
90
+
91
+ **Exit Codes:**
92
+ - `0` - No critical issues
93
+ - `1` - Scan error
94
+ - `2` - Critical issues found
95
+
96
+ ---
97
+
98
+ ### 2. Security Scan
99
+
100
+ Security vulnerability detection and user audit.
101
+
102
+ **Usage:**
103
+ ```bash
104
+ # Via npm
105
+ npm run wordpress:security-scan
106
+
107
+ # Via npx
108
+ npx myaidev-method wordpress:security-scan
109
+
110
+ # With options
111
+ npm run wordpress:security-scan -- --detailed --output security-report.json
112
+ ```
113
+
114
+ **Options:**
115
+ - `--format <type>` - Output format: `json` (default) or `text`
116
+ - `--output <file>` / `-o <file>` - Write output to file
117
+ - `--verbose` / `-v` - Show detailed progress
118
+ - `--detailed` / `-d` - Include detailed vulnerability info
119
+ - `--help` / `-h` - Show help
120
+
121
+ **Security checks:**
122
+ - User account security audit
123
+ - Plugin vulnerability detection
124
+ - Outdated software detection
125
+ - Common security misconfigurations
126
+ - Weak password patterns
127
+
128
+ **Output Structure (JSON):**
129
+ ```json
130
+ {
131
+ "success": true,
132
+ "timestamp": "2025-10-01T12:00:00.000Z",
133
+ "site": { "name": "...", "url": "..." },
134
+ "security_score": 85,
135
+ "vulnerabilities": [],
136
+ "warnings": [...],
137
+ "summary": {
138
+ "critical_issues": 0,
139
+ "warnings": 2,
140
+ "status": "warning"
141
+ },
142
+ "recommendations": [...]
143
+ }
144
+ ```
145
+
146
+ **Exit Codes:**
147
+ - `0` - No security issues
148
+ - `1` - Scan error
149
+ - `2` - Warnings found
150
+ - `3` - Critical vulnerabilities found
151
+
152
+ ---
153
+
154
+ ### 3. Performance Check
155
+
156
+ Performance analysis with timing measurements.
157
+
158
+ **Usage:**
159
+ ```bash
160
+ # Via npm
161
+ npm run wordpress:performance-check
162
+
163
+ # Via npx
164
+ npx myaidev-method wordpress:performance-check
165
+
166
+ # With options
167
+ npm run wordpress:performance-check -- --iterations 5 --output perf-report.json
168
+ ```
169
+
170
+ **Options:**
171
+ - `--format <type>` - Output format: `json` (default) or `text`
172
+ - `--output <file>` / `-o <file>` - Write output to file
173
+ - `--verbose` / `-v` - Show detailed progress
174
+ - `--iterations <n>` / `-i <n>` - Number of timing iterations (default: 3)
175
+ - `--help` / `-h` - Show help
176
+
177
+ **Performance checks:**
178
+ - API response time measurement (avg, median, min, max)
179
+ - Database content analysis
180
+ - Media file optimization opportunities
181
+ - Plugin performance impact
182
+ - Resource usage patterns
183
+
184
+ **Output Structure (JSON):**
185
+ ```json
186
+ {
187
+ "success": true,
188
+ "timestamp": "2025-10-01T12:00:00.000Z",
189
+ "site": { "name": "...", "url": "..." },
190
+ "performance_score": 85,
191
+ "timing": {
192
+ "average": 250,
193
+ "median": 245,
194
+ "min": 230,
195
+ "max": 280
196
+ },
197
+ "metrics": {
198
+ "post_count": 150,
199
+ "media_count": 400,
200
+ "plugin_count": 15,
201
+ "active_plugins": 12
202
+ },
203
+ "analysis": {...},
204
+ "recommendations": [...]
205
+ }
206
+ ```
207
+
208
+ **Exit Codes:**
209
+ - `0` - No performance issues
210
+ - `1` - Check error
211
+ - `2` - Performance warnings
212
+
213
+ ---
214
+
215
+ ### 4. Comprehensive Report
216
+
217
+ Runs all checks and synthesizes into comprehensive report.
218
+
219
+ **Usage:**
220
+ ```bash
221
+ # Via npm
222
+ npm run wordpress:comprehensive-report
223
+
224
+ # Via npx
225
+ npx myaidev-method wordpress:comprehensive-report
226
+
227
+ # With options
228
+ npm run wordpress:comprehensive-report -- --format markdown --output wp-report.md
229
+ npm run wordpress:comprehensive-report -- --save-individual --verbose
230
+ ```
231
+
232
+ **Options:**
233
+ - `--format <type>` - Output format: `markdown` (default) or `json`
234
+ - `--output <file>` / `-o <file>` - Write output to file
235
+ - `--verbose` / `-v` - Show detailed progress
236
+ - `--save-individual` - Save individual report files as well
237
+ - `--health-only` - Only run health check
238
+ - `--security-only` - Only run security scan
239
+ - `--performance-only` - Only run performance check
240
+ - `--help` / `-h` - Show help
241
+
242
+ **Report includes:**
243
+ - Executive summary with all scores
244
+ - Critical issues requiring immediate attention
245
+ - Warnings and recommendations
246
+ - Prioritized action items
247
+ - Key metrics and statistics
248
+ - Individual check results
249
+
250
+ **Exit Codes:**
251
+ - `0` - No critical issues
252
+ - `1` - Error occurred
253
+ - `2` - Warnings found
254
+ - `3` - Critical issues found
255
+
256
+ ---
257
+
258
+ ## Agent Integration
259
+
260
+ These scripts are designed to work with the `wordpress-admin` agent:
261
+
262
+ ### Example: WordPress Admin Agent Workflow
263
+
264
+ ```bash
265
+ # Agent calls comprehensive report
266
+ npx myaidev-method wordpress:comprehensive-report --format json --output /tmp/wp-report.json
267
+
268
+ # Agent reads and processes JSON output
269
+ # Agent generates natural language analysis
270
+ # Agent provides actionable recommendations
271
+ ```
272
+
273
+ ### Agent Usage Pattern
274
+
275
+ 1. **Script Execution**: Agent runs script to get structured data
276
+ 2. **Data Processing**: Agent parses JSON output
277
+ 3. **Analysis**: Agent synthesizes findings with context
278
+ 4. **Recommendations**: Agent provides prioritized actions
279
+
280
+ ### Calling from Agent
281
+
282
+ In `.claude/agents/wordpress-admin.md`:
283
+
284
+ ```markdown
285
+ ## Running Health Check
286
+
287
+ Use the Bash tool to execute the health check script:
288
+
289
+ ```bash
290
+ npm run wordpress:health-check -- --format json --output /tmp/health.json
291
+ ```
292
+
293
+ Then read the JSON output:
294
+
295
+ ```bash
296
+ # Read the report
297
+ cat /tmp/health.json
298
+ ```
299
+
300
+ Process the structured data and provide comprehensive analysis.
301
+ ```
302
+
303
+ ---
304
+
305
+ ## Library Usage
306
+
307
+ You can also use the utilities programmatically:
308
+
309
+ ```javascript
310
+ import { WordPressAdminUtils } from 'myaidev-method/src/lib/wordpress-admin-utils.js';
311
+ import { ReportSynthesizer } from 'myaidev-method/src/lib/report-synthesizer.js';
312
+
313
+ // Initialize
314
+ const wpUtils = new WordPressAdminUtils({
315
+ url: 'https://your-site.com',
316
+ username: 'admin',
317
+ appPassword: 'xxxx xxxx xxxx xxxx'
318
+ });
319
+
320
+ // Run health check
321
+ const healthData = await wpUtils.runHealthCheck();
322
+ console.log(healthData);
323
+
324
+ // Run security scan
325
+ const securityData = await wpUtils.runSecurityScan();
326
+ console.log(securityData);
327
+
328
+ // Synthesize multiple reports
329
+ const synthesizer = new ReportSynthesizer();
330
+ synthesizer.addReport(healthData, 'health');
331
+ synthesizer.addReport(securityData, 'security');
332
+
333
+ const comprehensive = synthesizer.synthesize();
334
+ console.log(comprehensive);
335
+
336
+ // Generate markdown report
337
+ const markdown = synthesizer.generateMarkdownReport();
338
+ console.log(markdown);
339
+ ```
340
+
341
+ ---
342
+
343
+ ## CI/CD Integration
344
+
345
+ ### Example: GitHub Actions
346
+
347
+ ```yaml
348
+ name: WordPress Health Check
349
+
350
+ on:
351
+ schedule:
352
+ - cron: '0 0 * * *' # Daily at midnight
353
+
354
+ jobs:
355
+ health-check:
356
+ runs-on: ubuntu-latest
357
+ steps:
358
+ - uses: actions/checkout@v3
359
+
360
+ - name: Setup Node.js
361
+ uses: actions/setup-node@v3
362
+ with:
363
+ node-version: '18'
364
+
365
+ - name: Install dependencies
366
+ run: npm install myaidev-method
367
+
368
+ - name: Run health check
369
+ env:
370
+ WORDPRESS_URL: ${{ secrets.WORDPRESS_URL }}
371
+ WORDPRESS_USERNAME: ${{ secrets.WORDPRESS_USERNAME }}
372
+ WORDPRESS_APP_PASSWORD: ${{ secrets.WORDPRESS_APP_PASSWORD }}
373
+ run: |
374
+ npx myaidev-method wordpress:comprehensive-report \
375
+ --format json \
376
+ --output health-report.json
377
+
378
+ - name: Upload report
379
+ uses: actions/upload-artifact@v3
380
+ with:
381
+ name: wordpress-health-report
382
+ path: health-report.json
383
+
384
+ - name: Check for critical issues
385
+ run: |
386
+ # Exit code 3 = critical issues
387
+ if [ $? -eq 3 ]; then
388
+ echo "::error::Critical WordPress issues found"
389
+ exit 1
390
+ fi
391
+ ```
392
+
393
+ ---
394
+
395
+ ## Monitoring & Automation
396
+
397
+ ### Scheduled Health Checks
398
+
399
+ ```bash
400
+ # Add to crontab for daily checks
401
+ 0 0 * * * cd /path/to/project && npm run wordpress:comprehensive-report -- --output /var/log/wp-health-$(date +\%Y\%m\%d).json
402
+ ```
403
+
404
+ ### Alert on Critical Issues
405
+
406
+ ```bash
407
+ #!/bin/bash
408
+ # health-check-alert.sh
409
+
410
+ npm run wordpress:health-check -- --format json --output /tmp/health.json
411
+ EXIT_CODE=$?
412
+
413
+ if [ $EXIT_CODE -eq 2 ]; then
414
+ # Send alert (email, Slack, etc.)
415
+ echo "Critical WordPress issues detected!"
416
+ cat /tmp/health.json | mail -s "WordPress Critical Alert" admin@example.com
417
+ fi
418
+ ```
419
+
420
+ ---
421
+
422
+ ## Troubleshooting
423
+
424
+ ### Authentication Errors
425
+
426
+ ```bash
427
+ # Test connection
428
+ npx myaidev-method wordpress:health-check --verbose
429
+
430
+ # Common issues:
431
+ # - Incorrect application password (no spaces in .env)
432
+ # - Wrong username
433
+ # - REST API disabled
434
+ # - Firewall blocking requests
435
+ ```
436
+
437
+ ### Permission Errors
438
+
439
+ Some operations require administrator privileges:
440
+ - Plugin management
441
+ - User audits
442
+ - Theme information
443
+
444
+ Ensure the WordPress user has admin role.
445
+
446
+ ### Script Not Found
447
+
448
+ ```bash
449
+ # Ensure package is installed
450
+ npm list myaidev-method
451
+
452
+ # Reinstall if needed
453
+ npm install myaidev-method
454
+
455
+ # Run from project root
456
+ npm run wordpress:health-check
457
+ ```
458
+
459
+ ---
460
+
461
+ ## Contributing
462
+
463
+ To add new WordPress admin utilities:
464
+
465
+ 1. Add functions to `src/lib/wordpress-admin-utils.js`
466
+ 2. Create script in `src/scripts/wordpress-*.js`
467
+ 3. Add npm script to `package.json`
468
+ 4. Update this documentation
469
+
470
+ ---
471
+
472
+ ## License
473
+
474
+ MIT - See LICENSE file for details
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myaidev-method",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "AI CLI tools package with custom subagents and MCP integrations for Claude Code, Gemini CLI, and more",
5
5
  "mcpName": "io.github.myaione/myaidev-method",
6
6
  "main": "src/index.js",
@@ -23,16 +23,25 @@
23
23
  "build:mcp": "mkdir -p dist/mcp && cp .claude/mcp/*.js .claude/mcp/*.json dist/mcp/",
24
24
  "prepublishOnly": "npm install && npm test && npm run build:mcp",
25
25
  "postinstall": "echo \"MyAIDev Method installed successfully! Run 'npx myaidev-method init --claude' to get started.\"",
26
- "wordpress:troubleshoot": "node src/templates/docs/wordpress-troubleshoot.js"
26
+ "wordpress:troubleshoot": "node src/templates/docs/wordpress-troubleshoot.js",
27
+ "wordpress:health-check": "node src/scripts/wordpress-health-check.js",
28
+ "wordpress:security-scan": "node src/scripts/wordpress-security-scan.js",
29
+ "wordpress:performance-check": "node src/scripts/wordpress-performance-check.js",
30
+ "wordpress:comprehensive-report": "node src/scripts/wordpress-comprehensive-report.js",
31
+ "coolify:status": "node src/scripts/coolify-status.js",
32
+ "coolify:list": "node src/scripts/coolify-list-resources.js"
27
33
  },
28
34
  "keywords": [
29
35
  "claude-code",
30
36
  "ai-cli",
31
37
  "mcp",
32
38
  "wordpress",
39
+ "coolify",
33
40
  "content-writer",
34
41
  "ai-agents",
35
42
  "automation",
43
+ "deployment",
44
+ "devops",
36
45
  "cli-tool",
37
46
  "slash-commands",
38
47
  "gemini-cli",
@@ -69,7 +78,9 @@
69
78
  "README.md",
70
79
  "USER_GUIDE.md",
71
80
  "LICENSE",
72
- ".env.example"
81
+ ".env.example",
82
+ "WORDPRESS_ADMIN_SCRIPTS.md",
83
+ "COOLIFY_DEPLOYMENT.md"
73
84
  ],
74
85
  "engines": {
75
86
  "node": ">=18.0.0"