Not loaded · from platinum-seo-engine
Builds pillar/cluster topical taxonomy from DataForSEO keyword data, persisting to master.xlsx topical_map sheet. For SEO content architecture planning.
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 + §16.8 budget pre-flight. Raw JSON
drift recovery is mandatory: every DFS response is dropped into
inbox/dfs/ before any transform runs, so a transform bug never
costs us the upstream payload (which is paid; re-fetch costs credits).
This skill follows the convention authority of
skills/discovery/cannibalization/SKILL.md (Phase 7 Wave 1 — 10-step
protocol shape + DURUR + workflow_runner approve gate),
skills/discovery/content-gaps/SKILL.md (Phase 7 Wave 2 — DFS staging
skills/discovery/geo-analysis/SKILL.md
(Phase 7 Wave 2 — D-003 helper IMPORT discipline + cross-source consume).
The 10-step protocol, raw JSON inbox discipline, budget pre-flight, and
provenance event format are reused verbatim — only the domain content
(target sheet, transform script, pillar/cluster heuristic, F-09 contract)
changes. Deviate only with an ADR.| Name | Type | Default | Notes |
|---|---|---|---|
project_slug | string | — | Required. Resolves projects/{slug}/master.xlsx. |
seed_keyword | string | — | Required. Becomes pillar #1; anchors the taxonomy. |
location_code | integer | (config) | Config-first from project.config.dataforseo.location_code; no engine default. See Locale resolution. |
language_code | string | (config) | Config-first from project.config.dataforseo.language_code. See Locale resolution. |
max_pillars | integer | 5 | Upper bound on pillar rows. |
max_clusters_per_pillar | integer | 6 | Upper bound on cluster rows per pillar. |
max_supporting_per_cluster | integer | 0 | Supporting rows per pillar bucket (0 = OFF). |
default_status | string | "TODO" | statusEnum seed for new rows. |
keyword_cap | integer | 5000 | DoS guard per MCP tool. |
workspace_root is resolved via PSEO_WORKSPACE_ROOT env or explicit
test override (mirrors workflow_runner / events_writer).
location_code / language_code are resolved config-first from the
project's own project.config.dataforseo block — schema-required fields
(schemas/project-config.schema.json). There is no engine-level country
default: the engine is project-agnostic and must never assume Turkey (or
any country). Resolution order:
location_code / language_code input (operator override).project.config.dataforseo.location_code + project.config.dataforseo.language_code.language_code is the DFS short code (tr, en), set in the config at
init from language.content_locale (e.g. tr-TR→tr, en-CA→en).
market | content_locale | location_code | language_code | Note |
|---|---|---|---|---|
| TR | tr-TR | 2792 | tr | Turkey (country). |
| CA | en-CA | 20120 | en | "Ontario,Canada" — a sub-country location; a coarse country code would be wrong. |
| NG | en-NG | 2566 | en | Nigeria (country). |
These are the markets currently in the portfolio; every code above is read
straight from that project's project.config.dataforseo (the authoritative
source — not hardcoded here). For a NEW market, resolve the DFS
location_code at init via a serp_locations lookup and persist it into
project.config.dataforseo — never guess a country code in skill logic.
TR caveat. TR projects (location 2792) are subject to the same [email protected] TR-forwarding bug documented in
skills/ingestion/dfs-pull/SKILL.md; the imported_normalize_dfs_responsetolerates the response shapes, and TR-locale verification stays mandatory for TR projects (do not remove it).
projects/{slug}/master.xlsx#topical_map — pillar/cluster/supporting
rows (10 cols, schema-locked). Order: pillar row → cluster rows
(volume desc) → supporting rows (when enabled).projects/{slug}/outputs/reports/{date}-topical-map.md — human-readable summary.projects/{slug}/_state/events.jsonl — event_kind=provenance
(source.kind=dataforseo_mcp, target_excel_sheet=topical_map).projects/{slug}/inbox/dfs/{date}-keyword_ideas-topical-{slug}.json and
…-related_keywords-topical-{slug}.json — raw labs payloads (drift recovery; paid).pillar, cluster, primary_keyword, monthly_volume, data_source,
assigned_url, page_type, status, priority, note
Anchored in schemas/master-excel.schema.json#topical_map.required_columns.
The transform's TOPICAL_MAP_COLUMNS constant must equal this tuple
byte-for-byte; any drift raises RowSchemaError at row build time AND at
emit time (defensive double-check).
The schema does NOT define an enum for page_type (free string column).
The skill commits to a small documented vocabulary so cluster-map /
new-content-plan / monthly-report can branch deterministically:
page_type | When applied |
|---|---|
pillar | Top-of-funnel anchor concept. Seed keyword always wins this. |
cluster | Subtopic sharing ≥1 token with its pillar; volume ≥ min_cluster_volume. |
supporting | Long-tail, low-volume, demoted from cluster pool. Optional. |
New values require an ADR; the transform raises PageTypeError for any
value outside this set. Open Question Q-W-C2-01 documents the lack
of a formal schema enum — promotion is a Phase 9+ governance decision.
cluster_keywords.assigned_url ⊆ topical_map.assigned_urlThis cluster_keywords ⊆ topical_map join is a DEFERRED design rule
(schemas/cross-sheet-invariants.json#/deferred_design_rules → F-09,
computed_by=consistency_check, status=deferred). It is NOT enforced
today by scripts/validation/validate_invariants.py or the drift-check
skill — that cross-sheet join awaits the consistency_check tool (Phase 9+).
(Do not confuse it with the active F-09 in
schemas/cross-sheet-invariants.json#/rules, which validates a different
thing: master_task.task_id uniqueness.) topical-map populates the
superset side: every emitted row carries assigned_url="" until
cluster-map (W-C1 sibling) or manual edits fill it; this skill guarantees
only that its own row writes are F-09-compatible. Downstream cross-sheet
enforcement is pending the consistency_check tool.
topical_map.pillar ⊆ data/pillars.jsonCRITICAL. Pillar values must eventually round-trip through
data/pillars.json. In W-C2 the seed→pillar mapping is documented in
output but NOT re-keyed automatically (Phase 9 governance). Manager
confirms the seed before approving the workflow run.
url_normalizer(x) == x everywhere. No-op for this skill (writes empty
assigned_url); D-03 hardening lives in cluster-map / new-content-plan.
from scripts.ingestion.dfs_pull import _normalize_dfs_response
The function is owned by scripts/ingestion/dfs_pull.py:178 (REST
envelope tasks[0].result[0].items AND flat wrapper items tolerance).
Copying would silently fork the contract on the next DFS shape
change. Identity is locked by
tests/skills/test_topical_map.py::test_topical_map_dfs_normalize_helper_imported
(is-check). KOPYA YASAK.
Each step name must match the
steps[*].namepassed toworkflow_runner.create_run. Names are stable identifiers across runs.
preflight_budget (§16.8, MANDATORY for paid-MCP skills)Subprocess wrapper around scripts/budget/check_budget.py (W-A3/W-A4
paterni). DURUR #1 if exceeded — never silently downgrade.
from scripts.planning import topical_map_transform as tmt
envelope = tmt.preflight_budget(
project_config_path=project_root / "project.config.json",
events_path=project_root / "_state" / "events.jsonl",
)
# envelope == {"budget_per_day": 500, "used_24h": 15, "remaining": 485, "exceeded": false}
The wrapper raises BudgetExceededError when the subprocess exits
non-zero. Inherits from TopicalMapError so a single except handles
every DURUR class this skill emits.
create_runOpen a workflow run shell. The state file lives at
projects/{slug}/_state/workflows/{run_id}.json (ADR-021).
from scripts.state import workflow_runner
handle = workflow_runner.create_run(
skill="topical-map",
project_slug=project_slug,
steps=[
{"name": "preflight_budget"},
{"name": "fetch_keyword_ideas"},
{"name": "fetch_related_keywords"},
{"name": "consume_geo_staging"}, # OPTIONAL
{"name": "transform"},
{"name": "request_approval"},
{"name": "write_excel"},
{"name": "render_report"},
],
)
fetch_keyword_ideas + Step 4 — fetch_related_keywords (MCP §16.5 step 3 — raw inbox first)workflow_runner.start_step(handle.run_id, 1, project_slug=project_slug)
# location_code / language_code resolved config-first (see "Locale
# resolution") — no engine-level country default.
raw_ideas = mcp__dataforseo__dataforseo_labs_google_keyword_ideas(
keywords=[seed_keyword],
location_code=location_code, # from project.config.dataforseo
language_code=language_code, # from project.config.dataforseo
limit=keyword_cap,
)
raw_related = mcp__dataforseo__dataforseo_labs_google_related_keywords(
keyword=seed_keyword,
location_code=location_code, language_code=language_code,
depth=2, limit=keyword_cap,
)
# Persist raw → drift recovery (DFS is paid; re-fetch costs credits).
for label, payload in (("keyword_ideas", raw_ideas), ("related_keywords", raw_related)):
inbox_path = (workspace_root / "projects" / project_slug / "inbox" / "dfs"
/ f"{today.isoformat()}-{label}-topical-{project_slug}.json")
inbox_path.parent.mkdir(parents=True, exist_ok=True)
inbox_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2))
consume_geo_staging (OPTIONAL, Phase 7 W-B4 cross-ref)When _state/staging/geo_analysis_geo_signals_{date}_{slug}.json exists,
load it via topical_map_transform._load_geo_staging(path). Each row's
note column is enriched with the matching geo_gap + llm_visibility_score
signals. Missing/unreadable file → graceful skip (_load_geo_staging
returns []) — DURUR #5 fires ONLY when the caller explicitly required
geo-staging via a CLI flag and the file is broken.
from scripts.planning import topical_map_transform as tmt
geo_path = (workspace_root / "projects" / project_slug
/ "_state" / "staging"
/ f"geo_analysis_geo_signals_{today.isoformat()}_{project_slug}.json")
geo_rows = tmt._load_geo_staging(geo_path) if geo_path.exists() else []
transformPure compute via scripts/planning/topical_map_transform.py:
python3 scripts/planning/topical_map_transform.py \
--raw-keyword-ideas inbox/dfs/{date}-keyword_ideas-topical-{slug}.json \
--raw-related-keywords inbox/dfs/{date}-related_keywords-topical-{slug}.json \
--seed-keyword "{seed}" \
--geo-staging _state/staging/geo_analysis_geo_signals_{date}_{slug}.json \
--max-pillars 5 \
--max-clusters-per-pillar 6 \
--default-status TODO \
--output-dir _state/transform/{run_id}/
Produces a JSON object {"topical_map": [<row>, ...], "meta": {...}}
shaped to the 10-column master-excel schema. Idempotent: same input →
byte-identical output.
1. Gather DFS candidates from keyword_ideas + related_keywords. Dedupe
by lower-case keyword; higher-volume entries win on duplicates.
2. PILLAR selection (deterministic):
- seed_keyword is ALWAYS pillar #1 (synthetic if missing from DFS).
- Remaining pillar slots fill with candidates that:
(a) clear min_pillar_volume (default 100),
(b) share ≥1 token with the seed (sub-pillar of same overall topic),
(c) don't share their token-set with an already-selected pillar
(avoids "dental clinic" + "dental clinics" double-pillar).
3. CLUSTER bucketing:
- For each remaining candidate, compute Jaccard overlap against
every pillar; assign to the pillar with the maximum overlap > 0.
Candidates with 0 overlap to all pillars are SKIPPED (sibling
topics, not in this taxonomy).
4. Per pillar, sort assigned candidates by volume desc, take the first
max_clusters_per_pillar as cluster rows; below min_cluster_volume
→ demoted to supporting pool.
5. Emit rows: pillar block first (pillar row → cluster rows → supporting
rows), in pillar order from Step 2.
note = "seed=<seed>; geo_gap=<gap>; llm_vis=<score>; pillar_vol=<n>"
Only fields with signal land in the note string; absent signals collapse to nothing. The note column stays free-form; downstream parsers are optional.
request_approval (skill EXIT awaiting_approval)workflow_runner.request_approval(
handle.run_id, project_slug=project_slug,
approver="user",
subject=(f"{result['meta']['pillar_count']} pillar / "
f"{result['meta']['cluster_count']} cluster bulundu, "
f"master.xlsx#topical_map'e yazalım mı?"),
step_index=4,
)
# Skill exits here. The user replies in a fresh session; resume below.
approve → write_excel)Single committer.commit call — the orchestrator's idempotent commit path
(whole-block transaction.replace from the schema's data_start_row, so
re-running never duplicates rows on the topical_map snapshot sheet). Goes
through the single approved write path (backup + lock + schema validation +
post-write provenance event).
workflow_runner.approve(handle.run_id, project_slug=project_slug, approver="user")
from scripts.orchestration import committer
committer.commit(
workspace_root/"projects"/project_slug/"master.xlsx",
"topical_map",
topical_map_rows,
run_id=handle.run_id,
project_slug=project_slug,
writer="topical-map",
)
render_report + Provenance eventrender_template.py templates/reports/topical-map.template.md data.json
→ outputs/reports/{date}-topical-map.md. Variables: $project_slug,
$date, $seed_keyword, $pillar_count, $cluster_count,
$top_pillar, $top_pillar_volume, $top_cluster,
$top_cluster_volume, $geo_gaps_summary, $report_summary.
from scripts.state import events_writer
events_writer.append_provenance(
project_id=project_slug,
source={"kind": "dataforseo_mcp", "mcp_server": "dataforseo",
"mcp_tool": "dataforseo__dataforseo_labs_google_keyword_ideas",
"response_bytes": len(json.dumps(raw_ideas))},
operation="project_excel",
target_excel_sheet="topical_map",
rows_written=len(topical_map_rows),
cost={"provider": "dataforseo",
"credits": float(estimated_credits),
"budget_key": "project.config.dataforseo.budget_credits_per_day"},
)
# Repeat for related_keywords (separate provenance entry per MCP call).
completeworkflow_runner.complete(handle.run_id, project_slug=project_slug, outputs={
# F5: outputs.* must be STRING-TYPED.
"pillar_count": str(result["meta"]["pillar_count"]),
"cluster_count": str(result["meta"]["cluster_count"]),
"row_count": str(result["meta"]["row_count"]),
"report_path": str(report_path),
"raw_jsons": ";".join([str(inbox_path), str(related_inbox)]),
"credits_used": str(estimated_credits),
})
Workflow status flips running → done (workflow-run schema) and a
workflow_action=done event lands in events.jsonl (ADR-020).
Stop and flag the manager — do not patch, do not fall back.
scripts/budget/check_budget.py exits
non-zero → BudgetExceededError. DFS is paid; running over budget
is unrecoverable from this side.mcp__dataforseo__…_keyword_ideas /
…_related_keywords returns auth/network error OR a shape the
imported _normalize_dfs_response refuses
(ValueError("Unrecognized DFS response shape")). STOP — wrapper
drift is an ADR-level event.master.xlsx#topical_map column count or
names don't match the 10-column schema → RowSchemaError at row
build OR emit time.monthly_volume not int, status
not in statusEnum, default_status argument invalid.--require-geo-staging but file missing/unreadable →
GeoStagingMissingError. Default is graceful skip; this DURUR
fires only on opt-in.page_type outside
{pillar, cluster, supporting} → PageTypeError. New values
require an ADR (Q-W-C2-01).keyword_cap exceeded (default 5000) →
KeywordCapExceededError. DoS prevention.inbox/dfs/ path unwritable (workspace misconfigured / readonly)
or workflow_runner.create_run fails schema validation
(schemas/workflow-run.schema.json).location_code / language_code
cannot be resolved (no explicit input AND project.config.dataforseo
missing/unreadable). STOP before any paid MCP call; never default to a
country (engine is project-agnostic). See Locale resolution.master-excel.schema.json#topical_map (10 cols +
statusEnum), cross-sheet-invariants.json (F-09 + D-01),
events.schema.json (dataforseo_mcp / topical_map),
skill-frontmatter.schema.json (this frontmatter).workflow_runner, transaction,
events_writer, check_budget (subprocess), render_template.
From dfs_pull: _normalize_dfs_response imported (KOPYA YASAK,
identity test).scripts/planning/topical_map_transform.py (transform,
estimate_credits, preflight_budget, _load_geo_staging,
TOPICAL_MAP_COLUMNS, PAGE_TYPE_*).tests/skills/test_topical_map.py (15 cases incl. import-
identity + 10-col tuple lock).cluster-map (W-C1 sibling) consumes
master.xlsx#topical_map as the F-09 superset before writing
master.xlsx#cluster_keywords. The cluster_keywords ⊆ topical_map
join is a DEFERRED design rule (computed_by=consistency_check, Phase 9+)
— NOT yet enforced by drift-check /
scripts/validation/validate_invariants.py.skill-frontmatter.schema.json Draft 7; budget block obeys
additionalProperties:false (Q-W-A4-01).project_slug flows through
every path; transform has 0 hardcoded slug words.Use when/Also use when/Do not use when are STRING
content inside description, not separate fields.transaction, workflow_runner,
events_writer imported, not modified. _normalize_dfs_response
imported from dfs_pull (KOPYA YASAK enforced by identity test).keyword_cap default 5000.master.xlsx (lowercase, schema-shaped).outputs.* STRING-TYPED.assigned_url=""
until cluster-map (Phase 8 W-C1) or manual edits fill it.events.jsonl only grows.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
seo, topical-map, pillar-cluster, keyword-taxonomy, content-planning
npx claudepluginhub popiliadam/platinum-seo-engine --plugin platinum-seo-engine50 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-decayUse when: kullanıcı "içerik decay", "content decay", "tıklama düşen sayfalar",
"ctr düştü", "90 gün öncesine göre azalma", "trafik kaybeden sayfalar",
"decay analizi", "content_decay sheet yenile" der ya da /pseo-content-decay
çağırır.
Also use when: aktif projenin GSC verisi master.xlsx'te mevcut (gsc-pull
önce çalışmış); 90-günlük recent + previous pencere karşılaştırması
yapılacak; pillar bazlı içerik decay haritası lazım; downstream
content-improve / new-content-plan skill'leri bu listeyi tüketecek.
Do not use when: quick-win opportunity scoring (quick-wins skill), GSC
delta ingestion (gsc-pull skill), tek-URL audit (tech-audit skill),
cannibalization analizi — ayrı discovery skill'leri. Master.xlsx
yokken çağırma; init-project + gsc-pull önce çalışmalı (DURUR #6).
Other plugins' skills for the same job