← ClaudeAtlas

project-card-cleanuplisted

Re-scope a project card CHAIN to its handoff role — 最高指導原則 + 實驗現狀紀錄 + 待辦 handoff — against an external authority layer (paper draft, .private/chapter-plan & evidence-map, or the axis card). Unlike project-card-merge (which FOLDS appends into the body), cleanup DISTILLS writing-phase appends, SUPERSEDES history pile-ups, and POINTERIZES content that now lives in the draft/plan/axis card, while preserving every experiment number, method record, figure, and card-link. Use when the user says 清理卡鏈 / cleanup 專案卡 / 卡鏈瘦身 / 讓卡回到指導原則 / handoff 化, typically during paper-writing periods when cards accumulate both cluster experiment appends and Mac-side planning appends. Consolidated (needs_merge=false) chains are VALID targets — this is a re-scoping, not a marker-driven merge.
SungFeng-Huang/research-cards · ★ 3 · AI & Automation · score 76
Install: claude install-skill SungFeng-Huang/research-cards
# Project Card Cleanup — re-scope a card chain to 指導原則 + handoff ## 與 project-card-merge 的分工 | | merge | cleanup(本 skill) | |---|---|---| | 觸發 | 鏈上有 📥/🔍/孤兒 markers | 使用者點名(consolidated 鏈也是合法對象) | | 動作 | fold appends 進正文 | 對照**參考文件層**重定位整條卡 | | 內容權威 | 卡自身的 📥 blocks | 稿件 + .private/ 規劃檔 + 軸卡(見下) | | 產出 | 一張整併卡 | 一張「指導原則+實驗現狀+待辦 handoff」卡 | 機制(chain dump / md5 lock / finalize_chain / cleanup_children)完全復用 merge 的 `merge_lib`;本 skill 的 `cleanup_lib` 只加薄層(見檔頭 docstring)。 merge 的 hard rules(下一步只放沒做的事、supersede 不重複、不丟 paper-grade 數字、card-link 與表格不自動搬運必須顯式重建)全數適用。 ```python import sys sys.path.insert(0, "<本 skill 的 base 目錄>") # skill 系統開頭給的路徑 import cleanup_lib as CL # CL.M = merge_lib, CL.M.L = rewrite_lib ``` ## Step 0 — 確認參考文件層與競態 1. **參考文件層**(pointerize 的合法性來源;至少一項存在,逐一向使用者確認路徑): - paper 稿件(如 Overleaf 專案 sections/ + main.tex + references.bib) - 規劃權威檔(`.private/chapter-plan-*.md`、`.private/outline-evidence-map-*.md`、`.private/lit-*.md`) - 軸卡(跨案卡:稿件狀態與待辦總表的家)——清理案卡時,軸卡是上游權威;清理軸卡時,上游是稿件+.private。 2. **競態防線**(同 merge):cluster 有進行中 campaign job/append 時,md5 lock 會擋 entry 覆寫、`cleanup_children(md5s=…)` 會放過變動的舊卡(留孤兒待下輪)—— 但 trash 窗口的殘餘競態仍在,**開跑前看 squeue 或跟使用者確認**;使用者明知 job running 仍指示清理時照做,靠 md5 防線兜底。 ## Step 1 — Scan + dump 落檔(省 context 的讀法) ```bash python3 ~/.claude/skills/research-cards/skills/project-card-merge/merge_lib.py <entryId> # scan ``` ```python CHAIN, MD5S, IMGS = CL.dump_chain(ENTRY_ID, SCRATCH_DIR) # ★ md5 基準在此定格 ``` - dump 檔落 scrat