静的サイトのリンク切れチェック(オフライン)

Offline link checker for built static sites

ビルド済みの静的サイトのフォルダを巡回し、リンク切れ・存在しないアンカー・見つからない画像やCSSを行番号つきで報告します。外部リンクの確認は指定したときだけ行います。

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

できること

dist/ や public/ などのビルド済みフォルダを、サーバーを立てずにそのまま調べます。

  • 内部リンク切れ(存在しないページへの a タグ)を、ファイル名と行番号つきで報告
  • #見出しid のようなページ内リンクで、移動先の id が存在しないものを検出
  • img・srcset・CSS の url()・script・link・動画のポスター・og:image など、見つからない画像やファイルを検出
  • /about を /about.html や /about/index.html として扱う「きれいなURL」と、サブパス公開(--base-path /docs)に対応
  • 外部リンクは --external を付けたときだけ、1件ずつ間隔をあけて HEAD で確認(拒否されたら小さな GET で再確認)

使い方

python scripts/link_check.py dist --site-url https://www.example.com --md link-report.md
python scripts/link_check.py dist --external --delay 1.0

エージェントが結果を確認し、ビルド結果ではなく元のテンプレートや記事を直す方法を提案します。

必要な環境

  • Python 3(標準ライブラリのみ)
  • 外部リンクを確認する場合のみネットワーク接続

注意点

  • サイトのファイルは変更しません。書き出すのは指定したレポートだけです。
  • JavaScript で後から作られるリンクや、サーバー側のリダイレクト設定は確認できません。
  • 外部サイトの 403・429 やTLSエラーは、ボット対策や手元の環境が原因のこともあります。
English description

Crawls a built static site folder offline and reports broken internal links, missing #anchors and missing assets with line numbers. External links are checked only on request.

What it does

Checks a built folder such as dist/ or public/ directly, without running a server.

  • Broken internal links (a tags pointing to pages that do not exist), with file and line number
  • In-page links such as #section-id whose target id does not exist
  • Missing images and files referenced by img, srcset, CSS url(), script, link, video posters, og:image and more
  • Supports clean URLs (/about as /about.html or /about/index.html) and sub-path hosting (--base-path /docs)
  • External links only with --external: one HEAD request at a time with a delay, retried with a small GET when HEAD is refused

How to use

python scripts/link_check.py dist --site-url https://www.example.com --md link-report.md
python scripts/link_check.py dist --external --delay 1.0

The agent reviews the results and proposes fixes in the source templates or content, not in the build output.

Requirements

  • Python 3 (standard library only)
  • Network access only when checking external links

Caveats

  • Site files are never modified; only the report files you name are written.
  • Links created by JavaScript at runtime and server-side redirect rules are not evaluated.
  • HTTP 403/429 or TLS errors from external sites can be caused by bot protection or the local environment.

インストール方法

  1. ダウンロードしたZIPを展開します(中に static-site-link-checker/ フォルダと 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 件

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