cleanup
Repository cleanup with evidence-based decisions (user)
When & Why to Use This Skill
This Claude skill provides a comprehensive, evidence-based workflow for repository maintenance and cleanup. It automates the analysis of unstaged and untracked files, offering intelligent suggestions for deletion, deduplication, and documentation archiving to keep development environments organized and efficient.
Use Cases
- Scenario 1: Tidying up a cluttered workspace by identifying and removing obsolete temporary files, logs, and build artifacts based on evidence-based analysis.
- Scenario 2: Managing repository technical debt by detecting duplicate files and providing interactive options to merge, keep, or delete them.
- Scenario 3: Streamlining the transition from development to documentation by automatically moving completed work to dedicated folders and updating project memory.
- Scenario 4: Enhancing version control hygiene by reviewing unstaged changes and facilitating the commitment of relevant files while ignoring or deleting noise.
| name | cleanup |
|---|---|
| description | "Repository cleanup with evidence-based decisions (user)" |
| version | 1.0.0 |
| priority | medium |
| requires | ["claude-mem"] |
| changelog | "1.0.0 - Initial skill from command conversion" |
Repository Cleanup
Perform comprehensive repository cleanup with evidence-based decisions.
When to Activate
- User says "cleanup", "clean up repo", "tidy files"
- Working directory has accumulated unstaged/untracked files
Workflow
Launch the cleanup-analyzer agent to scan unstaged and untracked files, then process categories interactively.
Phase 1: Analysis (Agent)
Launch cleanup-analyzer agent using the Task tool with subagent_type='general-purpose'. The agent will return JSON with categorized files and evidence.
Phase 2: Quick Wins (Interactive)
Present obvious_deletions and markdown files:
- Show evidence for each deletion candidate
- Execute approved deletions immediately
- For .md files not in lessons_learned_docs, offer to run /ingest-docs
Phase 3: Deduplication (Interactive)
For each duplicate pair:
- Show similarity score and evidence
- Show memory context if available
- Present options: merge/keep both/delete one/skip
- Execute approved action immediately
Phase 4: Completed Work (Interactive)
For each completed proposal:
- Show implementation evidence
- Present draft memory (content, tags, files)
- Get approval to store memory + archive file
- Execute: store memory, then git mv to docs/completed/
Phase 5: Should Commit (Interactive)
- Show files ready to commit with evidence
- Get approval and execute git add
Phase 6: Ambiguous (Interactive)
For each ambiguous file:
- Show evidence and questions
- Ask user: keep/delete/commit/defer
- Execute decision
Phase 7: Summary
- Show actions taken (counts by type)
- Draft cleanup session memory
- Store memory if approved
Guardrails
- Execute actions immediately after approval (don't batch)
- Show evidence before each decision
- For .md files, integrate with /ingest-docs workflow
- Capture completed work and cleanup decisions to memory
- Use the agent's evidence, don't re-analyze
- Never delete without explicit approval