ctf-clean
Skill4 starsChanged 7 months agoMITView on GitHub
Safely GC stale agent cruft (worktrees, registrations, tmux windows, agent rows). Offers to PR un-merged work first; reports isolation clones. Usage: /ctf-clean [--dry-run]
- Commits and pushes
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- appstoreconnectSkill
- ab-test-store-listingSkill
- app-analyticsSkill
- app-launchSkill
- app-marketing-contextSkill
- app-store-featuredSkill
- aso-auditSkill
- competitor-analysisSkill
- keyword-researchSkill
- localizationSkill
- market-moversSkill
- market-pulseSkill
- metadata-optimizationSkill
- monetization-strategySkill
- retention-optimizationSkill
- review-managementSkill
- screenshot-optimizationSkill
- ua-campaignSkill
- docs-lookupSkill
- efnpmSkill
- isolate-workspaceSkill
- list-prsSkill
- opibSkill
- readable-ultraSkill
- refactorSkill
- reviewer-ultraSkill
- summSkill
- team-leadSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Safety invariant: only cruft tied to a done task is ever touched.
- Very specific: line 20
Run the sweeper. If the user passed --dry-run, pass it through, print the output, and STOP — touch nothing else.
- Distinctive: line 53
Never deletes or modifies isolation clones.
- Very specific: line 54
Never deletes agents rows (the sweeper only resets orphaned running rows to cancelled).
- Distinctive: line 56
Never touches anything tied to a non-terminal task.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
ctf-clean — agent workspace janitor
Reclaim stale agent cruft from the task framework. Auto-removes only worktrees
whose task is done/merged with no real uncommitted work; offers to PR un-merged
work before removing it; reports (never deletes) /isolate clones.
Safety invariant: only cruft tied to a done task is ever touched. Anything
tied to todo/in-progress/in-review is left alone — that's agent-watcher's
job, not this skill's.
Steps
- Run the sweeper. If the user passed
--dry-run, pass it through, print the output, and STOP — touch nothing else.scripts/agent-clean ${ARGUMENTS} - Show the summary block (worktrees removed + GB reclaimed, registrations pruned, tmux windows killed, agent rows reset).
- Parse the
ATTENTIONlines (tab-separated:ATTENTION <task_id> <branch> <status> <why>). These are un-merged / active worktrees that were NOT removed. For each whosewhycontains "un-merged" (skip ones marked "active task"), offer three choices:- (a) PR + remove — open a PR from the branch, then remove the worktree:
Resolvegit -C <project.local_path> push -u origin task-<id> gh pr create --repo <org/repo> --head task-<id> --title "<task title>" --body "<bullet summary>" git -C <project.local_path> worktree remove --force <framework_root>/.workspaces/agent-<id><project.local_path>and<org/repo>fromtasks/projects;<framework_root>is the claude-task-framework repo root (wherescripts/agent-cleanlives) — the worktree's absolute path, since it's registered to the project repo but lives under the framework's.workspaces/. Title + bullets follow the repo's PR conventions; if the project's org has Jira/Discord configured, update them per the Autonomy rules. - (b) keep — leave it untouched.
- (c) force-delete —
git -C <project.local_path> worktree remove --force <framework_root>/.workspaces/agent-<id>without a PR. Worktrees marked "active task" are reported only — never offer to remove them.
- (a) PR + remove — open a PR from the branch, then remove the worktree:
- Print the
ISOLATIONlines verbatim (tab-separated:ISOLATION <path> <size> <git summary>). These are user isolation clones — report only, never act on them.
Boundaries
- Never deletes or modifies isolation clones.
- Never deletes
agentsrows (the sweeper only resets orphanedrunningrows tocancelled). - Never touches anything tied to a non-terminal task.
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
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.

