agentleFS
YSAA1YSAA1/harness-workflow/skills/sweep/SKILL.md

sweep

Skill3 starsChanged 13 days agoMITView on GitHub

按需全仓对账(非任务收尾):跑 harness_lint 修 ERROR → 旧布局迁移到恢复面合同 v2 → 对账清单补 lint 不查的部分 → 六档分类 → 机械项自动修、模糊项列证据人裁 → 汇报。Triggers: sweep, 盘点, 大扫除, 项目对账.

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use incident, adr and 6 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.
  • JkudjoSkill

    incident

    Production incident response — structured triage, hypothesis tree, safe remediation, incident record

    Also in 3 projects that use this

  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 4 projects that use this

  • anombyte93Skill

    discover

    Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 5 projects that use this

  • VercelSkill

    deploy

    Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

The file

Files
SKILL.md

Sweep

全仓对账:把任务产物、恢复面状态与仓库遗留物对成一本账。检测靠 lint 和清单,定罪靠证据,模糊项交人裁。

本 skill 是低频全局对账的按需入口,不做任务收尾(收尾走 cleanup)。恢复面的格式与写入规则以 ../writing-for-agents/references/recovery_surface_policy.md(合同 v2)为准,格式由 harness_lint.py 机械检查;本文件的对账清单只补 lint 看不到的部分(轨道状态与实情、孤儿文档、untracked 遗留物)。源头规则正常运转时,本 skill 大多数时候零修改结束。

流程

  1. 探测恢复面并跑 lint(实测,不假设):清点 .harness/ 实际文件集。有 → 跑 python3 scripts/harness_lint.py .(没有 python3 时用 python);项目没有这个脚本时用 harness-builder 自带的 ../harness-builder/scripts/harness_lint.py,两者都没有就按合同逐条手查。ERROR 都是本轮必修项。无 .harness/ 或项目用 tracker/existing backend → 降级为只扫任务产物孤儿与 untracked 遗留物,显式声明“.harness 状态面缺失”(tracker/existing 的恢复面即其 tracker 本身,并非缺失),不虚构状态判据(第三方项目可能从没建过 .harness)。
  2. 旧布局迁移:lint 报出 work_index.md、state.md、*-state.md、progress.md、decisions.md 等旧文件时,按合同的「旧布局迁移」一节迁到 index.md + tracks/<id>.md + lessons.md。已关闭的旧行不迁,直接删(历史在 git 里);旧快照里的运行流水和历史证据不搬进 tracks 文件,只留当前事实,非显然经验蒸馏进 lessons.md;按日期记事的 lessons 改成按主题分组。删旧文件前确认它们已被 git 跟踪,迁移完再跑 lint 到零 ERROR。迁移是机械项,但某条旧行该算 active 还是已关闭说不清时,按第 5 步交用户裁决。
  3. 对账清单(lint 不查的部分):
    • 状态与实情:index.md 每行的状态是否与实际进度冲突;Entry: 指向的文件是否存在(文件系统或 git worktree list 注册树内,任一命中即算存在)。
    • 可达性:根集合=index.md 与 tracks/*.md 的全部出链 + 持久入口(AGENTS.md、根 README、docs/README 类)。任务产物(plans/specs/reports)逐个 grep -F basename 于根集合全部文件,零提及=孤儿候选;basename 匹配防裸文件名假阳。
    • untracked:git status --porcelain 列出,git check-ignore -v 剔除已忽略项,按目录/主题分组。
  4. 六档分类:
    • ① 任务产物孤儿:tracked 三重证据定罪——根集合零提及 + git log --follow 溯源 + 同目录交叉引用;spec/plan 成对产物(共享 slug)成组裁决,防删 spec 留 plan;reports 类"零引用 + README 声明非权威"可直接列罪。自足交付物守卫:研究日志(头带 Track 自登记、终态已写)与 review 报告(落 docs/reviews/、头带归属声明)是自带户口的交付物——零引用不直接列罪,走三重定罪后降 needs-review 人裁,不自动删。
    • ② 僵尸 blocked:不止字面 blocked,paused/待用户确认/blocked-by-policy 等价形态都入档,列冻结起点与时长。
    • ③ 未关的轨道:行状态与实际进度/时间线冲突即可列入,无需联网核验。典型形态:轨道已完成或被后续任务取代(如它占用的 GPU/目录已被新任务占用),但 index.md 行和 tracks/<id>.md 还在,计划/Spec 文档也没删。
    • ④ untracked 遗留物:一律不删,只列证据 + 二选一出口(补 commit 或补 .gitignore);有 tracked 先例的目录(如 artifacts/)默认 commit 候选;内含注册 worktree 的目录单列高危——须先 git worktree remove 才能谈处置,绝不直接 ignore/删。
    • ⑤ 归档目录(docs/archive/ 类):仅清点标记,内容一律 needs-review 待人裁,不入可删档。
    • ⑥ 恢复面写超本分:tracks 行塞运行流水或历史证据 → 移到 artifacts/ 或计划文件,tracks 只留当前事实;lessons.md 过长或按日期记事(lint 给 WARN),或同一规则多份副本 → 按主题合并、失效即删。
  5. 处置:机械项(lint ERROR、旧布局迁移、删已定罪孤儿)自动修;模糊项(abandoned vs paused、未了事项去向)列证据请用户裁决,不裁决不删除(保守停)。③ 里确认已结束的轨道按合同「关轨道」处理,同一 commit 内删行、删 tracks 文件、蒸馏 lessons、删计划与 Spec(ADR 不删)。
  6. 汇报:lint 零 ERROR 后汇报;无漂移可零修改结束。

假阳守卫(实测教训)

  • 主树文件缺席≠可定罪:Entry: 指向的文件可能活在注册 worktree 内;孤儿判定以"引用源零提及"为准,不以"文件缺失"为准。
  • /tmp 等外部路径引用会腐烂但非全部灭失,不宜机械定罪,只作证据维度。
  • 全路径精确匹配会把裸文件名引用误判孤儿(文件实际以相对路径被引用);slug 匹配会把共享 slug 的 spec/plan 互相放行——basename 匹配两头都对。

汇报格式

  • 已处理:项 + 动作 + 证据摘要(含 lint 前后 ERROR 数)。
  • needs-review:原因(等价僵尸形态 / 未关的轨道 / 高危 worktree / 归档目录)。
  • 保留:守卫命中项(多入边、tracked 先例、活跃引用)。
  • 下一轮候选:本轮处置后新暴露的嫌疑(如级联孤儿)。

Recommended next skill

  • 对账完成:cleanup 收尾本轨道;新踩的坑按 lessons 落笔。
  • 发现的是行为 bug 而非记录漂移:diagnose。

不做

  • 不删 untracked 文件(出口只有补 commit 或补 .gitignore)。
  • 不动归档目录内容与 ADR;不做任务收尾(归 cleanup)。
  • 不追求一次清零;大仓分多次会话。

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.