claude-plugin-wordpress-manager 2.9.1 → 2.12.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/CHANGELOG.md +73 -0
- package/agents/wp-content-strategist.md +58 -1
- package/agents/wp-distribution-manager.md +39 -6
- package/docs/plans/2026-03-01-tier6-7-design.md +246 -0
- package/docs/plans/2026-03-01-tier6-7-implementation.md +1629 -0
- package/hooks/hooks.json +18 -0
- package/package.json +6 -3
- package/servers/wp-rest-bridge/build/tools/index.js +9 -0
- package/servers/wp-rest-bridge/build/tools/linkedin.js +203 -0
- package/servers/wp-rest-bridge/build/tools/schema.js +159 -0
- package/servers/wp-rest-bridge/build/tools/twitter.js +183 -0
- package/servers/wp-rest-bridge/build/wordpress.js +94 -0
- package/skills/wordpress-router/references/decision-tree.md +10 -2
- package/skills/wp-content-generation/SKILL.md +128 -0
- package/skills/wp-content-generation/references/brief-templates.md +151 -0
- package/skills/wp-content-generation/references/generation-workflow.md +132 -0
- package/skills/wp-content-generation/references/outline-patterns.md +188 -0
- package/skills/wp-content-generation/scripts/content_gen_inspect.mjs +90 -0
- package/skills/wp-content-repurposing/SKILL.md +13 -0
- package/skills/wp-content-repurposing/references/auto-transform-pipeline.md +128 -0
- package/skills/wp-content-repurposing/references/transform-templates.md +304 -0
- package/skills/wp-linkedin/SKILL.md +96 -0
- package/skills/wp-linkedin/references/linkedin-analytics.md +58 -0
- package/skills/wp-linkedin/references/linkedin-posting.md +53 -0
- package/skills/wp-linkedin/references/linkedin-setup.md +59 -0
- package/skills/wp-linkedin/scripts/linkedin_inspect.mjs +55 -0
- package/skills/wp-structured-data/SKILL.md +94 -0
- package/skills/wp-structured-data/references/injection-patterns.md +160 -0
- package/skills/wp-structured-data/references/schema-types.md +127 -0
- package/skills/wp-structured-data/references/validation-guide.md +89 -0
- package/skills/wp-structured-data/scripts/schema_inspect.mjs +88 -0
- package/skills/wp-twitter/SKILL.md +101 -0
- package/skills/wp-twitter/references/twitter-analytics.md +60 -0
- package/skills/wp-twitter/references/twitter-posting.md +66 -0
- package/skills/wp-twitter/references/twitter-setup.md +62 -0
- package/skills/wp-twitter/scripts/twitter_inspect.mjs +58 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-structured-data
|
|
3
|
+
description: This skill should be used when the user asks about "structured data",
|
|
4
|
+
"Schema.org", "JSON-LD", "rich snippets", "schema markup", "dati strutturati",
|
|
5
|
+
"rich results", "Google rich cards", "schema validation", "breadcrumb schema",
|
|
6
|
+
"FAQ schema", "product schema", "article schema", or mentions adding/validating
|
|
7
|
+
Schema.org markup on WordPress content.
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# WordPress Structured Data Skill
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Structured data (Schema.org markup in JSON-LD format) helps search engines understand page content and enables rich results (FAQ accordions, product stars, recipe cards, event listings, etc.). This skill manages the full lifecycle: validate existing markup, inject new schemas, and audit site-wide coverage.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- User wants to add structured data to posts or pages
|
|
20
|
+
- User asks about rich snippets or Schema.org
|
|
21
|
+
- User needs to validate existing JSON-LD markup
|
|
22
|
+
- User wants to audit structured data coverage across the site
|
|
23
|
+
- User mentions FAQ schema, product schema, article schema, etc.
|
|
24
|
+
|
|
25
|
+
## Decision Tree
|
|
26
|
+
|
|
27
|
+
1. **What operation?**
|
|
28
|
+
- "validate" / "check" / "test" / "audit" → Validation (Section 1)
|
|
29
|
+
- "add" / "inject" / "create" / "set up" → Injection (Section 2)
|
|
30
|
+
- "list" / "audit" / "scan" / "coverage" → Site Audit (Section 3)
|
|
31
|
+
- "types" / "which schema" / "what schema" → Schema Types Reference (Section 4)
|
|
32
|
+
|
|
33
|
+
2. **Run detection first:**
|
|
34
|
+
```bash
|
|
35
|
+
node skills/wp-structured-data/scripts/schema_inspect.mjs [--cwd=/path/to/project]
|
|
36
|
+
```
|
|
37
|
+
This checks for existing schema plugins (Yoast, Rank Math, Schema Pro) and JSON-LD presence.
|
|
38
|
+
|
|
39
|
+
## Sections
|
|
40
|
+
|
|
41
|
+
### Section 1: Validation
|
|
42
|
+
See `references/validation-guide.md`
|
|
43
|
+
- Validate live URLs: `sd_validate` with `url` parameter
|
|
44
|
+
- Validate raw markup: `sd_validate` with `markup` parameter
|
|
45
|
+
- Interpret results: check @context, @type, required properties
|
|
46
|
+
- Common issues: missing @context, invalid JSON, wrong @type
|
|
47
|
+
|
|
48
|
+
### Section 2: Injection
|
|
49
|
+
See `references/injection-patterns.md`
|
|
50
|
+
- Article schema for blog posts
|
|
51
|
+
- Product schema for WooCommerce
|
|
52
|
+
- FAQ schema for Q&A content
|
|
53
|
+
- HowTo schema for tutorials
|
|
54
|
+
- Use `sd_inject` with post_id, schema_type, schema_data
|
|
55
|
+
|
|
56
|
+
### Section 3: Site Audit
|
|
57
|
+
- List all schema types: `sd_list_schemas`
|
|
58
|
+
- Filter by type: `sd_list_schemas` with `schema_type`
|
|
59
|
+
- Identify posts without structured data
|
|
60
|
+
- Coverage report: total posts vs posts with schema
|
|
61
|
+
|
|
62
|
+
### Section 4: Schema Types
|
|
63
|
+
See `references/schema-types.md`
|
|
64
|
+
- Supported types and their required/recommended properties
|
|
65
|
+
- Mapping WordPress content types to Schema.org types
|
|
66
|
+
- Rich result eligibility per type
|
|
67
|
+
|
|
68
|
+
## MCP Tools
|
|
69
|
+
|
|
70
|
+
| Tool | Description |
|
|
71
|
+
|------|-------------|
|
|
72
|
+
| `sd_validate` | Validate JSON-LD from URL or raw markup |
|
|
73
|
+
| `sd_inject` | Inject/update JSON-LD in post meta |
|
|
74
|
+
| `sd_list_schemas` | List Schema.org types across the site |
|
|
75
|
+
|
|
76
|
+
## Reference Files
|
|
77
|
+
|
|
78
|
+
| File | Content |
|
|
79
|
+
|------|---------|
|
|
80
|
+
| `references/schema-types.md` | Supported Schema.org types with required properties |
|
|
81
|
+
| `references/validation-guide.md` | Validation workflow, common issues, fixes |
|
|
82
|
+
| `references/injection-patterns.md` | Injection patterns per content type |
|
|
83
|
+
|
|
84
|
+
## Recommended Agent
|
|
85
|
+
|
|
86
|
+
**`wp-content-strategist`** — coordinates structured data with content creation and SEO optimization.
|
|
87
|
+
|
|
88
|
+
## Related Skills
|
|
89
|
+
|
|
90
|
+
- **`wp-content`** — content lifecycle management (source for schema injection)
|
|
91
|
+
- **`wp-content-optimization`** — SEO scoring and meta optimization
|
|
92
|
+
- **`wp-search-console`** — track rich result impressions in Google Search Console
|
|
93
|
+
- **`wp-woocommerce`** — product structured data for e-commerce
|
|
94
|
+
- **`wp-programmatic-seo`** — bulk schema injection for template pages
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Injection Patterns
|
|
2
|
+
|
|
3
|
+
## Pattern 1: Article Schema for Blog Posts
|
|
4
|
+
|
|
5
|
+
**When:** Any blog post. Most impactful schema type for content sites.
|
|
6
|
+
|
|
7
|
+
**Steps:**
|
|
8
|
+
1. Fetch post: `wp_get_post(id: POST_ID)`
|
|
9
|
+
2. Extract: title, date, modified date, author, featured image, excerpt
|
|
10
|
+
3. Build schema data
|
|
11
|
+
4. Inject: `sd_inject(post_id, "Article", schema_data)`
|
|
12
|
+
|
|
13
|
+
**Schema data template:**
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"headline": "{post.title.rendered}",
|
|
17
|
+
"image": "{featured_image_url}",
|
|
18
|
+
"datePublished": "{post.date}",
|
|
19
|
+
"dateModified": "{post.modified}",
|
|
20
|
+
"author": {
|
|
21
|
+
"@type": "Person",
|
|
22
|
+
"name": "{author.name}"
|
|
23
|
+
},
|
|
24
|
+
"publisher": {
|
|
25
|
+
"@type": "Organization",
|
|
26
|
+
"name": "{site_name}",
|
|
27
|
+
"logo": {
|
|
28
|
+
"@type": "ImageObject",
|
|
29
|
+
"url": "{site_logo_url}"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"description": "{post.excerpt.rendered (stripped HTML)}"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Note:** If Yoast or Rank Math is active, they already add Article schema. Check with `sd_validate` first.
|
|
37
|
+
|
|
38
|
+
## Pattern 2: Product Schema for WooCommerce
|
|
39
|
+
|
|
40
|
+
**When:** WooCommerce product pages.
|
|
41
|
+
|
|
42
|
+
**Steps:**
|
|
43
|
+
1. Fetch product: `wc_get_product(id: PRODUCT_ID)`
|
|
44
|
+
2. Extract: name, price, stock status, images, description
|
|
45
|
+
3. Build schema with offers
|
|
46
|
+
4. Inject: `sd_inject(post_id, "Product", schema_data)`
|
|
47
|
+
|
|
48
|
+
**Schema data template:**
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"name": "{product.name}",
|
|
52
|
+
"image": "{product.images[0].src}",
|
|
53
|
+
"description": "{product.short_description}",
|
|
54
|
+
"sku": "{product.sku}",
|
|
55
|
+
"brand": {
|
|
56
|
+
"@type": "Brand",
|
|
57
|
+
"name": "{brand_name}"
|
|
58
|
+
},
|
|
59
|
+
"offers": {
|
|
60
|
+
"@type": "Offer",
|
|
61
|
+
"price": "{product.price}",
|
|
62
|
+
"priceCurrency": "EUR",
|
|
63
|
+
"availability": "https://schema.org/{InStock|OutOfStock}",
|
|
64
|
+
"url": "{product.permalink}"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Pattern 3: FAQ Schema from Content
|
|
70
|
+
|
|
71
|
+
**When:** Posts containing Q&A sections (H3 questions with paragraph answers).
|
|
72
|
+
|
|
73
|
+
**Steps:**
|
|
74
|
+
1. Fetch post: `wp_get_post(id: POST_ID)`
|
|
75
|
+
2. Parse content HTML: extract Q&A pairs from H3 + following paragraphs
|
|
76
|
+
3. Build FAQPage schema
|
|
77
|
+
4. Inject: `sd_inject(post_id, "FAQPage", schema_data)`
|
|
78
|
+
|
|
79
|
+
**Schema data template:**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"mainEntity": [
|
|
83
|
+
{
|
|
84
|
+
"@type": "Question",
|
|
85
|
+
"name": "{question_text}",
|
|
86
|
+
"acceptedAnswer": {
|
|
87
|
+
"@type": "Answer",
|
|
88
|
+
"text": "{answer_text}"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Extraction heuristic:**
|
|
96
|
+
- H3 ending with `?` → Question
|
|
97
|
+
- Following `<p>` blocks until next H3 → Answer
|
|
98
|
+
- Minimum 3 Q&A pairs for meaningful FAQ schema
|
|
99
|
+
|
|
100
|
+
## Pattern 4: HowTo Schema from Tutorials
|
|
101
|
+
|
|
102
|
+
**When:** Tutorial or step-by-step posts.
|
|
103
|
+
|
|
104
|
+
**Steps:**
|
|
105
|
+
1. Fetch post: `wp_get_post(id: POST_ID)`
|
|
106
|
+
2. Parse content: extract steps from H2 sections or ordered lists
|
|
107
|
+
3. Build HowTo schema
|
|
108
|
+
4. Inject: `sd_inject(post_id, "HowTo", schema_data)`
|
|
109
|
+
|
|
110
|
+
**Schema data template:**
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"name": "{post.title.rendered}",
|
|
114
|
+
"step": [
|
|
115
|
+
{
|
|
116
|
+
"@type": "HowToStep",
|
|
117
|
+
"name": "{step_heading}",
|
|
118
|
+
"text": "{step_description}"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"totalTime": "PT{minutes}M"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Extraction heuristic:**
|
|
126
|
+
- H2 headings starting with "Step" or numbered → HowToStep
|
|
127
|
+
- Ordered list items (`<ol><li>`) → HowToStep
|
|
128
|
+
- Time references in content → totalTime
|
|
129
|
+
|
|
130
|
+
## Pattern 5: Bulk Injection
|
|
131
|
+
|
|
132
|
+
**When:** Adding schema to multiple existing posts at once.
|
|
133
|
+
|
|
134
|
+
**Steps:**
|
|
135
|
+
1. List posts: `wp_list_posts(per_page: 50)`
|
|
136
|
+
2. Check existing schemas: `sd_list_schemas()`
|
|
137
|
+
3. Identify posts without schema
|
|
138
|
+
4. For each post without schema:
|
|
139
|
+
a. Determine best schema type from content
|
|
140
|
+
b. Extract relevant data
|
|
141
|
+
c. `sd_inject(post_id, schema_type, schema_data)`
|
|
142
|
+
5. Verify: `sd_list_schemas()` to confirm coverage
|
|
143
|
+
|
|
144
|
+
**Type determination heuristic:**
|
|
145
|
+
| Content Pattern | Schema Type |
|
|
146
|
+
|----------------|-------------|
|
|
147
|
+
| Contains Q&A pairs (H3 + ?) | FAQPage |
|
|
148
|
+
| Contains step-by-step (H2 "Step N" or `<ol>`) | HowTo |
|
|
149
|
+
| Is WooCommerce product | Product |
|
|
150
|
+
| Has event date/time | Event |
|
|
151
|
+
| Default for blog posts | Article |
|
|
152
|
+
|
|
153
|
+
## Conflict Resolution
|
|
154
|
+
|
|
155
|
+
When SEO plugins already add schema:
|
|
156
|
+
|
|
157
|
+
1. **Check first:** `sd_validate(url: PAGE_URL)` to see existing schemas
|
|
158
|
+
2. **Don't duplicate:** If Article schema already exists from Yoast, don't add another
|
|
159
|
+
3. **Supplement:** Add types the plugin doesn't handle (FAQ, HowTo)
|
|
160
|
+
4. **Override:** To replace plugin schema, disable plugin's schema output for that post type and use `sd_inject` instead
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Supported Schema.org Types
|
|
2
|
+
|
|
3
|
+
## Type Reference
|
|
4
|
+
|
|
5
|
+
### Article
|
|
6
|
+
**Use for:** Blog posts, news articles, how-to articles
|
|
7
|
+
**Rich result:** Article rich result with headline, image, date, author
|
|
8
|
+
**Required properties:**
|
|
9
|
+
- `headline` — article title (max 110 chars for rich result)
|
|
10
|
+
- `image` — featured image URL (min 696px wide)
|
|
11
|
+
- `datePublished` — ISO 8601 date
|
|
12
|
+
- `author` — `{ "@type": "Person", "name": "Author Name" }`
|
|
13
|
+
|
|
14
|
+
**Recommended:** `dateModified`, `publisher`, `description`
|
|
15
|
+
|
|
16
|
+
**WordPress mapping:**
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"headline": "post.title.rendered",
|
|
20
|
+
"image": "featured_media URL",
|
|
21
|
+
"datePublished": "post.date",
|
|
22
|
+
"dateModified": "post.modified",
|
|
23
|
+
"author": { "@type": "Person", "name": "post.author.name" }
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Product
|
|
28
|
+
**Use for:** WooCommerce products, product pages
|
|
29
|
+
**Rich result:** Product snippet with price, availability, rating
|
|
30
|
+
**Required properties:**
|
|
31
|
+
- `name` — product name
|
|
32
|
+
- `image` — product image URL
|
|
33
|
+
- `offers` — `{ "@type": "Offer", "price": "19.99", "priceCurrency": "EUR", "availability": "https://schema.org/InStock" }`
|
|
34
|
+
|
|
35
|
+
**Recommended:** `description`, `sku`, `brand`, `aggregateRating`, `review`
|
|
36
|
+
|
|
37
|
+
### FAQ
|
|
38
|
+
**Use for:** FAQ pages, Q&A sections within posts
|
|
39
|
+
**Rich result:** FAQ accordion in search results
|
|
40
|
+
**Required properties:**
|
|
41
|
+
- `mainEntity` — array of Question objects
|
|
42
|
+
|
|
43
|
+
**Structure:**
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"@type": "FAQPage",
|
|
47
|
+
"mainEntity": [
|
|
48
|
+
{
|
|
49
|
+
"@type": "Question",
|
|
50
|
+
"name": "What is cactus water?",
|
|
51
|
+
"acceptedAnswer": {
|
|
52
|
+
"@type": "Answer",
|
|
53
|
+
"text": "Cactus water is a beverage made from Sicilian prickly pear..."
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### HowTo
|
|
61
|
+
**Use for:** Tutorial posts, step-by-step guides
|
|
62
|
+
**Rich result:** How-to rich result with steps
|
|
63
|
+
**Required properties:**
|
|
64
|
+
- `name` — how-to title
|
|
65
|
+
- `step` — array of HowToStep objects
|
|
66
|
+
|
|
67
|
+
**Structure:**
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"@type": "HowTo",
|
|
71
|
+
"name": "How to Make Cactus Water Smoothie",
|
|
72
|
+
"step": [
|
|
73
|
+
{ "@type": "HowToStep", "text": "Blend 200ml cactus water with ice" },
|
|
74
|
+
{ "@type": "HowToStep", "text": "Add fresh fruit of your choice" }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Recommended:** `totalTime` (ISO 8601 duration), `estimatedCost`, `image`
|
|
80
|
+
|
|
81
|
+
### LocalBusiness
|
|
82
|
+
**Use for:** Business location pages, contact pages
|
|
83
|
+
**Rich result:** Knowledge panel with business info
|
|
84
|
+
**Required properties:**
|
|
85
|
+
- `name` — business name
|
|
86
|
+
- `address` — PostalAddress object
|
|
87
|
+
- `telephone` — phone number
|
|
88
|
+
|
|
89
|
+
**Recommended:** `openingHoursSpecification`, `geo`, `image`, `priceRange`
|
|
90
|
+
|
|
91
|
+
### Event
|
|
92
|
+
**Use for:** Event listings, webinar pages, course dates
|
|
93
|
+
**Rich result:** Event rich result with date, location, tickets
|
|
94
|
+
**Required properties:**
|
|
95
|
+
- `name` — event name
|
|
96
|
+
- `startDate` — ISO 8601 date
|
|
97
|
+
- `location` — Place or VirtualLocation object
|
|
98
|
+
|
|
99
|
+
**Recommended:** `endDate`, `image`, `description`, `offers`, `performer`
|
|
100
|
+
|
|
101
|
+
### Organization
|
|
102
|
+
**Use for:** About pages, company profiles
|
|
103
|
+
**Rich result:** Knowledge panel
|
|
104
|
+
**Required properties:**
|
|
105
|
+
- `name` — organization name
|
|
106
|
+
- `url` — website URL
|
|
107
|
+
|
|
108
|
+
**Recommended:** `logo`, `contactPoint`, `sameAs` (social profile URLs)
|
|
109
|
+
|
|
110
|
+
### BreadcrumbList
|
|
111
|
+
**Use for:** Navigation breadcrumbs on any page
|
|
112
|
+
**Rich result:** Breadcrumb trail in search results
|
|
113
|
+
**Required properties:**
|
|
114
|
+
- `itemListElement` — array of ListItem objects with position, name, item URL
|
|
115
|
+
|
|
116
|
+
## Content Type → Schema Type Mapping
|
|
117
|
+
|
|
118
|
+
| WordPress Content | Recommended Schema | Notes |
|
|
119
|
+
|-------------------|-------------------|-------|
|
|
120
|
+
| Blog post | Article | Auto-map title, date, author |
|
|
121
|
+
| Product (WooCommerce) | Product | Map price, stock, reviews |
|
|
122
|
+
| FAQ page | FAQPage | Extract Q&A pairs from content |
|
|
123
|
+
| Tutorial post | HowTo | Extract steps from H2/H3 or ordered lists |
|
|
124
|
+
| About page | Organization | Company info, social links |
|
|
125
|
+
| Contact page | LocalBusiness | Address, phone, hours |
|
|
126
|
+
| Event post | Event | Date, location, ticket info |
|
|
127
|
+
| Any page with breadcrumbs | BreadcrumbList | Navigation hierarchy |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Validation Guide
|
|
2
|
+
|
|
3
|
+
## Validation Workflow
|
|
4
|
+
|
|
5
|
+
### Step 1: Check Existing Markup
|
|
6
|
+
|
|
7
|
+
Use `sd_validate` with `url` to scan a live page:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
sd_validate(url: "https://example.com/blog-post")
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Result interpretation:**
|
|
14
|
+
- `valid: true` — JSON-LD is well-formed with @context and @type
|
|
15
|
+
- `valid: false` — issues found (listed in `issues` array)
|
|
16
|
+
- `schemas_found: N` — number of JSON-LD blocks on the page
|
|
17
|
+
|
|
18
|
+
### Step 2: Validate Before Injection
|
|
19
|
+
|
|
20
|
+
Before using `sd_inject`, validate markup inline:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
sd_validate(markup: '{"@context":"https://schema.org","@type":"Article","headline":"Test"}')
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Step 3: Post-Injection Verification
|
|
27
|
+
|
|
28
|
+
After `sd_inject`, verify by fetching the page and validating:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
sd_validate(url: "https://example.com/blog-post")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Common Issues and Fixes
|
|
35
|
+
|
|
36
|
+
### Missing @context
|
|
37
|
+
|
|
38
|
+
**Issue:** `Missing or invalid @context (should include schema.org)`
|
|
39
|
+
**Fix:** `sd_inject` automatically adds `@context: "https://schema.org"` — this issue only appears on existing markup from other sources.
|
|
40
|
+
|
|
41
|
+
### Missing @type
|
|
42
|
+
|
|
43
|
+
**Issue:** `Missing @type`
|
|
44
|
+
**Fix:** Every schema must have a @type. When using `sd_inject`, the `schema_type` parameter sets this automatically.
|
|
45
|
+
|
|
46
|
+
### Invalid JSON
|
|
47
|
+
|
|
48
|
+
**Issue:** `Invalid JSON-LD on page`
|
|
49
|
+
**Cause:** Malformed JSON in the `<script type="application/ld+json">` block.
|
|
50
|
+
**Fix:** Check for trailing commas, unescaped quotes, or broken HTML in the JSON-LD block.
|
|
51
|
+
|
|
52
|
+
### Multiple Schemas Conflict
|
|
53
|
+
|
|
54
|
+
**Issue:** SEO plugin (Yoast/Rank Math) adds its own schema, plus custom schema via `sd_inject`
|
|
55
|
+
**Fix:** Check with `sd_validate` first. If plugin already covers the type, don't duplicate. Use `sd_inject` for types the plugin doesn't handle (e.g., FAQ, HowTo).
|
|
56
|
+
|
|
57
|
+
### Required Properties Missing
|
|
58
|
+
|
|
59
|
+
Google requires specific properties per type. See `schema-types.md` for the full list. Common missing properties:
|
|
60
|
+
|
|
61
|
+
| Type | Often Missing | Impact |
|
|
62
|
+
|------|--------------|--------|
|
|
63
|
+
| Article | `image` | No rich result without image |
|
|
64
|
+
| Product | `offers` | No price shown in search |
|
|
65
|
+
| FAQ | `acceptedAnswer` | Invalid FAQ schema |
|
|
66
|
+
| Event | `startDate` | Invalid event schema |
|
|
67
|
+
|
|
68
|
+
## Google Rich Results Eligibility
|
|
69
|
+
|
|
70
|
+
Not all Schema.org types generate rich results. Eligible types:
|
|
71
|
+
|
|
72
|
+
| Type | Rich Result |
|
|
73
|
+
|------|-------------|
|
|
74
|
+
| Article | Article card with image, date |
|
|
75
|
+
| Product | Price, availability, rating stars |
|
|
76
|
+
| FAQPage | Expandable FAQ accordion |
|
|
77
|
+
| HowTo | Step-by-step instructions |
|
|
78
|
+
| Event | Event card with date, location |
|
|
79
|
+
| LocalBusiness | Knowledge panel |
|
|
80
|
+
| BreadcrumbList | Breadcrumb trail |
|
|
81
|
+
| Recipe | Recipe card with image, time, calories |
|
|
82
|
+
| VideoObject | Video thumbnail in search |
|
|
83
|
+
|
|
84
|
+
## External Validation
|
|
85
|
+
|
|
86
|
+
For definitive testing beyond `sd_validate`:
|
|
87
|
+
- **Google Rich Results Test**: https://search.google.com/test/rich-results
|
|
88
|
+
- **Schema.org Validator**: https://validator.schema.org/
|
|
89
|
+
- **Google Search Console**: Rich results report (requires GSC access via `gsc_*` tools)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* schema_inspect.mjs — Detects structured data plugins and JSON-LD presence.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node skills/wp-structured-data/scripts/schema_inspect.mjs [--cwd=/path/to/project]
|
|
7
|
+
*
|
|
8
|
+
* Checks:
|
|
9
|
+
* 1. Yoast SEO (adds Article/Organization/BreadcrumbList schemas)
|
|
10
|
+
* 2. Rank Math SEO (adds Article/Product/FAQ/HowTo schemas)
|
|
11
|
+
* 3. Schema Pro or WP Schema plugins
|
|
12
|
+
* 4. WP_SITES_CONFIG environment for REST API access
|
|
13
|
+
* 5. Theme-level JSON-LD output
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { readFileSync, existsSync } from 'fs';
|
|
17
|
+
import { join, resolve } from 'path';
|
|
18
|
+
|
|
19
|
+
const args = process.argv.slice(2);
|
|
20
|
+
const cwdFlag = args.find(a => a.startsWith('--cwd='));
|
|
21
|
+
const cwd = cwdFlag ? resolve(cwdFlag.split('=')[1]) : process.cwd();
|
|
22
|
+
|
|
23
|
+
const result = {
|
|
24
|
+
structured_data: {
|
|
25
|
+
detected: false,
|
|
26
|
+
plugins: [],
|
|
27
|
+
has_rest_access: false,
|
|
28
|
+
details: {},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Check for SEO/schema plugins in wp-content/plugins
|
|
33
|
+
const pluginsDir = join(cwd, 'wp-content', 'plugins');
|
|
34
|
+
const schemaPlugins = [
|
|
35
|
+
{ dir: 'wordpress-seo', name: 'Yoast SEO', schemas: ['Article', 'Organization', 'BreadcrumbList', 'WebSite', 'WebPage'] },
|
|
36
|
+
{ dir: 'seo-by-rank-math', name: 'Rank Math', schemas: ['Article', 'Product', 'FAQ', 'HowTo', 'LocalBusiness', 'Event'] },
|
|
37
|
+
{ dir: 'schema-pro', name: 'Schema Pro', schemas: ['Article', 'Product', 'FAQ', 'HowTo', 'LocalBusiness', 'Event', 'Recipe'] },
|
|
38
|
+
{ dir: 'wp-schema-pro', name: 'WP Schema Pro', schemas: ['Article', 'Product', 'FAQ'] },
|
|
39
|
+
{ dir: 'schema', name: 'Schema (Starter)', schemas: ['Article', 'Organization'] },
|
|
40
|
+
{ dir: 'schema-and-structured-data-for-wp', name: 'Schema & Structured Data for WP', schemas: ['Article', 'Product', 'FAQ', 'Event', 'Recipe'] },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
if (existsSync(pluginsDir)) {
|
|
44
|
+
for (const plugin of schemaPlugins) {
|
|
45
|
+
if (existsSync(join(pluginsDir, plugin.dir))) {
|
|
46
|
+
result.structured_data.detected = true;
|
|
47
|
+
result.structured_data.plugins.push({
|
|
48
|
+
name: plugin.name,
|
|
49
|
+
directory: plugin.dir,
|
|
50
|
+
auto_schemas: plugin.schemas,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Check for WP REST API access (needed for sd_inject and sd_list_schemas)
|
|
57
|
+
const sitesConfig = process.env.WP_SITES_CONFIG;
|
|
58
|
+
if (sitesConfig) {
|
|
59
|
+
try {
|
|
60
|
+
const config = JSON.parse(sitesConfig);
|
|
61
|
+
const sites = Array.isArray(config) ? config : [config];
|
|
62
|
+
result.structured_data.has_rest_access = sites.length > 0;
|
|
63
|
+
result.structured_data.details.sites_count = sites.length;
|
|
64
|
+
} catch {
|
|
65
|
+
result.structured_data.details.config_error = 'Invalid WP_SITES_CONFIG JSON';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Check for theme-level JSON-LD in functions.php
|
|
70
|
+
const functionsPhp = join(cwd, 'functions.php');
|
|
71
|
+
const themeDir = join(cwd, 'wp-content', 'themes');
|
|
72
|
+
let hasThemeSchema = false;
|
|
73
|
+
if (existsSync(functionsPhp)) {
|
|
74
|
+
const content = readFileSync(functionsPhp, 'utf8');
|
|
75
|
+
if (content.includes('application/ld+json') || content.includes('schema.org')) {
|
|
76
|
+
hasThemeSchema = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
result.structured_data.details.theme_schema = hasThemeSchema;
|
|
80
|
+
|
|
81
|
+
// Summary
|
|
82
|
+
if (result.structured_data.plugins.length > 0) {
|
|
83
|
+
result.structured_data.details.note = 'Schema plugins detected. sd_inject will store in post meta alongside plugin schemas. Verify no conflicts.';
|
|
84
|
+
} else {
|
|
85
|
+
result.structured_data.details.note = 'No schema plugins detected. sd_inject can manage all structured data via post meta.';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log(JSON.stringify(result, null, 2));
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-twitter
|
|
3
|
+
description: This skill should be used when the user asks to "publish a tweet",
|
|
4
|
+
"create a thread", "Twitter analytics", "tweet a post", "pubblica tweet",
|
|
5
|
+
"Twitter/X publishing", or mentions Twitter/X posting, threads, and analytics
|
|
6
|
+
for WordPress content.
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
tags: [twitter, x, social-media, tweets, threads, direct-social]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# WordPress Twitter/X Integration Skill
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Direct Twitter/X publishing connects WordPress content to Twitter via the API v2. This enables quick content distribution: single tweets for announcements, threads for long-form storytelling, and metrics for engagement tracking. The WP REST Bridge provides 5 MCP tools with the `tw_*` namespace.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- User wants to tweet about a WordPress blog post
|
|
20
|
+
- User needs to create a Twitter thread from a blog post
|
|
21
|
+
- User asks about tweet metrics (impressions, likes, retweets)
|
|
22
|
+
- User wants to manage tweets (publish, list, delete)
|
|
23
|
+
- User needs social media distribution via Twitter/X
|
|
24
|
+
|
|
25
|
+
## Decision Tree
|
|
26
|
+
|
|
27
|
+
1. **What Twitter action?**
|
|
28
|
+
- "tweet" / "publish tweet" / "post to Twitter" → Single tweet (Section 1)
|
|
29
|
+
- "thread" / "tweetstorm" / "multi-tweet" → Thread creation (Section 2)
|
|
30
|
+
- "analytics" / "metrics" / "impressions" → Metrics (Section 3)
|
|
31
|
+
- "delete" / "remove tweet" → Delete tweet (Section 4)
|
|
32
|
+
- "setup" / "configure" / "connect Twitter" → Setup guide (Section 5)
|
|
33
|
+
|
|
34
|
+
2. **Run detection first:**
|
|
35
|
+
```bash
|
|
36
|
+
node skills/wp-twitter/scripts/twitter_inspect.mjs [--cwd=/path/to/project]
|
|
37
|
+
```
|
|
38
|
+
This identifies configured Twitter credentials in WP_SITES_CONFIG.
|
|
39
|
+
|
|
40
|
+
## Sections
|
|
41
|
+
|
|
42
|
+
### Section 1: Single Tweet
|
|
43
|
+
See `references/twitter-posting.md`
|
|
44
|
+
- Tweet creation with text, media, and reply-to
|
|
45
|
+
- Character limit enforcement (280 chars)
|
|
46
|
+
- Hashtag and mention strategy
|
|
47
|
+
- Link sharing and Twitter card generation
|
|
48
|
+
|
|
49
|
+
### Section 2: Thread Creation
|
|
50
|
+
See `references/twitter-posting.md`
|
|
51
|
+
- Blog post → thread conversion
|
|
52
|
+
- Thread splitting logic
|
|
53
|
+
- Sequential reply-chaining
|
|
54
|
+
- Best practices for thread engagement
|
|
55
|
+
|
|
56
|
+
### Section 3: Metrics
|
|
57
|
+
See `references/twitter-analytics.md`
|
|
58
|
+
- Tweet impressions, likes, retweets, replies, quotes
|
|
59
|
+
- Performance tracking over time
|
|
60
|
+
- Engagement benchmarks
|
|
61
|
+
|
|
62
|
+
### Section 4: Tweet Deletion
|
|
63
|
+
- Delete a specific tweet by ID
|
|
64
|
+
- Safety hook requires explicit user confirmation
|
|
65
|
+
- Deletion is irreversible
|
|
66
|
+
|
|
67
|
+
### Section 5: Setup Guide
|
|
68
|
+
See `references/twitter-setup.md`
|
|
69
|
+
- Twitter Developer Portal app creation
|
|
70
|
+
- API v2 Bearer token generation
|
|
71
|
+
- WP_SITES_CONFIG configuration
|
|
72
|
+
- Required access levels and permissions
|
|
73
|
+
|
|
74
|
+
## Reference Files
|
|
75
|
+
|
|
76
|
+
| File | Content |
|
|
77
|
+
|------|---------|
|
|
78
|
+
| `references/twitter-setup.md` | Developer portal, API keys, WP_SITES_CONFIG, permissions |
|
|
79
|
+
| `references/twitter-posting.md` | Tweets, threads, content adaptation, formatting |
|
|
80
|
+
| `references/twitter-analytics.md` | Metrics, engagement tracking, performance benchmarks |
|
|
81
|
+
|
|
82
|
+
## MCP Tools
|
|
83
|
+
|
|
84
|
+
| Tool | Description |
|
|
85
|
+
|------|-------------|
|
|
86
|
+
| `tw_create_tweet` | Publish a tweet (text, media, reply-to) |
|
|
87
|
+
| `tw_create_thread` | Publish a connected tweet thread |
|
|
88
|
+
| `tw_get_metrics` | Get tweet metrics (impressions, likes, retweets) |
|
|
89
|
+
| `tw_list_tweets` | List recent user tweets |
|
|
90
|
+
| `tw_delete_tweet` | Delete a tweet (irreversible, safety hook) |
|
|
91
|
+
|
|
92
|
+
## Recommended Agent
|
|
93
|
+
|
|
94
|
+
Use the **`wp-distribution-manager`** agent for multi-channel workflows that combine Twitter/X with Mailchimp, Buffer, SendGrid, and LinkedIn.
|
|
95
|
+
|
|
96
|
+
## Related Skills
|
|
97
|
+
|
|
98
|
+
- **`wp-linkedin`** — LinkedIn direct publishing (B2B channel)
|
|
99
|
+
- **`wp-social-email`** — Mailchimp, Buffer, SendGrid distribution
|
|
100
|
+
- **`wp-content-repurposing`** — Transform blog content into tweet-optimized formats
|
|
101
|
+
- **`wp-content`** — Create source WordPress content for distribution
|