Maintenanceprompt onlyIntermediate

Cleanup Unused Files

This loop automatically identifies and removes unused files and dead code from your codebase. It iteratively scans the project, presents candidates for removal, and seeks user confirmation before deletion, ensuring a clean and maintainable codebase.

← all loops
cleanupmaintenancerefactoringcode-qualityautomation

Goal

Remove dead code and files

How to Run

Run this loop in your terminal-based coding environment to systematically eliminate unused assets and code.

  1. 01

    Initialize

    Start the loop by entering the kickoff prompt. Your agent will begin scanning for unused files.

  2. 02

    Review Suggestions

    At each iteration, the agent will present a list of potentially unused files. Confirm which should be deleted.

  3. 03

    Automate Cleanup

    The agent will remove confirmed files and re-scan until no more unused files are detected.

Workflow Steps

  1. 01

    Scan codebase for unused files

    Tool: unused file scan · Output: List of candidate files for deletion

  2. 02

    Prompt user for confirmation on each file

    Tool: interactive prompt · Output: User decisions on which files to keep/delete

  3. 03

    Delete confirmed unused files

    Tool: file system commands · Output: Removed files and updated project structure

  4. 04

    Re-run scan to verify cleanup

    Tool: unused file scan · Output: Updated list of unused files

  5. 05

    Repeat until exit condition is met

    Tool: loop control · Output: Exit when no unused files remain

Kickoff Prompt

Start the "Cleanup Unused Files" loop.

Goal: Remove dead code and files
Max iterations: 10
Between iterations run: unused file scan
Exit when: No unused files found


Initiate the cleanup loop by scanning the project for unused files and presenting them for review.

Self-pace this loop. After each iteration, run `unused file scan` and evaluate the output, and only continue if the exit condition is not met (No unused files found). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Always back up files before deletion
  • ·Never delete files without explicit user confirmation
  • ·Only consider files not imported or referenced anywhere in the codebase
  • ·Preserve configuration and build-related files unless explicitly marked as unused

Flow Diagram

rendering…

Related loops — Maintenance