/xuanran-seo-blog-writer:weekly-digestfrom xuanran-seo-blog-writer
Harvests Tier-A and Tier-B industry news sources, assembles a weekly digest article, and publishes as a WordPress draft awaiting explicit publish. Triggers on /weekly or 'industry weekly digest'.
Ships in xuanran-seo-blog-writer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Produces a SEO- and GEO-optimised weekly news digest article, published as DRAFT by
default (Rule 5a). The pipeline reuses the standard run_pipeline loop from
skills/seo-blog/SKILL.md for all build→publish stages, but bypasses keyword-research,
SERP-analysis, and competitor-analysis (meaningless for a digest) via explicit --action skip.
Every /weekly run creates a WordPress post with status: "draft".
Publishing live requires explicit user confirmation in the same conversation:
"publish" / "go live" / "发布" / "上线" — or a project-level
publish_policy.default = "publish" in business-context.json.
The pipeline MUST NOT flip status to publish without that signal.
active_slug=$(python -c "from scripts._core import active_project as a; print(a.get_active_project() or '')")
If active_slug is empty, ask the user which project to run for (/switch <slug> or set
XS_ACTIVE_PROJECT env var). Do not proceed without a slug.
weekly_digest config; stop if absent or disabledpython -c "
import json, sys
from pathlib import Path
bc = json.loads(Path('projects/{slug}/business-context.json').read_text(encoding='utf-8'))
wd = bc.get('weekly_digest', {})
if not wd.get('enabled'):
print('NOT_ENABLED')
sys.exit(2)
print('OK')
"
If the command prints NOT_ENABLED (or the file is missing), stop and tell the user:
The
weekly_digestblock is absent orenabled: falseinprojects/{slug}/business-context.json. Add aweekly_digestobject with at least{"enabled": true, "series_keyword": "...", "connectors": {...}}to activate the feature. Plan 3 (loamwright rollout) wires the first production config.
tid = "{slug}_wk_{YYYYMMDD}" # e.g. loamwright_wk_20260630
# must match ^[a-z0-9_]{8,32}$
ws = "memory/workspace/{tid}/"
Create the workspace directory:
python -c "from pathlib import Path; Path('memory/workspace/{tid}').mkdir(parents=True, exist_ok=True); print('ok')"
Dispatch the Tier-B researcher before the runner so all sources are available for the single harvest pass in Step 4.
Dispatch Agent(subagent_type="xuanran-seo-blog-writer:researcher") with the following
prompt (fill {slug}, {tid}, and {mcp_list} from the project config):
You are the Tier-B harvest arm for the weekly digest.
Project: {slug}
Task ID: {tid}
MCP connectors this project uses: {mcp_list} # from business-context weekly_digest.connectors.mcp (Tier-B ONLY: consumed by the researcher-agent prompt, deliberately NOT read by industry_news_runner)[]
Goal: Search for industry news items published in the last 7 days that will complement
what the Tier-A connectors find. Use every MCP connector listed above AND perform
broad Tavily web + news searches for "{series_keyword}".
For each news item you find, emit a normalized NewsItem object with EXACTLY these 10 keys:
{
"headline": "<str> — concise factual title, max 120 chars",
"url": "<str> — canonical URL of the primary source",
"source_domain": "<str> — e.g. example.com (no www.)",
"source_name": "<str> — publication name",
"published_at": "<str> — ISO-8601 UTC, e.g. 2026-06-30T12:00:00+00:00",
"summary_raw": "<str> — 1-3 sentence factual summary, max 500 chars",
"connector": "<str> — e.g. 'tavily_news' | 'mcp_pubmed' | 'web_search'",
"raw_score": <float|null>,
"entities": ["<str>", ...],
"topic_tags": ["<str>", ...]
}
Write ALL found items as a JSON array to:
memory/workspace/{tid}/tier-b.json
Output format: {"items": [ <NewsItem>, ... ]}
IRON RULE (Rule 8): Do NOT include any URL from the project's
do_not_cite_domains list in your output.
IRON RULE (extract-verified identity, v3.38.1): every item's headline,
summary_raw, and any statistic in it MUST be derived from the EXTRACTED
content of `url` itself (tavily_extract on that exact URL) — never from a
search snippet, another article about the same topic, or memory. If the
extracted page does not literally support the headline/stat you would
write, DISCARD the item. (2026-07-08 failure: a Tier-B item attributed a
fabricated "Pew 69,000-search study, 15%→8%" to a URL that actually hosts
a Define Media Group 64-site/42% analysis — the fact-checker caught it,
but the item identity must be right at harvest time.)
SCOPE: news EVENTS only. Conference CFPs / "submit a pitch" posts,
webinar promos, product marketing pages, and sponsored listicles are NOT
digest material — do not emit them.
Wait for the researcher agent to write memory/workspace/{tid}/tier-b.json.
If the researcher fails, tier-b.json will be absent — the runner in Step 4 silently
degrades to Tier-A only (no blocking).
Connector config shape (per-project, inside business-context.json :: weekly_digest):
{
"enabled": true,
"series_keyword": "SEO news this week",
"lookback_days": 7,
"follow_up_window_weeks": 4,
"items_per_issue": 7,
"category_id": 42,
"connectors": {
"rss": { "enabled": true, "feeds": ["https://feeds.example.com/news.rss"] },
"hackernews": { "enabled": true, "query": "SEO OR search engine" },
"gdelt": { "enabled": false, "queries": [] },
"newsapi": { "enabled": false, "domains": [], "queries": [] },
"community": { "enabled": true, "query": "SEO news 2026", "sources": ["reddit"] },
"tavily_news": { "enabled": true, "query": "SEO digital marketing news", "max_results": 10 },
"mcp": []
}
}
Run the harvest runner exactly once, passing --extra-items to merge any Tier-B
items the researcher wrote in Step 3. This single invocation runs all Tier-A connectors,
loads Tier-B items, de-duplicates, cross-week-filters, competitor-filters (Rule 8), ranks,
and writes covered.json / issues.json exactly once — no second run, no self-filter race:
python -m scripts.research.industry_news_runner \
--project {slug} \
--task-id {tid} \
--extra-items memory/workspace/{tid}/tier-b.json \
--json
If tier-b.json is absent (Step 3 researcher failed), --extra-items degrades to []
and Tier-A stands — no blocking, no second run needed.
Writes:
memory/workspace/{tid}/news-digest.json — ranked items, theme_of_week, rejected_competitor_domains[]projects/{slug}/weekly/covered.json — cross-process-locked append (Rule 7)projects/{slug}/weekly/issues.json — cross-process-locked append (Rule 7)Immediately after the runner finishes, verify the digest has items:
python -c "import json,sys; d=json.load(open('memory/workspace/{tid}/news-digest.json')); sys.exit(0 if d.get('items') else 3)"
Exit 3 → STOP. Report to the user:
No qualifying industry news this week — no digest generated. (All harvested items were either already covered, filtered as competitors, or no items were found by any connector.)
Do NOT proceed to pre-write, pipeline, or publish when the digest has 0 items.
digest_artifacts.py raises ValueError as a backstop if a 0-item digest somehow
reaches build_outline (Rule 6).
Open news-digest.json and review the 7 selections BEFORE pre-writing artifacts.
The 2026-08-02 root cures fixed the mechanical failures (follow-ups now APPEND
after fresh items and can never own theme_of_week; evergreen/how-to titles are
filtered with drops listed in the runner's evergreen_dropped[]; "via @handle"
headline suffixes are stripped at ingestion; relevance is token-based), but two
KNOWN RANKING LIMITATIONS remain — by decision, not oversight (no eval harness
exists to validate a re-tune):
FIXED 2026-08-12 (v3.42.11) — relevance was scored against the wrong words.
The runner used to feed content_strategy.primary_clusters into the relevance
scorer. Those are SERVICE-LINE labels ("Technical SEO", "Local SEO") describing
what the agency sells, not the vocabulary industry news is written in. Measured
on the seven hand-curated items of the 2026-08-12 issue, 6 of 7 scored 0.0 —
the "definitely off-topic, worse than unknown" verdict — so the 0.20 relevance
weight was not merely dead but anti-correlated, and freshness alone decided the
issue. That is why the ranker mis-selected five issues running.
The scorer's arithmetic was correct and is unchanged (a lone common word like
"local" must not match "Local SEO" — two tests pin that in both directions). What
changed is the SOURCE: _digest_relevance_terms() now prefers
weekly_digest.relevance_terms and falls back to primary_clusters only when a
project has not supplied one.
Each project should set weekly_digest.relevance_terms to short NEWS-topic
phrases in the vocabulary its trade press actually uses ("AI Overviews",
"algorithm update", "Search Console"), NOT to its service lines. Keep phrases
specific: multi-word terms need ≥2 overlapping tokens, and a bare "SEO" would
match everything. With loamwright's 35-term list the same seven items score
1.000 (6 of 7), while a bakery story still scores 0.0.
Follow-ups are now capped at weekly_digest.max_followups_per_issue
(default 2, and at least one fresh slot is always reserved). Previously they had
first claim on the entire items_per_issue budget without ever being ranked, so
3 of 7 slots on 2026-08-12 went to continuing stories carrying an empty summary
and a hardcoded 0.5 significance. A published follow-up is also now closed
(developing → reported) by close_published_followups; before this the same
three entries would have recycled on 08-19 and 08-26.
Step 4b curation review is still MANDATORY — these fixes improve the ranking inputs, they do not replace editorial judgment.
When the picks are wrong, HAND-CURATE from the Tier-B pool (tier-b.json):
clone build_digest()'s item shape exactly, use positional cluster ids, and
repair projects/{slug}/weekly/covered.json in BOTH directions under
file_lock.locked — remove the runner's rows for stories you dropped (a false
"reported" mark suppresses that story forever) and append rows for stories you
added (else they resurface next week).
Convert news-digest.json into the 5 standard pipeline artifacts (state, research, angle,
outline, image-prompts) so the orchestrator can skip the research/plan stages:
python -m scripts.research.digest_artifacts \
--task-id {tid} \
--project {slug} \
--json
Reads: memory/workspace/{tid}/news-digest.json + projects/{slug}/business-context.json
Writes (all in memory/workspace/{tid}/):
state.json — phase=plan, current_stage=format-selector, command=weekly-digestresearch.json — digest items as digest_items[]; empty serp_features[]/competitor_titles[]angle.json — format_id=weekly-digest, angle=trends; since 2026-08-02 the series
conventions are ENCODED: title {IND} Weekly, {Month D YYYY}: {hook} and slug
{ind}-weekly-YYYY-MM-DD, both derived from the ISSUE date in {tid} (never the
harvest wall-clock — the 07-22 issue slugged itself 07-23 by crossing UTC midnight).
Both slug and slug_draft are written. No hand-correction step needed.outline.json — TL;DR + one section per item + FAQ + References. Claim markers are
POSITIONAL (c1_src…c7_src), independent of cluster ids — hand-curated ids like
hc1 no longer produce schema-illegal [claim:hc1_src] markers.image-prompts.json — single cover photo slotNote: the assembled draft contains NO ## Conclusion for this format — the format
baseline (references/seo/format-mandatory-sections.json :: weekly-digest) excludes
it, and assemble.py now honors that resolution instead of injecting the
_(See verdict in main body sections.)_ placeholder stub (2026-08-02 root cure).
The SERP-analysis and competitor-analysis stages are meaningless for a news digest (there is no single target keyword; content comes from the harvest, not from SERP gaps). Explicitly skip them with a logged reason so the audit trail is clean:
python -m scripts.pipeline.orchestrator \
--workspace {tid} \
--action skip \
--stage serp-analysis \
--reason "weekly-digest: no single-keyword SERP; content sourced from harvest"
python -m scripts.pipeline.orchestrator \
--workspace {tid} \
--action skip \
--stage competitor-analysis \
--reason "weekly-digest: no competitor analysis; digest format covers news events, not keyword gaps"
This records status:"skipped" (NOT "completed") in the stage-history with the reason,
so a later auditor can tell what ran from what was deliberately dropped. Skipping a
mandatory stage is refused (exit 1) — only optional stages can be skipped.
⚠️ Do NOT --action skip the visual-designer stage for a digest. The
visual-density-check gate is mandatory (v3.31): it blocks publish on a wall-of-text
(no table / cited-stat block / quotation). The visual-designer restructures the digest into
an At-a-Glance table + a By-the-Numbers stat block that clear the floor, so it must run. A
digest that already carries those (they are the standard digest layout) passes; skipping the
designer on a thin digest would make the BASH density gate block publish.
The digest is now a standard pipeline artifact set. Drive it with the same
run_pipeline DISPATCH_LLM loop documented in skills/seo-blog/SKILL.md:
REPEAT:
1. result = Bash("python -m scripts.pipeline.run_pipeline --workspace {tid} --json"
[+ " --completed-llm {last_llm_stage}" if you just finished one])
2. Read result.action:
"COMPLETE" → Digest pipeline done. Proceed to Step 8 (post-publish verification).
"DISPATCH_LLM" → Dispatch Agent(subagent_type=result.subagent_type, prompt=result.dispatch_prompt).
After the subagent finishes, confirm expected_outputs exist,
then GOTO 1 with --completed-llm {result.stage}.
"GATE_FAILED" → Fix the draft or re-dispatch the failing subagent per
subskills/cross-cutting/repair-orchestrator, then GOTO 1.
"WAIT" → A CHECK isn't ready. Wait briefly, GOTO 1.
"BLOCKED" → Fix missing inputs per result.missing_inputs, then GOTO 1.
"ERROR" → Inspect result.detail, fix the crash, GOTO 1.
The runner services: section-drafter / fact-check / humanizer / geo-auditor / reviewer / meta-builder / image-visual-qa / publisher stages in the correct order.
⚠ Command-timeout discipline (2026-08-02): the run_pipeline invocation that
services wordpress-publisher runs a media upload that alone takes ~140s on a 4K
cover — give that Bash call a timeout of ≥600s. A tool-level timeout that kills
the runner mid-publisher leaves the stage in_progress with no publish-result.json.
Recovery procedure: (1) ghost-check WordPress FIRST — GET /wp/v2/posts?slug={slug} &status=any via WPClient('{slug}') (the publisher is not idempotent; a re-run
after a half-completed create makes a ghost post); (2) if no post exists, run the
stage command directly (python -m scripts.wordpress.wp_publisher {slug} --workspace {tid} --status draft --json) to capture its real stderr, then re-invoke the runner
to reconcile.
Publish defaults to DRAFT (Rule 5a). The publisher creates the post as
status: "draft". Do NOT flip to publish during the loop without explicit user
confirmation.
Publisher targeting note: the digest's dedicated WordPress category
(weekly_digest.category_id) is pinned into meta.category_ids automatically
by the category-selector optimize-phase stage — it detects format_id: "weekly-digest" in angle.json and short-circuits content-derived selection
(scripts/build/category_selector.py). No manual step is required; just ensure
category_id is set in the project config before the first run. (Before
2026-06-30 this was an unwired claim and digests silently fell through to
Uncategorized — Rule 6.)
After run_pipeline reports COMPLETE and the post exists as a draft:
python -m scripts.wordpress.verify_post {slug} {post_id} \
--workspace {tid} \
--expected-status draft \
--min-images 1
--min-images 1 is required: a digest ships a single cover photo (often
featured-only under a no_inline policy), so the default --min-images 4 would
report OVERALL FAIL on every digest even when publish is perfect.
Run the 13-point structural verification on the preview URL:
{wp_site_url}/?p={post_id}&preview=true
Checks include (from seo-blog SKILL.md Rule 4):
wp-content/uploads/<title>, <link rel="canonical">, <meta name="robots"> match planned meta<h2>References</h2> present with ≥1 <li> link-resolvable entryReport the preview URL to the user. Confirm covered/issues state was updated by Step 4 (the single runner pass writes covered/issues exactly once).
Present the user with:
Draft created: {preview_url}
Verification: {verification_summary}
To publish live, reply "publish" or "发布".
On explicit confirmation → run THE flip executor (v3.42.16 — one command owns PATCH → live re-verify → indexing re-run; never hand-run the three steps):
python -m scripts.wordpress.flip_post_live {slug} --workspace {tid} --json
Exit 0 = flipped + live-verified + submitted. Exit 2 = flipped + live-verified but NOT submitted (no_credentials/transport — resolve, then re-run indexing_notify). Exit 1 = hard failure; the flip is NOT complete. Evidence: workspace flip-result.json + verify-live-result.json.
Once the digest post is published (Step 9) and has a real permalink, record
the issue and (re)build the series hub page (whose path is the project's
weekly_digest.hub_page, default /weekly-digest/ — a project value, never
hardcoded in skill code). This is a concrete executor — the hub is NOT updated by
run_pipeline, so this step must run explicitly (Rule 6):
python -m scripts.wordpress.hub_page_publisher --project {slug} \
--task-id {tid} \
--issue-title "{published_post_title}" \
--issue-url "{published_post_permalink}" \
--issue-date {YYYY-MM-DD} \
--item-count {published_item_count} \
--status publish \
--json
Notes:
--task-id makes the issue record idempotent (a re-run updates the row in
place; it never appends a duplicate). The title/url backfill the harvest-time
stub so the hub lists a real link instead of "Untitled Issue → #".--status publish so the hub goes live too. Without it the
hub is created draft and — since refresh never flips status (H5) — stays a
permanent draft (the configured hub_page, e.g. /weekly-digest/ → 404). This
was the H1/Bug-1 silent failure.
--status for a project whose
business-context.json :: publish_policy.default == "publish": the publisher
auto-resolves to publish for that project (Rule 5a project-level opt-in,
via hub_page_publisher.resolve_hub_status).--status
(H5: omitting it leaves the live hub's status untouched). Passing
--status publish again is also safe (idempotent).subskills/research/industry-news-monitor/SKILL.md — harvest architecture detailscripts/research/industry_news_runner.py — Tier-A connector executor + --extra-items mergescripts/research/digest_artifacts.py — pre-writer CLI (5 pipeline artifacts)skills/seo-blog/SKILL.md — run_pipeline DISPATCH_LLM loop (canonical reference)scripts/pipeline/orchestrator.py — --action skip stage skippingscripts/pipeline/run_pipeline.py — the runner driving the build→publish looptemplates/weekly-digest.md — article format template (format_id: weekly-digest)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
weekly-digest, industry-news, content-automation, seo, draft-publishing
npx claudepluginhub xuanranl/loamwright-seo-skill --plugin xuanran-seo-blog-writer75 skills in this plugin
/ai-overview-recovery4-phase recovery when Google AI Overview drops an article. Measure damage → diagnose skip reason → rewrite → T+7/14/28 monitor. Triggered by drift-detector AIO loss alert OR /aio-recovery command./ai-visibility-trackerActive probe of ChatGPT/PPLX/Claude/Gemini to check if our article is cited. Compares to projects/{slug}/geo-baseline.json. Triggered by /ai-visibility command or daily/weekly schedule./batch-articleRun /article end-to-end for a list of keywords. Each keyword goes through the FULL pipeline (research → plan → build → optimize → publish → monitor baseline). Use for agency-scale operations — drop 10-500 keywords, get 10-500 published articles. Resumable across sessions.Other plugins' skills for the same job