hf-sync
Skill4 starsChanged 33 days agoMITView on GitHub
Mirror a research repo's graph.jsonld to its Hugging Face dataset as graph.jsonl. Use after the GitHub release step of release-doi, or to resync the dataset.
- Commits and pushes
In this repository51 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- agent-sendSkill
- agent-stocktakeSkill
- author-calibrated-evalSkill
- authorship-strategySkill
- collect-contextSkill
- context-syncSkill
- decision-historySkill
- detail-loopSkill
- generation-auditSkill
- harness-boundarySkill
- harness-stocktakeSkill
- harness-syncSkill
- headline-craftSkill
- hook-stocktakeSkill
- implementation-chainSkill
- jev-judgment-designSkill
- jsonld-knowledge-graphSkill
- learn-evalSkill
- llm-as-judgeSkill
- llms-txt-writerSkill
- mono-figureSkill
- persona-read-loopSkill
- plugin-directory-submitSkill
- prompt-perturbSkill
- prose-translationSkill
- public-commentSkill
- readme-writerSkill
- release-doiSkill
- repair-disciplineSkill
- repo-asset-stocktakeSkill
- review-to-lintSkill
- rfc-writerSkill
- rules-distillSkill
- rules-stocktakeSkill
- search-firstSkill
- session-judgment-miningSkill
- skill-complySkill
- skill-healthSkill
- skill-stocktakeSkill
- skill-writerSkill
- social-postSkill
- spawn-sessionSkill
- task-stocktakeSkill
- task-triageSkill
- verify-bootstrapSkill
- widen-the-askSkill
- wiki-harvestSkill
- wiki-querySkill
- x-draftSkill
The file
Files
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 が存在しない)
Execution
script のパスは ${CLAUDE_SKILL_DIR}(この SKILL.md のあるディレクトリ)から始まる:
bash "${CLAUDE_SKILL_DIR}/sync.sh" $ARGUMENTS$ARGUMENTS は HF dataset の repo ID(例: Shimo4228/agent-knowledge-cycle)。
cwd 制約: graph.jsonld が存在する project root で実行する。
What it does
- cwd の
graph.jsonldの structural sanity check(@graphが array で non-empty) - Source の
graph.jsonldを HF clone dir ($HF_CLONE_BASE/<dataset>/, default~/MyAI_Lab/hf-datasets/<dataset>/) にコピー - HF clone 側で
jq -c '.["@graph"][]' graph.jsonld > graph.jsonlを生成(HF Dataset Viewer 用 1 node 1 行 flatten) hf upload <Owner/dataset> <hf-clone>/graph.jsonld graph.jsonld --repo-type datasethf upload <Owner/dataset> <hf-clone>/graph.jsonl graph.jsonl --repo-type dataset- Success log + HF URL を表示
Source repo は汚さない: graph.jsonl は HF clone 側でだけ生成・存在し、source の git tree には残らない。
HF 側の README.md(dataset card)はこの sync の対象外。HF 用に customize されている(sibling dataset への link、mirror notice 等)ので、文面を変えるときは手動で hf upload <Owner/dataset> <hf-clone>/README.md README.md --repo-type dataset。
Auth は ~/.cache/huggingface/token(hf auth login で保存されたもの)を hf CLI が自動で読む。
Repo mapping
各 project の GitHub repo と HF dataset の対応は project ごとに違う。Skill 本体には embed しない(portability 保持)。Mapping は project の CLAUDE.md または同等の場所に記録しておき、起動時にコピペで引数に渡す。
shimo4228 系の現行 mapping は ~/MyAI_Lab/shimo4228/CLAUDE.md の "HF Datasets mirror" section を参照。
新規 project で記録を起こすときの format:
| GitHub repo | HF dataset |
|---|---|
| `owner/project-a` | `Owner/project-a` |
| `owner/hub` | `Owner/research-program-hub` |Related skills
jsonld-knowledge-graph—graph.jsonldの 設計 layer。本 skill はその operational mirror に対応release-doi— Zenodo DOI release flow。Phase 4 末尾で本 skill を呼ぶ
Failure modes
graph.jsonldnot found in cwd → project root に移動してから起動- HF clone dir not found → staging dir(
$HF_CLONE_BASE/<dataset>/、HF 側の README.md と過去 snapshot の置き場)を作る。HF 側が空ならmkdir -p $HF_CLONE_BASE/<dataset>/、既存ファイルがあればhf download <Owner/dataset> --repo-type dataset --local-dir <hf-clone>で初期 sync @graphnot array / empty →graph.jsonldの構造を見直す(jsonld-knowledge-graphskill 参照)hf upload401 / 403(未 login、または token が write scope を持たない)→hf auth whoamiで token 確認。write scope を持つ token を HF settings で発行しhf auth loginで入れ直す- HF dataset repo が存在しない (404)(dataset 未作成の project)→ 先に
hf repo create <Owner/dataset> --repo-type datasetで repo を作る
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

