claude-plugin-wordpress-manager 1.8.0 → 2.0.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 (42) hide show
  1. package/.claude-plugin/plugin.json +7 -3
  2. package/CHANGELOG.md +41 -0
  3. package/agents/wp-cicd-engineer.md +194 -0
  4. package/agents/wp-site-manager.md +27 -0
  5. package/docs/plans/2026-02-28-cicd-v2.0.0.md +375 -0
  6. package/docs/plans/2026-02-28-multisite-v1.9.0-design.md +258 -0
  7. package/docs/plans/2026-02-28-multisite-v1.9.0.md +1604 -0
  8. package/package.json +8 -3
  9. package/servers/wp-rest-bridge/build/tools/index.d.ts +260 -0
  10. package/servers/wp-rest-bridge/build/tools/index.js +6 -0
  11. package/servers/wp-rest-bridge/build/tools/multisite-network.d.ts +132 -0
  12. package/servers/wp-rest-bridge/build/tools/multisite-network.js +157 -0
  13. package/servers/wp-rest-bridge/build/tools/multisite-sites.d.ts +150 -0
  14. package/servers/wp-rest-bridge/build/tools/multisite-sites.js +160 -0
  15. package/servers/wp-rest-bridge/build/types.d.ts +13 -0
  16. package/servers/wp-rest-bridge/build/wordpress.d.ts +19 -0
  17. package/servers/wp-rest-bridge/build/wordpress.js +10 -0
  18. package/servers/wp-rest-bridge/build/wpcli.d.ts +23 -0
  19. package/servers/wp-rest-bridge/build/wpcli.js +72 -0
  20. package/skills/wordpress-router/references/decision-tree.md +7 -3
  21. package/skills/wp-cicd/SKILL.md +119 -0
  22. package/skills/wp-cicd/references/bitbucket-pipelines-wordpress.md +142 -0
  23. package/skills/wp-cicd/references/deploy-strategies.md +164 -0
  24. package/skills/wp-cicd/references/github-actions-wordpress.md +183 -0
  25. package/skills/wp-cicd/references/gitlab-ci-wordpress.md +189 -0
  26. package/skills/wp-cicd/references/quality-gates.md +215 -0
  27. package/skills/wp-cicd/references/secrets-management.md +175 -0
  28. package/skills/wp-cicd/references/wp-env-ci.md +135 -0
  29. package/skills/wp-cicd/scripts/cicd_inspect.mjs +183 -0
  30. package/skills/wp-deploy/SKILL.md +4 -0
  31. package/skills/wp-e2e-testing/SKILL.md +4 -0
  32. package/skills/wp-multisite/SKILL.md +92 -0
  33. package/skills/wp-multisite/references/domain-mapping.md +70 -0
  34. package/skills/wp-multisite/references/migration-multisite.md +76 -0
  35. package/skills/wp-multisite/references/network-plugins.md +66 -0
  36. package/skills/wp-multisite/references/network-setup.md +69 -0
  37. package/skills/wp-multisite/references/site-management.md +67 -0
  38. package/skills/wp-multisite/references/user-roles.md +73 -0
  39. package/skills/wp-multisite/scripts/multisite_inspect.mjs +160 -0
  40. package/skills/wp-phpstan/SKILL.md +4 -0
  41. package/skills/wp-security/SKILL.md +4 -0
  42. package/skills/wp-wpcli-and-ops/SKILL.md +4 -0
@@ -0,0 +1,258 @@
1
+ # v1.9.0 Multisite — Design Document
2
+
3
+ **Data:** 2026-02-28
4
+ **Stato:** Approvato
5
+ **Baseline:** v1.8.0 (25 skill, 9 agent, 71 MCP tools, 13 detection scripts)
6
+
7
+ ---
8
+
9
+ ## Contesto
10
+
11
+ WordPress Multisite permette di gestire un network di siti da una singola installazione. Le REST API standard di WordPress NON espongono endpoint per operazioni multisite (creazione/eliminazione sub-siti, network activation, Super Admin management). Per questo motivo, i tool MCP usano **WP-CLI** come backend di esecuzione.
12
+
13
+ ## Decisioni architetturali
14
+
15
+ | Decisione | Scelta | Motivazione |
16
+ |-----------|--------|-------------|
17
+ | Backend esecuzione | WP-CLI via child_process | WordPress REST API non ha endpoint multisite |
18
+ | Contesto esecuzione | Locale + SSH remoto | Copre sia ambienti dev che produzione |
19
+ | Approccio ibrido | REST dove disponibile, wp-cli per network-only | Minimizza dipendenza SSH, massima compatibilita |
20
+ | Agent | Estensione wp-site-manager (no nuovo agent) | Come da roadmap, multisite e gestione siti |
21
+ | Modulo wp-cli | Dedicato (wpcli.ts) | Riusabile per v2.0 CI/CD, DRY |
22
+
23
+ ---
24
+
25
+ ## Componenti
26
+
27
+ | Tipo | Nome | Descrizione |
28
+ |------|------|-------------|
29
+ | Modulo TS | `wpcli.ts` | Esecuzione wp-cli locale/SSH con auto-detection |
30
+ | MCP Tools | `multisite-sites.ts` (5) | CRUD sub-siti via wp-cli |
31
+ | MCP Tools | `multisite-network.ts` (5) | Network admin, misto REST + wp-cli |
32
+ | Skill | `wp-multisite` | SKILL.md + 6 reference files |
33
+ | Detection | `multisite_inspect.mjs` | Rileva multisite, sub-siti, domain mapping |
34
+ | Agent update | `wp-site-manager.md` | Nuova sezione Multisite Network Management |
35
+
36
+ ---
37
+
38
+ ## Architettura TypeScript
39
+
40
+ ### SiteConfig estesa (`types.ts`)
41
+
42
+ Nuovi campi opzionali aggiunti a SiteConfig:
43
+
44
+ ```typescript
45
+ // WP-CLI access (optional, for multisite and CLI operations)
46
+ wp_path?: string; // Local WP installation path (e.g., ~/Studio/mysite, /var/www/wordpress)
47
+ ssh_host?: string; // SSH hostname for remote wp-cli
48
+ ssh_user?: string; // SSH username
49
+ ssh_key?: string; // Path to SSH private key
50
+ ssh_port?: number; // SSH port (default: 22)
51
+ is_multisite?: boolean; // Flag: this site is a multisite network
52
+ ```
53
+
54
+ ### Nuovo tipo `WPNetworkSite`
55
+
56
+ ```typescript
57
+ interface WPNetworkSite {
58
+ blog_id: number;
59
+ url: string;
60
+ domain: string;
61
+ path: string;
62
+ registered: string;
63
+ last_updated: string;
64
+ public: boolean;
65
+ archived: boolean;
66
+ mature: boolean;
67
+ spam: boolean;
68
+ deleted: boolean;
69
+ }
70
+ ```
71
+
72
+ ### Nuovo modulo `wpcli.ts`
73
+
74
+ Funzioni esportate:
75
+
76
+ | Funzione | Firma | Scopo |
77
+ |----------|-------|-------|
78
+ | `executeWpCli` | `(command: string, siteId?: string) => Promise<string>` | Esegue wp-cli locale o SSH, restituisce stdout |
79
+ | `hasWpCli` | `(siteId?: string) => boolean` | Verifica se wp-cli e configurato |
80
+ | `isMultisite` | `(siteId?: string) => boolean` | Verifica flag is_multisite |
81
+
82
+ Logica `executeWpCli`:
83
+ 1. Risolve siteId (default: activeSiteId)
84
+ 2. Recupera SiteConfig
85
+ 3. Se `wp_path` presente e NO `ssh_host` → locale: `cd {wp_path} && wp {command} --format=json`
86
+ 4. Se `ssh_host` presente → SSH: `ssh -i {ssh_key} -p {ssh_port} {ssh_user}@{ssh_host} 'cd {wp_path} && wp {command} --format=json'`
87
+ 5. Se nessuno configurato → throw Error con messaggio chiaro
88
+ 6. Timeout: 30 secondi
89
+ 7. Parse stdout, gestione stderr per errori
90
+
91
+ ---
92
+
93
+ ## MCP Tools (10 totali)
94
+
95
+ ### `multisite-sites.ts` — 5 tool (tutti wp-cli)
96
+
97
+ | Tool | WP-CLI Command | Input | Output |
98
+ |------|---------------|-------|--------|
99
+ | `ms_list_sites` | `wp site list` | `site_id?` | Array WPNetworkSite |
100
+ | `ms_get_site` | `wp site list --blog_id={id}` | `blog_id, site_id?` | WPNetworkSite singolo |
101
+ | `ms_create_site` | `wp site create --slug --title --email` | `slug, title, email, site_id?` | blog_id creato |
102
+ | `ms_activate_site` | `wp site activate/deactivate {id}` | `blog_id, active: boolean, site_id?` | Conferma |
103
+ | `ms_delete_site` | `wp site delete {id} --yes` | `blog_id, confirm: true, site_id?` | Conferma |
104
+
105
+ ### `multisite-network.ts` — 5 tool (misto REST + wp-cli)
106
+
107
+ | Tool | Metodo | Input | Output |
108
+ |------|--------|-------|--------|
109
+ | `ms_list_network_plugins` | REST `list_plugins` | `site_id?` | Plugin con flag network_active |
110
+ | `ms_network_activate_plugin` | wp-cli `wp plugin activate --network` | `plugin_slug, site_id?` | Conferma |
111
+ | `ms_network_deactivate_plugin` | wp-cli `wp plugin deactivate --network` | `plugin_slug, site_id?` | Conferma |
112
+ | `ms_list_super_admins` | wp-cli `wp super-admin list` | `site_id?` | Array username |
113
+ | `ms_get_network_settings` | wp-cli `wp network meta list 1` | `site_id?` | Network settings object |
114
+
115
+ ### Safety gates
116
+
117
+ - Tutti i tool verificano `isMultisite(siteId)` — errore se non multisite
118
+ - `ms_delete_site` richiede `confirm: true` esplicito
119
+ - `ms_network_activate_plugin` e `ms_network_deactivate_plugin` loggano il plugin e il siteId
120
+ - Timeout 30s per ogni comando wp-cli
121
+
122
+ ---
123
+
124
+ ## Skill `wp-multisite`
125
+
126
+ ### Struttura
127
+
128
+ ```
129
+ skills/wp-multisite/
130
+ ├── SKILL.md
131
+ ├── references/
132
+ │ ├── network-setup.md
133
+ │ ├── site-management.md
134
+ │ ├── domain-mapping.md
135
+ │ ├── network-plugins.md
136
+ │ ├── user-roles.md
137
+ │ └── migration-multisite.md
138
+ └── scripts/
139
+ └── multisite_inspect.mjs
140
+ ```
141
+
142
+ ### SKILL.md — Contenuto
143
+
144
+ - Trigger phrases: multisite, network, sub-site, domain mapping, super admin
145
+ - Prerequisites: wp-cli, is_multisite flag, wp_path/ssh_host configurati
146
+ - Decision tree: 10 tool ms_* con condizioni
147
+ - Reference file links
148
+
149
+ ### Reference files (6)
150
+
151
+ | File | Contenuto |
152
+ |------|-----------|
153
+ | `network-setup.md` | Sub-directory vs sub-domain, wp-config.php constants, MULTISITE/SUBDOMAIN_INSTALL |
154
+ | `site-management.md` | CRUD sub-siti, bulk operations, template sites |
155
+ | `domain-mapping.md` | Domini custom per sub-siti, SSL, DNS CNAME, sunrise.php |
156
+ | `network-plugins.md` | Network-activated vs per-site, must-use plugins, conflict resolution |
157
+ | `user-roles.md` | Super Admin capabilities, site-level roles, add/remove super admin |
158
+ | `migration-multisite.md` | Single-site → multisite, multisite → single, database tables |
159
+
160
+ ### Detection script `multisite_inspect.mjs`
161
+
162
+ Controlla:
163
+ 1. `wp-config.php` per costanti `MULTISITE`, `SUBDOMAIN_INSTALL`, `DOMAIN_CURRENT_SITE`, `PATH_CURRENT_SITE`
164
+ 2. `WP_SITES_CONFIG` env var per flag `is_multisite`
165
+ 3. Presenza di `wp-content/sunrise.php` (domain mapping avanzato)
166
+ 4. `.htaccess` per rewrite rules multisite (sub-directory pattern)
167
+
168
+ ---
169
+
170
+ ## Agent update: `wp-site-manager.md`
171
+
172
+ Nuova sezione **"## Multisite Network Management"** (~25 righe):
173
+
174
+ - Prerequisiti: verifica `is_multisite` e wp-cli
175
+ - Procedure: lista sub-siti, crea sub-sito, gestione plugin network, domain mapping
176
+ - Tool reference: 10 tool `ms_*`
177
+ - Safety: conferma prima di delete, verificare Super Admin
178
+
179
+ ---
180
+
181
+ ## Router `decision-tree.md` (v6)
182
+
183
+ Step 0 — aggiunta keyword "multisite" e "network" alla categoria operations.
184
+
185
+ Step 2b (operations) — nuova entry:
186
+ ```
187
+ "multisite, network, sub-sito, sub-site, domain mapping, super admin, network activate"
188
+ → wp-multisite skill + wp-site-manager agent
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Cross-references
194
+
195
+ | File | Aggiunta |
196
+ |------|----------|
197
+ | `wp-wpcli-and-ops/SKILL.md` | "Per operazioni multisite, vedi `wp-multisite` skill" |
198
+ | `wp-security/SKILL.md` | "Per Super Admin e capabilities multisite, vedi `wp-multisite` skill" |
199
+
200
+ ---
201
+
202
+ ## Config esempio
203
+
204
+ ```json
205
+ [
206
+ {
207
+ "id": "mynetwork",
208
+ "url": "https://network.example.com",
209
+ "username": "superadmin",
210
+ "password": "xxxx xxxx xxxx xxxx",
211
+ "wp_path": "/var/www/wordpress",
212
+ "ssh_host": "network.example.com",
213
+ "ssh_user": "deploy",
214
+ "ssh_key": "~/.ssh/id_rsa",
215
+ "is_multisite": true
216
+ },
217
+ {
218
+ "id": "local-multisite",
219
+ "url": "http://multisite.local",
220
+ "username": "admin",
221
+ "password": "yyyy yyyy yyyy yyyy",
222
+ "wp_path": "~/Studio/multisite",
223
+ "is_multisite": true
224
+ }
225
+ ]
226
+ ```
227
+
228
+ Primo sito: remoto via SSH. Secondo: locale senza SSH.
229
+
230
+ ---
231
+
232
+ ## Version bump
233
+
234
+ - `plugin.json` → v1.9.0, description aggiornata (26 skill, 9 agent)
235
+ - `package.json` → v1.9.0, keywords: +multisite, +network
236
+ - `CHANGELOG.md` → entry v1.9.0
237
+
238
+ ---
239
+
240
+ ## File da creare/modificare
241
+
242
+ | File | Azione | Note |
243
+ |------|--------|------|
244
+ | `servers/wp-rest-bridge/src/wpcli.ts` | **NUOVO** | Modulo WP-CLI execution |
245
+ | `servers/wp-rest-bridge/src/types.ts` | Modifica | +WPNetworkSite, +SiteConfig fields |
246
+ | `servers/wp-rest-bridge/src/tools/multisite-sites.ts` | **NUOVO** | 5 tool gestione sub-siti |
247
+ | `servers/wp-rest-bridge/src/tools/multisite-network.ts` | **NUOVO** | 5 tool network admin |
248
+ | `servers/wp-rest-bridge/src/tools/index.ts` | Modifica | Registrazione 10 nuovi tool |
249
+ | `skills/wp-multisite/SKILL.md` | **NUOVO** | Skill principale |
250
+ | `skills/wp-multisite/references/*.md` (6 file) | **NUOVO** | 6 reference files |
251
+ | `skills/wp-multisite/scripts/multisite_inspect.mjs` | **NUOVO** | Detection script |
252
+ | `agents/wp-site-manager.md` | Modifica | +sezione Multisite |
253
+ | `skills/wordpress-router/references/decision-tree.md` | Modifica | Router v6 |
254
+ | `skills/wp-wpcli-and-ops/SKILL.md` | Modifica | Cross-ref |
255
+ | `skills/wp-security/SKILL.md` | Modifica | Cross-ref |
256
+ | `.claude-plugin/plugin.json` | Modifica | Version bump |
257
+ | `package.json` | Modifica | Version bump |
258
+ | `CHANGELOG.md` | Modifica | Entry v1.9.0 |