内部リンク提案(関連記事・アンカーテキスト・孤立ページ)

Internal link suggester for Markdown and HTML articles

Markdown や HTML の記事フォルダを読み、内容が近いのにリンクしていない記事の組み合わせを、本文中にあるアンカーテキスト候補と挿入位置つきで提案し、孤立ページも見つけます。日本語にも対応しています。

ClaudeHermes AgentCodexCursorMIT(改変・再配布・商用利用可)Python

できること

ブログやドキュメントの記事フォルダから、内部リンクを増やす候補を見つけます。記事ファイルは書き換えません。

  • 各記事のキーワードを TF-IDF で数値化し、内容が近い記事の組み合わせを計算。日本語は文字の 2 文字区切り(バイグラム)とカタカナ語・漢字語で扱うため、形態素解析ツールは不要です
  • 既存のリンク(Markdown のリンクと <a href>)を読み取り、まだリンクしていない組み合わせだけを提案
  • リンク先の記事タイトル・見出し・重要語のうち、リンク元の本文にすでにある言葉をアンカーテキスト候補として示し、どの文に入れるかも表示
  • どの記事からもリンクされていない孤立ページと、そこへリンクすべき記事を一覧化
  • 結果は Markdown・CSV・JSON で出力

使い方

python scripts/link_suggest.py ./content --base-url https://example.com/blog/ --out ./link-report

エージェントに「記事フォルダの内部リンクを提案して」と頼むと、内容を確認したうえで記事ごとのリンク案をまとめます。依頼すれば、合意した文だけを書き換えることもできます。

必要な環境

  • Python 3(標準ライブラリのみ)

注意点

  • 似ているかどうかは使われている言葉の重なりで判定しています。最終的に読者の役に立つかはエージェントと人が判断してください。
  • メニューやテンプレートのリンクは記事ファイルに含まれないため、実際のサイトではリンクされていても「孤立」と出ることがあります。
  • 記事数が数千を超えると処理に時間がかかります(400 記事で約 5 秒でした)。
English description

Reads a folder of Markdown or HTML articles and suggests missing internal links with anchor text found in the source and the sentence to place it, plus orphan pages. Works for Japanese.

What it does

Finds internal linking opportunities in a folder of blog or documentation articles. Your files are never modified.

  • Builds TF-IDF vectors for every article and computes which ones are related. Japanese and Chinese text is handled with character bigrams plus katakana and kanji runs, so no morphological analyzer is needed
  • Reads existing links (Markdown links and <a href>) and only suggests pairs that are not linked yet
  • Offers anchor text candidates taken from the target's title, headings and key terms that already appear in the source text, and shows the sentence where the link fits
  • Lists orphan pages (no inbound internal link) and the best pages to link from
  • Outputs Markdown, CSV and JSON

How to use

python scripts/link_suggest.py ./content --base-url https://example.com/blog/ --out ./link-report

Ask your agent to suggest internal links for your content folder; it reviews the candidates and presents a per-article plan, and can edit only the agreed sentences if you ask.

Requirements

  • Python 3 (standard library only)

Caveats

  • Relatedness is based on shared vocabulary. The agent and you decide whether a link actually helps readers.
  • Menu and template links are not part of the article files, so a page may show as orphan here while being linked on the live site.
  • Thousands of articles take longer (400 articles took about 5 seconds in testing).

インストール方法

  1. ダウンロードしたZIPを展開します(中に internal-link-suggester/ フォルダと SKILL.md があります)。
  2. フォルダごと、使うエージェントのスキル置き場にコピーします。
    • Claude:~/.claude/skills/(プロジェクト単位なら .claude/skills/)
    • Hermes Agent:~/.hermes/skills/
    • Codex:~/.agents/skills//Cursor:~/.cursor/skills/
    • Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
  3. エージェントを再起動し、スキル一覧に表示されることを確認します。

Windows・Mac 別、エージェント別のインストール手順

出品者

AI Skill Market 公式

出品スキル 44 件

出品者のプロフィールとスキル一覧