agentleFS
bookchaowalitbookchaowalit/platform-agent-skills/unused-file-cleanup/SKILL.md

unused-file-cleanup

Skill0 starsChanged 9 days agoApache-2.0View on GitHub

Find tracked files, scripts, and modules in the Solo Empire root repository that nothing references, verify each candidate, and propose or apply an approved, scoped cleanup. Use when asked to find or remove unused, dead, orphaned, or stale files (for example "หาไฟล์ที่ไม่ได้ใช้", "ลบไฟล์ที่ไม่ได้ใช้", "dead code", "orphan files").

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Very specific:

    Check scheduled or external callers: Taskfiles under infra/tasks/, .github/workflows/, cron/systemd/Task Scheduler definitions, Docker and …

    line 23
  2. Distinctive:

    Never delete without an explicit yes in chat for that set of files.

    line 47

≈ “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

Unused File Cleanup

Overview

task cleanup:unused runs a read-only scan that lists tracked files whose filename (or module stem for code) appears in no other tracked text file. The scan never deletes, moves, or stages anything. A candidate is only a lead: every removal needs verification and explicit approval.

Workflow

  • Run task cleanup:unused -- --kind code first (scripts and modules), then task cleanup:unused -- <path-prefix> for a focused area. Use --json when the result feeds another step.
  • Verify each candidate before classifying it:
    • rg -n "<stem>" across the repo, including dynamic forms (glob patterns, string-built paths, run-python3 wrappers, importlib, CLI names).
    • Check scheduled or external callers: Taskfiles under infra/tasks/, .github/workflows/, cron/systemd/Task Scheduler definitions, Docker and compose files, and package.json scripts.
    • git log --oneline -3 -- <path> for intent; a recent commit usually means work in progress.
  • Classify every candidate as keep, archive, or delete, with a one-line reason, and present the table to the user.
  • Apply only the rows the user approves: git rm <path> per file (never git add .), or git mv into infra/scripts/archive/one-off/ for archive. Update any doc or catalog that listed the file.
  • Run the checks for the touched area (task test, task typecheck, task docs:check), then commit only the scoped paths.

Decision rules

  • Referenced only by dynamic paths, a scheduler, or an external system → keep.
  • Product or content asset (catalog/, media/, client deliverables, templates, .docx) → keep; these are consumed by people, not code.
  • One-off fix or migration script already applied → archive or delete.
  • Duplicate of a newer file (*_v2, *-old, copy) → delete after confirming the newer file is the one referenced.
  • Last commit within 14 days → ask before any action.
  • Anything under data/, artifacts/, diary/, nested repositories, or generated sub-agent files → out of scope; the scan already excludes them.
  • Never delete without an explicit yes in chat for that set of files.

Resources

  • infra/scripts/utils/unused_files.py — the read-only scanner (contract solo-empire.unused-files.v1); run through task cleanup:unused.

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.