Hugging Face Datasets Skill
Create, configure, and stream datasets on the Hugging Face Hub, and query, transform, and republish any public dataset with DuckDB SQL.
The skill writes to the external Hugging Face Hub, creates repos and pushes data (external effects); the token is interpolated via f-string into CREATE SECRET, and SQL helpers concatenate column/where strings, creating an injection surface; push_to_hub defaults to private and init supports --private (good least-privilege signals), but there is no pre-operation confirmation and no rollback guidance. Deducted for missing confirmation/recovery and credential-string handling.
Both scripts are internally coherent with inline uv dependency metadata and reasonably clear error messages; however sql_manager.py is truncated in evidence (raw/transform CLI branches and --push-to handling not fully visible), doc/CLI inconsistencies exist (histogram bins default; _build_hf_path defaults config='default' which may mismatch real datasets), and there are no tests. Static cap 10; deducted for unreproduced key paths and possible path mismatches.
Audience and scenarios are clear (dataset creation, SQL query/transform), with an explicit division of labor vs the HF MCP server and a multi-format template system; but English-only, and core function depends entirely on huggingface.co/hf:// reachability, questionable from mainland China, with no fallback. Deducted for environment fit and missing boundary/non-fit declarations.
SKILL.md is well layered (overview → dependencies → quick start → API reference → combined examples), declares version 2.1.0, embeds dependency manifests, and ships machine-readable templates; but script versions (2.0.0/1.0.0) disagree with SKILL.md, generated README self-attributes as 'Claude Dataset Skill' (confusing provenance), and there is no changelog or clear maintainer/update path. Deducted for version inconsistency, attribution contradiction, and governance gaps.
Docs and scripts are highly consistent, examples are copy-pasteable, covering query/export/push core tasks with clear marginal value (wrapping DuckDB hf:// access into one-line commands); but there is zero execution/output validation evidence and output correctness is unverified. Static cap 7; deducted for unverified representative outputs and claim-only comparative benefit.
Auditable primary material exists (full source, template JSONs, example data), but no test suite, no CI workflow evidence, and no third-party execution corroboration; docstring examples are not independently reproducible. Static cap 5; deducted for single evidence type and thin reproduction coverage.
- Requires a write-access HF_TOKEN; the token is interpolated into a DuckDB SECRET via string concatenation — review credential handling before use.
- SQL helpers (histogram/unique/count/transform) interpolate column names and where clauses directly into SQL; use only with trusted inputs to avoid injection.
- The skill creates and pushes external Hub repositories (external side effects); verify target repo_id before pushing, despite private-by-default.
- Core function depends entirely on huggingface.co and the hf:// protocol; may be unreachable from mainland-China networks with no fallback.
- Not execution-verified: doc/script inconsistencies possible (truncated sql_manager.py, default config='default' path building); validate with small describe/sample calls first.
What does this skill do, and when should you use it?
This is a dataset-management skill for the Hugging Face Hub, version 2.1.0. It ships two scripts: dataset_manager.py initializes dataset repos, stores system-prompt configurations, and adds rows via templates (chat, classification, qa, completion, tabular); sql_manager.py uses DuckDB's hf:// protocol to run SQL directly against any public (or private) dataset for schema discovery, sampling, aggregation, transformation, and pushing results to new Hub repos or local Parquet/JSONL exports. It is designed to complement the HF MCP server, which handles discovery and retrieval while this skill handles creation, editing, and querying. Dependencies are huggingface_hub, duckdb, and datasets, plus an HF_TOKEN with write access.
Reads: accesses Parquet files of any Hugging Face dataset via the hf:// protocol. Runs: dataset_manager.py provides init, config, quick_setup, add_rows, stats, and list_templates commands; sql_manager.py provides query, describe, sample, count, unique, histogram, transform, export, and raw commands, with data as the SQL table name substituted by the actual hf:// path. Produces: new or updated Hub dataset repos, local Parquet or JSONL exports, and dataset statistics. Hub writes require an HF_TOKEN environment variable with write access.
- A data engineer who wants to filter a public dataset like cais/mmlu by subject into a medical subset and push it to their own private repo for fine-tuning.
- A training-data practitioner building a structured training set from scratch using templates (qa, chat, classification) with system prompts and JSON validation.
- An analyst who wants to explore an unfamiliar dataset's schema, row counts, and column distributions via SQL without downloading it.
- A team merging multiple datasets via SQL joins or exporting subsets (e.g., long questions from duorc) to local Parquet/JSONL for downstream pipelines.
- A researcher converting MMLU into QA format (extracting choices[answer] as the correct answer) and publishing it as a new dataset.
What are this skill's strengths and limitations?
- SQL queries run through DuckDB's hf:// protocol, enabling filtering, aggregation, and sampling without downloading whole datasets.
- Query results can be pushed to a new Hub repo (with --private support) or exported as Parquet/JSONL in one step.
- Five templates (chat/classification/qa/completion/tabular) with built-in JSON validation and error recovery.
- Supports config/split selection (including all splits) and raw SQL joins across datasets.
- All write operations require an HF_TOKEN with Write access, adding friction for read-only use.
- The source provides no evidence of a test suite, CI, or test coverage.
- Documentation does not explain installation/invocation on specific agent platforms.
- SQL must use `data` as the table name; complex queries require the raw mode with fully hand-written hf:// paths, a learning curve.
- Queries rely on DuckDB's auto-converted Parquet revision (@~parquet); coverage of highly custom dataset formats is not specified in the source.
How do you install this skill?
The source does not specify where the skill folder should be placed (e.g., a specific client skills directory); it only documents script dependencies. Verifiable steps: 1) Install dependencies: uv add huggingface_hub duckdb datasets; 2) Set the HF_TOKEN environment variable (a write-access token); 3) Activate the virtual environment: source .venv/bin/activate; 4) Scripts live under the skill's scripts/ directory (dataset_manager.py and sql_manager.py). Skill-directory placement is not documented in the source.
How do you use this skill?
After activating the environment, call the scripts from the command line, e.g.: python scripts/sql_manager.py query --dataset "cais/mmlu" --sql "SELECT * FROM data WHERE subject='nutrition' LIMIT 10"; python scripts/sql_manager.py describe --dataset "cais/mmlu"; python scripts/dataset_manager.py init --repo_id "your-username/dataset-name"; python scripts/dataset_manager.py add_rows --repo_id "..." --template qa --rows_ "$(cat your_qa_data.)". A Python API is also available: from sql_manager import HFDatasetSQL; sql.query("cais/mmlu", "SELECT * FROM data LIMIT 10"). The recommended workflow uses the HF MCP server for dataset discovery and this skill for creation and querying.
How does this skill compare with similar options?
SKILL.md explicitly delineates roles against the HF MCP server: the HF MCP server handles dataset discovery, search, and metadata retrieval; this skill handles dataset creation, content editing, SQL queries, and data transformation. They are designed to be used together.