Files
SuperClaude/.claude/commands/cleanup.md
NomenAK 219ff3905a feat: Optimize all 18 command files using @include reference system
Major streamlining achievement:
- Eliminate 2,733 lines of duplicate content across commands
- Reduce individual command files by ~70% (130-150 → 35-60 lines)
- Leverage existing shared/*.yml reference patterns
- Maintain full Claude Code compliance

Benefits:
• Single source of truth for universal content
• Guaranteed consistency across all commands
• Dramatically reduced maintenance overhead
• Massive token efficiency improvements

Implementation:
- Universal Legend: @include shared/universal-constants.yml#Universal Legend
- Universal Flags: @include shared/flag-inheritance.yml#Universal_Always
- Command patterns: References to appropriate shared/*.yml files
- Template system: Enhanced command-patterns.yml

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 22:46:52 +02:00

2.0 KiB

@include shared/universal-constants.yml#Universal_Legend

Command Execution

@include shared/command-structure.yml#Base_Execution

Cleanup project files, dependencies & artifacts in $ARGUMENTS.

@include shared/flag-inheritance.yml#Universal_Always

Clean up project artifacts, code & cfg specified in $ARGUMENTS.

--code flag:

  • Remove unused imports & dead code | Clean console.log & debug code
  • Remove commented blocks | Fix style inconsistencies | Remove TODO>30 days

--files flag:

  • Remove build artifacts & temp files | Clean node_modules if corrupted
  • Remove logs & cache dirs | Clean test outputs | Remove OS files (.DS_Store, thumbs.db)

--deps flag:

  • Remove unused deps from package.json | Update vulnerable deps
  • Clean duplicate deps | Optimize dep tree | Check outdated packages

--git flag:

  • Remove untracked files (w/ confirmation) | Clean merged branches
  • Remove large/unwanted files from history | Optimize git (.git/objects cleanup) | Clean stale refs

--cfg flag:

  • Remove deprecated cfg settings | Clean unused env vars
  • Update outdated cfg formats | Validate cfg consistency | Remove duplicate entries

--all flag:

  • Comprehensive cleanup all areas | Generate detailed report
  • Suggest maintenance schedule | Provide perf impact analysis

--dry-run flag:

  • Show what would be cleaned w/o changes | Estimate space savings & perf impact | ID risks before cleanup

--watch flag:

  • Monitor & auto-clean new artifacts | Continuous cleanup during dev | Prevent temp file accumulation | Real-time maintenance

Integration & Best Practices

@include shared/research-patterns.yml#Mandatory_Research_Flows

@include shared/user-experience.yml#Standard_Notifications

  • Space savings: .claudedocs/metrics/cleanup-savings-<timestamp>.md
  • Ensure dirs: mkdir -p .claudedocs/reports/ .claudedocs/metrics/
  • Include location: "📄 Cleanup report saved to: [path]"

Deliverables: Cleanup report w/ space saved, perf improvements, maintenance recommendations, safety analysis & cleanup strategy docs.