静的サイトのリンク切れチェック(オフライン)
Offline link checker for built static sites
ビルド済みの静的サイトのフォルダを巡回し、リンク切れ・存在しないアンカー・見つからない画像やCSSを行番号つきで報告します。外部リンクの確認は指定したときだけ行います。
できること
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-idwhose 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 (
/aboutas/about.htmlor/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.
インストール方法
- ダウンロードしたZIPを展開します(中に
static-site-link-checker/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills//Cursor:~/.cursor/skills/ - Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
- Claude:
- エージェントを再起動し、スキル一覧に表示されることを確認します。
出品者
AI Skill Market 公式
出品スキル 44 件