agentleFS
yiyaw-labyiyaw-lab/agent-armor/tidy/SKILL.md

tidy

Skill1 starsChanged 5 months agoMITView on GitHub

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.

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use map, architect and 4 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.
  • AWSSkill

    map

    Map verified service capabilities against customer-provided control framework and threat model. Produces mapping-results.json, controls-catalog.md, and framework-mapping.md. Supports pluggable frameworks: CCMv4, NIST 800-53, CIS Benchmarks, ISO 27001, etc. Split into 4 focused sub-skills for better accuracy; this skill orchestrates them.

    Also in 3 projects that use this

  • Harut8Skill

    architect

    Also in 3 projects that use this

  • AWSSkill

    retro

    Conduct a retrospective on a coding session.

    Also in 4 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    verify

    End-to-end app testing pipeline for browser-based web apps on cloud browsers via Azure Playwright Workspaces: verify the live app, author tests for working flows, heal failing tests, then re-run with video and produce one consolidated report. Three phases (app verification, test authoring, test healing) plus a scoped final sanity run; each phase emits a sub-report. Use when asked to "verify my app", "make sure my app works and has good test coverage", "do a full QA pass", "add tests where I'm missing coverage", "fix failing tests and add new ones", "smoke test before deploy", "QA my deployment", or any combined verify-and-test ask. Requires Azure CLI (`az login`) and a Playwright Workspace resource ID — bootstraps configs on first invocation. Browser-based web apps with Playwright only — not for unit/API tests, native mobile/desktop, load/perf, or full accessibility audits.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read-only. Emit the triage report (the same classification + evidence) and propose nothing, write nothing.

    line 22

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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).

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.