Cleanup Skill: The Smart Way to Tame Project Temp Files
Have you ever stared at your project directory and wondered where all that disk space went? Temp files, build artifacts, log dumps—they pile up faster than you'd think, and manually cleaning them feels like playing Russian roulette with your data. I've been there too, especially when inheriting legacy projects from other developers. Can I safely delete those mysterious cache folders? That's exactly where the Cleanup Skill comes in. It's not a standalone tool, but a smart module integrated into the Local Task Tracker (loctt) project. Think of it as your personal project housekeeper—it scans your directories, identifies junk files using predefined rules, and cleans them up without breaking anything. But here's the kicker: it's not just a glorified delete button. This skill comes with built-in safety mechanisms, customizable patterns, and preview modes that make cleanup feel less like a chore and more like a strategic maintenance task.
The core logic is refreshingly simple: scan the project, identify cleanup candidates, then either delete or move them to trash based on your configuration. It handles common junk types like compilation outputs (dist/, build/), dependency caches (node_modules/.cache), log files (*.log), and those annoying system-generated files (.DS_Store, Thumbs.db). What makes it stand out is the exclusion and inclusion lists—you can tell it to preserve specific files even within directories marked for cleanup. For instance, you might want to keep dist/important_config.json while still cleaning everything else in dist/. This level of granularity means you never have to worry about accidentally nuking something critical.
Three Steps to Setup: From Installation to Custom Rules
Getting started with the Cleanup Skill is almost embarrassingly easy. Can it really be this straightforward? First, make sure you have the loctt project installed. Then, you just invoke the cleanup skill from the command line in your project root. It'll load default configurations automatically. But the real magic happens when you customize it. Create a .cleanuprc or cleanup.config.json file in your project root, and define what you want to clean. Here's a practical example:
{
"patterns": ["*.log", "*.tmp", "dist/", "build/"],
"exclude": ["dist/important.json", "node_modules"],
"dryRun": true,
"moveToTrash": true
}
See that dryRun field? This is your safety net. When set to true, the skill only scans and lists files that would be deleted, without actually removing anything. It's like a preview mode—you get to review everything before committing. Once you're confident, just flip it to false and run it again. The moveToTrash option is another lifesaver: instead of permanently deleting files, it sends them to your system's trash bin. If you accidentally include something important, you can easily restore it. This combination of preview and recovery options makes the Cleanup Skill feel much safer than traditional cleaning scripts.
Safety First: Built-in Protection Against Accidental Deletion
Let's be honest—the biggest fear with any cleanup tool is deleting something you shouldn't. The Cleanup Skill addresses this head-on with multiple layers of protection. It has a Safe Mode enabled by default, which checks each file before deletion. If a file is locked by another process or belongs to a system-critical path, the skill skips it and logs a warning. But that's not all. It also supports timestamp-based filtering—you can specify to only clean files older than a certain number of days. Check out this configuration:
{
"age": 30,
"unit": "days",
"patterns": ["*.log", "*.cache"]
}
This tells the skill to only delete log and cache files that haven't been accessed in 30 days. Files you're actively using? They stay untouched. There's also a file size threshold option—you can set a minimum size to avoid wasting time on tiny files. All these safety layers work together to ensure that cleanup operations are both efficient and safe. I remember the first time I used it, I ran the dryRun mode at least five times before finally committing. But after a few successful cleanups, my trust level shot up. Now I run it weekly without a second thought.
Real-World Scenarios: Putting Cleanup Skill to Work
Let's move from theory to practice. Imagine you're working on a front-end project that generates massive dist/ folders with each build. Over time, these build artifacts can eat up gigabytes of disk space. With the Cleanup Skill, you can automate the removal of old builds. For example, set up a weekly task to clean build artifacts older than a week. Another common use case is log file management—development logs are useful during debugging but become clutter once the feature ships. You can configure the skill to keep only the last 7 days of logs:
{
"patterns": ["logs/**/*.log"],
"age": 7,
"unit": "days",
"exclude": ["logs/error.log"]
}
Notice how I excluded error.log? That's because error logs often need to be retained longer for troubleshooting. This is the beauty of fine-grained control. You can also integrate the Cleanup Skill into your CI/CD pipeline—run it before each build to ensure a clean environment. Or pair it with a cron job for automatic daily cleanups at 3 AM. Imagine having every project in your workspace configured this way. Your development environment would feel brand new every day, with no manual effort required.
From Manual to Automatic: Making Cleanup a Habit
Ultimately, the value of the Cleanup Skill isn't about how many files it deletes—it's about building better project maintenance habits. I used to dread cleaning up project files, putting it off until my disk was screaming for space. But this tool changed that. Now I actively look forward to configuring cleanup rules because the whole process is so effortless—write a config file, run a command, and let it do the heavy lifting. The benefits are tangible: more disk space, faster project startup times, and a smoother development experience. If you're tired of wrestling with junk files in your projects, give the Cleanup Skill a try. Start with the simplest configuration, then gradually refine it as you learn what works for your workflow. Remember, great tools don't make you do more work—they help you achieve better results with less effort. Go ahead and create that cleanup config for your project today. Your hard drive will thank you, and so will your future self.