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.
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.
- 01
Initialize
Start the loop by entering the kickoff prompt. Your agent will begin scanning for unused files.
- 02
Review Suggestions
At each iteration, the agent will present a list of potentially unused files. Confirm which should be deleted.
- 03
Automate Cleanup
The agent will remove confirmed files and re-scan until no more unused files are detected.
Workflow Steps
- 01
Scan codebase for unused files
Tool: unused file scan · Output: List of candidate files for deletion
- 02
Prompt user for confirmation on each file
Tool: interactive prompt · Output: User decisions on which files to keep/delete
- 03
Delete confirmed unused files
Tool: file system commands · Output: Removed files and updated project structure
- 04
Re-run scan to verify cleanup
Tool: unused file scan · Output: Updated list of unused files
- 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
Related loops — Maintenance
Maintenance
Package Audit Fixer
Automatically identifies and fixes package vulnerabilities in your Node.js project by running `npm audit` and applying recommended fixes until the audit is clean.
Maintenance
Upgrade Framework Version
This loop automates the process of upgrading a project's framework to a newer version. It systematically analyzes the current framework, plans the upgrade path, updates dependencies, resolves breaking changes, and ensures all tests pass before completion.
Maintenance
Dependency Update Until Green
Automated loop to safely upgrade project dependencies while ensuring all tests pass after each update. The agent incrementally updates out-of-date packages and runs test checks to prevent breaking changes.