agentleFS
PanQiWeiPanQiWei/pqw-skills/skills/cleanup/SKILL.md

cleanup

Skill1 starsChanged 8 days agoMITView on GitHub

交付期第 13 步,清理:每切片清一次不必留给下一切片的中间产物,如子代理工作树、分支、临时数据;一程交付后全盘清理,含临时目录下的汇报件,并出交付声明。切片收口完成、一程交付完毕,或人说「清理一下」时加载。切片进行中不加载。

74 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chips, react-query-best-practices and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • udecodeSkill

    chips

    Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    react-query-best-practices

    Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback anti-patterns in your code

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • Aetheria-Labs1Skill

    plan-page

    Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • +3 more from bibektimilsina00

The file

Files
SKILL.md

清理

位置:交付期第 13 步,每个切片一次,一程交付后一次。上一步 progress-artifacts,下一步 context-pack(下一个切片)、pass-the-baton(一程交付后收回)。顺序与例外见入口技能 single-session-dev-flow。

清理是交付的一部分。一程交付完毕的声明里有一句「清了什么」。

只有一个判断

清理只做一个判断:这个东西还要不要。不要的直接删,用 rm、git rm、git worktree remove、git branch -d;要留的原地留。

一步就够,因为留痕已经有了:Git 历史记着删掉的每个字节,系统临时目录的汇报件记着过程,架构与规格记着约束。打包、归档、复制备份是给没有留痕的东西准备的,这里的东西都有。判断完就删,删完在交付声明里写一句:汇报的是结果,所以动手之前不需要先汇报。文档只记事实,所以删之前文档照旧,删之后引用它的那一处(若有)改成新的去处。把文档改成「待删」「已删」再去删,是写一个马上就不存在的事实,还多出一处要同步的状态。

两个尺度

时机不要的,删要的,原地留
每个切片交付时下一切片用不到的中间产物:子代理的工作树、工作分支、临时数据、本切片的探路件下一切片要用的上下文包增量、已合回的代码、约束类文档、汇报件
一程完整交付后本程全部子代理工作树与分支、系统临时目录下 pqw-skills/<会话标识>/<一程标识>/ 整个子目录(含汇报件)、项目 tmp 里本程的过程材料(人看过的)、宿主里的定时任务已落到拥有者的约束类文档、已合入的代码、变更记录

怎么判断

  • 子代理的工作树与分支:已合回或已放弃,并且没有别的会话在用,才是不要的。树干净或分支已合并都不能证明可以强制删除;仍有执行者持有的树是要的。
  • 过程材料(spec、plan、整程包):人看过了就是不要的,直接删;人还没看就是要的,原地留,交付声明写路径。两种情形都不打包。
  • 汇报件:用完即弃。汇报件是这一程的材料,随清理删。里面属于约束的(架构与领域边界、规格的六样、能写成检查或证明的)在交付前落到它的拥有者;其余不搬。
  • 验收要用的证据原件(命令输出、日志、测量结果):接受者在项目接入点「验收处」读证据(例如工单评论;没填就是本程目录)。证据的摘要与关键行已经贴到验收处,原件才是不要的;还没贴的先贴,再删。接受者读不到的证据等于没有,删了就只能重跑。
  • 删除不可逆,所以判断在删之前做完。判断完的东西要么删掉要么留着,没有「待删」这个状态。

脚本

scripts/cleanup.mjs 做 Git 工作树、分支和临时目录三类,按名字前缀匹配本程的子代理产物。缺省只列不删,列出来是让你做「还要不要」的判断,--apply 才删。它自动跳过主工作树、当前分支、有未提交改动的工作树、没合进当前 HEAD 的分支,并写明原因。每条独立执行,中断不留半删状态。

node <技能目录>/scripts/cleanup.mjs --scope slice --prefix <前缀>            # 切片级,只列
node <技能目录>/scripts/cleanup.mjs --scope slice --prefix <前缀> --apply    # 切片级,删
node <技能目录>/scripts/cleanup.mjs --scope run --prefix <前缀> --project-tmp <目录> --apply   # 一程级

项目专有的清理项从项目接入点取,脚本不管。宿主里的定时任务由主代理按 one-lesson-rule 自己删。

待人验收

交付声明有一节「待人验收」,必填:每行一样交付的行为、人怎么上手验、预计要多久,没有要验的写「无」。代理做出来、人还没验过的东西是没验收的库存,看着是进度,其实是风险;这一节让人回来时知道先验什么、要多久。交付声明就是交回的东西,人回到设计会话收回时,先看它勾完没有;设计与交付分在两个会话时,它照跨会话协调的约定交回,例如在这一程的工单上评论,第一行写「## 交付声明」。一程的承诺、大小与交出收回归交接期,由设计会话做,人在场。做法加载技能 pass-the-baton。看到人这一侧的风险就说一次:提醒、依据、建议、选择。做法加载技能 candid-friend。

产出

交付声明另有一行「自己定的读法」:原文没说清、自己定了的地方逐条列,没有写「无」。怎样定、怎样列,加载技能 think-unknowns。

切片级:收口记录里一句「清了什么」,没有可清的就写没有。一程级:填交付声明,贴进最后一份汇报件。

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.