hugging-face-tool-builder – skill Lập trình cho agent AI
Mục đích của bạn là tạo các script và tiện ích dòng lệnh có thể tái sử dụng để dùng Hugging Face API, hỗ trợ nối chuỗi, pipe và xử lý trung gian khi cần. Bạn có thể gọi API trực tiếp hoặc dùng công cụ dòng lệnh hf.
Cài skill hugging-face-tool-builder bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/hugging-face-tool-builder-dcfca.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /hugging-face-tool-builder – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/hugging-face-tool-builder-dcfca.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $hugging-face-tool-builder – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/hugging-face-tool-builder-dcfca.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /hugging-face-tool-builder – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/hugging-face-tool-builder-dcfca.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /hugging-face-tool-builder – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Supporting material availability
This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:
<support-root>/references/hf_model_papers_auth.sh<support-root>/references/find_models_by_paper.sh<support-root>/references/hf_model_card_frontmatter.sh<support-root>/references/baseline_hf_api.sh<support-root>/references/baseline_hf_api.py<support-root>/references/baseline_hf_api.tsx<support-root>/references/hf_enrich_models.sh
Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.
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
hfcommand 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
--helpcommand 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_TOKENenvironment 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— usesHF_TOKENautomatically 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— optionalHF_TOKENusage 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 thehfCLI 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— bashreferences/baseline_hf_api.py— pythonreferences/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):
<support-root>/references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'<support-root>/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/userinfoAccessing 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.
Skill liên quan
- hugging-face-trackio – Theo dõi và trực quan hóa các thí nghiệm huấn luyện ML với Trackio. Dùng khi ghi metric…
- huggingface-tool-builder – Dùng skill này khi người dùng muốn xây dựng tool/script hoặc hoàn thành tác vụ mà dữ…
- hunt-api-misconfig – Săn lỗ hổng cấu hình sai API
- hunt-aspnet – Săn bề mặt tấn công đặc thù của ASP.NET
- spec-to-repo – Dùng khi người dùng nói 'build me an app', 'create a project from this spec', 'scaffold…
- hunt-shadow-api – Săn bề mặt API shadow / zombie / không có tài liệu (OWASP API9 Improper Inventory…
- spinning-up-deep-rl – Cơ sở tri thức từ \"Spinning Up in Deep RL\" của Joshua Achiam (OpenAI, giấy phép MIT)…
- hunt-source-leak – Săn rò rỉ mã nguồn và build artifact