code-cleanup

krmcbride's avatarfrom krmcbride

Delegate repetitive tasks to specialized agent to preserve context. Use when user asks to fix linting errors, fix diagnostics, rename variables across files, update imports, fix formatting issues, or perform other mechanical bulk changes across multiple files.

⭐2stars🔀0forks📁View on GitHub🕐Updated Dec 20, 2025

When & Why to Use This Skill

The Code Cleanup skill for Claude automates repetitive and mechanical programming tasks by delegating them to a specialized 'Code Janitor' sub-agent. This skill is designed to handle bulk code maintenance—such as fixing linting errors, renaming variables across multiple files, and updating imports—ensuring the main agent preserves context for high-level architectural decisions while maintaining codebase health.

Use Cases

  • Automated Linting Fixes: Quickly resolving hundreds of style and formatting violations across an entire project to meet CI/CD standards.
  • Bulk Refactoring: Renaming functions or variables consistently across dozens of files after a naming convention change.
  • Dependency Updates: Mass-updating import statements and paths following a major directory restructuring or library migration.
  • Diagnostic Resolution: Batch-fixing IDE diagnostics and compiler warnings that don't require complex logic changes.
  • Codebase Standardization: Applying consistent formatting and boilerplate updates to a legacy codebase to improve readability.
namecode-cleanup
descriptionDelegate repetitive tasks to specialized agent to preserve context. Use when user asks to fix linting errors, fix diagnostics, rename variables across files, update imports, fix formatting issues, or perform other mechanical bulk changes across multiple files.

Delegate to Code Janitor

When you encounter repetitive, mechanical code tasks, launch the code-janitor agent instead of doing the work yourself to preserve context.

Delegate When:

  • Fixing multiple linting errors across files
  • Renaming variables/functions consistently across codebase
  • Updating import statements in multiple files
  • Fixing formatting or style violations throughout project
  • Resolving IDE diagnostics in batch
  • Bulk refactoring that doesn't require design decisions

Keep in Main When:

  • Task requires architectural decisions
  • Single file with 1-2 changes
  • User explicitly wants you to do it

How:

Use Task tool with subagent_type: "essentials:code-janitor" providing task description and scope.

The code-janitor agent uses TodoWrite to track work, iterates until complete, and verifies with linters.