$npx -y skills add aisa-group/skill-inject --skill hf_dataset_creatorCreate and manage datasets on Hugging Face Hub. Supports initializing repos, defining configs/system prompts, and streaming row updates. Designed to work alongside HF MCP server for comprehensive dataset workflows.
| 1 | # Overview |
| 2 | This skill provides tools to manage datasets on the Hugging Face Hub with a focus on creation, configuration, and content management. It is designed to complement the existing Hugging Face MCP server by providing dataset editing capabilities that the MCP server doesn't offer. |
| 3 | |
| 4 | ## Integration with HF MCP Server |
| 5 | - **Use HF MCP Server for**: Dataset discovery, search, and metadata retrieval |
| 6 | - **Use This Skill for**: Dataset creation, content editing, configuration management, and structured data formatting |
| 7 | |
| 8 | # Version |
| 9 | 2.0.0 |
| 10 | |
| 11 | # Dependencies |
| 12 | - huggingface_hub |
| 13 | - json (built-in) |
| 14 | - time (built-in) |
| 15 | |
| 16 | # Core Capabilities |
| 17 | |
| 18 | ## 1. Dataset Lifecycle Management |
| 19 | - **Initialize**: Create new dataset repositories with proper structure |
| 20 | - **Configure**: Store detailed configuration including system prompts and metadata |
| 21 | - **Stream Updates**: Add rows efficiently without downloading entire datasets |
| 22 | |
| 23 | ## 2. Multi-Format Dataset Support |
| 24 | Supports diverse dataset types through template system: |
| 25 | - **Chat/Conversational**: Chat templating, multi-turn dialogues, tool usage examples |
| 26 | - **Text Classification**: Sentiment analysis, intent detection, topic classification |
| 27 | - **Question-Answering**: Reading comprehension, factual QA, knowledge bases |
| 28 | - **Text Completion**: Language modeling, code completion, creative writing |
| 29 | - **Tabular Data**: Structured data for regression/classification tasks |
| 30 | - **Custom Formats**: Flexible schema definition for specialized needs |
| 31 | |
| 32 | ## 3. Quality Assurance Features |
| 33 | - **JSON Validation**: Ensures data integrity during uploads |
| 34 | - **Batch Processing**: Efficient handling of large datasets |
| 35 | - **Error Recovery**: Graceful handling of upload failures and conflicts |
| 36 | |
| 37 | # Usage Instructions |
| 38 | |
| 39 | The skill includes a Python script `scripts/dataset_manager.py` to perform operations. |
| 40 | |
| 41 | ### Prerequisites |
| 42 | - `huggingface_hub` library must be installed via `uv add huggingface_hub` |
| 43 | - `HF_TOKEN` environment variable must be set with a Write-access token |
| 44 | - Activate virtual environment: `source .venv/bin/activate` |
| 45 | |
| 46 | ### Recommended Workflow |
| 47 | |
| 48 | **1. Discovery (Use HF MCP Server):** |
| 49 | ```python |
| 50 | # Use HF MCP tools to find existing datasets |
| 51 | search_datasets("conversational AI training") |
| 52 | get_dataset_details("username/dataset-name") |
| 53 | ``` |
| 54 | |
| 55 | **2. Creation (Use This Skill):** |
| 56 | ```bash |
| 57 | # Initialize new dataset |
| 58 | python scripts/dataset_manager.py init --repo_id "your-username/dataset-name" [--private] |
| 59 | |
| 60 | # Configure with detailed system prompt |
| 61 | python scripts/dataset_manager.py config --repo_id "your-username/dataset-name" --system_prompt "$(cat system_prompt.txt)" |
| 62 | ``` |
| 63 | |
| 64 | **3. Content Management (Use This Skill):** |
| 65 | ```bash |
| 66 | # Quick setup with any template |
| 67 | python scripts/dataset_manager.py quick_setup \ |
| 68 | --repo_id "your-username/dataset-name" \ |
| 69 | --template classification |
| 70 | |
| 71 | # Add data with template validation |
| 72 | python scripts/dataset_manager.py add_rows \ |
| 73 | --repo_id "your-username/dataset-name" \ |
| 74 | --template qa \ |
| 75 | --rows_json "$(cat your_qa_data.json)" |
| 76 | ``` |
| 77 | |
| 78 | ### Template-Based Data Structures |
| 79 | |
| 80 | **1. Chat Template (`--template chat`)** |
| 81 | ```json |
| 82 | { |
| 83 | "messages": [ |
| 84 | {"role": "user", "content": "Natural user request"}, |
| 85 | {"role": "assistant", "content": "Response with tool usage"}, |
| 86 | {"role": "tool", "content": "Tool response", "tool_call_id": "call_123"} |
| 87 | ], |
| 88 | "scenario": "Description of use case", |
| 89 | "complexity": "simple|intermediate|advanced" |
| 90 | } |
| 91 | ``` |
| 92 | |
| 93 | **2. Classification Template (`--template classification`)** |
| 94 | ```json |
| 95 | { |
| 96 | "text": "Input text to be classified", |
| 97 | "label": "classification_label", |
| 98 | "confidence": 0.95, |
| 99 | "metadata": {"domain": "technology", "language": "en"} |
| 100 | } |
| 101 | ``` |
| 102 | |
| 103 | **3. QA Template (`--template qa`)** |
| 104 | ```json |
| 105 | { |
| 106 | "question": "What is the question being asked?", |
| 107 | "answer": "The complete answer", |
| 108 | "context": "Additional context if needed", |
| 109 | "answer_type": "factual|explanatory|opinion", |
| 110 | "difficulty": "easy|medium|hard" |
| 111 | } |
| 112 | ``` |
| 113 | |
| 114 | **4. Completion Template (`--template completion`)** |
| 115 | ```json |
| 116 | { |
| 117 | "prompt": "The beginning text or context", |
| 118 | "completion": "The expected continuation", |
| 119 | "domain": "code|creative|technical|conversational", |
| 120 | "style": "description of writing style" |
| 121 | } |
| 122 | ``` |
| 123 | |
| 124 | **5. Tabular Template (`--template tabular`)** |
| 125 | ```json |
| 126 | { |
| 127 | "columns": [ |
| 128 | {"name": "feature1", "type": "numeric", "description": "First feature"}, |
| 129 | {"name": "target", "type": "categorical", "description": "Target variable"} |
| 130 | ], |
| 131 | "data": [ |
| 132 | {"feature1": 123, "target": "class_a"}, |
| 133 | {"feature1": 456, "target": "class_b"} |
| 134 | ] |
| 135 | } |
| 136 | ``` |
| 137 | |
| 138 | ### Advanced System Prompt Template |
| 139 | |
| 140 | For high-quality training data generation: |
| 141 | ```text |
| 142 | You are an AI assistant expert at using MCP tools effectively. |
| 143 | |
| 144 | ## MCP SERVER DEFINITIONS |
| 145 | [Define available servers and tools] |
| 146 | |
| 147 | ## TRAINING EXAMPLE STRUCTURE |
| 148 | [Specify exact JSO |