Not loaded · from platinum-seo-engine
Identifies content decay by comparing 90-day GSC click/CTR windows. Produces a pillar-based decay map for downstream content-improve or new-content-plan skills.
Claude Code won't load this skill
It ships in platinum-seo-engine at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
10-step protocol. Steps map 1:1 to workflow_runner invocations + the
spec §16.5 8-step MCP discipline. Raw JSON drift recovery is mandatory:
every MCP response is dropped into inbox/gsc/ (or inbox/dfs/ for
the optional historical-rank cross-check) before any transform runs,
so a transform bug never costs us the upstream payload.
This skill follows the convention authority established by
skills/discovery/quick-wins/SKILL.md + the Phase 6 GSC ingestion
paterni skills/ingestion/gsc-pull/SKILL.md. The 10-step protocol shape,
raw JSON inbox discipline, URL normalization (D-03), DURUR + flag rule,
and provenance event format are reused verbatim — only the domain content
(window semantics, transform script, target sheet, optional DFS branch)
changes. Deviate only with an ADR.
| Name | Type | Default | Notes |
|---|---|---|---|
project_slug | string | — | Required. Resolves projects/{slug}/master.xlsx. |
days_back | integer | 90 | Recent window end=today, start=today-N. Previous window same length. |
dimensions | array | ['page'] | GSC dimensions for enhanced_search_analytics calls. |
workspace_root is resolved via PSEO_WORKSPACE_ROOT env or explicit
test override (mirrors workflow_runner / events_writer).
projects/{slug}/master.xlsx#content_decay — per-page recent vs
previous window decay rows (8 cols, schema-locked).projects/{slug}/outputs/reports/{date}-content-decay.md — human-
readable summary (top decayed pages, trend distribution, pillars).projects/{slug}/_state/events.jsonl — event_kind=provenance
entries (source.kind=gsc_mcp; one per MCP call, plus optionally one
dataforseo_mcp entry when the optional rank cross-check fires).projects/{slug}/inbox/gsc/{date}-enhanced_search_analytics-decay-recent-{slug}.json
— raw MCP payload for the recent 90-day window (drift recovery).projects/{slug}/inbox/gsc/{date}-enhanced_search_analytics-decay-previous-{slug}.json
— raw MCP payload for the previous 90-day window.projects/{slug}/inbox/dfs/{date}-historical_rank_overview-decay-{slug}.json
— raw DFS historical rank cross-check payload (only when the
optional branch is invoked AND its budget pre-flight passes).Each step name must match the
steps[*].namepassed toworkflow_runner.create_run. Names are stable identifiers across runs.
create_runOpen a workflow run shell. The state file lives at
projects/{slug}/_state/workflows/{run_id}.json (ADR-021, ADR-019).
from scripts.state import workflow_runner
handle = workflow_runner.create_run(
skill="content-decay",
project_slug=project_slug,
steps=[
{"name": "fetch_recent"},
{"name": "fetch_previous"},
{"name": "transform"},
{"name": "request_approval"},
{"name": "write_excel"},
{"name": "render_report"},
],
)
fetch_recent (MCP §16.5 step 3 — raw inbox first)Recent window: gsc_window.recent_window(today, days_back) — the latest complete days, ending today-3 (D-04).
workflow_runner.start_step(handle.run_id, 0,
project_slug=project_slug)
raw_recent = mcp__gsc__enhanced_search_analytics(
siteUrl=project_config["gsc"]["site_url"],
**gsc_window.recent_window(today, days_back).as_params(), # D-04: ends today-3, no overlap
rowLimit=gsc_window.GSC_ROW_LIMIT, # D-01: tool default is 1,000; check gsc_window.truncation(raw)
dimensions=dimensions, # default: ["page"]
)
inbox_recent = (
workspace_root / "projects" / project_slug
/ "inbox" / "gsc"
/ f"{today.isoformat()}-enhanced_search_analytics-decay-recent-{project_slug}.json"
)
inbox_recent.parent.mkdir(parents=True, exist_ok=True)
inbox_recent.write_text(json.dumps(raw_recent, ensure_ascii=False, indent=2))
workflow_runner.finish_step(handle.run_id, 0,
project_slug=project_slug,
output_ref=str(inbox_recent))
fetch_previous (previous window for delta — MUST succeed)mcp__gsc__enhanced_search_analytics covering the PREVIOUS window of
equal length — gsc_window.comparison_windows(today, days_back)[1]: it ends the
day before the recent window starts (D-04: no shared boundary day), with
rowLimit=gsc_window.GSC_ROW_LIMIT (D-01). Persist to
inbox/gsc/{date}-enhanced_search_analytics-decay-previous-{slug}.json.
Both windows are required. Unlike gsc-pull (where previous-window failure is non-fatal first-run), decay analysis has no signal without the comparison baseline. Failure here triggers DURUR #1 (do NOT proceed with one-window data).
transformPure compute via scripts/discovery/content_decay_transform.py:
python3 scripts/discovery/content_decay_transform.py \
--recent inbox/gsc/{date}-enhanced_search_analytics-decay-recent-{slug}.json \
--previous inbox/gsc/{date}-enhanced_search_analytics-decay-previous-{slug}.json \
--output-dir _state/transform/{run_id}/
Produces a JSON array (content_decay) shaped to the master-excel
schema. URL normalization (D-03) is applied here, not at fetch time, so
the raw inbox copy is byte-faithful to the MCP response. The transform
is idempotent: same inputs → byte-identical output. Sort: clicks_delta
ascending (most decayed first), then url asc for tie-break determinism.
optional_dfs_cross_check (only when invoked)When the optional mcp__dataforseo__dataforseo_labs_google_historical_rank_overview
branch is active, first run the budget pre-flight via
scripts/budget/check_budget.py against the project's 24h DFS credit
total.
inbox/dfs/{date}-historical_rank_overview-decay-{slug}.json,
enrich action with a short note (e.g. "rank also dropped in DFS")
for rows where the DFS series confirms the decay direction.StopAndAwaitApproval). Do
NOT silently fall back to GSC-only. The skill exits with
awaiting_approval; the manager must explicitly authorize either
raising the budget cap or skipping the cross-check (recorded as an
ADR), then resume.from scripts.budget import check_budget
budget_envelope = check_budget.preflight(
project_config_path=project_root / "project.config.json",
events_path=project_root / "_state" / "events.jsonl",
estimated_credits=1, # one DFS historical_rank_overview call
)
if budget_envelope["exceeded"]:
workflow_runner.request_approval(
handle.run_id, project_slug=project_slug,
approver="user",
subject="DFS historical_rank cross-check budget aşıldı; cap yükseltilsin mi?",
step_index=3,
)
raise check_budget.BudgetGateError("DFS budget pre-flight failed; awaiting_approval")
request_approval (skill EXIT awaiting_approval)workflow_runner.request_approval(
handle.run_id, project_slug=project_slug,
approver="user",
subject=f"Content decay {len(rows)} URL hesaplandı, master.xlsx#content_decay'e yazalım mı?",
step_index=3,
)
# Skill exits here. The user replies in a fresh session; resume below.
approve → continue)workflow_runner.approve(handle.run_id, project_slug=project_slug,
approver="user")
write_excel (atomic, schema-validated)Single idempotent committer.commit call for the content_decay sheet
(replace — re-running refreshes the snapshot, never duplicates rows; routes
through transaction.py: backup + lock + schema validation + provenance).
Note: the transform module itself does NOT import the committer
(scripts.orchestration.committer) — only the skill orchestrator layer does
(cross-module IMPORT discipline).
from scripts.orchestration import committer
committer.commit(
workbook_path=workspace_root/"projects"/project_slug/"master.xlsx",
sheet="content_decay",
rows=content_decay_rows,
run_id=handle.run_id,
project_slug=project_slug,
writer="content-decay",
)
render_reportrender_template.py templates/reports/content-decay.template.md data.json
→ outputs/reports/{date}-content-decay.md. Variables (all 13 the template
references — render hard-fails on any missing): $project_slug, $date,
$days_back, $run_id, $total_urls, $rows_written, $decay_count,
$retired_count, $top_decay_url, $top_decay_delta, $trend_distribution,
$pillar_summary, $report_summary.
One provenance entry per MCP call (two for GSC, plus one DFS when the optional branch fires).
from scripts.state import events_writer
events_writer.append_provenance(
project_id=project_slug,
source={"kind": "gsc_mcp", "mcp_server": "gsc",
"mcp_tool": "gsc__enhanced_search_analytics",
"response_bytes": len(json.dumps(raw_recent))},
operation="project_excel",
target_excel_sheet="content_decay",
rows_written=len(content_decay_rows),
)
# Repeat for raw_previous (also gsc_mcp). When DFS branch ran:
# source.kind=dataforseo_mcp + cost.credits=1 + budget_key.
completeworkflow_runner.complete(handle.run_id, project_slug=project_slug, outputs={
# F5: outputs.* must be STRING-TYPED.
"content_decay_rows": str(len(content_decay_rows)),
"decay_count": str(meta["trend_counts"]["DECAY"]),
"retired_count": str(meta["trend_counts"]["RETIRED"]),
"report_path": str(report_path),
"raw_recent": str(inbox_recent),
"raw_previous": str(inbox_previous),
})
Every URL passing through this skill is normalized via
scripts.discovery.content_decay_transform.normalize_url. The function
is idempotent: normalize_url(normalize_url(u)) == normalize_url(u).
Rules: lowercase scheme+host, IDN→punycode, strip default ports, strip
trailing slash (root excluded), drop fragment, drop tracking params,
sort remaining query keys.
The transform self-checks idempotency on every emitted URL — a drift between transform and downstream consumers is escalated as DURUR #3 rather than silently masked.
recent window: [today - days_back, today] (default 90d)
previous window: [today - 2*days_back, today - days_back]
Both windows must have equal length. The transform aggregates clicks +
impressions + impression-weighted position per normalized URL across each
window, then labels the trend per R-85 (single source —
rules/content-update-discipline.md). The clicks delta_pct is still the
emitted column; position/impressions feed the DECISION only (the 8-column
schema is unchanged).
clicks_delta = clicks_recent - clicks_previous
delta_pct = (clicks_recent - clicks_previous) / clicks_previous * 100,
rounded 2dp; clamped to ±100 when previous=0
(mirrors gsc-pull's _delta_pct, Phase 6 paterni)
trend (R-85 multi-signal — see rules/content-update-discipline.md §R-85):
NEW if previous clicks=0 and recent>0
RETIRED if recent clicks=0 and previous>0
GROWTH if clicks delta_pct ≥ +20
DECAY if (clicks Δ% < clicks_threshold AND position worsened > position_threshold)
OR (impressions Δ% < -40% AND ranking trend negative)
STABLE otherwise ← a clicks-only drop with NO position/impression
corroboration is STABLE, not DECAY (single-signal
volatility ≠ decay — R-85 rationale)
profile-aware thresholds (clicks/position branch; impressions branch fixed):
YMYL : clicks_threshold -20%, position_threshold +3 (stricter)
e-commerce : -30% / +5
other/default: -30% / +5
(resolved via scripts/util/profile_aware_defaults.cascade_default — a
project.config tuning key or an explicit override wins over the profile
default; meta records the resolved thresholds + which R-85 branch fired.)
pillar = first non-empty path segment (e.g. /blog/x → "blog")
action = trend → deterministic prescription
DECAY → "investigate + refresh"
STABLE → "monitor"
GROWTH → "double-down"
NEW → "new content tracking"
RETIRED → "redirect or revive review"
YoY mode (--yoy): compares the recent window against the same window
one year earlier (the --previous payload is that year-ago window). When
the year-ago data is present it is used as the decay baseline; when it is
absent the transform refuses to fabricate verdicts — it emits a
meta.yoy_unavailable=true note and zero rows (never fakes a YoY baseline).
Stop and flag the manager — do not patch, do not fall back.
mcp__gsc__enhanced_search_analytics call (recent OR
previous) returns auth/network/scope error. Decay analysis has no
signal without both windows; STOP — do not proceed with one-window
data.content_decay_transform.transform).master.xlsx#content_decay column count or names don't match
schema (schemas/master-excel.schema.json#content_decay,
8 required_columns).committer.commit raises RowSchemaError for content_decay.workflow_runner.create_run fails schema validation.historical_rank_overview invoked AND budget pre-
flight FAILS → STOP, transition to awaiting_approval. Manager
bilgilendirilir; do NOT silently fall back to GSC-only (false-success
failure mode the brief explicitly forbids).ContentDecayError: no data in window). Decay-specific: there is no signal to project.PSEO_WORKSPACE_ROOT env unset → also a STOP (inherited from
workflow_runner / events_writer discipline; folded into DURUR #2's
"workspace path missing" surface).
schemas/master-excel.schema.json (content_decay sheet,
8 required_columns at lines 173-180), schemas/events.schema.json
(source.kind=gsc_mcp / dataforseo_mcp,
target_excel_sheet=content_decay),
schemas/cross-sheet-invariants.json (D-03 invariant),
schemas/skill-frontmatter.schema.json (this frontmatter).scripts/state/workflow_runner.py,
scripts/excel/transaction.py, scripts/state/events_writer.py,
scripts/reporting/render_template.py,
scripts/budget/check_budget.py (optional DFS branch only —
not for the GSC-only path).scripts/discovery/content_decay_transform.py
(normalize_url, infer_pillar, transform,
CONTENT_DECAY_COLUMNS, ContentDecayError).tests/skills/test_content_decay.py (≥6 cases incl. trend
coverage, ±100 clamp, sort, schema column match, smoke E2E).templates/reports/content-decay.template.md.awaiting_approval,
not a silent GSC-only fallback.schemas/skill-frontmatter.schema.json Draft 7.project_slug flows through.
0-tolerance ADR-008 + D-010 Path B.Use when/Also use when/Do not use when are STRING
content inside description, not separate fields.transaction /
workflow_runner / events_writer / check_budget are imported,
never modified from this skill. The transform module itself does
NOT import scripts.excel.transaction (skill-orchestrator-only).master.xlsx (lowercase, schema-shaped).outputs.* values are STRING-TYPED (artifact paths or
stringified counts), never raw ints.events_writer.append_provenance,
one per MCP call; workflow run JSON only forward-flips step status.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
50 skills in this plugin
/aio-competitor-mapUse when: kullanıcı "AIO analiz", "competitor SERP analizi", "top10
AIO map", "AI overview rakip", "rakip içerik AIO citation", "SERP
pattern map" der ya da /pseo-aio-competitor-map çağırır; SERP top-N
fetch (DataForSEO heavy) + Scrapling tier-1 fetch (per URL) +
R-109/R-110/R-111 competitor content-quality signal detect (schema markup
+ entity reference + author authority) + serp_aio AIO presence
(references[]) + competitor_pages.jsonl staging.
Also use when: yeni keyword için pre-content-plan AIO landscape
haritalanacak; mevcut pillar için competitor refresh yapılacak;
brand'ın AIO-friendly olup olmadığını competitor content-quality + AIO
presence (serp_aio references[]) ile test edilecek; cluster-map sonrası
seçilen ana keyword için competitor R-109..R-111 sinyalleri ölçülecek.
Do not use when: SERP rank tracking için (gsc skill); manuel tek URL
analiz için (on-page-audit kullan); content gap için (content-gaps
kullan); kendi sitemizin AIO-friendliness denetimi için (schema-audit
+ on-page-audit kombinasyonu); target_keyword empty ya da whitespace
(DURUR #5); budget_credits_per_day aşılmış (DURUR #1 — skip skill,
AMBER); SERP empty top_n=0 (DURUR #2 REJECT).
/brand-onboardingUse when: kullanıcı "yeni proje", "brand onboarding", "proje bootstrap",
"wizard çalıştır", "yeni site ekle", "project-config oluştur" der ya da
/pseo-brand-onboarding çağırır; brand_identity 20 + content_settings 14
+ profile enum 5-value Süleyman input'u alarak project-config.schema 1.5
conformant staging output üretir.
Also use when: workspace henüz yok (Phase 14 öncesi staging-only mode);
domain DNS doğrulanması gerekiyor; profile heuristic suggest fallback
istendi; init-project çalıştırılmadan önce config wizardı isteniyor.
Do not use when: mevcut proje config update için (separate edit-config
skill — gelecek phase); workspace var ve direkt project.config.json
yazılacak (Phase 14+ behavior; init-project devreye giriyor); başka
projenin config'i kopyalanacak (template-clone — gelecek phase).
/cannibalizationUse when: kullanıcı "cannibalization", "kannibalizasyon", "keyword
conflict", "aynı keyword'e iki sayfa", "URL çakışması", "anahtar kelime
çakışması", "iki sayfam aynı sorguya çıkıyor", "intent split" der ya
da /pseo-cannibalization çağırır.
Also use when: aktif projenin GSC verisi mevcut; aynı sorguda ≥2 URL
ranking ediyor; quick-win / content-decay ile birlikte triage; F-08
invariant kontrolünden sonra cannibalization sheet doldurulacak.
Do not use when: tek sayfanın decay analizi (content-decay), pozisyon
11-20 fırsat taraması (quick-wins), tech audit (tech-audit), yeni
içerik planı (new-content-plan) — ayrı discovery skill'leri. Master.xlsx
yokken çağırma; init-project önce çalışmalı (DURUR #6).
/cluster-mapUse when: kullanıcı "cluster map", "keyword cluster", "cluster keywords",
"cluster-keyword haritası", "anahtar kelime kümeleme", "intent cluster",
"cluster planı", "keyword'leri cluster'lara dağıt" der ya da
/pseo-cluster-map çağırır. DataForSEO keyword_suggestions +
related_keywords + GSC enhanced_search_analytics raw JSON'larını
inbox/dfs|gsc/ altına persist eder ve master.xlsx#cluster_keywords
sheet'ini doldurur (workflow_runner approve gate üzerinden, transaction
atomic write).
Also use when: aktif projenin topical_map sheet'i mevcut (D-02
invariant — cluster ⊆ topical_map.cluster); content-gaps Phase 7
staging mevcut (seed keyword sinyali); budget pre-flight PASS;
cluster→keyword projection gerekiyor; new-content-plan / topical-map
aşağı akıma keyword inventory besleniyor.
Do not use when: keyword discovery henüz yapılmadı (content-gaps önce
çalışmalı); sadece pillar/cluster taksonomisi tanımlanacak (topical-map
ile dene); tek sayfa decay analizi (content-decay), pozisyon 11-20
fırsat taraması (quick-wins), URL çakışması (cannibalization)
gerekiyor — ayrı discovery skill'leri. Master.xlsx yokken çağırma;
init-project önce çalışmalı (DURUR #4). Topical_map sheet boşken
çağırma; D-02 invariant violation çıkar (DURUR #7). Budget aşılmışsa
fallback YASAK (DURUR #1).
/competitive-analysisUse when: kullanıcı "rakip analizi", "competitive analysis", "competitor
monitoring", "rakip site snapshot", "rakip içerik takibi", "competitor
diff", "rakip keyword'leri", "weekly competitor" der ya da
/pseo-competitive-analysis çağırır.
Also use when: hedef alan adı için DFS competitors_domain ile rakip
listesi çekilecek; rakip URL'leri Scrapling tier-escalation §14.5 ile
fetch edilecek; ADR-025 Phase 7+ S1_competitor_snapshot sub-schema
enforcement gerekiyor; weekly cadence (S1 senaryosu) cron tetikliyor;
sf-import / gsc-pull veri çekiminden bağımsız rakip izleme talep edildi.
Do not use when: kendi sitemizin on-page kontrolü (on-page-audit), kendi
GSC verisi (gsc-pull), keyword volume/ideas (dfs-pull / cluster-map),
cannibalization (cannibalization), tech audit (tech-audit) — ayrı
skill'ler. Master.xlsx yokken çağırma; init-project önce çalışmalı.
Budget pre-flight FAIL ise fallback YASAK (DURUR #2). >50% URL all-tiers
fail ise batch unhealthy → DURUR #4. Tier_escalation override §14.5
canonical sequence dışındaysa STOP (DURUR #7).
/content-gapsUse when: kullanıcı "content gap", "içerik açığı", "rakip keyword bulalım",
"yeni keyword fırsatı", "konu açığı analizi", "competitor keyword discovery",
"yeni içerik için keyword araştırması", "ilgili keyword'leri çıkar" der ya
da /pseo-content-gaps çağırır. DataForSEO keyword_ideas + related_keywords
(+ optional content_analysis_search) raw JSON'larını inbox/dfs/ altına
persist eder ve `_state/staging/` altına shape-adapted staging table yazar
(Phase 8 cluster-map / new-content-plan konsume eder).
Also use when: aktif projenin seed keyword listesi config'te tanımlı; TR
(location_code=2792, language_code='tr') varsayılan; budget pre-flight
PASS; yeni içerik planı (new-content-plan) için aday havuzu gerekiyor;
cluster-map için keyword inventory besleniyor.
Do not use when: GSC veri ingestion (gsc-pull), DFS volume lookup
(dfs-pull), tek sayfa decay analizi (content-decay), pozisyon 11-20
fırsat taraması (quick-wins), URL çakışması (cannibalization) gerekiyor —
ayrı discovery / ingestion skill'leri. Master.xlsx yokken çağırma; init-
project önce çalışmalı (DURUR #4). Budget aşılmışsa fallback YASAK
(DURUR #2).
npx claudepluginhub popiliadam/platinum-seo-engine --plugin platinum-seo-engineOther plugins' skills for the same job