Install
npx skillscat add sequant-io/sequant/templates-skills-clean Install via the SkillsCat registry.
Local overrides (read this first). Before following any instruction below, check whether
.claude/.local/skills/clean/overrides.mdexists. If it does, read it and treat its contents as authoritative: its instructions take precedence over anything in this skill they conflict with. This is the supported way to tailor/cleanwithout forking it —overrides.mdlives under.claude/.local/, whichsequant updateandsyncnever overwrite.
Repository Cleanup Command
Comprehensive, safe repository cleanup that archives stale files, removes artifacts, and commits changes.
Safety First
Before making ANY changes:
- Verify we're on
mainbranch with clean working tree - Run
npm run buildto ensure current state builds - Create a safety checkpoint (stash any uncommitted work)
Cleanup Categories
Category 1: Safe to Auto-Archive (No Review Needed)
These files are always safe to archive - they're historical artifacts:
Root directory patterns:
*.backupfiles (e.g.,CLAUDE.md.backup)CODE_REVIEW_PR_*.md- Old PR reviews*_AUDIT.mdfiles older than 30 days- One-off shell scripts with dates in names
docs/ patterns:
ISSUE_*_PHASE_*.md- Issue implementation specs (work is done)*_IMPLEMENTATION.mdolder than 30 dayscontent-audit-*.md- Point-in-time audits- City-specific audit files (e.g.,
NYC_*_AUDIT.md,LA_*_REPORT.md)
Category 2: Review Before Archiving
These need a quick check - might still be referenced:
- Files in
migrations/(check if applied to database) context/directory contents- Any
APPLY_*.mdorapply-*.shfiles
Category 3: Always Keep
Never archive these:
CLAUDE.md- Active project instructionsREADME.md- Project readmedocs/WORKFLOW_COMMANDS.md- Active workflow docsdocs/patterns/*- Active pattern catalogdocs/CONTENT_STANDARDS.md- Active standards- Any file modified in the last 7 days
Archive Structure
scripts/archive/
├── one-off-migrations/ # Shell scripts for one-time tasks
├── adhoc-migrations/ # SQL files applied manually (not via migrations tool)
└── deprecated/ # Old/replaced scripts
docs/archive/
├── audits/ # Completed audits and reviews
├── issue-specs/ # GitHub issue implementation specs
├── implementation-reports/ # Feature implementation summaries
└── context/ # Old project context filesExecution Steps
Step 1: Pre-flight Checks
# Verify branch and status
git branch --show-current # Must be 'main'
git status --porcelain # Should be empty or only untracked
# Verify build works
npm run buildIf build fails or we're not on main with clean tree, STOP and report.
Step 2: Identify Cleanup Candidates
Scan for files matching Category 1 and 2 patterns. Create a manifest of what will be archived.
Report to user:
- Files to auto-archive (Category 1)
- Files needing review (Category 2)
- Total space to be reclaimed
Step 3: Execute Cleanup
- Create archive directories if needed
- Move Category 1 files to appropriate archive locations
- Move Category 2 files (after user confirmation via manifest)
- Remove artifacts:
.DS_Storefiles (except in node_modules)- Empty directories (except .git, node_modules, .next)
- Update
docs/archive/README.mdwith current date
Step 4: Verification
# Verify build still works
npm run build
# Verify no breaking imports
npm run lintIf either fails, ROLLBACK all changes immediately.
Step 5: Commit and Push
# Stage all changes
git add -A
# Create descriptive commit
git commit -m "chore: repository cleanup $(date +%Y-%m-%d)
Archived:
- [X] old issue specs
- [X] completed audits
- [X] one-off migration scripts
- [X] stale documentation
Build verified: passing"
# Push to origin
git push origin mainRollback Procedure
If anything goes wrong:
git checkout -- .
git clean -fdOutput Format
Report final summary:
Repository Cleanup Complete
Archived:
- X files from root directory
- X files from docs/
- X migration scripts
Removed:
- X .DS_Store files
- X empty directories
Commit: [hash] pushed to origin/main
Next cleanup recommended: [date + 30 days]Usage Notes
- Run monthly or when repo feels cluttered
- Safe to run multiple times (idempotent)
- Will not touch files modified in last 7 days
- Always verifies build before and after
BEGIN EXECUTION
Execute the cleanup following the steps above. Be thorough but safe - when in doubt, skip a file rather than risk breaking something.
Output Verification
Before responding, verify your output includes ALL of these:
- Pre-flight Results - Branch check, build verification passed
- Cleanup Manifest - List of files to be archived/removed
- Archive Summary - Count of files archived by category
- Build Verification - Post-cleanup build/lint passed
- Commit Details - Commit hash and push confirmation
- Next Cleanup Date - Recommended date for next cleanup
DO NOT respond until all items are verified.