/esso0428-skills:data-repo-gitignorefrom esso0428-skills
資料型 / ML repo 的 .gitignore 策略(資料類目錄各自的 .gitignore + root 全域副檔名排除 + git check-ignore 驗證)。在設定、檢查或修正含有資料、dataset、模型輸出、報表或大型二進位檔的 repo 的 .gitignore 時使用;新增資料目錄或會產出檔案的流程時,或使用者擔心大檔(npz、pt/pkl 模型、圖片、csv/xlsx 表格、VCF 等基因型檔)會被 git 收進去時也使用,即使沒有提到 gitignore。
Ships in esso0428-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
兩層防線:資料類目錄各自宣告自己保留什麼(per-directory .gitignore),root 用副檔名全域攔截大檔(不管檔案被放到哪裡)。最後用 git check-ignore 實測,結果不靠推理。
列出 repo 頂層目錄與大小(du -sh */),把目錄分成兩類:
.gitignore。src/、tests/、configs/、experiments/ 等。→ 只受 root 副檔名規則保護。同時記下每個資料類目錄「要進 git 的東西」:README.md、取檔腳本(*.sh)、要公開的子目錄說明等。
完成條件:每個頂層目錄都歸類,且資料類目錄都有一份「保留清單」。
.gitignore每個資料類目錄一份,第一行註解說明用途,接著 * 全擋,再逐一放行。打開目錄就看得到它保留什麼。
範本(datasets/.gitignore):
# datasets/:預設全部不進 git,只保留以下檔案(不要加 !*/,否則 git 會掃描每個子目錄)
*
!.gitignore
!README.md
常見變化:
# inputs/:只保留取檔腳本與說明(inputs/<物種>/ 由 <物種>.sh 重建)
*
!.gitignore
!README.md
!*.sh
# models/:訓練輸出不進 git(可重跑),只保留說明與 publish/ 的 README
*
!.gitignore
!README.md
!publish/
publish/*
!publish/README.md
要放行子目錄裡的檔案,必須三行一組:!sub/ → sub/* → !sub/<file>。原因:父目錄被排除時,git 不會進去,裡面的 ! 規則全部無效。
放行子目錄只寫明確名稱(如上面的 !publish/),通用的 !*/ 會讓每個子目錄都被重新納入,git 得掃完整棵樹,且子目錄內的檔案仍需另外處理。
.gitignoreroot 只放兩種東西:工具/環境規則(Python cache、venv、編輯器與 agent 目錄),以及全域副檔名排除。再對程式需要的設定檔做窄範圍放行。
# 模型與 run artifact(不論放在哪個目錄都不進 git)
*.pth
*.pt
*.joblib
*.pkl
*.pickle
*.onnx
# 陣列與二進位資料
*.npz
*.npy
*.parquet
*.feather
*.h5
*.hdf5
# 基因型原始檔與壓縮檔
*.vcf
*.vcf.gz
*.hmp
*.bed
*.bim
*.fam
*.gz
*.7z
*.tar
*.rar
# 資料類目錄各自用自己的 .gitignore
# 表格、報表、圖片與其他產出
*.csv
*.tsv
*.xlsx
*.xls
*.docx
*.pptx
*.pdf
*.log
*.jpg
*.jpeg
*.png
*.gif
*.svg
*.webp
*.txt
*.json
*.jsonc
*.zip
# 程式需要的設定檔(窄範圍放行)
!/configs/**/*.json
依 repo 調整副檔名清單與放行規則。*.txt、*.json 會吃掉 requirements.txt、package.json、tsconfig.json 這類必要檔,逐一加 !/<path> 放行,並在第 5 步的「必須追蹤」清單驗證。
為什麼需要全域副檔名:只寫目錄規則(如 /models/*/)的話,放錯位置的檔案會漏網,例如 publish/x.npz、models/publish/m.pt、experiments/<x>/x.npz。
git ls-files 找出符合新規則但已被追蹤的檔案(git ls-files -ci --exclude-standard),列給使用者,由人決定是否 git rm --cached。git status 0.017 s)。用 per-directory 檔是為了可讀性與就近宣告。建兩份清單,用 git check-ignore -q <path> 逐一測試(路徑不存在也能測):
publish/x.npz、publish/x.pt、models/publish/m.pt、experiments/<x>/x.npz、raw data 子目錄內的檔案。.gitignore、各 README、取檔腳本、config YAML/JSON、lockfile(uv.lock、requirements.txt 等)。for p in <必須被忽略的路徑...>; do git check-ignore -q "$p" || echo "LEAK: $p"; done
for p in <必須追蹤的路徑...>; do git check-ignore -q "$p" && echo "WRONGLY IGNORED: $p"; done
git status --short -uall | grep '^??' # 只能出現預期的新檔
git status --short -uall | awk '/^\?\?/{print $2}' | xargs -r du -h | sort -h | tail -5 # 最大的 untracked 檔
time git status >/dev/null
完成條件:兩個迴圈都沒有輸出、untracked 清單只有預期檔案、最大 untracked 檔不是資料檔、git status 在秒級以內。
本 skill 只修改 .gitignore 檔,不執行任何改變 git 狀態的指令(add、rm --cached、commit 等)。
.gitignore 清單與各自保留的檔案。git status 時間。What SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/acquiring-video-sources建立官方 YouTube 頻道/playlist inventory、收集 metadata 與字幕、下載已授權影片,並規劃失敗項目的 AGY fallback;不做內容解讀。/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./distilling-youtube-channel把一個 YouTube 頻道從 inventory 一路帶到有 provenance 的蒸餾前證據(字幕、ASR、AGY 補證、source chunks、語意審查、Wiki 與 coverage)。/executing-roadmap-plan按照既有 `ROADMAP.md` 計畫執行,並維持 checkbox、report 與 evidence 紀律。/llm-wiki把已驗證的逐字稿、候選原則與 coverage 紀錄編譯成可搜尋、可重建且保留 provenance 的 Markdown Wiki。/recovering-asr對沒有可用字幕、已驗證的本機影片執行可續跑、可追溯的本機 ASR,並記錄 READY/READY_PARTIAL/ASR_FAILED 狀態。npx claudepluginhub esso0428/skills --plugin esso0428-skillsOther plugins' skills for the same job