Skip to content
Back to skills

Sweep

ASecurity

On-demand repo-wide reconciliation (not a task close-out): run harness_lint and fix ERRORs → migrate old layouts to recovery surface contract v2 → reconciliation checklist for what the lint cannot see → six-bucket classification → mechanical items auto-fixed, ambiguous items listed with evidence for human adjudication → report. Triggers: sweep, take stock, big cleanup, project reconciliation (盘点, 大扫除, 项目对账).

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 24, 2026
ai-agentspythongogitbackend

Works with

  • terminal

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add YSAA1/harness-workflow --skill sweep --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sweep?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sweep
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ysaa1-sweep/badge)](https://www.skillsdirectory.com/skills/ysaa1-sweep)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sweep
description: "On-demand repo-wide reconciliation (not a task close-out): run harness_lint and fix ERRORs → migrate old layouts to recovery surface contract v2 → reconciliation checklist for what the lint cannot see → six-bucket classification → mechanical items auto-fixed, ambiguous items listed with evidence for human adjudication → report. Triggers: sweep, take stock, big cleanup, project reconciliation (盘点, 大扫除, 项目对账)."
---

# Sweep

Repo-wide reconciliation: bring task artifacts, recovery-surface state, and repository leftovers into a single ledger. Detection relies on the lint and the checklist, conviction relies on evidence, and ambiguous items go to human adjudication.

This skill is the on-demand entry for low-frequency global reconciliation; it does not do task close-out (close-out goes to `cleanup`). The recovery surface's format and write rules follow `../writing-for-agents/references/recovery_surface_policy.md` (contract v2), and `harness_lint.py` checks the format mechanically; the checklist in this file covers only what the lint cannot see (track status versus reality, orphan documents, untracked leftovers). When the rules at the source operate normally, this skill most often ends with zero modifications.

## Process

1. **Probe the recovery surface and run the lint (measured, not assumed)**: inventory the actual file set of `.harness/`. Present → run `python3 scripts/harness_lint.py .` (or `python` where `python3` is unavailable); when the project lacks that script, use harness-builder's own `../harness-builder/scripts/harness_lint.py`; with neither, check the contract item by item by hand. Every ERROR must be fixed this round. No `.harness/`, or the project uses a tracker/existing backend → degrade to scanning only task-artifact orphans and untracked leftovers, explicitly declaring "the `.harness` state surface is missing" (for tracker/existing the recovery surface is the tracker itself, which is not a case of missing), and do not fabricate state criteria (a third-party project may never have created `.harness`).
2. **Migrate the old layout**: when the lint reports old files such as `work_index.md`, `state.md`, `*-state.md`, `progress.md`, or `decisions.md`, migrate them to `index.md` + `tracks/<id>.md` + `lessons.md` per the contract's "Migrating the old layout" section. Closed old rows are not migrated, just deleted (history lives in git); run logs and historical evidence in old snapshots are not carried into track files — keep only current facts and distill non-obvious lessons into `lessons.md`; date-journal lessons are regrouped by topic. Before deleting old files, confirm git tracks them; after migrating, rerun the lint until it reports zero ERRORs. Migration is a mechanical item, but when it is unclear whether an old row is still active or already closed, hand it to the user per step 5.
3. **Reconciliation checklist (what the lint does not check)**:
   - Status versus reality: whether each `index.md` row's status conflicts with actual progress; whether the file its `Entry:` points to exists (in the file system or within the trees registered by `git worktree list`; a hit in either counts as existing).
   - Reachability: root set = all outbound links of `index.md` and `tracks/*.md` + persistent entries (AGENTS.md, root README, docs/README-like files). For each task artifact (plans/specs/reports), `grep -F` its basename across all files in the root set; zero mentions = orphan candidate; basename matching guards against bare-filename false positives.
   - untracked: listed via `git status --porcelain`, already-ignored entries removed via `git check-ignore -v`, grouped by directory/theme.
4. **Six-bucket classification**:
   - **① Task-artifact orphans**: convict tracked ones via triple-evidence conviction — zero mentions in the root set + `git log --follow` origin tracing + same-directory cross-references; spec/plan paired artifacts (shared slug) are adjudicated as a group, preventing deleting a spec while leaving its plan; reports-type items with "zero references + README declared non-authoritative" can be charged directly. Self-registered-deliverable guard: research logs (header carries Track self-registration, terminal state written) and review reports (landed in `docs/reviews/`, header carries an ownership declaration) are self-registered deliverables — zero references does not convict them directly; after triple-evidence conviction they are downgraded to needs-review for human adjudication, never auto-deleted.
   - **② Zombie blocked rows**: not only literally blocked — paused / awaiting-user-confirmation / blocked-by-policy and other equivalent forms are all filed, listing the freeze starting point and duration.
   - **③ Unclosed tracks**: any row whose status conflicts with actual progress/timeline qualifies; no online verification needed. Typical form: the track is finished or superseded by a later task (e.g., the GPU/directory it occupied has been taken over by a new task), yet its `index.md` row and `tracks/<id>.md` remain and its plan/Spec documents were never deleted.
   - **④ untracked leftovers**: never deleted; only list evidence + an either/or outlet (add a commit or add a .gitignore entry); directories with tracked precedent (e.g., artifacts/) default to commit candidates; directories containing registered worktrees are listed separately as high-risk — `git worktree remove` must happen before any disposition can be discussed; never directly ignore/delete.
   - **⑤ Archive directories** (docs/archive/ and the like): only inventoried and marked; their contents always go to needs-review for human adjudication, never into the deletable bucket.
   - **⑥ Recovery-surface writes overstepping their remit**: track lines stuffed with run logs or historical evidence → move them to `artifacts/` or the plan file, leaving only current facts in the track file; `lessons.md` overlong or kept as a dated journal (the lint warns), or the same rule copied several times → merge by topic, delete what is invalid.
5. **Disposition**: mechanical items (lint ERRORs, old-layout migration, deleting convicted orphans) are fixed automatically; ambiguous items (abandoned vs paused, where unfinished items go) list evidence for user adjudication — no adjudication, no deletion (conservative stop). Tracks in ③ confirmed as finished are closed per the contract's "close a track": in one commit, delete the row and the track file, distill lessons, delete the plan and Spec (ADRs are kept).
6. **Report**: report once the lint shows zero ERRORs; with no drift, end with zero modifications.

## False-positive guards (lessons from practice)

- Absence from the main tree ≠ convictable: the file an `Entry:` points to may live inside a registered worktree; orphan judgment goes by "zero mentions in referencing sources", not by "file missing".
- References to external paths such as /tmp rot but do not all perish; do not convict mechanically — treat them only as one dimension of evidence.
- Full-path exact matching misjudges bare-filename references as orphans (the file is actually referenced by relative path); slug matching lets spec/plan pairs sharing a slug pass each other — basename matching is right on both ends.

## Report format

- **Handled**: item + action + evidence summary (including the lint's ERROR count before and after).
- **needs-review**: reason (equivalent zombie form / unclosed track / high-risk worktree / archive directory).
- **Kept**: guard-hit items (multi in-degree, tracked precedent, active references).
- **Next-round candidates**: suspects newly exposed after this round's disposition (e.g., cascading orphans).

## Recommended next skill

- Reconciliation done: `cleanup` closes out this track; newly hit pitfalls are written down per the lessons format.
- What is found is a behavior bug rather than record drift: `diagnose`.

## Do not

- Do not delete untracked files (the only outlets are adding a commit or adding a .gitignore entry).
- Do not touch archive-directory contents or ADRs; do not do task close-out (that belongs to `cleanup`).
- Do not pursue clearing everything in one pass; split large repositories across multiple sessions.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.