agentleFS
Gord1yGord1y/countersign-skills/skills/writeups-cleanup/SKILL.md

writeups-cleanup

Skill2 starsChanged 38 days agoMITView on GitHub

Propose what in a repo's writeups/ folder can go (merged and released changes, superseded releases, scratch) and delete only what the user approves. Run with /writeups-cleanup.

  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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. Distinctive:

    Ask once: delete everything proposed, pick paths, or nothing.

    line 85
  2. Distinctive:

    Delete exactly the approved paths, each named in full, never a glob:

    line 88
  3. Very specific:

    If local.md exists next to this file, read it.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Writeups cleanup

writeups/ collects every draft the skills write: PR bodies, QA evidence, walkthroughs, release drafts and briefs. It is gitignored, so nothing removes it, and a deletion cannot be undone. This skill finds what has done its job, proposes it with the evidence, and deletes only the paths the user approves.

Repo facts

This skill needs the facts below. Look each one up in the repo's CLAUDE.md (or AGENTS.md) and the files it imports or points to (of a repo-facts file, only this skill's section: sed -n '/^## writeups-cleanup$/,/^## /p' <file>), then in local.md next to this file. If neither has it, ask the user once, then suggest the one line to add to CLAUDE.md so the next run finds it.

FactExample
Where drafts goa gitignored writeups/ folder in the main checkout
The ref that holds what has been releasedorigin/main, which moves only at releases
How releases are taggedv<semver> tags; or no tags, and the release notes index lists each version

The layout and its rules

writeups/
  changes/<date>-<branch-or-run>/   pr.md, walkthrough.md or walkthrough.html, shots/, qa/
  releases/<version>/               promotion-staging.md, promotion-main.md, walkthrough.html, shots/
  briefs/<date>-<topic>.md          asks for other repos or teams
  scratch/                          delete any time
EntryProposed for deletion when
changes/<x>/its PR is merged and the merge commit is in the released ref
releases/<version>/a later version has shipped
scratch/always
briefs/<file>never by rule: listed with its age, for the user to judge
anything outside the layoutnever by rule: listed as "outside the layout", with the place it would move to when its name makes that clear

Step 1: inventory, read-only

Resolve the folder from the main checkout, and work only inside it:

WRITEUPS="$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/writeups"
find "$WRITEUPS" -mindepth 1 -maxdepth 2 -exec du -sh {} +

Gather the evidence in as few calls as possible:

git fetch origin --tags
gh pr list --state all --limit 300 --json number,headRefName,state,mergedAt,mergeCommit
git tag --list 'v*' --sort=-v:refname

Match each changes/<date>-<x>/ to a PR by its head branch, written with / as -. A merge commit counts as released when git merge-base --is-ancestor <merge commit> <released ref> succeeds. A folder with no matching PR (a run on the default branch, a renamed branch) is listed with "no PR found" and never proposed.

Step 2: one proposal

One table, nothing deleted yet:

| Path | Size | Last changed | Evidence | Proposal |
| --- | --- | --- | --- | --- |
| changes/2026-09-12-feat-invoices/ | 4.1 MB | 2026-09-14 | PR #312 merged 2026-09-15, in origin/main | delete |
| releases/1.2.0/ | 9.8 MB | 2026-09-02 | v1.3.0 shipped | delete |
| changes/2026-09-30-fix-totals/ | 0.3 MB | 2026-09-30 | PR #331 open | keep |
| briefs/2026-08-20-backend-totals.md | 4 KB | 2026-08-20 | 44 days old | your call |

Then the total the proposed deletions free. State plainly that writeups/ is gitignored, so a deleted path is gone for good.

Step 3: delete only on a yes

Ask once: delete everything proposed, pick paths, or nothing; and the same for each "your call" row the user wants gone. A path the user did not approve stays, whatever the rules say.

Delete exactly the approved paths, each named in full, never a glob:

rm -rf -- "$WRITEUPS/changes/2026-09-12-feat-invoices"

Then report each deleted path and the space freed, and anything that failed. Never touch anything outside writeups/, never an entry whose PR is open, and never move a file without the same yes.

If local.md exists next to this file, read it; where it disagrees with this file, it wins.

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.