cleanproject
I'll help clean up development artifacts while preserving your working code.
I'll help you restructure your code systematically - preserving functionality while improving structure, readability, and maintainability.
How it fires
How this command gets triggered: by you, by Claude, or both.
/refactorContext preview
What this command does when you run it.
I'll help you restructure your code systematically - preserving functionality while improving structure, readability, and maintainability.
I'll help you restructure your code systematically - preserving functionality while improving structure, readability, and maintainability.
Arguments: `$ARGUMENTS` - files, directories, or refactoring scope
**KEY FEATURE: Built-in validation and refinement after EVERY change ensures nothing breaks and no code is left behind. The AI will automatically fix its own mistakes during the refactoring process.**
**SESSION FILES LOCATION: Always use refactor/ folder in current directory**
I'll maintain refactoring continuity across sessions:
**Session Files (in current project):**
**IMPORTANT:** The `refactor` folder is created in your CURRENT PROJECT directory. Use `refactor/` to access it.
**Auto-Detection:**
**EXAMPLE OF CORRECT PATH USAGE:**
# CORRECT - looks in current project: Read refactor/state.json LS refactor # WRONG - these will fail: Read ../../../refactor/state.json Read $HOME/.claude/refactor/state.json
For complex refactoring scenarios, I'll use extended thinking to develop comprehensive strategies:
<think> When faced with complex architectural refactoring:
</think>
**Triggers for Extended Analysis:**
**MANDATORY FIRST STEPS FOR SESSION CHECK:**
Step 1: Check for refactor directory in CURRENT directory Command: LS refactor Step 2: If refactor exists, read session files: Command: Read refactor/state.json Command: Read refactor/plan.md DO NOT USE THESE WRONG PATHS: - ../../../refactor/ (WRONG - goes up directories) - $HOME/refactor/ (WRONG - home directory) - ~/refactor/ (WRONG - home directory) ONLY USE: refactor/ (current directory)
**CRITICAL:** The refactor folder is created in the CURRENT WORKING DIRECTORY where user is running the command. NOT in home, NOT in parent directories.
I'll examine your codebase to identify improvement opportunities:
**Analysis Focus:**
**Smart Scoping:**
Based on analysis, I'll create a structured plan:
**Refactoring Categories:**
**Plan Structure:** I'll create a detailed plan in `refactor/plan.md`:
# Refactor Plan - [timestamp] ## Initial State Analysis - **Current Architecture**: [description of existing patterns] - **Problem Areas**: [specific issues found] - **Dependencies**: [external/internal dependencies] - **Test Coverage**: [current coverage %] ## Refactoring Tasks [Prioritized list with risk levels] ## Validation Checklist - [ ] All old patterns removed - [ ] No broken imports - [ ] All tests passing - [ ] Build successful - [ ] Type checking clean - [ ] No orphaned code - [ ] Documentation updated ## De-Para Mapping | Before | After | Status | |--------|-------|--------| | OldService.method() | NewService.method() | Pending | | /api/v1/* | /api/v2/* | Pending |
I'll apply refactorings systematically:
**Execution Order:** 1. Create git checkpoint for safety 2. Apply low-risk improvements first 3. Validate after each change 4. Progress to higher-impact refactorings 5. Update plan with completion status
**Continuous Validation & Refinement:** After EVERY refactoring change: 1. **Immediate Testing:**
2. **Deep Comparison:**
3. **Automated Fixes:**
4. **Quality Gates:**
5. **Continuous Refinement:**
I'll apply consistent patterns throughout:
**Pattern Recognition:**
**Code Improvements:**
I'll track refactoring impact:
**Measurable Improvements:**
Best Claude Code framework that actually save time. Built by a dev tired of typing "please act like a senior engineer" in every conversation.
Repo: notlikeDev/CCPlugins
I'll help clean up development artifacts while preserving your working code.
I'll analyze recent operations and create contextual TODO comments in your code.
I'll intelligently manage your project documentation by analyzing what actually happened and updating ALL relevant docs accordingly.
I'll explain this code as a senior developer would, focusing on the why behind decisions.
I'll locate all TODO comments and unfinished work markers in your codebase.