jpskill.com
✍️ ライティング コミュニティ

zig-docs

Zig言語や標準ライブラリのAPI詳細、関数シグネチャ、言語リファレンスをCLI経由で素早く検索するSkill。

📜 元の英語説明(参考)

Fetches Zig language and standard library documentation via CLI. Activates when needing Zig API details, std lib function signatures, or language reference content that isn't covered in zig-best-practices.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Zig言語や標準ライブラリのAPI詳細、関数シグネチャ、言語リファレンスをCLI経由で素早く検索するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Zig ドキュメントの取得

手順

  • 標準ライブラリのドキュメントには、Codeberg の生のソースを使用してください(最も信頼性が高いです)。
  • ziglang.org から言語リファレンスを取得するには、pandoc を使用してください(散文コンテンツに有効です)。
  • ziglang.org の標準ライブラリの HTML ドキュメントは JavaScript でレンダリングされるため、空のコンテンツが返されます。これらは避けてください。
  • Zig のソースファイルには、モジュールドキュメント用の //! とアイテムドキュメント用の /// のドキュメントコメントが含まれており、これらが公式のドキュメントとして機能します。

クイックリファレンス

標準ライブラリのソースを取得する(推奨)

標準ライブラリのモジュールは自己文書化されています。ソースを直接取得してください。

# ドキュメントコメント付きのモジュールソース
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/<module>.zig"

# 一般的なモジュール:
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/log.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/fs.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/heap.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/debug.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/testing.zig"

アロケータインターフェースを取得する

curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig"

言語リファレンス(散文)を取得する

# 完全な言語リファレンス(大きい、約500KBのテキスト)
pandoc -f html -t plain "https://ziglang.org/documentation/master/"

# 特定のセクションのためにheadにパイプする
pandoc -f html -t plain "https://ziglang.org/documentation/master/" | head -200

標準ライブラリの内容をリスト表示する

# Codeberg API経由ですべての標準ライブラリモジュールをリスト表示する
curl -sL "https://codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std" | jq -r '.[].name'

# サブディレクトリの内容をリスト表示する
curl -sL "https://codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std/mem" | jq -r '.[].name'

zig.guide のコンテンツを取得する

# ランディングページとナビゲーション
pandoc -f html -t plain "https://zig.guide/"

ドキュメントソース

ソース URLパターン 注意事項
標準ライブラリソース codeberg.org/ziglang/zig/raw/branch/master/lib/std/<path> 最も信頼性が高く、ドキュメントコメントが含まれます
言語リファレンス ziglang.org/documentation/master/ pandoc を使用してください。散文コンテンツです
zig.guide zig.guide/ 初心者向けです。pandoc を使用してください
Codeberg API codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std ディレクトリの内容をリスト表示します

一般的なモジュールパス

モジュール パス
Allocator lib/std/mem/Allocator.zig
ArrayList lib/std/array_list.zig
HashMap lib/std/hash_map.zig
StringHashMap lib/std/hash/map.zig
File System lib/std/fs.zig
File lib/std/fs/File.zig
IO lib/std/Io.zig
Logging lib/std/log.zig
Testing lib/std/testing.zig
Debug lib/std/debug.zig
Heap lib/std/heap.zig
Build System lib/std/Build.zig
JSON lib/std/json.zig
HTTP lib/std/http.zig
Thread lib/std/Thread.zig
Process lib/std/process.zig

バージョン固有のドキュメント

安定版リリースでは、master をバージョンタグに置き換えてください。

# 0.14.0 リリース
curl -sL "https://codeberg.org/ziglang/zig/raw/tag/0.14.0/lib/std/log.zig"

# 特定のバージョンの言語リファレンス
pandoc -f html -t plain "https://ziglang.org/documentation/0.14.0/"

ドキュメントの検索

標準ライブラリ内の特定の関数/型を検索する

# 標準ライブラリ全体で関数名を検索する
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/<module>.zig" | grep -A5 "pub fn <name>"

# 例: allocator.create を検索する
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig" | grep -A10 "pub fn create"

ドキュメントコメントを抽出する

# モジュールレベルのドキュメント (//!)
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/log.zig" | grep "^//!"

# 関数/型のドキュメント (///)
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig" | grep -B1 "pub fn" | grep "///"

トラブルシューティング

ziglang.org/documentation/master/std/ からのコンテンツが空です:

  • 標準ライブラリの HTML ドキュメントは JavaScript でレンダリングされます。代わりに Codeberg の生ソースを使用してください。

pandoc が失敗します:

  • 一部のページは JavaScript を必要とします。その場合は curl と Codeberg の生ソースにフォールバックしてください。
  • URL が正しいか確認してください(末尾のスラッシュの問題など)。

Codeberg API でレート制限が発生します:

  • API の代わりに codeberg.org の生 URL を直接使用してください。
  • 頻繁にアクセスするコンテンツはローカルにキャッシュしてください。

参考文献

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Zig Documentation Fetching

Instructions

  • Use raw Codeberg sources for std lib documentation (most reliable)
  • Use pandoc for language reference from ziglang.org (works for prose content)
  • The std lib HTML docs at ziglang.org are JavaScript-rendered and return empty content; avoid them
  • Zig source files contain doc comments (//! for module docs, /// for item docs) that serve as authoritative documentation

Quick Reference

Fetch Standard Library Source (Recommended)

Standard library modules are self-documenting. Fetch source directly:

# Module source with doc comments
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/<module>.zig"

# Common modules:
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/log.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/fs.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/heap.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/debug.zig"
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/testing.zig"

Fetch Allocator Interface

curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig"

Fetch Language Reference (Prose)

# Full language reference (large, ~500KB of text)
pandoc -f html -t plain "https://ziglang.org/documentation/master/"

# Pipe to head for specific sections
pandoc -f html -t plain "https://ziglang.org/documentation/master/" | head -200

List Standard Library Contents

# List all std lib modules via Codeberg API
curl -sL "https://codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std" | jq -r '.[].name'

# List subdirectory contents
curl -sL "https://codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std/mem" | jq -r '.[].name'

Fetch zig.guide Content

# Landing page and navigation
pandoc -f html -t plain "https://zig.guide/"

Documentation Sources

Source URL Pattern Notes
Std lib source codeberg.org/ziglang/zig/raw/branch/master/lib/std/<path> Most reliable; includes doc comments
Language reference ziglang.org/documentation/master/ Use pandoc; prose content
zig.guide zig.guide/ Beginner-friendly; use pandoc
Codeberg API codeberg.org/api/v1/repos/ziglang/zig/contents/lib/std List directory contents

Common Module Paths

Module Path
Allocator lib/std/mem/Allocator.zig
ArrayList lib/std/array_list.zig
HashMap lib/std/hash_map.zig
StringHashMap lib/std/hash/map.zig
File System lib/std/fs.zig
File lib/std/fs/File.zig
IO lib/std/Io.zig
Logging lib/std/log.zig
Testing lib/std/testing.zig
Debug lib/std/debug.zig
Heap lib/std/heap.zig
Build System lib/std/Build.zig
JSON lib/std/json.zig
HTTP lib/std/http.zig
Thread lib/std/Thread.zig
Process lib/std/process.zig

Version-Specific Documentation

Replace master with version tag for stable releases:

# 0.14.0 release
curl -sL "https://codeberg.org/ziglang/zig/raw/tag/0.14.0/lib/std/log.zig"

# Language reference for specific version
pandoc -f html -t plain "https://ziglang.org/documentation/0.14.0/"

Searching Documentation

Search for specific function/type in std lib

# Search for function name across std lib
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/<module>.zig" | grep -A5 "pub fn <name>"

# Example: find allocator.create
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig" | grep -A10 "pub fn create"

Extract doc comments

# Module-level docs (//!)
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/log.zig" | grep "^//!"

# Function/type docs (///)
curl -sL "https://codeberg.org/ziglang/zig/raw/branch/master/lib/std/mem/Allocator.zig" | grep -B1 "pub fn" | grep "///"

Troubleshooting

Empty content from ziglang.org/documentation/master/std/:

  • The std lib HTML docs are JavaScript-rendered; use raw Codeberg instead

pandoc fails:

  • Some pages require JavaScript; fall back to curl + raw Codeberg
  • Check URL is correct (no trailing slash issues)

Rate limiting on Codeberg API:

  • Use codeberg.org raw URLs directly instead of API
  • Cache frequently accessed content locally

References