Content Gapsのロゴ

Content Gaps

コミュニティ
popiliadam
content-gaps

Use 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).

概要

公開者popiliadam
リポジトリplatinum-seo-engine
スキル名content-gaps
スター
26
フォーク
3
同梱ファイル
指示のみ
ライセンスAGPL-3.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    popiliadamがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Content Gaps」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/popiliadam/platinum-seo-engine/tree/main/skills/discovery/content-gaps
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/popiliadam/platinum-seo-engine.git /tmp/platinum-seo-engine
mkdir -p .claude/skills
cp -r /tmp/platinum-seo-engine/skills/discovery/content-gaps .claude/skills/content-gaps
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでContent Gapsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にContent Gapsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Content Gapsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

content-gaps — discovery skill (Phase 7 Wave 2, paid-MCP DFS HEAVY)

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/ingestion/dfs-pull/SKILL.md (Phase 6 — staging-only D-003 pattern + REST/flat shape tolerance via _normalize_dfs_response) and skills/discovery/cannibalization/SKILL.md (Wave 1 structural shape). The 10-step protocol, raw JSON inbox discipline, budget pre-flight, and provenance event format are reused verbatim — only the domain content (target sources, transform script, gap_score heuristic) changes. Deviate only with an ADR.

Inputs (frontmatter contract)

NameTypeDefaultNotes
project_slugstring—Required. Resolves projects/{slug}/master.xlsx.
seed_keywordstring—Required. Drives DFS fetches; embedded in every staging row (cluster-map join key).
location_codeinteger2792DFS Turkey.
language_codestring"tr"DFS Turkish.
keyword_capinteger5000DoS guard per MCP tool.
use_content_analysis_searchbooleanfalseOptional third source.

workspace_root is resolved via PSEO_WORKSPACE_ROOT env or explicit test override (mirrors workflow_runner / events_writer).

Outputs (artifacts produced)

  • projects/{slug}/_state/staging/content_gaps_keyword_ideas_{date}_{slug}.json — keyword_ideas candidate staging table (schema-versioned, sha256 content_hash per row, ISO 8601 microsecond fetched_at). Columns from content_gaps_transform.CONTENT_GAPS_COLUMNS.
  • projects/{slug}/_state/staging/content_gaps_related_keywords_{date}_{slug}.json — related_keywords candidate staging table.
  • projects/{slug}/_state/staging/content_gaps_content_analysis_search_{date}_{slug}.json — optional content_analysis_search staging table (only when input use_content_analysis_search=true).
  • projects/{slug}/outputs/reports/{date}-content-gaps.md — human-readable summary (top gap_score keywords, source breakdown).
  • projects/{slug}/_state/events.jsonl — event_kind=provenance entries (source.kind=dataforseo_mcp, target_excel_sheet=null — staging-only).
  • projects/{slug}/inbox/dfs/{date}-keyword_ideas-gaps-{slug}.json — raw labs payload (drift recovery).
  • projects/{slug}/inbox/dfs/{date}-related_keywords-gaps-{slug}.json — raw labs payload.

Note: content-gaps does NOT write to master.xlsx. Phase 8 cluster-map and new-content-plan skills consume the staging tables and project to master.xlsx#cluster_keywords / new_content_plan downstream (F-09 shared writer disiplini orada uygulanır).

D-003 staging-only routing (paterni: dfs-pull)

The Phase 6 D-003 lesson is enforced verbatim here:

  • Discovery skills that produce candidate inventory route to _state/staging/ only. No transaction.append. No master.xlsx write.
  • Phase 8 planning skills (cluster-map, new-content-plan) consume staging tables and project the chosen subset into Excel — they own the F-09 shared-writer discipline for sheets with multiple writers.
  • Re-running content-gaps does NOT touch master.xlsx; only the staging JSON is overwritten (idempotent: same input → byte-stable file).

Shape adapter (_normalize_dfs_response): runtime tolerates two DFS response shapes — REST envelope tasks[0].result[0].items AND wrapper- flattened items — by importing the function from scripts.ingestion.dfs_pull (not copying). Any future shape fix in dfs-pull is inherited automatically; KOPYA YASAK is enforced by the import-discipline test.

10-Step Body Protocol

Each step name must match the steps[*].name passed to workflow_runner.create_run. Names are stable identifiers across runs.

Step 1 — preflight_budget (§16.8, MANDATORY for paid-MCP skills)

Subprocess wrapper around scripts/budget/check_budget.py (W-A3/W-A4 paterni). DURUR #2 if exceeded — never silently downgrade.

python
from scripts.discovery import content_gaps_transform as cgt

envelope = cgt.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 underlying script exits non-zero. The error inherits from ContentGapsError so a single except handles every DURUR class this skill emits.

Step 2 — create_run

Open a workflow run shell. The state file lives at projects/{slug}/_state/workflows/{run_id}.json (ADR-021).

python
from scripts.state import workflow_runner
handle = workflow_runner.create_run(
    skill="content-gaps",
    project_slug=project_slug,
    steps=[
        {"name": "preflight_budget"},
        {"name": "fetch_keyword_ideas"},
        {"name": "fetch_related_keywords"},
        {"name": "fetch_content_analysis_search"},  # optional
        {"name": "transform"},
        {"name": "request_approval"},
        {"name": "write_staging"},
        {"name": "render_report"},
    ],
)

Step 3 — fetch_keyword_ideas (MCP §16.5 step 3 — raw inbox first)

python
workflow_runner.start_step(handle.run_id, 1, project_slug=project_slug)
raw_ideas = mcp__dataforseo__dataforseo_labs_google_keyword_ideas(
    keywords=[seed_keyword],
    location_code=location_code,    # 2792 = Turkey
    language_code=language_code,    # "tr"
    limit=keyword_cap,
)
inbox_path = (
    workspace_root / "projects" / project_slug
    / "inbox" / "dfs"
    / f"{today.isoformat()}-keyword_ideas-gaps-{project_slug}.json"
)
inbox_path.parent.mkdir(parents=True, exist_ok=True)
inbox_path.write_text(json.dumps(raw_ideas, ensure_ascii=False, indent=2))
workflow_runner.finish_step(handle.run_id, 1, project_slug=project_slug,
                            output_ref=str(inbox_path))

Step 4 — fetch_related_keywords

python
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,
)
related_inbox = (
    workspace_root / "projects" / project_slug
    / "inbox" / "dfs"
    / f"{today.isoformat()}-related_keywords-gaps-{project_slug}.json"
)
related_inbox.write_text(json.dumps(raw_related, ensure_ascii=False, indent=2))

Step 5 — fetch_content_analysis_search (OPTIONAL)

Only when the caller passes use_content_analysis_search=true.

python
raw_cas = None
if use_content_analysis_search:
    raw_cas = mcp__dataforseo__content_analysis_search(
        keyword=seed_keyword,
        location_code=location_code,
        language_code=language_code,
    )
    cas_inbox = (
        workspace_root / "projects" / project_slug / "inbox" / "dfs"
        / f"{today.isoformat()}-content_analysis_search-gaps-{project_slug}.json"
    )
    cas_inbox.write_text(json.dumps(raw_cas, ensure_ascii=False, indent=2))

Step 6 — transform

Pure compute via scripts/discovery/content_gaps_transform.py (staging-only output). The transform calls the imported _normalize_dfs_response() first to flatten REST or wrapper shapes uniformly, then builds one staging payload per source:

bash
python3 scripts/discovery/content_gaps_transform.py \
    --raw-keyword-ideas    inbox/dfs/{date}-keyword_ideas-gaps-{slug}.json \
    --raw-related-keywords inbox/dfs/{date}-related_keywords-gaps-{slug}.json \
    --seed-keyword         "{seed}" \
    --keyword-cap          5000 \
    --staging-dir          _state/staging/ \
    --project-slug         {slug}

Produces 2-3 staging JSON files (content_gaps_keyword_ideas_*.json, content_gaps_related_keywords_*.json, optionally content_gaps_content_analysis_search_*.json) — each with schema_version, tool, seed_keyword, fetched_at (ISO 8601 µs UTC), row_count, columns, rows[] (1-indexed id + sha256 content_hash).

Gap score formula (transform domain)

gap_score = (search_volume / (1 + keyword_difficulty)) * (1 - competition_norm)

competition_norm:
    numeric  → clipped to [0, 1] (DFS competition_index sometimes 0..100;
                                  collapsed by /100)
    LOW      → 0.20
    MEDIUM   → 0.55
    HIGH     → 0.90
    unknown  → 0.50  (mid-band default)

Coarse but deterministic. Higher volume → higher score; higher difficulty / higher competition → lower score. Pluggable: callers may substitute a custom scorer; the staging column stays gap_score regardless. Result is rounded to 4 decimals for staging idempotency.

Rows are sorted by gap_score desc, ties broken by keyword asc.

Step 7 — request_approval (skill EXIT awaiting_approval)

python
workflow_runner.request_approval(
    handle.run_id, project_slug=project_slug,
    approver="user",
    subject=f"{seed_keyword} için {total_candidates} aday keyword bulundu, _state/staging/'e yazalım mı?",
    step_index=5,
)
# Skill exits here. The user replies in a fresh session; resume below.

Step 8 — write_staging (atomic, schema-validated)

content_gaps_transform.write_staging() writes one self-contained staging JSON per source (overwrite-idempotent) under projects/{slug}/_state/staging/. Schema validated by _validate_staging_payload() before write — StagingSchemaError (IDENTITY-shared with dfs-pull) on drift. NO transaction.append here; staging-only.

python
from scripts.discovery import content_gaps_transform as cgt
written = cgt.write_staging(
    result,
    staging_dir=workspace_root / "projects" / project_slug / "_state" / "staging",
    project_slug=project_slug,
    date=today.isoformat(),
)
# written == {"keyword_ideas": "...", "related_keywords": "...", ["content_analysis_search": "..."]}

Step 9 — Provenance event + report

python
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="ingest",
    target_table="content_gaps_keyword_ideas",
    target_excel_sheet=None,    # staging-only; Phase 8 cluster-map projects to Excel
    rows_written=0,             # staging-only: no Excel rows yet
    cost={"provider": "dataforseo",
          "credits": float(estimated_credits),
          "budget_key": "project.config.dataforseo.budget_credits_per_day"},
)
# Repeat for related_keywords (and content_analysis_search when used).

render_template.py templates/reports/content-gaps.template.md data.json → outputs/reports/{date}-content-gaps.md. Variables: $project_slug, $date, $seed_keyword, $location_code, $language_code, $total_candidates, $top_keyword, $top_gap_score, $source_breakdown, $top1_* … $top3_*, $estimated_credits, $budget_preflight_status, $staging_path_ideas, $staging_path_related, $run_id.

Step 10 — complete

python
workflow_runner.complete(handle.run_id, project_slug=project_slug, outputs={
    # F5: outputs.* must be STRING-TYPED.
    "ideas_staging_rows":   str(result["keyword_ideas"]["row_count"]),
    "related_staging_rows": str(result["related_keywords"]["row_count"]),
    "staging_files":        ";".join(written.values()),
    "seed_keyword":         seed_keyword,
    "credits_used":         str(estimated_credits),
    "report_path":          str(report_path),
    "raw_jsons":            ";".join([str(inbox_path), str(related_inbox)]),
})

DURUR conditions (9)

Stop and flag the manager — do not patch, do not fall back.

  1. mcp__dataforseo__dataforseo_labs_google_keyword_ideas OR …_related_keywords returns auth/network/scope error.
  2. scripts/budget/check_budget.py exits non-zero → subprocess wrapper raises BudgetExceededError. STOP, await manager approval to lift the cap (W-A3/W-A4 paterni).
  3. REST/flat shape both fail — imported _normalize_dfs_response raises ValueError("Unrecognized DFS response shape"). STOP, the wrapper version drift is an ADR-level event.
  4. _state/staging/ path cannot be created under projects/{slug}/ (workspace path missing or read-only).
  5. Keyword count from MCP > keyword_cap (default 5000) → KeywordCapExceededError. DoS prevention; never project a runaway payload.
  6. inbox/dfs/ path cannot be created (workspace path missing or non-writable).
  7. PSEO_WORKSPACE_ROOT env var unset and no explicit workspace_root arg passed to workflow_runner / events_writer. STOP, surface to manager.
  8. workflow_runner.create_run fails schema validation (schemas/workflow-run.schema.json).
  9. Both required MCPs return 0 candidate rows for the seed → NoCandidatesError. The skill refuses to silently emit empty staging — surfaces "no content gaps found for seed=…" so the manager can pick a different seed.

(Defensive #5 mirror: StagingSchemaError from imported dfs-pull re-validation also DURURs the run if a row drifts before disk write.)

Cross-references

  • Schemas: schemas/dataforseo-endpoint-mapping.schema.json (DFS contract; cost.credits_per_call), schemas/events.schema.json (source.kind=dataforseo_mcp, target_excel_sheet=null for staging-only ops), schemas/skill-frontmatter.schema.json (this frontmatter; budget.additionalProperties:false enforced).
  • Cross-modules (IMPORT-only): scripts/state/workflow_runner.py, scripts/state/events_writer.py, scripts/budget/check_budget.py (subprocess wrapper). From scripts/ingestion/dfs_pull.py: _normalize_dfs_response AND StagingSchemaError are imported — KOPYA YASAK; identity preserved by the import-discipline test. Note: scripts/excel/transaction.py is NOT imported (staging-only).
  • Transform: scripts/discovery/content_gaps_transform.py (gap_score, transform, write_staging, staging_filename, _staging_table_dict, _validate_staging_payload, CONTENT_GAPS_COLUMNS, preflight_budget).
  • Tests: tests/skills/test_content_gaps.py (≥6 cases incl. import- discipline identity check).
  • Template: templates/reports/content-gaps.template.md.
  • Phase 8 cluster-map skill consumes _state/staging/content_gaps_*.json and applies F-09 shared-writer discipline when projecting to master.xlsx#cluster_keywords / new_content_plan alongside dfs-pull staging.

Discipline checklist

  • TODO/fallback YASAK — every DURUR raises, none silently downgrade.
  • Schema-first — frontmatter validates against schemas/skill-frontmatter.schema.json Draft 7. Budget block conforms to additionalProperties:false (Q-W-A4-01: only uses_paid_mcp + estimated_credits; no _per_call / _per_url leakage).
  • Plugin-agnostik — no slug literals; project_slug flows through every path; transform has 0 hardcoded slug words.
  • ADR-013: Use when/Also use when/Do not use when are STRING content inside description, not separate fields.
  • Budget pre-flight integration — scripts/budget/check_budget.py invoked at Step 1 (subprocess wrapper) BEFORE any paid call.
  • Append-only — all events via events_writer; staging JSON is overwrite-idempotent (re-run produces stable id/content_hash); Phase 8 owns the F-09 shared-writer discipline downstream.
  • Cross-module IMPORT discipline — workflow_runner / events_writer are imported, never modified. From dfs_pull: _normalize_dfs_response AND StagingSchemaError are imported (KOPYA YASAK enforced by identity test). scripts.excel.transaction is NOT imported (staging-only — D-003 resolution).
  • DoS guard — keyword_cap default 5000 (configurable per-run); MCP responses larger than the cap → KeywordCapExceededError.
  • F1: write target is _state/staging/ (no master.xlsx from this skill — Phase 8 cluster-map / new-content-plan owns the projection).
  • F5: outputs.* values are STRING-TYPED (artifact paths or stringified counts), never raw ints.

よくある質問

AIスキル「Content Gaps」では何ができますか?

Use 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...

TypingMindでContent Gapsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Content Gapsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにContent Gapsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/popiliadam/platinum-seo-engine/tree/main/skills/discovery/content-gapsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Content Gapsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Content Gapsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもContent Gapsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Content Gaps」は無料ですか?

はい。popiliadamがAGPL-3.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇