git push不等於上線。commit 完不等於收工。 這個 skill 處理的是 agentic coding 最少人談的那一段:怎麼收工。
一個 Claude Code skill。說一句「收工」,它跑完四條線: 壓縮記憶 → 清理分支 → 發布並驗證 → 寫明日第一步。
用 AI 寫 code 的人多半有一套「怎麼開工」的流程,卻沒有「怎麼收工」的。結果是:
- 記憶膨脹 —— 每次 session 都往記憶裡塞東西,半年後自己都不想讀
- 分支積灰 —— 十幾個分支躺著,不知道哪些已經併進去了
- 假上線 —— push 完就在報告裡寫「已完成」,但部署根本沒跑起來
- 隔天失憶 —— 開場前二十分鐘都在回想「我昨天做到哪」
這四件事都不難,難在每次都要記得做。所以把它編譯成一個字。
範圍是這次 session 碰到的,不是全量重掃(那太貴)。逐條套一張判準表:
| 留 | 砍(git 有歷程) |
|---|---|
| 目前結論 / 現況 | 推估歷程、追查過程 |
| 連線 / 環境真相 | 踩坑教訓(一次性 debug) |
| 工具用法 / 後台能力 | 程式碼疊代細節(PR#、commit、測試數) |
| 進度狀態 | 歷史決策過程 |
| 目的 / 未完成待辦 |
最容易做錯的一條:
⚠️ 連線/環境真相別跟踩坑一起砍。 有些條目掛著「踩坑」的外皮,核心其實是環境事實—— 協定走 http、API key 綁 IPv4 白名單、某個 env 必勾。 先把那句真相併進對應的連線檔,再砍原檔。
標籤不可信,一律查實況。 判準只有一個:
git rev-list --count origin/main..<branch>
# 0 ahead = 已收斂(squash / merge 都算),安全可刪ahead > 0 的不擅刪,但也不讓它默默積灰——列一張陳情表:
| 分支 | ahead | 最後 commit | 在幹嘛 |
|---|---|---|---|
feat/xxx |
3 | 12 天前 | … |
逼一個裁決:續做 / 併掉 / 棄單。 沒空裁就維持原狀,但每次收尾都會再列一次——擱置天數持續上升,本身就是提醒。
-
絕不
git add .—— 精準git add <path>,stage 後複查 -
秘密掃描(staged 內容,一行):
git diff --cached | grep -nE '(sk-[A-Za-z0-9_-]{16,}|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{20,}|AIza[A-Za-z0-9_-]{20,}|xox[baprs]-|-----BEGIN [A-Z ]*PRIVATE KEY)'
命中就停下人工確認——寧可誤報,不可漏放
-
子目錄自帶的
.gitignore是既定意圖,尊重它(踩過:某個資料遷移工具目錄有*排除鐵律,內含真實客戶資料衍生物) -
部署後驗證:等部署跑完,打健康檢查、確認新碼真的上去。 別信版號和時間戳——它們在建置時就寫死了,跟部署成不成功無關。
驗過才准寫「已上線」,否則寫「已 push、部署驗證未過」。
收尾最後一步,把下次的開場白寫進 MEMORY.md 頂部:
> ⏭️ 明日第一步(2026-09-03 收尾):跑正式站轉單主線驗真 LLM
寫「動作」不寫「狀態」:
- ✅ 「跑正式站轉單主線驗真 LLM」
- ❌ 「轉單系統待驗證」
MEMORY.md 每個 session 自動載入,所以這一行就是隔天的開場白。
沒有明確下一步就整行刪掉——別留過期指示誤導明天的自己。
git clone https://github.com/youllook/wrap-up.git ~/.claude/skills/wrap-upWindows (PowerShell):
git clone https://github.com/youllook/wrap-up.git "$env:USERPROFILE\.claude\skills\wrap-up"單一 SKILL.md,無相依套件。
收工
或「收尾」「wrap-up」「整理工作區」「清一下分支」。
收尾回報會給你四條線各一句現況、未合併分支陳情表、 「刻意保留的」清單(哪些分支留下、為何;哪些檔沒進版控、依據哪條決策), 以及明確二選一的發布狀態。
A wrap-up protocol for agentic coding. Most people have a routine for starting a session; almost nobody has one for ending it. Say "wrap up" and this runs four lines:
- Compress memory — only what this session touched, against a keep/burn table. The subtle rule: environment truths often disguise themselves as debugging war stories — extract the fact before you delete the entry.
- Prune branches — labels lie, check reality.
git rev-list --count origin/main..<branch>; 0 ahead means converged and safe to delete. Anything ahead gets listed in a standing table with its age, forcing a continue / merge / abandon call. - Publish and verify — never
git add ., scan staged content for secrets, and verify the deployment actually landed. Don't trust version strings or timestamps; they're baked at build time and say nothing about whether the deploy succeeded. - Write tomorrow's first step — one line at the top of
MEMORY.md, phrased as an action, not a state. It becomes the opening line of the next session.
The skill body is in Traditional Chinese. Install by cloning into ~/.claude/skills/.
MIT