Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add grahama1970/agent-skills --skill "cleanup"
Install specific skill from multi-skill repository
# Description
>
# SKILL.md
name: cleanup
description: >
Assess the project to reorganize or deprecate unused/outdated files.
Cleans the git workspace and commits changes.
allowed-tools: Bash, Read, Grep, Glob
triggers:
- cleanup this project
- reorganize the codebase
- remove outdated files
- deprecate unused code
- git cleanup
metadata:
short-description: Deep codebase assessment and technical debt cleanup
Cleanup Skill
This skill performs a deep assessment of the codebase to identify technical debt, unused files, and outdated documentation, then performs cleanup operations with confirmation.
Workflow
- Assessment (
--dry-run): Scan the codebase for: - Untracked "junk" files (logs, temp images, build artifacts).
- Tracked files that are no longer referenced in the codebase.
- Outdated documentation files.
- Project structure inconsistencies.
- Planning (
--plan): Generate a Cleanup Plan markdown file for review. - Execution (
--execute): Perform cleanup operations with user confirmation: - Remove junk files (with optional
--forceto skip prompts) - Remove dead tracked files (always requires confirmation, never auto-deleted)
- Log all actions to
local/CLEANUP_LOG.md
How to Use
- Trigger with "cleanup this project" or "reorganize codebase".
- Run
bash .pi/skills/cleanup/run.sh --dry-runto see JSON findings. - Run
bash .pi/skills/cleanup/run.sh --planto generate a readable cleanup plan. - Review the plan and run
bash .pi/skills/cleanup/run.sh --executeto perform cleanup. - Use
--forceto skip confirmation for junk files only (dead files still require confirmation).
Safety Features
- Dead files always require confirmation: The skill will never auto-delete tracked files that appear unreferenced. You must explicitly confirm each deletion.
- Uncommitted changes warning: The skill warns and asks for confirmation if you have uncommitted changes.
- Detailed logging: All actions are recorded in
local/CLEANUP_LOG.md. - Junk file detection: Uses patterns to identify common junk files (logs, temp files, build artifacts).
Command Options
| Option | Description |
|---|---|
--dry-run |
Print JSON findings without making changes |
--plan |
Generate a Cleanup Plan markdown file |
--execute |
Perform cleanup operations with confirmation |
--force |
Skip confirmation for junk files only (dead files still require confirmation) |
--output <file> |
Specify output file for plan (default: CLEANUP_PLAN.md) |
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.