No slash command · from xuanran-seo-blog-writer
Harvests industry news via Tier-A deterministic connectors and Tier-B researcher arm, deduplicates, filters, ranks clusters, and updates state. Called by /weekly skill.
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.
This subskill documents the full harvest architecture for the weekly digest.
The /weekly skill orchestrates it (Steps 3–4); this file is the definitive
reference for how harvesting works and how to extend it.
Tier-A (deterministic, scriptable) Tier-B (MCP / deep-web, researcher agent)
───────────────────────────────── ──────────────────────────────────────────
RSS feeds MCP tools (pubmed, tavily, biorxiv, etc.)
HackerNews search Community deep searches (Reddit/X)
GDELT news graph Specialised industry APIs
NewsAPI (paid, per-project) Broad Tavily news searches
Community (Tavily reddit/x) Paywalled trade publication extracts
Tavily topic="news" search ─────────────────────────────────────────
───────────────────────────── Writes: memory/workspace/{tid}/tier-b.json
Writes: memory/workspace/{tid}/ (NewsItem JSON array)
news-digest.json (initial pass) ↓
Merged by runner via --extra-items flag
python -m scripts.research.industry_news_runner \
--project {slug} \
--task-id {tid} \
[--extra-items memory/workspace/{tid}/tier-b.json] \
[--lookback-days N] \
[--window-weeks N] \
--json
scripts/research/industry_news_runner.py is the single source of truth for Tier-A.
It reads projects/{slug}/business-context.json :: weekly_digest.connectors and
calls the enabled connector modules from scripts/fetch/.
The /weekly skill runs the runner exactly once with --extra-items pointing at the
researcher's tier-b.json output (written in Step 3). The runner appends Tier-B items to
the Tier-A set before de-dup/filter/rank — it does NOT replace the Tier-A results:
python -m scripts.research.industry_news_runner \
--project {slug} \
--task-id {tid} \
--extra-items memory/workspace/{tid}/tier-b.json \
--json
Running the runner only once (not separately for Tier-A then again for Tier-B) prevents
the cross_week_filter from silently dropping Tier-A stories that were just written to
covered.json with status:"reported" moments earlier.
| File | Description |
|---|---|
memory/workspace/{tid}/news-digest.json | Ranked digest with items[], theme_of_week, rejected_competitor_domains[], connectors_run[] |
projects/{slug}/weekly/covered.json | Cross-process-locked append of newly-reported URLs + status |
projects/{slug}/weekly/issues.json | Cross-process-locked append of issue stub {date, task_id, item_count} |
Per-project connector config lives at:
projects/{slug}/business-context.json :: weekly_digest.connectors
| Key | Module | Required config keys |
|---|---|---|
rss | scripts.fetch.rss_fetch | feeds: [url, ...] |
hackernews | scripts.fetch.hackernews_search | query: "..." |
gdelt | scripts.fetch.gdelt_query | queries: ["...", ...] |
newsapi | scripts.fetch.newsapi_query | domains: [...], queries: [...] |
community | scripts.fetch.community_search | query: "...", sources: ["reddit"|"x"] |
tavily_news | scripts.fetch.tavily_search (topic=news) | query: "...", max_results: N |
A connector is active when its key is present in the config dict, enabled: true (or no
enabled key — absence means enabled), and has the required config keys populated.
The mcp[] array in weekly_digest.connectors is a list of MCP connector descriptors.
The researcher agent reads this list and calls the corresponding MCP tools:
"mcp": [
{ "tool": "mcp__tavily__tavily_search", "query_template": "{series_keyword} site:reddit.com" },
{ "tool": "mcp__pubmed__search_articles", "query_template": "{series_keyword}" },
{ "tool": "mcp__biorxiv__search_preprints", "category": "bioinformatics" }
]
The researcher is the ONLY agent with MCP access. It dispatches exactly the MCP tools listed, writes normalized NewsItem objects, and stops.
All items — Tier-A and Tier-B — must conform to this shape:
{
"headline": "string — concise factual title, max 120 chars",
"url": "string — canonical URL of primary source",
"source_domain": "string — e.g. techcrunch.com (no www.)",
"source_name": "string — publication display name",
"published_at": "string — ISO-8601 UTC timestamp",
"summary_raw": "string — 1-3 sentence factual summary, max 500 chars",
"connector": "string — e.g. 'rss' | 'tavily_news' | 'mcp_pubmed' | 'extra'",
"raw_score": "float | null — provider relevance score",
"entities": ["string", ...],
"topic_tags": ["string", ...]
}
source_domain is derived automatically by scripts/_core/news_item.make_item() from
url; Tier-B items may set it explicitly or omit it (the loader derives it).
Tier-B items written to tier-b.json should use the {"items": [...]} envelope.
After Tier-A + Tier-B items are loaded, the runner applies a 4-stage pipeline:
cluster_items(items) groups items by canonical_url (scheme-normalised, www-stripped,
trailing-slash-stripped). Each cluster has a head (most-recent item) and a corroboration
count (distinct source domains).
cross_week_filter(clusters, covered) drops clusters whose canonical_url was already
reported AND whose status in covered.json is NOT in {"developing", "unconfirmed", "watch"}.
Active follow-up stories (status ∈ the active set) pass through so they can be re-surfaced as
kind: "follow_up" items APPENDED after the fresh items (2026-08-02: follow-ups trail the
issue and can never own theme_of_week — pre-cure they were prepended, which made a stale
follow-up the theme/H1 three issues running).
competitor_filter(clusters, do_not_cite_domains) applies the per-project
citation_source_policy.do_not_cite_domains blocklist (suffix-match; subdomains blocked).
news-digest.json :: rejected_competitor_domains[].The blocklist is the SAME list used by the article pipeline (Rule 8, root CLAUDE.md).
rank_clusters(clusters, now_iso, project_terms, authority_domains) scores each cluster
(doc synced to the REAL formula 2026-07-01 — the old doc omitted the authority term):
significance = 0.30 × recency
+ 0.25 × corroboration_norm
+ 0.20 × relevance(project_terms)
+ 0.15 × authority(head domain ∈ authority_domains)
+ 0.10 × raw_score_norm
recency = 1.0 for items published today, 0.0 for items 7+ days old.
project_terms comes from _digest_relevance_terms(bc) (v3.42.11): it prefers
business-context.json :: weekly_digest.relevance_terms — short NEWS-topic phrases in the
vocabulary the trade press actually writes in — and falls back to
content_strategy.primary_clusters only when a project has not supplied one. Feeding
primary_clusters directly (the pre-v3.42.11 behaviour this line used to document) is a
category error: those are SERVICE-LINE labels, and on real harvests they scored 6 of 7
on-topic items 0.0, making the 0.20 weight anti-correlated (see skills/weekly-digest
Step 4b for the full account and per-project setup guidance).
authority_domains is derived from the project's RSS feeds + NewsAPI domains, plus an
optional explicit weekly_digest.authority_domains override.
Clusters are sorted descending. Follow-ups are capped at
weekly_digest.max_followups_per_issue (default 2, ≥1 fresh slot always reserved) and a
follow-up PUBLISHED this issue is closed to reported by close_published_followups
(v3.42.13 — its first version read the cluster shape instead of the item shape and silently
no-opped; the regression test now drives _emit_followups itself). Only the top
items_per_issue (default 7) appear in the digest body.
Stories with active status are tracked across issues to enable longitudinal reporting.
| Status | Meaning | Cross-week behavior |
|---|---|---|
reported | Covered; story resolved | Dropped from next digest |
developing | Story is actively evolving | Passes cross-week filter; re-surfaced as follow-up |
unconfirmed | Claim unverified at publish time | Passes filter; researcher re-checks |
watch | Operator manually flagged for monitoring | Always passes filter |
New item appears in harvest
↓ (runner: _load_covered + cross_week_filter)
Story is NEW (not in covered.json) → appended to digest as kind:"new"
↓ (runner: _write_covered, status="reported")
Covered with status="reported" → dropped from next week's digest
↓ (manual edit or future automation)
Operator edits covered.json status → "developing" / "watch"
↓ (runner: _emit_followups)
Next week: story re-surfaces as kind:"follow_up" item, appended after fresh items
# Locked write in industry_news_runner._write_covered():
with locked(path):
path.write_text(json.dumps(entries, ...), encoding="utf-8")
scripts/_core/file_lock.locked(path) is the ONLY sanctioned way to write covered.json
and issues.json. Never write them directly — concurrent sessions corrupt the file.
After the digest is final, digest_artifacts.py converts it into the 5 standard pipeline
artifacts so the orchestrator can advance without running the research/plan stages:
python -m scripts.research.digest_artifacts \
--task-id {tid} \
--project {slug} \
--json
See scripts/research/digest_artifacts.py for the 5-artifact builder functions.
research.json competitor exemption: The digest's research.json emits
competitor_titles: [] intentionally — digests have no competitors — and is written via
plain Python outside the PostToolUse schema-validate hook, so it is NOT subject to
research.schema.json's minItems:3 rule; do not fabricate titles or weaken the schema.
| Failure | Behavior |
|---|---|
| Tier-A connector HTTP error | Connector recorded as "degraded" in connectors_run[]; other connectors continue |
| Tier-B researcher agent fails | tier-b.json absent → runner silently ignores --extra-items (Tier-A digest stands) |
covered.json locked (concurrent session) | _write_covered retries via file_lock.locked; if timeout → warning logged, digest proceeds |
| All Tier-A connectors degrade | Empty digest → runner exits with {"ok": true, "items": 0}; /weekly skill reports to user before continuing |
do_not_cite_domains removes all clusters | digest has 0 items → /weekly skill reports to user; do NOT publish an empty article |
Structural wiring: tests/test_weekly_skill_wiring.py
NewsItem contract: tests/test_news_item.py
Rule 8 competitor filter: tests/test_competitor_domains.py, tests/test_competitor_citation_e2e.py
scripts/research/industry_news_runner.py — full Tier-A executor + --extra-items loaderscripts/_core/news_item.py — NewsItem TypedDict + make_item() factoryscripts/_core/file_lock.py — cross-process locking (Rule 7)scripts/_core/competitor_domains.py — Rule 8 domain filter (shared with article pipeline)skills/weekly-digest/SKILL.md — the /weekly orchestration skill that calls this subskillscripts/research/digest_artifacts.py — pre-writer that converts digest → 5 pipeline artifactsWhat SKILL.md sets; muted values are Claude Code's defaults
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./batch-job-pollerSupplemental recovery tool for orphan official-OpenAI image batches (batch is only ever used on the official-OpenAI fallback path; the primary openclawroot relay has no Batch API). The canonical image flow (openai-image-generator) runs realtime and does not require this skill. Use only to diagnose stuck batches or download images from a batch that completed after the main pipeline gave up./brand-auto-tunerAnalyze winner vs loser articles to find features that distinguish them, then suggest brand-guideline.yaml updates. Use after ≥10 articles have outcome tags. Closes the data-loop: production → measurement → learning → next-cycle adjustment./brand-guideline-maker7-Block interactive interview + URL Analysis triangulation. Builds projects/{slug}/brand-guideline.yaml that gets injected into every /article draft. The single most impactful one-time investment per brand — wrong voice = wrong content forever. Triggered by /brand-guideline command, OR after /init Stage 5 when voice-discrepancy detected.Other plugins' skills for the same job