agentsclimarketplace

Tidy

Skill yiyaw-lab/agent-armor/tidy

Armor for coding agents: a playbook of Claude Code skills that make an agent prove its work, not describe it.

Install
npx -y skills add yiyaw-lab/agent-armor --skill tidy

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

The judgment layer for workspace hygiene — resolves the loose ends the hygiene hook SURFACES with the reasoning a bash reconciler cannot do: branch-supersession triage (merged-equivalent-via-squash vs real-unmerged vs stale-divergent vs sibling-superseded), push/PR decisions, worktree-removal calls, and PR-state awareness. The on-demand judgment sibling of the always-on workspace-reconcile hook (which auto-cleans only the provably-safe and surfaces the rest). Verify-before-delete; reversible-only; propose-on-approval; never deletes unmerged work or a peer's worktree. Modes: <repo> (triage + propose + act on approval) | audit (read-only report) | apply.

SKILL.md

6.8 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

The law this skill runs on: a loose end you can SEE but don't ACT on still hangs. The hygiene hook (~/.claude/scripts/workspace-reconcile.sh, fired on Stop + push) is the automatic layer — it auto-deletes only what is provably an ancestor of origin/main and SURFACES everything else, because a bash reconciler cannot safely tell a merged-via-squash branch (patch-id-equivalent but not a literal ancestor) from real unmerged work, a sibling-superseded subset from the superset, or ancient divergent junk from a forgotten-but-valuable branch. That discrimination needs git forensics + PR state + judgment. /tidy is where the surfaced judgment calls get made and resolved to zero. The hook surfaces; tidy decides and clears.

Three hard invariants:

  • Verify before you delete — every "merged/superseded" is a CLAIM, proven three ways. Before any deletion, prove the branch's work is in origin/main by (1) patch-id equivalence (git cherry origin/main <b> all -), (2) file-vs-main diff (git diff origin/main...<b> empty/already-applied), and (3) PR/log match (gh pr list --head <b> --state merged, or the squashed commit subject in git log origin/main). Two of three agreeing = MERGED-EQUIV. Unsure = KEEP and surface, never delete. (The KNOWN-DEAD gate, applied to branches.)
  • Reversible-only + propose-on-approval. Destructive acts (delete branch, remove worktree) touch ONLY merged-equivalent / superseded / stale targets and clean worktrees — all reflog/origin-recoverable. NEVER delete unmerged work, a branch checked out in any worktree, or a worktree that is dirty or a peer session's. Pushes / PRs / merges happen only on the user's explicit nod (the public-repo no-push contract holds); default writes nothing.
  • Resolve to zero. The surfaced set must end empty: every loose end exits as DELETED (safe), PUSHED/PR'd (real work, on approval), or KEPT-with-a-stated-reason. "Triaged but left hanging" is the failure this skill exists to kill.

/tidy <repo> (default — triage + propose, act on approval)

  1. Gather the surfaced set. Run bash ~/.claude/scripts/workspace-reconcile.sh <repo> (it already did the safe-auto deletes + listed the rest) and read git/PR state: branches not in origin/main, extra/dirty worktrees, uncommitted changes, open PRs (gh pr list). On a repo with many branches, fan the per-branch forensics to parallel subagents — only the verdicts return.
  2. Triage each branch (three-way proof above) into exactly one: MERGED-EQUIV (work in main → delete) · SIBLING-SUPERSEDED (a superset branch exists → delete the subset, name the superset) · STALE-DIVERGENT (ancient base, nothing unique → delete) · REAL-UNMERGED (genuine work not in main → push / open PR / keep) · ACTIVE (current branch, WIP, or a peer's → keep). Cite the one-line evidence per verdict.
  3. PR-aware: for pushed branches read gh pr view state — merged → delete local (remote auto-deletes if the repo setting is on) · open → note + leave (it's in review) · closed-unmerged → decide with the user.
  4. Worktrees: clean + on a merged/deletable branch → propose git worktree remove; dirty or a peer's → surface only. Prune orphaned registrations.
  5. Propose the plan — the delete list (each with its 3-way evidence), the push/PR list (each with a recommendation), the keep list (each with a reason) — then act ONLY on approval. On a PUBLIC churning repo the triage itself is often the deliverable: queue the recipe, don't thrash branches a peer/EVOLVE loop is moving under you.

/tidy audit

Read-only. Emit the triage report (the same classification + evidence) and propose nothing, write nothing. The "what's hanging and why" snapshot — mirrors /redline sweep / /raze audit.

/tidy apply

Execute ONLY a plan approved in a prior triage. Re-verify merged-equivalence the instant before each delete (origin/main may have moved — peers, the EVOLVE loop). Safe deletes, worktree removals, and approved pushes only; one concern per action with explicit git add <path>; report what was cleared and what remains. A target that no longer verifies as merged-equivalent is dropped from the batch, not force-deleted.

Rules

  • Lane discipline. The hygiene HOOK (workspace-reconcile.sh) is the AUTOMATIC safe-auto + surface layer — do not re-implement its ancestor-merged deletes; /tidy adds only the merged-EQUIVALENT / superseded / stale / PR-state reasoning it cannot do. /nightshift owns the push→PR→Bugbot-converge loop (tidy proposes the push; nightshift or the user runs it). /redline is how this enforcement got installed; the CLAUDE.md "Definition of Done" is the policy tidy enforces. A recurring hygiene gap → /redline; a one-off → just resolve it here.
  • Verify-before-delete, default KEEP. Three-way proof or it stays. A confident wrong delete of unmerged work is the most expensive outcome — reflog buys ~90 days, but don't lean on it.
  • Peer & public safety. Never delete a branch checked out in a worktree, never remove a dirty/foreign worktree, never push/merge a public repo without the explicit ask. Re-fetch and diff origin/main before treating anything as merged (convergence: your branch may already be in main via a peer's PR, or conflicting).
  • Honesty metric. The grade is: surfaced loose ends that reached a terminal state (deleted / pushed / kept-with-reason) ÷ total surfaced. A perpetually non-empty surfaced set means tidy is being run but not resolving — escalate the recurring class to /redline so the hook prevents it instead of re-surfacing it.

Pipeline placement: the hygiene hook auto-cleans the provably-safe + surfaces the judgment calls → /tidy triages and resolves them to zero (delete-safe / push-real / keep-with-reason) → real unmerged work hands to /nightshift (push → PR → Bugbot-converge) or to you. tidy is the bridge from "surfaced" to "resolved"; it judges and clears, it does not auto-enforce (that is the hook) or run the PR loop (that is nightshift).

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.