jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ HuggingFaceツールビルダー

hugging-face-tool-builder

AIモデルのサービスであるHugging Faceの機能を

⏱ ボイラープレート実装 半日 → 30分

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool.

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

一言でいうと

AIモデルのサービスであるHugging Faceの機能を

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

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o hugging-face-tool-builder.zip https://jpskill.com/download/2996.zip && unzip -o hugging-face-tool-builder.zip && rm hugging-face-tool-builder.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/2996.zip -OutFile "$d\hugging-face-tool-builder.zip"; Expand-Archive "$d\hugging-face-tool-builder.zip" -DestinationPath $d -Force; ri "$d\hugging-face-tool-builder.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して hugging-face-tool-builder.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → hugging-face-tool-builder フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

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

🎯 この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

💬 こう話しかけるだけ — サンプルプロンプト

  • Hugging Face Tool Builder を使って、最小構成のサンプルコードを示して
  • Hugging Face Tool Builder の主な使い方と注意点を教えて
  • Hugging Face Tool Builder を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

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

Hugging Face API ツールビルダー

あなたの目的は、Hugging Face API を使用するための再利用可能なコマンドラインスクリプトとユーティリティを作成することです。これらは、必要に応じて連結、パイプ処理、および中間処理を可能にします。API に直接アクセスできるほか、hf コマンドラインツールも使用できます。モデルカードとデータセットカードは、リポジトリから直接アクセスできます。

使用する場面

  • Hugging Face API または hf コマンドラインツールに関する再利用可能な CLI スクリプトが必要な場合。
  • 連結、パイプ処理、および中間処理をサポートするシェルフレンドリーなユーティリティが必要な場合。
  • 繰り返しの Hub タスクを自動化し、アドホックな API 呼び出しではなく、構成可能なインターフェースが必要な場合。

スクリプトのルール

以下のルールを必ず守ってください。

  • スクリプトは、入力と出力を説明するために --help コマンドライン引数を取る必要があります。
  • 非破壊的なスクリプトは、ユーザーに引き渡す前にテストする必要があります。
  • シェルスクリプトが推奨されますが、複雑さやユーザーのニーズに応じて Python または TSX を使用してください。
  • 重要: 認証ヘッダーとして HF_TOKEN 環境変数を使用してください。例: curl -H "Authorization: Bearer ${HF_TOKEN}" https://huggingface.co/api/。これにより、より高いレート制限とデータアクセスに対する適切な認証が提供されます。
  • 最終的な設計を決定する前に、API 結果の形式を調査してください。構成可能性が有利になる場合は、パイプ処理と連結を活用し、可能な限りシンプルなソリューションを優先してください。
  • 完了したら使用例を共有してください。

質問や明確化が必要な場合は、必ずユーザーの好みを​​確認してください。

サンプルスクリプト

以下のパスは、このスキルディレクトリからの相対パスです。

参照例:

  • references/hf_model_papers_auth.shHF_TOKEN を自動的に使用し、トレンド → モデルメタデータ → フォールバック付きモデルカード解析を連結します。これは、ゲート付き/プライベートコンテンツの多段階 API 使用と認証衛生を示しています。
  • references/find_models_by_paper.sh--token を介したオプションの HF_TOKEN 使用、一貫した認証済み検索、および arXiv プレフィックス付き検索が狭すぎる場合の再試行パス。これは、回復力のあるクエリ戦略と明確なユーザー向けヘルプを示しています。
  • references/hf_model_card_frontmatter.shhf CLI を使用してモデルカードをダウンロードし、YAML フロントマターを抽出し、NDJSON 形式の要約(ライセンス、パイプラインタグ、タグ、ゲート付きプロンプトフラグ)を出力して、簡単にフィルタリングできるようにします。

ベースライン例(超シンプル、最小限のロジック、HF_TOKEN ヘッダー付きの生 JSON 出力):

  • references/baseline_hf_api.sh — bash
  • references/baseline_hf_api.py — python
  • references/baseline_hf_api.tsx — typescript 実行可能ファイル

構成可能なユーティリティ(stdin → NDJSON):

  • references/hf_enrich_models.sh — stdin からモデル ID を読み取り、ID ごとにメタデータをフェッチし、ストリーミングパイプライン用に1行につき1つの JSON オブジェクトを出力します。

パイプ処理による構成可能性(シェルフレンドリーな JSON 出力):

  • references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'
  • references/baseline_hf_api.sh 50 | jq '[.[] | {id, downloads}] | sort_by(.downloads) | reverse | .[:10]'
  • printf '%s\n' openai/gpt-oss-120b meta-llama/Meta-Llama-3.1-8B | references/hf_model_card_frontmatter.sh | jq -s 'map({id, license, has_extra_gated_prompt})'

高レベルエンドポイント

以下は、https://huggingface.co で利用可能な主要な API エンドポイントです。

/api/datasets
/api/models
/api/spaces
/api/collections
/api/daily_papers
/api/notifications
/api/settings
/api/whoami-v2
/api/trending
/oauth/userinfo

API へのアクセス

API は、OpenAPI 標準で https://huggingface.co/.well-known/openapi.json に文書化されています。

重要: https://huggingface.co/.well-known/openapi.json は処理するには大きすぎるため、直接読み取ろうとしないでください。

重要: jq を使用して、関連する部分をクエリして抽出してください。例えば、

全160エンドポイントを取得するコマンド

curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths | keys | sort'

モデル検索エンドポイントの詳細

curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths["/api/models"]'

エンドポイントをクエリしてデータの形式を確認することもできます。その際、結果を処理しやすく、かつ代表的なものにするために、結果の数を少なく制限してください。

HF コマンドラインツールの使用

hf コマンドラインツールを使用すると、Hugging Face リポジトリのコンテンツとインフラストラクチャにさらにアクセスできます。

❯ hf --help
Usage: hf [OPTIONS] COMMAND [ARGS]...

  Hugging Face Hub CLI

Options:
  --help                Show this message and exit.

Commands:
  auth                 Manage authentication (login, logout, etc.).
  cache                Manage local cache directory.
  download             Download files from the Hub.
  endpoints            Manage Hugging Face Inference Endpoints.
  env                  Print information about the environment.
  jobs                 Run and manage Jobs on the Hub.
  repo                 Manage repos on the Hub.
  repo-files           Manage files in a repo on the Hub.
  upload               Upload a file or a folder to the Hub.
  upload-large-folder  Upload a large folder to the Hub.
  version              Print information about the hf version.

hf CLI コマンドは、現在非推奨の huggingface_hub CLI コマンドに代わるものです。

制限事項

  • このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
  • 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
  • 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して明確化を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Hugging Face API Tool Builder

Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool. Model and Dataset cards can be accessed from repositories directly.

When to Use

  • You need reusable CLI scripts around the Hugging Face API or hf command line tool.
  • You want shell-friendly utilities that support chaining, piping, and intermediate processing.
  • You are automating repeated Hub tasks and need a composable interface instead of ad hoc API calls.

Script Rules

Make sure to follow these rules:

  • Scripts must take a --help command line argument to describe their inputs and outputs
  • Non-destructive scripts should be tested before handing over to the User
  • Shell scripts are preferred, but use Python or TSX if complexity or user need requires it.
  • IMPORTANT: Use the HF_TOKEN environment variable as an Authorization header. For example: curl -H "Authorization: Bearer ${HF_TOKEN}" https://huggingface.co/api/. This provides higher rate limits and appropriate authorization for data access.
  • Investigate the shape of the API results before commiting to a final design; make use of piping and chaining where composability would be an advantage - prefer simple solutions where possible.
  • Share usage examples once complete.

Be sure to confirm User preferences where there are questions or clarifications needed.

Sample Scripts

Paths below are relative to this skill directory.

Reference examples:

  • references/hf_model_papers_auth.sh — uses HF_TOKEN automatically and chains trending → model metadata → model card parsing with fallbacks; it demonstrates multi-step API usage plus auth hygiene for gated/private content.
  • references/find_models_by_paper.sh — optional HF_TOKEN usage via --token, consistent authenticated search, and a retry path when arXiv-prefixed searches are too narrow; it shows resilient query strategy and clear user-facing help.
  • references/hf_model_card_frontmatter.sh — uses the hf CLI to download model cards, extracts YAML frontmatter, and emits NDJSON summaries (license, pipeline tag, tags, gated prompt flag) for easy filtering.

Baseline examples (ultra-simple, minimal logic, raw JSON output with HF_TOKEN header):

  • references/baseline_hf_api.sh — bash
  • references/baseline_hf_api.py — python
  • references/baseline_hf_api.tsx — typescript executable

Composable utility (stdin → NDJSON):

  • references/hf_enrich_models.sh — reads model IDs from stdin, fetches metadata per ID, emits one JSON object per line for streaming pipelines.

Composability through piping (shell-friendly JSON output):

  • references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'
  • references/baseline_hf_api.sh 50 | jq '[.[] | {id, downloads}] | sort_by(.downloads) | reverse | .[:10]'
  • printf '%s\n' openai/gpt-oss-120b meta-llama/Meta-Llama-3.1-8B | references/hf_model_card_frontmatter.sh | jq -s 'map({id, license, has_extra_gated_prompt})'

High Level Endpoints

The following are the main API endpoints available at https://huggingface.co

/api/datasets
/api/models
/api/spaces
/api/collections
/api/daily_papers
/api/notifications
/api/settings
/api/whoami-v2
/api/trending
/oauth/userinfo

Accessing the API

The API is documented with the OpenAPI standard at https://huggingface.co/.well-known/openapi.json.

IMPORTANT: DO NOT ATTEMPT to read https://huggingface.co/.well-known/openapi.json directly as it is too large to process.

IMPORTANT Use jq to query and extract relevant parts. For example,

Command to Get All 160 Endpoints

curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths | keys | sort'

Model Search Endpoint Details

curl -s "https://huggingface.co/.well-known/openapi.json" | jq '.paths["/api/models"]'

You can also query endpoints to see the shape of the data. When doing so constrain results to low numbers to make them easy to process, yet representative.

Using the HF command line tool

The hf command line tool gives you further access to Hugging Face repository content and infrastructure.

❯ hf --help
Usage: hf [OPTIONS] COMMAND [ARGS]...

  Hugging Face Hub CLI

Options:
  --help                Show this message and exit.

Commands:
  auth                 Manage authentication (login, logout, etc.).
  cache                Manage local cache directory.
  download             Download files from the Hub.
  endpoints            Manage Hugging Face Inference Endpoints.
  env                  Print information about the environment.
  jobs                 Run and manage Jobs on the Hub.
  repo                 Manage repos on the Hub.
  repo-files           Manage files in a repo on the Hub.
  upload               Upload a file or a folder to the Hub.
  upload-large-folder  Upload a large folder to the Hub.
  version              Print information about the hf version.

The hf CLI command has replaced the now deprecated huggingface_hub CLI command.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.