---
allowed-tools: all
description: Evidence-based codebase cleanup with safety verification
---

# 🧹 /clean ARGUMENTS$

**SPEED IS CRITICAL - MAXIMUM PARALLEL AGENT USAGE REQUIRED!**

## Arguments Integration

**Task**: ARGUMENTS$

Apply to: store_fr3k: Store cleanup scope and safety constraints

**For any tasks created during cleanup work, use scope: 'maintenance'**

---

## Phase 1: Cleanup Analysis

**IMMEDIATELY spawn agents for comprehensive cleanup analysis:**
```
"I'll spawn agents for rapid codebase analysis:
- sherlock: Analyze project structure and identify cleanup opportunities
- murphy: Detect unused dependencies and configuration files
- sherlock: Find dead code, unused imports, and obsolete files
- bugsy: Identify code quality issues and technical debt
Let me analyze cleanup opportunities in parallel..."
```

## Phase 2: Safe Cleanup Execution

**IMMEDIATELY spawn agents for parallel cleanup:**
```
"I'll spawn agents for safe cleanup execution:
- artisan: Remove dead code and unused functions
- murphy: Clean up dependencies and configuration files
- artisan: Optimize imports and remove unused variables
- artisan: Clean up commented code and old implementations
Let me clean up the codebase safely in parallel..."
```

## Phase 3: Validation & Verification

**IMMEDIATELY spawn agents for cleanup validation:**
```
"I'll spawn agents to validate all cleanup changes:
- artisan: Run all tests to ensure nothing is broken
- bugsy: Check for any issues introduced by cleanup
- murphy: Verify all configurations still work
- artisan: Validate build processes and deployments
Let me verify everything still works in parallel..."
```

## Success Criteria

Before marking complete:
- [ ] All dead code and unused imports removed
- [ ] Dependencies are optimized and up-to-date
- [ ] Configuration files are clean and valid
- [ ] All tests pass after cleanup
- [ ] Build processes work correctly
- [ ] No functionality is broken
- [ ] Code quality metrics improved

## Safety Verification

- Test all functionality after cleanup
- Verify build and deployment processes
- Confirm no critical files were removed
- Store cleanup results with store_fr3k

---

**Core principle: Clean aggressively but verify everything still works.**