Hugging Face API Tool Builder
Turns Hugging Face API interactions into reusable, pipe-composable command-line scripts instead of one-off fetch code written every time.
Plus: HF_TOKEN injected via environment variable, not hardcoded; token optional for public data; scripts are read-only API calls with least privilege and temp-dir cleanup via trap. Minus: no explicit user-confirmation or rollback mechanisms; find_models_by_paper.sh builds AUTH_HEADER via unquoted string concatenation (mostly display-only, actual curl branches handled separately); token data-flow disclosure partially inferred; no systematic attribution or security-boundary statement.
Plus: most scripts use set -euo pipefail, --help, argument validation, jq dependency checks, and structured error outputs (request_failed/invalid_/not_found). Minus: find_models_by_paper.sh contains contradictory logic — the USE_TOKEN flag condition is muddled and the constructed CURL_CMD string is never executed (dead code), so --token does not actually change behavior; get_paper_title is a placeholder stub; no committed tests cover the key paths.
Plus: clear scenario (building reusable HF API CLI tools), explicit trigger conditions in the description (chained/repeated API tasks), rich examples and --help in reference scripts. Minus: no declared non-fit boundaries, no dependency version requirements (hf CLI, jq, python3), and core function depends entirely on huggingface.co/arxiv.org with no disclosure of mainland-China reachability impact.
Plus: well-layered SKILL.md (rules → examples → endpoints → CLI), progressive disclosure from baseline scripts to composed pipelines, clear repo-level MIT license. Minus: no per-skill versioning, changelog, or explicit maintenance ownership/update path; repo README targets a general tutorial collection rather than this skill; known-limitations disclosure is thin beyond the openapi. size warning.
Plus: clear goal with directly composable scripts (stdin→NDJSON→jq sorting) offering real marginal value over hand-written cURL; scripts appear directly usable. Minus: static review cannot verify output correctness; example outputs (openai/gpt-oss-120b etc.) unverified; the hand-rolled YAML parser in hf_model_card_frontmatter.sh may mishandle complex frontmatter, requiring human review.
Plus: all key claims (script behavior, dependencies, usage) map to auditable source files. Minus: no CI workflows, committed tests, or third-party execution evidence covering this skill path; tests elsewhere in the repo (build-code-harness, notebook-lm-clone) are unrelated and cannot corroborate this skill.
- Core functionality depends entirely on huggingface.co; direct use from mainland-China networks may be blocked without alternative network arrangements.
- find_models_by_paper.sh has muddled --token logic and unused dead code; actual behavior may diverge from its help text — verify manually before use.
- Static review only; no scripts were executed. Example outputs are unverified, and the YAML frontmatter parser is a hand-rolled simple implementation that may mishandle complex model cards.
- The skill has no independent version number or changelog; script behavior may change silently with repository updates.
What does this skill do, and when should you use it?
This skill instructs an AI assistant to build reusable command-line tools for the Hugging Face API, with support for chaining, piping, and intermediate processing. It ships baseline example scripts in bash, Python, and TSX, plus reference implementations for model metadata, paper-linked model search, and model-card frontmatter extraction. It emphasizes HF_TOKEN-based authentication, probing the API shape with jq, and preferring simple, composable solutions. It fits users who repeatedly or automatically fetch, enrich, or process Hugging Face model and dataset data.
The skill has the assistant write shell/Python/TSX scripts with --help, calling endpoints under https://huggingface.co/api/ (models, datasets, spaces, collections, daily_papers, trending, etc.) via curl with an HF_TOKEN Authorization header, optionally using the hf CLI for repository files like model cards, and querying endpoint definitions from the OpenAPI spec with jq rather than reading the oversized openapi. directly. Outputs are executable, pipe-composable scripts emitting raw JSON or NDJSON with usage examples. Reference scripts include a trending → metadata → model-card chained fetch, arXiv-linked model search with retry fallback, and extraction of model-card YAML frontmatter (license, pipeline tag, gated prompt flag) into NDJSON summaries.
- Data engineers batch-fetching model metadata to feed downstream streaming pipelines (hf_enrich_models.sh reads model IDs from stdin and emits one NDJSON object per line)
- Researchers finding all Hugging Face models linked to an arXiv paper, with retry fallback when prefixed searches are too narrow
- Platform ops auditing model-card metadata (license, gated prompt flag) in bulk for compliance inventories
- Automation authors who want a tested, non-destructive --help-equipped baseline API fetch script to extend themselves
- Analyses comparing trending models by downloads: pipe the trending list, sort, take top N, then enrich with metadata
What are this skill's strengths and limitations?
- Ships directly reusable reference scripts (bash/Python/TSX baselines) covering auth, chained calls, and frontmatter extraction
- Enforces clear script-quality rules: --help, non-destructive testing, and pipe composability
- Uses HF_TOKEN for higher rate limits and gated/private content authorization
- The jq-against-OpenAPI-spec pattern avoids the trap of reading the oversized openapi. directly
- Hard external dependencies: curl, jq, the hf CLI, and the HF_TOKEN env variable — nothing runs without them
- No automated test suite in the skill; the repo README offers no standalone docs or install instructions for this sub-skill
- Shell-script-first design; native Windows (without WSL/bash) support is undocumented
- The endpoint list is a snapshot; Hugging Face API changes may require script updates
How do you install this skill?
The skill lives at hugging-face-skills/skills/hugging-face-tool-builder/ inside the patchy631/ai-engineering-hub monorepo (MIT licensed). Following Agent Skills convention, place the whole hugging-face-tool-builder folder into your Agent Skills client's skills directory; the repo README documents no dedicated installation command for this sub-skill. Prerequisites: set the HF_TOKEN environment variable, install jq and curl, and install the hf CLI (huggingface_hub).
How do you use this skill?
Trigger it by describing the task to a skill-enabled assistant, e.g. "Write me a script that lists the 25 trending Hugging Face models with their downloads and licenses." The assistant will generate the script, test it non-destructively before handoff, and share usage examples. You can also run the bundled reference scripts directly, e.g.: references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'.