agentleFS
sasuketoriisasuketorii/rev_harness_public/.agents/skills/development-junk-cleanup/SKILL.md

development-junk-cleanup

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Use when the user asks to clean, prune, archive, inspect, or reduce development junk, stale harness artifacts, temporary run directories, or Codex/Claude MCP helper residue in Revharness. Routes to existing janitor, artifact-pruner, and MCP cleanup scripts with read-only defaults and no delete path.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Use this skill for periodic harness hygiene when the task is about stale .claude/tmp/ artifacts, old run directories, local cleanup …

    line 8
  2. Distinctive:

    Prefer read-only inventory, report, or dry-run commands first.

    line 14
  3. Distinctive:

    Do not create a new cleanup engine for this workflow.

    line 15
  4. Distinctive:

    Do not move release, lineage, acceptance, archive, source, test, docs, registry, or project identity authority.

    line 16
  5. Distinctive:

    Treat cleanup output as hygiene evidence only.

    line 17
  6. Distinctive:

    Use the existing dispatcher first:

    line 21
  7. Very specific:

    If any root is outside repo-local .claude/tmp, is a symlink, is missing, or is ambiguous, stop and report BLOCK.

    line 52
  8. Distinctive:

    If a candidate is git-tracked or referenced by active state, latest pointer, pinned baseline, release evidence, or lineage evidence, do not …

    line 53
  9. Distinctive:

    Before reporting the workflow as ready or reviewed, run the relevant subset:

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Development Junk Cleanup

Use this skill for periodic harness hygiene when the task is about stale .claude/tmp/** artifacts, old run directories, local cleanup candidates, or MCP helper residue.

Contract

  • Default action: inspect.
  • This workflow never deletes files.
  • Prefer read-only inventory, report, or dry-run commands first.
  • Do not create a new cleanup engine for this workflow.
  • Do not move release, lineage, acceptance, archive, source, test, docs, registry, or project identity authority.
  • Treat cleanup output as hygiene evidence only. It is not acceptance, release readiness, reviewer validity, or completion evidence.

Command Routing

Use the existing dispatcher first:

bash scripts/rev-harness-janitor.sh inspect --root .claude/tmp --json
bash scripts/rev-harness-janitor.sh plan --root .claude/tmp --json

For active run artifacts, use the existing pruner in dry-run mode:

bash scripts/harness-active-artifact-pruner.sh --root .claude/tmp/harness-release-gate --keep-latest 20 --max-age-days 14 --json

For MCP helper residue, report first:

bash scripts/cleanup-codex-mcp-zombies.sh report --include-semantic
bash scripts/cleanup-codex-mcp-zombies.sh report --include-semantic --orphan-only

--orphan-only restricts matches to processes whose parent has already exited (ppid 1) — see docs/manual/mcp-zombie-lifecycle-hygiene.md for the automatic, fail-open detection phase this powers in .claude/hooks/agent-graceful-shutdown.sh (gsd_mcp_zombie_scan), and for why subagent count alone does not multiply MCP processes.

Escalation Rules

  • archive remains report-only through scripts/rev-harness-janitor.sh in this slice.
  • Live movement with scripts/harness-active-artifact-pruner.sh --execute requires a separate reviewed plan and explicit archive directory under the selected .claude/tmp root.
  • MCP live cleanup requires the existing script's explicit PID/age guards and a separate user/operator decision. The automatic lifecycle scan (gsd_mcp_zombie_scan) never kills by default; live reap additionally requires both GSD_MCP_ZOMBIE_AUTOREAP=1 and GSD_MCP_ZOMBIE_AUTOREAP_LIVE=1 set explicitly at invocation time, and is restricted to --orphan-only candidates.
  • If any root is outside repo-local .claude/tmp, is a symlink, is missing, or is ambiguous, stop and report BLOCK.
  • If a candidate is git-tracked or referenced by active state, latest pointer, pinned baseline, release evidence, or lineage evidence, do not move it.

Verification

Before reporting the workflow as ready or reviewed, run the relevant subset:

bash -n scripts/rev-harness-janitor.sh scripts/harness-active-artifact-pruner.sh scripts/cleanup-codex-mcp-zombies.sh
bash test/integration/rev_harness_janitor_test.sh
bash test/integration/harness_active_artifact_pruner_test.sh
bash test/integration/codex_mcp_zombie_cleanup_contract_test.sh
bash test/unit/test-mcp-zombie-orphan-filter.sh

For skill edits, also run:

python3 ${CODEX_HOME:-$HOME/.codex}/skills/.system/skill-creator/scripts/quick_validate.py .claude/skills/development-junk-cleanup

Related: rev-harness-lifecycle (clean subcommand calls rev-harness-janitor.sh build-cleanup for build artifacts).

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.