Skip to content
Back to skills

Hf Upload

ASecurity

Upload primitives for HuggingFace Soul persistence - file, folder, snapshot, JSONL append, and dataset card management with exponential backoff. Use when persisting agent learnings, snapshots, or semantic caches to HuggingFace.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 6, 2026
businesspythonbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add richfrem/Project_Sanctuary --skill hf-upload --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hf Upload?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hf Upload
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-hf-upload/badge)](https://www.skillsdirectory.com/skills/richfrem-hf-upload)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hf-upload
description: "Upload primitives for HuggingFace Soul persistence - file, folder, snapshot, JSONL append, and dataset card management with exponential backoff. Use when persisting agent learnings, snapshots, or semantic caches to HuggingFace."
allowed-tools: Bash, Read
---

# HuggingFace Upload Primitives

**Status:** Active
**Author:** Richard Fremmerlid
**Domain:** HuggingFace Integration
**Depends on:** `hf-init` (credentials must be configured first)

## Purpose

Provides consolidated upload operations for all HF-consuming plugins (Primary Agent, Orchestrator, etc.). All uploads include exponential backoff for rate-limit handling.

## Available Operations

| Function | Description | Remote Path |
|---|---|---|
| `upload_file()` | Upload a single file | Custom path |
| `upload_folder()` | Upload an entire directory | Custom prefix |
| `upload_soul_snapshot()` | Upload a sealed learning snapshot | `lineage/seal_<timestamp>_*.md` |
| `upload_semantic_cache()` | Upload RLM semantic cache | `data/rlm_summary_cache.json` |
| `append_to_jsonl()` | Append records to soul traces | `data/soul_traces.jsonl` |
| `ensure_dataset_structure()` | Create ADR 081 folders | `lineage/`, `data/`, `metadata/` |
| `ensure_dataset_card()` | Create/verify tagged README.md | `README.md` |

## Usage

### From Python (as a library)
```python
from hf_upload import upload_file, upload_soul_snapshot, append_to_jsonl

# Upload a single file
result = await upload_file(Path("my_file.md"), "lineage/my_file.md")

# Upload a sealed learning snapshot
result = await upload_soul_snapshot(Path("snapshot.md"), valence=-0.5)

# Append records to soul_traces.jsonl
result = await append_to_jsonl([{"type": "learning", "content": "..."}])
```

### Prerequisites
1. Run `hf-init` first to validate credentials and dataset structure
2. Requires `huggingface_hub` installed (`pip install huggingface_hub`)
3. Environment variables: `HUGGING_FACE_USERNAME`, `HUGGING_FACE_TOKEN`

## Error Handling

All operations return `HFUploadResult` with:
- `success: bool` — whether the upload succeeded
- `repo_url: str` — HuggingFace dataset URL
- `remote_path: str` — path within the dataset
- `error: str` — error message if failed

Rate-limited requests retry with exponential backoff (up to 5 attempts).

Files in this skill

  • SKILL.md2.3 KB
  • evals/evals.json1.8 KB
  • references/acceptance-criteria.md812 B
  • references/fallback-tree.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.