← ClaudeAtlas

hf-synclisted

Hugging Face Datasets mirror sync for graph.jsonld-bearing research repos. `<Owner/dataset>` を引数に取り、cwd の graph.jsonld を flatten して graph.jsonl と一緒に HF dataset へ upload する。`release-doi` Phase 4 末尾の `gh release create` 後、または ad-hoc resync で起動する(tag push は webhook を発火させないので契機にしない)。Local の `hf auth login` token を使うので GitHub Actions / CI auth は不要。
shimo4228/claude-harness · ★ 3 · AI & Automation · score 79
Install: claude install-skill shimo4228/claude-harness
# hf-sync — Local HF Dataset Mirror Sync `graph.jsonld` を持つ research repo の HF dataset mirror を、手元から 1 コマンドで同期する skill。`jsonld-knowledge-graph` で encode した graph を HF Datasets 上の mirror に反映する operational layer。 ## When to use - `release-doi` の Phase 4 末尾、`gh release create` 後の HF mirror 反映 - Graph に手を加えた直後の ad-hoc resync(release を切らずに HF だけ更新したい) - HF token を rotate した後の動作確認 ## When NOT to use - `graph.jsonld` を持たない repo(HF mirror が存在しない) - HF dataset 自体がまだ作成されていない project(先に `hf repo create <Owner/dataset> --repo-type dataset` で repo を作る) - HF clone dir (`$HF_CLONE_BASE/<dataset>/`) が存在しない(先に `mkdir -p ~/MyAI_Lab/hf-datasets/<dataset>` で staging dir を作る。HF 側の README.md と過去 snapshot がここに置かれる) - `hf auth login` していない / token が write scope を持たない(先に `hf auth login` で token を入れ直す) ## Execution ``` bash ~/.claude/skills/hf-sync/sync.sh $ARGUMENTS ``` `$ARGUMENTS` は HF dataset の repo ID(例: `Shimo4228/agent-knowledge-cycle`)。 cwd 制約: `graph.jsonld` が存在する project root で実行する。 ## What it does 1. cwd の `graph.jsonld` の structural sanity check(`@graph` が array で non-empty) 2. Source の `graph.jsonld` を HF clone dir (`$HF_CLONE_BASE/<dataset>/`, default `~/MyAI_Lab/hf-datasets/<dataset>/`) にコピー 3. HF clone 側で `jq -c '.["@graph"][]' graph.jsonld > graph.jsonl` を生成(HF Dataset Viewer 用 1 node 1 行 flatten) 4. `hf upload <Owner/dataset> <hf-clone>/graph.jsonld graph.jsonld --repo-type dataset` 5. `hf upload <Owner/dataset> <hf-clone>/graph.jsonl graph.jsonl --repo-type dataset` 6. Su