claude-plugin-wordpress-manager 1.4.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-plugin/plugin.json +19 -0
- package/.mcp.json +19 -0
- package/CHANGELOG.md +62 -0
- package/LICENSE +69 -0
- package/README.md +213 -0
- package/agents/wp-content-strategist.md +148 -0
- package/agents/wp-deployment-engineer.md +93 -0
- package/agents/wp-performance-optimizer.md +198 -0
- package/agents/wp-security-auditor.md +161 -0
- package/agents/wp-site-manager.md +109 -0
- package/commands/wp-audit.md +37 -0
- package/commands/wp-backup.md +45 -0
- package/commands/wp-deploy.md +38 -0
- package/commands/wp-setup.md +64 -0
- package/commands/wp-status.md +53 -0
- package/docs/GUIDE.md +1190 -0
- package/hooks/hooks.json +57 -0
- package/hooks/scripts/backup-reminder.sh +29 -0
- package/hooks/scripts/pre-deploy-check.sh +49 -0
- package/package.json +46 -0
- package/scripts/health-check.sh +110 -0
- package/scripts/validate-wp-operation.sh +115 -0
- package/servers/wp-rest-bridge/build/server.d.ts +2 -0
- package/servers/wp-rest-bridge/build/server.js +74 -0
- package/servers/wp-rest-bridge/build/tools/comments.d.ts +227 -0
- package/servers/wp-rest-bridge/build/tools/comments.js +192 -0
- package/servers/wp-rest-bridge/build/tools/index.d.ts +919 -0
- package/servers/wp-rest-bridge/build/tools/index.js +30 -0
- package/servers/wp-rest-bridge/build/tools/media.d.ts +174 -0
- package/servers/wp-rest-bridge/build/tools/media.js +247 -0
- package/servers/wp-rest-bridge/build/tools/plugin-repository.d.ts +62 -0
- package/servers/wp-rest-bridge/build/tools/plugin-repository.js +149 -0
- package/servers/wp-rest-bridge/build/tools/plugins.d.ts +153 -0
- package/servers/wp-rest-bridge/build/tools/plugins.js +175 -0
- package/servers/wp-rest-bridge/build/tools/search.d.ts +44 -0
- package/servers/wp-rest-bridge/build/tools/search.js +44 -0
- package/servers/wp-rest-bridge/build/tools/unified-content.d.ts +328 -0
- package/servers/wp-rest-bridge/build/tools/unified-content.js +628 -0
- package/servers/wp-rest-bridge/build/tools/unified-taxonomies.d.ts +244 -0
- package/servers/wp-rest-bridge/build/tools/unified-taxonomies.js +492 -0
- package/servers/wp-rest-bridge/build/tools/users.d.ts +269 -0
- package/servers/wp-rest-bridge/build/tools/users.js +226 -0
- package/servers/wp-rest-bridge/build/types.d.ts +151 -0
- package/servers/wp-rest-bridge/build/types.js +2 -0
- package/servers/wp-rest-bridge/build/wordpress.d.ts +48 -0
- package/servers/wp-rest-bridge/build/wordpress.js +305 -0
- package/servers/wp-rest-bridge/package.json +27 -0
- package/skills/wordpress-router/SKILL.md +78 -0
- package/skills/wordpress-router/references/decision-tree.md +88 -0
- package/skills/wp-abilities-api/SKILL.md +97 -0
- package/skills/wp-abilities-api/references/php-registration.md +67 -0
- package/skills/wp-abilities-api/references/rest-api.md +13 -0
- package/skills/wp-audit/SKILL.md +114 -0
- package/skills/wp-audit/references/performance-checklist.md +113 -0
- package/skills/wp-audit/references/security-checklist.md +95 -0
- package/skills/wp-audit/references/seo-checklist.md +128 -0
- package/skills/wp-backup/SKILL.md +87 -0
- package/skills/wp-backup/references/backup-strategies.md +116 -0
- package/skills/wp-backup/references/restore-procedures.md +129 -0
- package/skills/wp-block-development/SKILL.md +176 -0
- package/skills/wp-block-development/references/attributes-and-serialization.md +22 -0
- package/skills/wp-block-development/references/block-json.md +49 -0
- package/skills/wp-block-development/references/creating-new-blocks.md +46 -0
- package/skills/wp-block-development/references/debugging.md +36 -0
- package/skills/wp-block-development/references/deprecations.md +24 -0
- package/skills/wp-block-development/references/dynamic-rendering.md +23 -0
- package/skills/wp-block-development/references/inner-blocks.md +25 -0
- package/skills/wp-block-development/references/registration.md +30 -0
- package/skills/wp-block-development/references/supports-and-wrappers.md +18 -0
- package/skills/wp-block-development/references/tooling-and-testing.md +21 -0
- package/skills/wp-block-development/scripts/list_blocks.mjs +121 -0
- package/skills/wp-block-themes/SKILL.md +118 -0
- package/skills/wp-block-themes/references/creating-new-block-theme.md +37 -0
- package/skills/wp-block-themes/references/debugging.md +24 -0
- package/skills/wp-block-themes/references/patterns.md +18 -0
- package/skills/wp-block-themes/references/style-variations.md +14 -0
- package/skills/wp-block-themes/references/templates-and-parts.md +16 -0
- package/skills/wp-block-themes/references/theme-json.md +59 -0
- package/skills/wp-block-themes/scripts/detect_block_themes.mjs +117 -0
- package/skills/wp-content/SKILL.md +103 -0
- package/skills/wp-content/references/content-templates.md +230 -0
- package/skills/wp-content/references/seo-optimization.md +169 -0
- package/skills/wp-deploy/SKILL.md +52 -0
- package/skills/wp-deploy/references/hostinger-deploy.md +51 -0
- package/skills/wp-deploy/references/ssh-deploy.md +63 -0
- package/skills/wp-interactivity-api/SKILL.md +181 -0
- package/skills/wp-interactivity-api/references/debugging.md +29 -0
- package/skills/wp-interactivity-api/references/directives-quickref.md +30 -0
- package/skills/wp-interactivity-api/references/server-side-rendering.md +310 -0
- package/skills/wp-migrate/SKILL.md +100 -0
- package/skills/wp-migrate/references/cross-platform.md +104 -0
- package/skills/wp-migrate/references/hostinger-migration.md +86 -0
- package/skills/wp-performance/SKILL.md +148 -0
- package/skills/wp-performance/references/autoload-options.md +24 -0
- package/skills/wp-performance/references/cron.md +20 -0
- package/skills/wp-performance/references/database.md +20 -0
- package/skills/wp-performance/references/http-api.md +15 -0
- package/skills/wp-performance/references/measurement.md +21 -0
- package/skills/wp-performance/references/object-cache.md +24 -0
- package/skills/wp-performance/references/query-monitor-headless.md +38 -0
- package/skills/wp-performance/references/server-timing.md +22 -0
- package/skills/wp-performance/references/wp-cli-doctor.md +24 -0
- package/skills/wp-performance/references/wp-cli-profile.md +32 -0
- package/skills/wp-performance/scripts/perf_inspect.mjs +128 -0
- package/skills/wp-phpstan/SKILL.md +99 -0
- package/skills/wp-phpstan/references/configuration.md +52 -0
- package/skills/wp-phpstan/references/third-party-classes.md +76 -0
- package/skills/wp-phpstan/references/wordpress-annotations.md +124 -0
- package/skills/wp-phpstan/scripts/phpstan_inspect.mjs +263 -0
- package/skills/wp-playground/SKILL.md +103 -0
- package/skills/wp-playground/references/blueprints.md +36 -0
- package/skills/wp-playground/references/cli-commands.md +39 -0
- package/skills/wp-playground/references/debugging.md +16 -0
- package/skills/wp-plugin-development/SKILL.md +114 -0
- package/skills/wp-plugin-development/references/data-and-cron.md +19 -0
- package/skills/wp-plugin-development/references/debugging.md +19 -0
- package/skills/wp-plugin-development/references/lifecycle.md +33 -0
- package/skills/wp-plugin-development/references/security.md +29 -0
- package/skills/wp-plugin-development/references/settings-api.md +22 -0
- package/skills/wp-plugin-development/references/structure.md +16 -0
- package/skills/wp-plugin-development/scripts/detect_plugins.mjs +122 -0
- package/skills/wp-project-triage/SKILL.md +40 -0
- package/skills/wp-project-triage/references/triage.schema.json +143 -0
- package/skills/wp-project-triage/scripts/detect_wp_project.mjs +592 -0
- package/skills/wp-rest-api/SKILL.md +116 -0
- package/skills/wp-rest-api/references/authentication.md +18 -0
- package/skills/wp-rest-api/references/custom-content-types.md +20 -0
- package/skills/wp-rest-api/references/discovery-and-params.md +20 -0
- package/skills/wp-rest-api/references/responses-and-fields.md +30 -0
- package/skills/wp-rest-api/references/routes-and-endpoints.md +36 -0
- package/skills/wp-rest-api/references/schema.md +22 -0
- package/skills/wp-wpcli-and-ops/SKILL.md +125 -0
- package/skills/wp-wpcli-and-ops/references/automation.md +30 -0
- package/skills/wp-wpcli-and-ops/references/cron-and-cache.md +23 -0
- package/skills/wp-wpcli-and-ops/references/debugging.md +17 -0
- package/skills/wp-wpcli-and-ops/references/multisite.md +22 -0
- package/skills/wp-wpcli-and-ops/references/packages-and-updates.md +22 -0
- package/skills/wp-wpcli-and-ops/references/safety.md +30 -0
- package/skills/wp-wpcli-and-ops/references/search-replace.md +40 -0
- package/skills/wp-wpcli-and-ops/scripts/wpcli_inspect.mjs +90 -0
- package/skills/wpds/SKILL.md +60 -0
- package/skills/wpds/references/wpds-mcp-setup.md +59 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_IGNORES = new Set([
|
|
5
|
+
".git",
|
|
6
|
+
"node_modules",
|
|
7
|
+
"vendor",
|
|
8
|
+
"dist",
|
|
9
|
+
"build",
|
|
10
|
+
"coverage",
|
|
11
|
+
".next",
|
|
12
|
+
".turbo",
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function statSafe(p) {
|
|
16
|
+
try {
|
|
17
|
+
return fs.statSync(p);
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function existsDir(p) {
|
|
24
|
+
const st = statSafe(p);
|
|
25
|
+
return Boolean(st && st.isDirectory());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function readJsonSafe(p) {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(fs.readFileSync(p, "utf8"));
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function findFilesRecursive(repoRoot, predicate, { maxFiles = 6000, maxDepth = 10 } = {}) {
|
|
37
|
+
const results = [];
|
|
38
|
+
const queue = [{ dir: repoRoot, depth: 0 }];
|
|
39
|
+
let visited = 0;
|
|
40
|
+
|
|
41
|
+
while (queue.length > 0) {
|
|
42
|
+
const { dir, depth } = queue.shift();
|
|
43
|
+
if (depth > maxDepth) continue;
|
|
44
|
+
|
|
45
|
+
let entries;
|
|
46
|
+
try {
|
|
47
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
48
|
+
} catch {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (const ent of entries) {
|
|
53
|
+
const fullPath = path.join(dir, ent.name);
|
|
54
|
+
if (ent.isDirectory()) {
|
|
55
|
+
if (DEFAULT_IGNORES.has(ent.name)) continue;
|
|
56
|
+
queue.push({ dir: fullPath, depth: depth + 1 });
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!ent.isFile()) continue;
|
|
60
|
+
|
|
61
|
+
visited += 1;
|
|
62
|
+
if (visited > maxFiles) return { results, truncated: true };
|
|
63
|
+
if (predicate(fullPath)) results.push(fullPath);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return { results, truncated: false };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function summarizeBlockJson(repoRoot, blockJsonPath) {
|
|
71
|
+
const json = readJsonSafe(blockJsonPath);
|
|
72
|
+
if (!json) {
|
|
73
|
+
return {
|
|
74
|
+
path: path.relative(repoRoot, blockJsonPath),
|
|
75
|
+
error: "invalid-json",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const rel = path.relative(repoRoot, blockJsonPath);
|
|
80
|
+
const blockRoot = path.dirname(rel);
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
path: rel,
|
|
84
|
+
blockRoot,
|
|
85
|
+
name: typeof json?.name === "string" ? json.name : null,
|
|
86
|
+
title: typeof json?.title === "string" ? json.title : null,
|
|
87
|
+
apiVersion: typeof json?.apiVersion === "number" ? json.apiVersion : null,
|
|
88
|
+
render: typeof json?.render === "string" ? json.render : null,
|
|
89
|
+
viewScript: json?.viewScript ?? null,
|
|
90
|
+
viewScriptModule: json?.viewScriptModule ?? null,
|
|
91
|
+
editorScript: json?.editorScript ?? null,
|
|
92
|
+
script: json?.script ?? null,
|
|
93
|
+
style: json?.style ?? null,
|
|
94
|
+
editorStyle: json?.editorStyle ?? null,
|
|
95
|
+
attributes: json?.attributes ? Object.keys(json.attributes).slice(0, 50) : [],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function main() {
|
|
100
|
+
const repoRoot = process.cwd();
|
|
101
|
+
|
|
102
|
+
const { results: blockJsonFiles, truncated } = findFilesRecursive(repoRoot, (p) => path.basename(p) === "block.json", {
|
|
103
|
+
maxFiles: 8000,
|
|
104
|
+
maxDepth: 12,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const blocks = blockJsonFiles.map((p) => summarizeBlockJson(repoRoot, p));
|
|
108
|
+
|
|
109
|
+
const report = {
|
|
110
|
+
tool: { name: "list_blocks", version: "0.1.0" },
|
|
111
|
+
repoRoot,
|
|
112
|
+
truncated,
|
|
113
|
+
count: blocks.length,
|
|
114
|
+
blocks,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
main();
|
|
121
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-block-themes
|
|
3
|
+
description: "Use when developing WordPress block themes: theme.json (global settings/styles), templates and template parts, patterns, style variations, and Site Editor troubleshooting (style hierarchy, overrides, caching)."
|
|
4
|
+
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
source: "WordPress/agent-skills (GPL-2.0-or-later)"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# WP Block Themes
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
Use this skill for block theme work such as:
|
|
14
|
+
|
|
15
|
+
- editing `theme.json` (presets, settings, styles, per-block styles)
|
|
16
|
+
- adding or changing templates (`templates/*.html`) and template parts (`parts/*.html`)
|
|
17
|
+
- adding patterns (`patterns/*.php`) and controlling what appears in the inserter
|
|
18
|
+
- adding style variations (`styles/*.json`)
|
|
19
|
+
- debugging “styles not applying” / “editor doesn’t reflect theme.json”
|
|
20
|
+
|
|
21
|
+
## Inputs required
|
|
22
|
+
|
|
23
|
+
- Repo root and which theme is targeted (theme directory if multiple exist).
|
|
24
|
+
- Target WordPress version range (theme.json version and features vary by core version).
|
|
25
|
+
- Where the issue manifests: Site Editor, post editor, frontend, or all.
|
|
26
|
+
|
|
27
|
+
## Procedure
|
|
28
|
+
|
|
29
|
+
### 0) Triage and locate block theme roots
|
|
30
|
+
|
|
31
|
+
1. Run triage:
|
|
32
|
+
- `node skills/wp-project-triage/scripts/detect_wp_project.mjs`
|
|
33
|
+
2. Detect theme roots + key folders:
|
|
34
|
+
- `node skills/wp-block-themes/scripts/detect_block_themes.mjs`
|
|
35
|
+
|
|
36
|
+
If multiple themes exist, pick one and scope all changes to that theme root.
|
|
37
|
+
|
|
38
|
+
### 1) Create a new block theme (if needed)
|
|
39
|
+
|
|
40
|
+
If you are creating a new block theme from scratch (or converting a classic theme):
|
|
41
|
+
|
|
42
|
+
- Prefer starting from a known-good scaffold (or exporting from a WP environment) rather than guessing file layout.
|
|
43
|
+
- Be explicit about the minimum supported WordPress version because `theme.json` schema versions differ.
|
|
44
|
+
|
|
45
|
+
Read:
|
|
46
|
+
- `references/creating-new-block-theme.md`
|
|
47
|
+
|
|
48
|
+
After creating the theme root, re-run `detect_block_themes` and continue below.
|
|
49
|
+
|
|
50
|
+
### 2) Confirm theme type and override expectations
|
|
51
|
+
|
|
52
|
+
- Block theme indicators:
|
|
53
|
+
- `theme.json` present
|
|
54
|
+
- `templates/` and/or `parts/` present
|
|
55
|
+
- Remember the style hierarchy:
|
|
56
|
+
- core defaults → theme.json → child theme → user customizations
|
|
57
|
+
- user customizations can make theme.json edits appear “ignored”
|
|
58
|
+
|
|
59
|
+
Read:
|
|
60
|
+
- `references/debugging.md` (style hierarchy + fastest checks)
|
|
61
|
+
|
|
62
|
+
### 3) Make `theme.json` changes safely
|
|
63
|
+
|
|
64
|
+
Decide whether you are changing:
|
|
65
|
+
|
|
66
|
+
- **settings** (what the UI allows): presets, typography scale, colors, layout, spacing
|
|
67
|
+
- **styles** (how it looks by default): CSS-like rules for elements/blocks
|
|
68
|
+
|
|
69
|
+
Read:
|
|
70
|
+
- `references/theme-json.md`
|
|
71
|
+
|
|
72
|
+
### 4) Templates and template parts
|
|
73
|
+
|
|
74
|
+
- Templates live under `templates/` and are HTML.
|
|
75
|
+
- Template parts live under `parts/` and must not be nested in subdirectories.
|
|
76
|
+
|
|
77
|
+
Read:
|
|
78
|
+
- `references/templates-and-parts.md`
|
|
79
|
+
|
|
80
|
+
### 5) Patterns
|
|
81
|
+
|
|
82
|
+
Prefer filesystem patterns under `patterns/` when you want theme-owned patterns.
|
|
83
|
+
|
|
84
|
+
Read:
|
|
85
|
+
- `references/patterns.md`
|
|
86
|
+
|
|
87
|
+
### 6) Style variations
|
|
88
|
+
|
|
89
|
+
Style variations are JSON files under `styles/`. Note: once a user picks a style variation, that selection is stored in the DB, so changing the file may not “update what the user sees” automatically.
|
|
90
|
+
|
|
91
|
+
Read:
|
|
92
|
+
- `references/style-variations.md`
|
|
93
|
+
|
|
94
|
+
## Verification
|
|
95
|
+
|
|
96
|
+
- Site Editor reflects changes where expected (Styles UI, templates, patterns).
|
|
97
|
+
- Frontend renders with expected styles.
|
|
98
|
+
- If styles aren’t changing, confirm whether user customizations override theme defaults.
|
|
99
|
+
- Run the repo’s build/lint scripts if assets are involved (fonts, custom JS/CSS build).
|
|
100
|
+
|
|
101
|
+
## Failure modes / debugging
|
|
102
|
+
|
|
103
|
+
Start with:
|
|
104
|
+
|
|
105
|
+
- `references/debugging.md`
|
|
106
|
+
|
|
107
|
+
Common issues:
|
|
108
|
+
|
|
109
|
+
- wrong theme root (editing an inactive theme)
|
|
110
|
+
- user customizations override your defaults
|
|
111
|
+
- invalid `theme.json` shape/typos prevent application
|
|
112
|
+
- templates/parts in wrong folders (or nested parts)
|
|
113
|
+
|
|
114
|
+
## Escalation
|
|
115
|
+
|
|
116
|
+
If upstream behavior is unclear, consult canonical docs:
|
|
117
|
+
|
|
118
|
+
- Theme Handbook and Block Editor Handbook for `theme.json`, templates, patterns, and style variations.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Creating a new block theme
|
|
2
|
+
|
|
3
|
+
Use this file when you need to create a new block theme or convert a theme to block theme structure.
|
|
4
|
+
|
|
5
|
+
## Two practical starting points
|
|
6
|
+
|
|
7
|
+
1. **Export from a WP environment**
|
|
8
|
+
- Use the official “Create Block Theme” plugin to generate/export a theme from the Site Editor.
|
|
9
|
+
- This tends to produce a structure aligned with current WordPress behavior.
|
|
10
|
+
|
|
11
|
+
2. **Create the minimal filesystem structure**
|
|
12
|
+
- Create a theme folder with:
|
|
13
|
+
- `style.css` (theme header)
|
|
14
|
+
- `theme.json` (global settings/styles)
|
|
15
|
+
- `templates/index.html` (minimum viable template)
|
|
16
|
+
- `parts/header.html` and `parts/footer.html` (recommended)
|
|
17
|
+
|
|
18
|
+
## References
|
|
19
|
+
|
|
20
|
+
- Create Block Theme plugin:
|
|
21
|
+
- https://wordpress.org/plugins/create-block-theme/
|
|
22
|
+
- Block theme structure:
|
|
23
|
+
- https://developer.wordpress.org/themes/block-themes/theme-structure/
|
|
24
|
+
- Required templates:
|
|
25
|
+
- https://developer.wordpress.org/themes/block-themes/templates-and-template-parts/
|
|
26
|
+
|
|
27
|
+
## theme.json version choice (compatibility)
|
|
28
|
+
|
|
29
|
+
`theme.json` has schema versions. Pick the highest version that matches your minimum supported WordPress version.
|
|
30
|
+
|
|
31
|
+
References:
|
|
32
|
+
|
|
33
|
+
- Theme Handbook introduction:
|
|
34
|
+
- https://developer.wordpress.org/themes/global-settings-and-styles/introduction-to-theme-json/
|
|
35
|
+
- Theme.json version 3 dev note:
|
|
36
|
+
- https://make.wordpress.org/core/2024/06/19/theme-json-version-3/
|
|
37
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Debugging block theme issues
|
|
2
|
+
|
|
3
|
+
## Styles not applying
|
|
4
|
+
|
|
5
|
+
Fast checks:
|
|
6
|
+
|
|
7
|
+
1. Confirm you edited the active theme (Site Editor → theme).
|
|
8
|
+
2. Check if user customizations exist (they override theme defaults).
|
|
9
|
+
3. Validate `theme.json` structure (typos can prevent styles from applying).
|
|
10
|
+
|
|
11
|
+
Remember the hierarchy:
|
|
12
|
+
|
|
13
|
+
- core defaults → theme.json → child theme → user customizations
|
|
14
|
+
|
|
15
|
+
## Templates/parts not showing
|
|
16
|
+
|
|
17
|
+
- Ensure files are in the correct folders (`templates/`, `parts/`).
|
|
18
|
+
- Template parts must not be nested in subdirectories.
|
|
19
|
+
|
|
20
|
+
## Style variations not updating
|
|
21
|
+
|
|
22
|
+
- If a user already selected the variation, the selection is stored in the DB.
|
|
23
|
+
- Test with a fresh site/user or reset customizations when appropriate.
|
|
24
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Patterns (filesystem patterns)
|
|
2
|
+
|
|
3
|
+
Use this file when adding patterns that should be available in the inserter.
|
|
4
|
+
|
|
5
|
+
## Filesystem patterns
|
|
6
|
+
|
|
7
|
+
- Put patterns in `patterns/*.php`.
|
|
8
|
+
- Patterns are registered automatically by WordPress core based on file headers.
|
|
9
|
+
|
|
10
|
+
Upstream reference:
|
|
11
|
+
|
|
12
|
+
- https://developer.wordpress.org/themes/patterns/
|
|
13
|
+
|
|
14
|
+
## Practical guardrails
|
|
15
|
+
|
|
16
|
+
- Keep pattern markup stable; changing block names inside patterns can break older content in subtle ways.
|
|
17
|
+
- If a pattern should not be inserted directly by users, mark it as non-inserter / internal-only (per upstream header conventions).
|
|
18
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Style variations (`styles/*.json`)
|
|
2
|
+
|
|
3
|
+
Use this file when adding or debugging style variations.
|
|
4
|
+
|
|
5
|
+
Key points:
|
|
6
|
+
|
|
7
|
+
- Style variations are JSON files in `styles/`.
|
|
8
|
+
- Users can pick a style variation in the UI.
|
|
9
|
+
- Once selected, the choice is stored in the DB (so “changing the JSON file” may not update what a user already selected).
|
|
10
|
+
|
|
11
|
+
Upstream reference:
|
|
12
|
+
|
|
13
|
+
- https://developer.wordpress.org/themes/global-settings-and-styles/style-variations/
|
|
14
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Templates and template parts
|
|
2
|
+
|
|
3
|
+
Use this file when creating or editing HTML templates/parts.
|
|
4
|
+
|
|
5
|
+
## Key folders
|
|
6
|
+
|
|
7
|
+
- `templates/` for templates.
|
|
8
|
+
- `parts/` for template parts.
|
|
9
|
+
|
|
10
|
+
Template parts must not be nested in subdirectories.
|
|
11
|
+
|
|
12
|
+
Upstream references:
|
|
13
|
+
|
|
14
|
+
- Templates + parts overview: https://developer.wordpress.org/themes/block-themes/theme-structure/
|
|
15
|
+
- Template parts details: https://developer.wordpress.org/themes/block-themes/template-parts/
|
|
16
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# `theme.json` guidance
|
|
2
|
+
|
|
3
|
+
Use this file when changing global settings/styles or per-block styling.
|
|
4
|
+
|
|
5
|
+
## High-level structure
|
|
6
|
+
|
|
7
|
+
Common top-level keys:
|
|
8
|
+
|
|
9
|
+
- `version`
|
|
10
|
+
- `settings` (what the UI exposes / allows)
|
|
11
|
+
- `styles` (default appearance)
|
|
12
|
+
- `customTemplates` and `templateParts` (optional, to describe templates and parts)
|
|
13
|
+
|
|
14
|
+
Upstream references:
|
|
15
|
+
|
|
16
|
+
- Theme Handbook: https://developer.wordpress.org/themes/global-settings-and-styles/
|
|
17
|
+
- Block Editor Handbook (often more current): https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/
|
|
18
|
+
- Theme JSON living reference: https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/
|
|
19
|
+
- Theme JSON version 3 (dev note): https://make.wordpress.org/core/2024/06/19/theme-json-version-3/
|
|
20
|
+
|
|
21
|
+
## Practical guardrails
|
|
22
|
+
|
|
23
|
+
- Prefer presets when you want editor-visible controls (colors, font sizes, spacing).
|
|
24
|
+
- Prefer `styles` when you want consistent defaults without requiring user choice.
|
|
25
|
+
- Be careful with specificity: user global styles override theme defaults.
|
|
26
|
+
|
|
27
|
+
## WordPress 6.9 additions
|
|
28
|
+
|
|
29
|
+
**Form element styling:**
|
|
30
|
+
- Style text inputs and selects via `styles.elements` (e.g., `styles.elements.input`, `styles.elements.select`).
|
|
31
|
+
- Supports border, color, outline, shadow, and spacing properties.
|
|
32
|
+
- Note: Focus state styling is not yet available in 6.9.
|
|
33
|
+
|
|
34
|
+
**Border radius presets:**
|
|
35
|
+
- Define presets in `settings.border.radiusSizes` for visual selection in the border radius control.
|
|
36
|
+
- Users can still enter custom values.
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"settings": {
|
|
41
|
+
"border": {
|
|
42
|
+
"radiusSizes": [
|
|
43
|
+
{ "name": "Small", "slug": "small", "size": "4px" },
|
|
44
|
+
{ "name": "Medium", "slug": "medium", "size": "8px" },
|
|
45
|
+
{ "name": "Large", "slug": "large", "size": "16px" }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Button pseudo-classes:**
|
|
53
|
+
- Style Button block hover and focus states directly in theme.json.
|
|
54
|
+
- No longer requires custom CSS for simple button state styling.
|
|
55
|
+
|
|
56
|
+
References:
|
|
57
|
+
|
|
58
|
+
- Border radius presets: https://make.wordpress.org/core/2025/11/12/theme-json-border-radius-presets-support-in-wordpress-6-9/
|
|
59
|
+
- Form element styling: https://developer.wordpress.org/news/2025/11/how-wordpress-6-9-gives-forms-a-theme-json-makeover/
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_IGNORES = new Set([
|
|
5
|
+
".git",
|
|
6
|
+
"node_modules",
|
|
7
|
+
"vendor",
|
|
8
|
+
"dist",
|
|
9
|
+
"build",
|
|
10
|
+
"coverage",
|
|
11
|
+
".next",
|
|
12
|
+
".turbo",
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function statSafe(p) {
|
|
16
|
+
try {
|
|
17
|
+
return fs.statSync(p);
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function existsDir(p) {
|
|
24
|
+
const st = statSafe(p);
|
|
25
|
+
return Boolean(st && st.isDirectory());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function readJsonSafe(p) {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(fs.readFileSync(p, "utf8"));
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function findFilesRecursive(repoRoot, predicate, { maxFiles = 6000, maxDepth = 10 } = {}) {
|
|
37
|
+
const results = [];
|
|
38
|
+
const queue = [{ dir: repoRoot, depth: 0 }];
|
|
39
|
+
let visited = 0;
|
|
40
|
+
|
|
41
|
+
while (queue.length > 0) {
|
|
42
|
+
const { dir, depth } = queue.shift();
|
|
43
|
+
if (depth > maxDepth) continue;
|
|
44
|
+
|
|
45
|
+
let entries;
|
|
46
|
+
try {
|
|
47
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
48
|
+
} catch {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (const ent of entries) {
|
|
53
|
+
const fullPath = path.join(dir, ent.name);
|
|
54
|
+
if (ent.isDirectory()) {
|
|
55
|
+
if (DEFAULT_IGNORES.has(ent.name)) continue;
|
|
56
|
+
queue.push({ dir: fullPath, depth: depth + 1 });
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!ent.isFile()) continue;
|
|
60
|
+
|
|
61
|
+
visited += 1;
|
|
62
|
+
if (visited > maxFiles) return { results, truncated: true };
|
|
63
|
+
if (predicate(fullPath)) results.push(fullPath);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return { results, truncated: false };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function summarizeTheme(repoRoot, themeJsonPath) {
|
|
71
|
+
const json = readJsonSafe(themeJsonPath);
|
|
72
|
+
const rel = path.relative(repoRoot, themeJsonPath);
|
|
73
|
+
const rootDir = path.dirname(rel);
|
|
74
|
+
|
|
75
|
+
const templatesDir = path.join(repoRoot, rootDir, "templates");
|
|
76
|
+
const partsDir = path.join(repoRoot, rootDir, "parts");
|
|
77
|
+
const patternsDir = path.join(repoRoot, rootDir, "patterns");
|
|
78
|
+
const stylesDir = path.join(repoRoot, rootDir, "styles");
|
|
79
|
+
|
|
80
|
+
const hasTemplates = existsDir(templatesDir);
|
|
81
|
+
const hasParts = existsDir(partsDir);
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
themeRoot: rootDir,
|
|
85
|
+
themeJson: rel,
|
|
86
|
+
version: typeof json?.version === "number" ? json.version : null,
|
|
87
|
+
hasTemplates,
|
|
88
|
+
hasParts,
|
|
89
|
+
hasPatterns: existsDir(patternsDir),
|
|
90
|
+
hasStyles: existsDir(stylesDir),
|
|
91
|
+
isBlockTheme: hasTemplates || hasParts,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function main() {
|
|
96
|
+
const repoRoot = process.cwd();
|
|
97
|
+
|
|
98
|
+
const { results: themeJsonFiles, truncated } = findFilesRecursive(repoRoot, (p) => path.basename(p) === "theme.json", {
|
|
99
|
+
maxFiles: 8000,
|
|
100
|
+
maxDepth: 12,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const themes = themeJsonFiles.map((p) => summarizeTheme(repoRoot, p));
|
|
104
|
+
|
|
105
|
+
const report = {
|
|
106
|
+
tool: { name: "detect_block_themes", version: "0.1.0" },
|
|
107
|
+
repoRoot,
|
|
108
|
+
truncated,
|
|
109
|
+
count: themes.length,
|
|
110
|
+
themes,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
main();
|
|
117
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-content
|
|
3
|
+
description: This skill should be used when the user asks to "create a blog post",
|
|
4
|
+
"write content", "manage pages", "update content", "content strategy", "editorial
|
|
5
|
+
calendar", "bulk publish", "manage categories", or mentions WordPress content operations.
|
|
6
|
+
Provides SEO-aware content workflows and editorial best practices.
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# WordPress Content Management Skill
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Guides content creation, optimization, and management workflows for WordPress sites. Ensures all content follows SEO best practices and editorial standards.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- User wants to create or update blog posts, pages, or custom content
|
|
19
|
+
- User needs help organizing content with categories and tags
|
|
20
|
+
- User asks about content strategy or editorial workflows
|
|
21
|
+
- User wants to optimize existing content for SEO
|
|
22
|
+
- User needs to perform bulk content operations
|
|
23
|
+
|
|
24
|
+
## Content Lifecycle
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
IDEATION → DRAFT → REVIEW → OPTIMIZE → PUBLISH → MONITOR
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 1. Ideation
|
|
31
|
+
- Understand topic, target audience, and keywords
|
|
32
|
+
- Check existing content to avoid duplication (`list_content` with search)
|
|
33
|
+
- Plan content structure and format
|
|
34
|
+
|
|
35
|
+
### 2. Draft
|
|
36
|
+
- Create content via `create_content` with `status: "draft"`
|
|
37
|
+
- Follow content templates in `references/content-templates.md`
|
|
38
|
+
- Apply heading hierarchy (single H1, logical H2/H3)
|
|
39
|
+
|
|
40
|
+
### 3. Review
|
|
41
|
+
- Present draft URL to user for review
|
|
42
|
+
- Check word count, readability, keyword usage
|
|
43
|
+
- Verify all links work
|
|
44
|
+
|
|
45
|
+
### 4. Optimize
|
|
46
|
+
- Apply SEO checklist from `references/seo-optimization.md`
|
|
47
|
+
- Set meta description (excerpt)
|
|
48
|
+
- Assign categories and tags via `assign_terms_to_content`
|
|
49
|
+
- Add featured image
|
|
50
|
+
|
|
51
|
+
### 5. Publish
|
|
52
|
+
- Only publish after user approval
|
|
53
|
+
- Use `update_content` to change status from `draft` to `publish`
|
|
54
|
+
- Verify published URL is accessible
|
|
55
|
+
|
|
56
|
+
### 6. Monitor
|
|
57
|
+
- Check content appears in site navigation/archives
|
|
58
|
+
- Verify search engine indexing (after 24-48 hours)
|
|
59
|
+
|
|
60
|
+
## Content Operations Reference
|
|
61
|
+
|
|
62
|
+
### Creating Content
|
|
63
|
+
```
|
|
64
|
+
Tool: create_content
|
|
65
|
+
Required: content_type, title, content
|
|
66
|
+
Recommended: excerpt, slug, status (always "draft" initially), categories, tags
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Updating Content
|
|
70
|
+
```
|
|
71
|
+
Tool: update_content
|
|
72
|
+
Required: content_type, id
|
|
73
|
+
Safety: Always fetch current content first with get_content
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Finding Content
|
|
77
|
+
```
|
|
78
|
+
Tool: find_content_by_url — for URL-based lookup
|
|
79
|
+
Tool: get_content_by_slug — for slug-based lookup
|
|
80
|
+
Tool: list_content — for filtered searches
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Taxonomy Management
|
|
84
|
+
```
|
|
85
|
+
Tool: discover_taxonomies — list available taxonomies
|
|
86
|
+
Tool: create_term — create new category/tag
|
|
87
|
+
Tool: assign_terms_to_content — assign terms to content
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Safety Rules
|
|
91
|
+
|
|
92
|
+
- ALWAYS create content as "draft" first — never publish directly
|
|
93
|
+
- ALWAYS show the user a preview before publishing
|
|
94
|
+
- NEVER delete content without explicit confirmation
|
|
95
|
+
- NEVER overwrite existing content without showing changes
|
|
96
|
+
- PRESERVE existing SEO-optimized slugs when updating
|
|
97
|
+
- CHECK for duplicate slugs before creating new content
|
|
98
|
+
|
|
99
|
+
## Additional Resources
|
|
100
|
+
|
|
101
|
+
### Reference Files
|
|
102
|
+
- **`references/content-templates.md`** - Templates for different content types
|
|
103
|
+
- **`references/seo-optimization.md`** - On-page SEO patterns for WordPress
|