claude-plugin-wordpress-manager 2.12.2 → 2.13.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 (29) hide show
  1. package/.claude-plugin/plugin.json +8 -3
  2. package/CHANGELOG.md +55 -0
  3. package/docs/GUIDE.md +240 -1
  4. package/docs/VALIDATION.md +341 -0
  5. package/docs/plans/2026-03-02-content-framework-architecture.md +612 -0
  6. package/docs/plans/2026-03-02-content-framework-strategic-reflections.md +228 -0
  7. package/docs/plans/2026-03-02-content-intelligence-phase2.md +560 -0
  8. package/docs/plans/2026-03-02-content-pipeline-phase1.md +456 -0
  9. package/docs/plans/2026-03-02-editorial-calendar-phase3.md +490 -0
  10. package/docs/validation/.gitkeep +0 -0
  11. package/docs/validation/dashboard.html +286 -0
  12. package/docs/validation/results.json +1705 -0
  13. package/package.json +12 -3
  14. package/scripts/run-validation.mjs +1132 -0
  15. package/servers/wp-rest-bridge/build/server.js +16 -5
  16. package/servers/wp-rest-bridge/build/tools/index.js +0 -9
  17. package/servers/wp-rest-bridge/build/tools/plugin-repository.js +23 -31
  18. package/servers/wp-rest-bridge/build/tools/schema.js +10 -2
  19. package/servers/wp-rest-bridge/build/tools/unified-content.js +10 -2
  20. package/servers/wp-rest-bridge/build/wordpress.d.ts +0 -3
  21. package/servers/wp-rest-bridge/build/wordpress.js +16 -98
  22. package/servers/wp-rest-bridge/package.json +1 -0
  23. package/skills/wp-analytics/SKILL.md +153 -0
  24. package/skills/wp-analytics/references/signals-feed-schema.md +417 -0
  25. package/skills/wp-content-pipeline/SKILL.md +461 -0
  26. package/skills/wp-content-pipeline/references/content-brief-schema.md +377 -0
  27. package/skills/wp-content-pipeline/references/site-config-schema.md +431 -0
  28. package/skills/wp-editorial-planner/SKILL.md +262 -0
  29. package/skills/wp-editorial-planner/references/editorial-schema.md +268 -0
@@ -0,0 +1,560 @@
1
+ # Content Intelligence Layer (Phase 2) — Implementation Plan
2
+
3
+ > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
4
+
5
+ **Goal:** Create a feedback loop where WordPress analytics data is transformed into structured signals compatible with GenSignal, enabling data-driven content decisions.
6
+
7
+ **Architecture:** Extend the existing `wp-analytics` skill with a new Step 7 that collects GA4, GSC, Plausible, and CWV data, calculates deltas vs previous period, maps metrics to GenSignal's NormalizedEvent format, identifies anomalies (±30% threshold), matches 3+ GenSignal patterns, and writes `.content-state/signals-feed.md`. A new schema reference file documents the feed format. Zero new TypeScript — all orchestration lives in skill prompts and MD schemas.
8
+
9
+ **Tech Stack:** Markdown + YAML frontmatter, Claude Code skill system, existing MCP tools (14 analytics tools + GSC tools)
10
+
11
+ **Reference Docs:**
12
+ - Architecture: `docs/plans/2026-03-02-content-framework-architecture.md` (Sections 2.1–2.4)
13
+ - Strategic context: `docs/plans/2026-03-02-content-framework-strategic-reflections.md` (Section 5B)
14
+ - GenSignal schemas: `gensignal:references:schemas` (NormalizedEvent, SignalCard, PatternRule)
15
+ - GenSignal patterns: `gensignal:references:pattern-library` (26 patterns, 3 relevant for WP analytics)
16
+ - Existing skill: `skills/wp-analytics/SKILL.md` (6 sections, 14 MCP tools)
17
+ - Phase 1 artifacts: `skills/wp-content-pipeline/references/content-brief-schema.md`, `skills/wp-content-pipeline/references/site-config-schema.md`
18
+
19
+ ---
20
+
21
+ ### Task 1: Create Signals Feed Schema Reference
22
+
23
+ **Files:**
24
+ - Create: `skills/wp-analytics/references/signals-feed-schema.md`
25
+
26
+ **Step 1: Create the references directory if needed**
27
+
28
+ ```bash
29
+ mkdir -p skills/wp-analytics/references
30
+ ```
31
+
32
+ Note: the `references/` directory likely already exists (from ga4-integration.md, plausible-setup.md, etc.). This is a safety check.
33
+
34
+ **Step 2: Write the signals feed schema**
35
+
36
+ Create `skills/wp-analytics/references/signals-feed-schema.md` with complete schema documentation. This file defines the YAML frontmatter structure and body format for `.content-state/signals-feed.md` files.
37
+
38
+ The schema must include these sections:
39
+
40
+ **A. Overview** — One paragraph explaining: signals-feed.md is the bridge between wp-analytics output and GenSignal input. It translates WordPress metrics into the NormalizedEvent format that GenSignal can consume for pattern detection and scoring.
41
+
42
+ **B. Frontmatter fields** with types, required/optional status, and defaults:
43
+ - `feed_id` (string, required, format: `FEED-{site_id}-YYYY-MM`)
44
+ - `site_id` (string, required, must match a `.content-state/{site_id}.config.md`)
45
+ - `generated` (ISO 8601 timestamp, auto-set at generation time)
46
+ - `period` (string, required, format: `YYYY-MM-DD..YYYY-MM-DD`)
47
+ - `comparison_period` (string, auto-calculated, same duration offset backward)
48
+ - `source_tools` (string array, required, list of MCP tools that contributed data)
49
+ - `anomaly_threshold` (number, default: 30, percentage delta that qualifies as anomaly)
50
+ - `status` (enum: `generated | reviewed | actioned`, default: `generated`)
51
+
52
+ **C. NormalizedEvent format** — Detailed field-by-field documentation:
53
+ - `entity_id` (string, required) — Format: `{EntityType}:{identifier}`. Entity types:
54
+ - `Page:/path` — A specific page or post URL path
55
+ - `Keyword:term` — A search keyword from GSC
56
+ - `Source:name` — A traffic source (e.g., linkedin, google, direct)
57
+ - `Site:site_id` — Site-level aggregate metric
58
+ - `relation` (string, required) — The metric being measured. Valid relations per entity type:
59
+ - Page: `pageviews`, `sessions`, `avg_engagement_time`, `bounce_rate`, `conversions`
60
+ - Keyword: `search_impressions`, `search_clicks`, `search_ctr`, `search_position`
61
+ - Source: `referral_sessions`, `referral_conversions`, `referral_bounce_rate`
62
+ - Site: `total_sessions`, `total_pageviews`, `total_conversions`, `lcp`, `cls`, `inp`, `fcp`, `ttfb`
63
+ - `value` (number, required) — The metric value for the current period
64
+ - `unit` (string, required) — One of: `count`, `seconds`, `percentage`, `position`
65
+ - `ts` (ISO 8601 timestamp, required) — End of measurement period
66
+ - `delta_pct` (number, optional) — Percentage change vs comparison period. Positive = increase, negative = decrease. Omitted if no comparison data available.
67
+ - `provenance` (object, required):
68
+ - `source_id` (string) — The MCP tool that produced this data (e.g., `ga4_top_pages`, `gsc_query_analytics`)
69
+ - `site` (string) — The site_id
70
+
71
+ **D. Body sections** — The MD body after frontmatter contains YAML code blocks organized by signal category:
72
+
73
+ 1. `# Normalized Events` — All NormalizedEvent entries organized by subsection:
74
+ - `## Traffic Signals` — Page-level metrics from GA4/Plausible
75
+ - `## Search Signals` — Keyword-level metrics from GSC
76
+ - `## Source Signals` — Traffic source metrics from GA4
77
+ - `## Performance Signals` — CWV metrics from CrUX/PageSpeed
78
+
79
+ 2. `# Anomalies & Patterns` — A Markdown table summarizing detected anomalies and pattern matches:
80
+ - Columns: `Entity | Metric | Delta | Pattern Match | Action`
81
+ - Only entries where `|delta_pct| >= anomaly_threshold` appear here
82
+ - Pattern Match column uses GenSignal pattern names (see section F)
83
+ - Action column contains a brief recommended next step
84
+
85
+ **E. Delta calculation rules:**
86
+ - Period comparison: current period vs same-length previous period (e.g., Feb vs Jan)
87
+ - Formula: `delta_pct = ((current - previous) / previous) * 100`, rounded to nearest integer
88
+ - If previous value is 0: use `+999` for any positive current value, `0` if both zero
89
+ - If no previous data exists: omit `delta_pct` field entirely
90
+ - The `comparison_period` frontmatter field records which period was used for baseline
91
+
92
+ **F. GenSignal pattern matching** — Three patterns from the GenSignal pattern library (26 total) that can be detected from WP analytics data alone:
93
+
94
+ 1. **Search Intent Shift** (PTRN from GenSignal pattern library)
95
+ - **Detection**: GSC data shows `search_ctr` increasing while `search_position` stays flat or drops — users clicking more on existing rankings, suggesting intent shift toward transactional
96
+ - **Trigger**: `search_ctr` delta ≥ +20% sustained over 2+ measurement windows, OR `search_impressions` delta ≥ +50% on keywords with commercial modifiers
97
+ - **Data sources**: `gsc_query_analytics`
98
+ - **Action template**: "Investigate: content cluster opportunity" or "Optimize: test transactional CTAs"
99
+
100
+ 2. **Early-Adopter Surge** (PTRN from GenSignal pattern library)
101
+ - **Detection**: Single traffic source shows disproportionate session growth compared to other sources — early adoption signal from a specific community/channel
102
+ - **Trigger**: Single `Source:*` referral_sessions delta ≥ +50% while total site sessions delta < +20%
103
+ - **Data sources**: `ga4_traffic_sources`
104
+ - **Action template**: "Scale: increase posting frequency on {source}" or "Investigate: identify content resonating with {source} audience"
105
+
106
+ 3. **Hype→Utility Crossover** (PTRN from GenSignal pattern library)
107
+ - **Detection**: Page engagement metrics (avg_engagement_time, low bounce_rate) improving while raw pageviews plateau or decrease — shift from curiosity traffic to utility traffic
108
+ - **Trigger**: `avg_engagement_time` delta ≥ +15% AND `bounce_rate` delta ≤ -10%, with `pageviews` delta between -20% and +10%
109
+ - **Data sources**: `ga4_top_pages`, `ga4_report`
110
+ - **Action template**: "Shift: move spend from awareness to activation" or "Optimize: add conversion touchpoints to high-engagement pages"
111
+
112
+ **G. Status lifecycle**: `generated → reviewed → actioned`
113
+ - `generated`: Feed was just created by wp-analytics Step 7
114
+ - `reviewed`: User or Claude has reviewed the anomalies and confirmed/dismissed findings
115
+ - `actioned`: Findings have been acted upon (briefs created, campaigns launched, etc.)
116
+
117
+ **H. Integration notes:**
118
+ - GenSignal compatibility: NormalizedEvent fields map 1:1 to GenSignal Harvest stage input. The `entity_id` format uses GenSignal's `{Type}:{identifier}` convention. The `provenance` block ensures source tracking for GenSignal's `quality.corroboration` scoring.
119
+ - Phase 1 bridge: Anomalies with "content cluster opportunity" actions can feed directly into `wp-content-pipeline` by creating brief files in `pipeline-active/`.
120
+ - Phase 3 bridge: The Anomalies & Patterns table feeds `wp-editorial-planner` for topic suggestions when creating calendar entries.
121
+ - Overwrite semantics: `signals-feed.md` is overwritten each time Step 7 runs. Previous feeds are not archived (they represent point-in-time snapshots). The `comparison_period` field preserves the baseline reference.
122
+
123
+ **I. Example feed** — A complete, realistic example for opencactus with:
124
+ - 2-3 Traffic Signals (page-level)
125
+ - 2 Search Signals (keyword-level)
126
+ - 1 Source Signal
127
+ - 1 Performance Signal
128
+ - 2-3 rows in Anomalies & Patterns table matching the 3 patterns above
129
+
130
+ Use the exact examples from the architecture doc (section 2.2) as the basis, ensuring field names and formats match the schema defined above.
131
+
132
+ **J. Validation rules:**
133
+ - `feed_id` must follow `FEED-{site_id}-YYYY-MM` format
134
+ - `site_id` must match an existing `.content-state/{site_id}.config.md`
135
+ - Every event must have `entity_id`, `relation`, `value`, `unit`, `ts`, and `provenance`
136
+ - `entity_id` must use a recognized prefix: `Page:`, `Keyword:`, `Source:`, `Site:`
137
+ - `relation` must be valid for the entity type (see table in section C)
138
+ - `delta_pct` values should be integers (round to nearest)
139
+ - `anomaly_threshold` must be a positive number
140
+
141
+ **Step 3: Verify file exists and is valid markdown**
142
+
143
+ Run: `head -5 skills/wp-analytics/references/signals-feed-schema.md`
144
+
145
+ Expected: file exists with `# Signals Feed Schema` header.
146
+
147
+ **Step 4: Commit**
148
+
149
+ ```bash
150
+ git add skills/wp-analytics/references/signals-feed-schema.md
151
+ git commit -m "feat(content-intelligence): add signals feed schema reference
152
+
153
+ Defines the NormalizedEvent format for bridging wp-analytics output
154
+ to GenSignal input. Covers entity types, relations, delta calculation,
155
+ and 3 auto-detectable GenSignal patterns (Search Intent Shift,
156
+ Early-Adopter Surge, Hype→Utility Crossover)."
157
+ ```
158
+
159
+ ---
160
+
161
+ ### Task 2: Extend `wp-analytics` SKILL.md with Signal Feed Generation
162
+
163
+ **Files:**
164
+ - Modify: `skills/wp-analytics/SKILL.md`
165
+
166
+ **Step 1: Read the current SKILL.md**
167
+
168
+ Read: `skills/wp-analytics/SKILL.md`
169
+
170
+ Understand the current 6 sections and the structure. The new content will be added as a new Section 7 and a new workflow step.
171
+
172
+ **Step 2: Add Section 7 to the Sections list**
173
+
174
+ After the existing `### Section 6: Cross-Platform Comparison` block (around line 93-98), add:
175
+
176
+ ```markdown
177
+ ### Section 7: Signal Feed Generation (Content Intelligence)
178
+ See `references/signals-feed-schema.md`
179
+ - Generating `.content-state/signals-feed.md` from analytics data
180
+ - NormalizedEvent format for GenSignal compatibility
181
+ - Delta calculation against previous period
182
+ - Anomaly detection with configurable threshold (default ±30%)
183
+ - Pattern matching: Search Intent Shift, Early-Adopter Surge, Hype→Utility Crossover
184
+ - Integration with wp-content-pipeline (Phase 1) and wp-editorial-planner (Phase 3)
185
+ ```
186
+
187
+ **Step 3: Add the reference file to the Reference Files table**
188
+
189
+ In the `## Reference Files` table (around line 100-108), add a new row:
190
+
191
+ ```markdown
192
+ | `references/signals-feed-schema.md` | NormalizedEvent format, delta rules, pattern matching, anomaly detection |
193
+ ```
194
+
195
+ **Step 4: Add the Signal Feed Generation workflow**
196
+
197
+ After the Reference Files table and before the `## MCP Tools` section, add a new section:
198
+
199
+ ```markdown
200
+ ## Signal Feed Generation Workflow
201
+
202
+ ### When to Use
203
+
204
+ - User asks to "generate signals", "analyze performance and create signals", "run content intelligence"
205
+ - User wants to understand which analytics trends are actionable
206
+ - User mentions GenSignal integration or NormalizedEvent
207
+ - After running a standard analytics report (Sections 1-6), user wants structured output for strategic planning
208
+
209
+ ### Prerequisites
210
+
211
+ 1. At least one analytics service configured (GA4, Plausible, or GSC)
212
+ 2. A `.content-state/{site_id}.config.md` exists for the target site (created in Phase 1)
213
+ 3. Historical data for at least 2 periods (to calculate deltas)
214
+
215
+ ### Step 7: GENERATE SIGNAL FEED
216
+
217
+ ```
218
+ COLLECT → BASELINE → NORMALIZE → DELTA → ANOMALY → PATTERN → WRITE
219
+ ```
220
+
221
+ **7.1 COLLECT — Gather current period data**
222
+
223
+ Call the following MCP tools for the requested period (default: last 30 days):
224
+
225
+ | Tool | Data Collected | Entity Type |
226
+ |------|---------------|-------------|
227
+ | `ga4_top_pages` | Top 20 pages by pageviews, sessions, engagement time | Page |
228
+ | `ga4_traffic_sources` | Source/medium breakdown with sessions, bounce rate | Source |
229
+ | `ga4_report` | Site-level aggregate: total sessions, pageviews, conversions | Site |
230
+ | `gsc_query_analytics` | Top 20 keywords by impressions, clicks, CTR, position | Keyword |
231
+ | `pl_aggregate` | If Plausible configured: visitors, pageviews, bounce_rate | Site (cross-validate) |
232
+ | `cwv_crux_origin` | If CrUX available: LCP, CLS, INP, FCP, TTFB | Site |
233
+
234
+ Not all tools need to succeed. Generate events only from tools that return data. Record which tools contributed in `source_tools` frontmatter.
235
+
236
+ **7.2 BASELINE — Load comparison period data**
237
+
238
+ Read the existing `.content-state/signals-feed.md` if present. Extract the `period` and `events` to use as baseline for delta calculation.
239
+
240
+ If no previous feed exists:
241
+ - Call the same tools with date range offset by the period length (e.g., if current = Feb, baseline = Jan)
242
+ - If baseline tools fail: proceed without deltas (omit `delta_pct` fields)
243
+
244
+ Record the comparison period in `comparison_period` frontmatter field.
245
+
246
+ **7.3 NORMALIZE — Map to NormalizedEvent format**
247
+
248
+ For each data point from Step 7.1, create a NormalizedEvent:
249
+
250
+ ```yaml
251
+ - entity_id: "{EntityType}:{identifier}"
252
+ relation: "{metric_name}"
253
+ value: {numeric_value}
254
+ unit: "{count|seconds|percentage|position}"
255
+ ts: "{period_end_ISO8601}"
256
+ provenance:
257
+ source_id: "{mcp_tool_name}"
258
+ site: "{site_id}"
259
+ ```
260
+
261
+ **Entity ID mapping rules:**
262
+ - GA4 top pages: `Page:{page_path}` (e.g., `Page:/cactus-water-benefici`)
263
+ - GA4 traffic sources: `Source:{source_name}` (e.g., `Source:linkedin`)
264
+ - GA4 site aggregates: `Site:{site_id}` (e.g., `Site:opencactus`)
265
+ - GSC keywords: `Keyword:{query}` (e.g., `Keyword:acqua di cactus`)
266
+ - CWV metrics: `Site:{site_id}` with relation = metric name (e.g., `lcp`)
267
+
268
+ **Relation mapping rules:**
269
+ - GA4 `screenPageViews` → `pageviews`
270
+ - GA4 `sessions` → `sessions` (page-level) or `total_sessions` (site-level)
271
+ - GA4 `averageSessionDuration` → `avg_engagement_time`
272
+ - GA4 `bounceRate` → `bounce_rate`
273
+ - GSC `impressions` → `search_impressions`
274
+ - GSC `clicks` → `search_clicks`
275
+ - GSC `ctr` → `search_ctr`
276
+ - GSC `position` → `search_position`
277
+ - CWV metrics → lowercase (e.g., `lcp`, `cls`, `inp`)
278
+
279
+ **7.4 DELTA — Calculate percentage changes**
280
+
281
+ For each NormalizedEvent, find the matching baseline event (same `entity_id` + `relation`) and calculate:
282
+
283
+ ```
284
+ delta_pct = round(((current_value - baseline_value) / baseline_value) * 100)
285
+ ```
286
+
287
+ Special cases:
288
+ - Baseline value = 0 and current > 0: set `delta_pct: +999`
289
+ - Both values = 0: set `delta_pct: 0`
290
+ - No baseline match found: omit `delta_pct` field
291
+
292
+ Add the calculated `delta_pct` to each NormalizedEvent.
293
+
294
+ **7.5 ANOMALY — Identify significant changes**
295
+
296
+ Read `anomaly_threshold` from feed frontmatter (default: 30).
297
+
298
+ Filter events where `|delta_pct| >= anomaly_threshold`. These are anomalies.
299
+
300
+ For each anomaly, prepare a row for the Anomalies & Patterns table:
301
+ - Entity: the `entity_id`
302
+ - Metric: the `relation`
303
+ - Delta: the `delta_pct` with sign and % symbol
304
+
305
+ **7.6 PATTERN — Match GenSignal patterns**
306
+
307
+ For each anomaly, check against the 3 detectable patterns:
308
+
309
+ **Search Intent Shift:**
310
+ - Condition: Entity is `Keyword:*` AND (`search_ctr` delta ≥ +20% with `search_position` delta ≤ +5%) OR (`search_impressions` delta ≥ +50%)
311
+ - Action: "Investigate: content cluster opportunity"
312
+
313
+ **Early-Adopter Surge:**
314
+ - Condition: Entity is `Source:*` AND `referral_sessions` delta ≥ +50% AND site-level `total_sessions` delta < +20%
315
+ - Action: "Scale: increase posting frequency on {source}"
316
+
317
+ **Hype→Utility Crossover:**
318
+ - Condition: Entity is `Page:*` AND `avg_engagement_time` delta ≥ +15% AND `bounce_rate` delta ≤ -10% AND `pageviews` delta between -20% and +10%
319
+ - Requires checking multiple relations for the same entity
320
+ - Action: "Shift: add conversion touchpoints to {page}"
321
+
322
+ If no pattern matches: set Pattern Match to "Unclassified anomaly" and Action to "Review: investigate cause of {delta_pct}% change in {relation}"
323
+
324
+ **7.7 WRITE — Generate signals-feed.md**
325
+
326
+ Write `.content-state/signals-feed.md` with:
327
+ 1. YAML frontmatter: `feed_id`, `site_id`, `generated`, `period`, `comparison_period`, `source_tools`, `anomaly_threshold`, `status: generated`
328
+ 2. Body: organized by signal category (Traffic, Search, Source, Performance)
329
+ 3. Anomalies & Patterns table at the end
330
+
331
+ **After writing**, present a summary to the user:
332
+ ```
333
+ Signal Feed generato per {site_id}:
334
+ - Periodo: {period}
335
+ - Eventi normalizzati: {count}
336
+ - Anomalie rilevate: {anomaly_count}
337
+ - Pattern riconosciuti: {pattern_list}
338
+
339
+ Anomalie principali:
340
+ 1. {entity} — {relation} {delta}% → {pattern}: {action}
341
+ 2. ...
342
+
343
+ Per approfondire un segnale con GenSignal: "approfondisci il segnale N con GenSignal"
344
+ Per creare brief dai segnali: "crea brief per i segnali azionabili"
345
+ ```
346
+ ```
347
+
348
+ **Step 5: Update Related Skills**
349
+
350
+ In the `## Related Skills` section (around line 133-138), add:
351
+
352
+ ```markdown
353
+ - **`wp-content-pipeline`** — use signal insights to create content briefs for publishing
354
+ ```
355
+
356
+ **Step 6: Update Cross-references**
357
+
358
+ In the `## Cross-references` section (around line 140-145), add:
359
+
360
+ ```markdown
361
+ - Signal feed generation bridges to `wp-content-pipeline` for data-driven content creation
362
+ - GenSignal integration: signals-feed.md is the exchange format between wp-analytics and GenSignal pattern detection
363
+ ```
364
+
365
+ **Step 7: Verify SKILL.md structure**
366
+
367
+ Run: `grep -n "### Section" skills/wp-analytics/SKILL.md`
368
+
369
+ Expected: 7 sections listed (Section 1 through Section 7).
370
+
371
+ Run: `grep -n "Step 7" skills/wp-analytics/SKILL.md`
372
+
373
+ Expected: at least 1 match for the new Step 7 content.
374
+
375
+ **Step 8: Commit**
376
+
377
+ ```bash
378
+ git add skills/wp-analytics/SKILL.md
379
+ git commit -m "feat(content-intelligence): extend wp-analytics with signal feed generation
380
+
381
+ Adds Step 7: GENERATE SIGNAL FEED workflow (COLLECT → BASELINE →
382
+ NORMALIZE → DELTA → ANOMALY → PATTERN → WRITE). Maps GA4, GSC,
383
+ Plausible, CWV metrics to GenSignal NormalizedEvent format. Detects
384
+ 3 patterns: Search Intent Shift, Early-Adopter Surge, Hype→Utility
385
+ Crossover. Writes .content-state/signals-feed.md."
386
+ ```
387
+
388
+ ---
389
+
390
+ ### Task 3: Create Example Signals Feed Instance
391
+
392
+ **Files:**
393
+ - Create: `.content-state/signals-feed.md`
394
+
395
+ **Step 1: Write a realistic test feed**
396
+
397
+ Create `.content-state/signals-feed.md` with:
398
+
399
+ - Frontmatter targeting opencactus, period: 2026-02-01..2026-02-28, comparison_period: 2026-01-01..2026-01-31
400
+ - source_tools: `[ga4_top_pages, ga4_traffic_sources, ga4_report, gsc_query_analytics]`
401
+ - anomaly_threshold: 30
402
+ - status: generated
403
+
404
+ Events section with realistic data:
405
+
406
+ **Traffic Signals (3 events):**
407
+ - `Page:/benefici-acqua-cactus-idratazione-naturale-sicilia` — pageviews: 3240, delta: +47%
408
+ - `Page:/benefici-acqua-cactus-idratazione-naturale-sicilia` — avg_engagement_time: 185s, delta: +12%
409
+ - `Page:/prodotti` — pageviews: 1850, delta: +8%
410
+
411
+ **Search Signals (2 events):**
412
+ - `Keyword:acqua di cactus` — search_impressions: 8500, delta: +120%
413
+ - `Keyword:acqua di cactus benefici` — search_ctr: 4.2%, delta: -8%
414
+
415
+ **Source Signals (1 event):**
416
+ - `Source:linkedin` — referral_sessions: 420, delta: +85%
417
+
418
+ **Performance Signals (1 event):**
419
+ - `Site:opencactus` — lcp: 2.1s, no delta (first CWV measurement)
420
+
421
+ **Anomalies & Patterns table (3 rows):**
422
+
423
+ | Entity | Metric | Delta | Pattern Match | Action |
424
+ |--------|--------|-------|---------------|--------|
425
+ | Keyword:acqua di cactus | search_impressions | +120% | Search Intent Shift | Investigate: content cluster opportunity |
426
+ | Source:linkedin | referral_sessions | +85% | Early-Adopter Surge | Scale: increase LinkedIn posting frequency |
427
+ | Page:/benefici-acqua-cactus-idratazione-naturale-sicilia | pageviews | +47% | Unclassified anomaly | Review: investigate cause of +47% change in pageviews |
428
+
429
+ This feed serves as the integration test artifact. The wp-analytics Step 7 will produce files in this exact format.
430
+
431
+ **Step 2: Verify feed structure**
432
+
433
+ Run: `head -15 .content-state/signals-feed.md`
434
+
435
+ Expected: valid YAML frontmatter with `feed_id: FEED-opencactus-2026-02` and `status: generated`.
436
+
437
+ **Step 3: No commit** — this file is gitignored (instance data). It lives locally for testing.
438
+
439
+ ---
440
+
441
+ ### Task 4: Update Architecture Doc Status
442
+
443
+ **Files:**
444
+ - Modify: `docs/plans/2026-03-02-content-framework-architecture.md`
445
+
446
+ **Step 1: Read current acceptance criteria**
447
+
448
+ Read lines around 582-588 of the architecture doc to find the Phase 2 checklist.
449
+
450
+ **Step 2: Update Phase 2 checklist**
451
+
452
+ Check off the implemented criteria:
453
+
454
+ ```markdown
455
+ ### Fase 2: Content Intelligence
456
+
457
+ - [x] `signals-feed.schema.md` compatibile con GenSignal NormalizedEvent
458
+ - [x] `wp-analytics` estesa con Step 7 (signal feed generation)
459
+ - [x] Delta calculation funzionante (confronto con periodo precedente)
460
+ - [x] Almeno 3 GenSignal patterns riconosciuti automaticamente
461
+ - [ ] Flusso testato: analytics → signals-feed.md → insight azionabili
462
+ ```
463
+
464
+ Note: "Flusso testato" left unchecked — that requires a live analytics test with real GA4/GSC data, which is a separate manual validation step (same pattern as Phase 1).
465
+
466
+ **Step 3: Update document status**
467
+
468
+ Change `**Stato**: Fase 1 Implementata` to `**Stato**: Fase 2 Implementata`
469
+
470
+ **Step 4: Commit**
471
+
472
+ ```bash
473
+ git add docs/plans/2026-03-02-content-framework-architecture.md
474
+ git commit -m "docs: update architecture status — Phase 2 implemented
475
+
476
+ Signals feed schema, wp-analytics Step 7 extension, delta calculation,
477
+ and 3 GenSignal patterns in place. Live analytics flow test pending."
478
+ ```
479
+
480
+ ---
481
+
482
+ ### Task 5: Update GUIDE.md with Phase 2 Documentation
483
+
484
+ **Files:**
485
+ - Modify: `docs/GUIDE.md`
486
+
487
+ **Step 1: Read current Content Framework section**
488
+
489
+ Read the Content Framework section in GUIDE.md (added in Phase 1 as section 17) to find where to insert Phase 2 content.
490
+
491
+ **Step 2: Add Content Intelligence subsection**
492
+
493
+ After the existing `### 17.2 Content Pipeline (Phase 1)` subsection, add a new subsection:
494
+
495
+ ```markdown
496
+ ### 17.5 Content Intelligence (Phase 2)
497
+
498
+ **Skill**: `wp-analytics` (extended with Step 7: Signal Feed Generation)
499
+
500
+ The intelligence layer creates a feedback loop: analytics data → structured signals → actionable insights.
501
+
502
+ **Generating a signals feed**:
503
+ 1. Run `wp-analytics` signal feed generation for a site
504
+ 2. Step 7 collects data from GA4, GSC, Plausible, CWV tools
505
+ 3. Calculates delta % vs previous period
506
+ 4. Maps metrics to GenSignal NormalizedEvent format
507
+ 5. Identifies anomalies (±30% threshold by default)
508
+ 6. Matches 3 GenSignal patterns automatically
509
+ 7. Writes `.content-state/signals-feed.md`
510
+
511
+ **Detectable patterns**:
512
+
513
+ | Pattern | Detection Source | Trigger |
514
+ |---------|-----------------|---------|
515
+ | Search Intent Shift | GSC queries | CTR ≥ +20% with stable position |
516
+ | Early-Adopter Surge | GA4 traffic sources | Single source ≥ +50% vs site < +20% |
517
+ | Hype→Utility Crossover | GA4 page metrics | Engagement ≥ +15% with bounce ≤ -10% |
518
+
519
+ **Acting on signals**:
520
+ - "Approfondisci con GenSignal" → Full SignalCard with scoring and next_actions
521
+ - "Crea brief dai segnali" → Auto-generate content briefs in pipeline-active/
522
+ - Signals feed topic suggestions → Editorial calendar (Phase 3)
523
+
524
+ **Signal feed file**: `.content-state/signals-feed.md` (overwritten each generation)
525
+ ```
526
+
527
+ Note: The subsection numbering should follow whatever the last subsection is in the current GUIDE.md Content Framework section. Read the file first to determine the correct number.
528
+
529
+ **Step 3: Commit**
530
+
531
+ ```bash
532
+ git add docs/GUIDE.md
533
+ git commit -m "docs: add Content Intelligence (Phase 2) section to GUIDE.md
534
+
535
+ Documents signal feed generation workflow, 3 detectable GenSignal
536
+ patterns, and integration with content pipeline and editorial calendar."
537
+ ```
538
+
539
+ ---
540
+
541
+ ## Summary
542
+
543
+ | Task | Deliverable | Type |
544
+ |------|-------------|------|
545
+ | 1 | `signals-feed-schema.md` | Schema reference |
546
+ | 2 | `wp-analytics/SKILL.md` Step 7 extension | Skill modification |
547
+ | 3 | `.content-state/signals-feed.md` example | Test artifact (gitignored) |
548
+ | 4 | Architecture doc status update | Documentation |
549
+ | 5 | GUIDE.md Content Intelligence section | Documentation |
550
+
551
+ **Total new files**: 1 tracked + 1 gitignored instance
552
+ **Total modified files**: 3 (wp-analytics/SKILL.md, architecture doc, GUIDE.md)
553
+ **New TypeScript**: 0
554
+
555
+ **Acceptance Criteria (from architecture doc)**:
556
+ - [x] `signals-feed.schema.md` compatible with GenSignal NormalizedEvent → Task 1
557
+ - [x] `wp-analytics` extended with Step 7 → Task 2
558
+ - [x] Delta calculation working → Task 1 (rules) + Task 2 (workflow step 7.4)
559
+ - [x] At least 3 GenSignal patterns recognized → Task 1 (section F) + Task 2 (step 7.6)
560
+ - [ ] Flow tested: analytics → signals-feed.md → actionable insights → Manual test (post-implementation)