Cleanup Skill
Purpose
After every implementation, clean up and verify code quality before considering the task complete.
Cleanup Checklist
- •
Remove Duplicate Code
- •Find and remove any duplicate implementations
- •Consolidate similar functions
- •Extract common patterns into utilities
- •
Check for Errors
- •TypeScript/TSX errors
- •ESLint/Prettier issues
- •Python type errors (if using mypy)
- •Syntax errors in any language
- •
Verify Code Functionality
- •Check that the code actually works
- •Look for logical errors
- •Verify edge cases are handled
- •
Check Dependencies
- •Ensure all imports are valid
- •Verify packages are in package.json/requirements.txt
- •Check for missing type definitions
- •
Run Dev/Type-Check
- •Run
npm run devto verify development server starts - •Run
npm run type-checkortsc --noEmitfor TypeScript errors - •Verify no type errors
- •Run
- •
Verify File Management
- •Check
.gitignoreincludes.history/ - •Ensure all build outputs are ignored
- •Check
If Errors Found
Critical Rule: If ANY error is found during cleanup, continue fixing the problems directly. The Super Coder worker agent has full edit access and can fix issues autonomously.
Report Format:
code
Cleanup found the following issues: 1. [Error type]: [Description] File: [path/to/file] Line: [line number] 2. [Error type]: [Description] File: [path/to/file] Fixing these issues now...
Validation Commands
Node.js/TypeScript:
bash
npm run dev # Verify dev server starts npm run lint # Check linting errors npm run type-check # Or: tsc --noEmit
Python:
bash
python -m py_compile [file.py] mypy [file.py] flake8 [file.py]
File Management Validation
Verify .gitignore includes:
gitignore
.history/
Post-Cleanup
After cleanup passes with no errors:
- •Provide final summary of implementation
- •Report successful completion
- •If session is ending, provide compact summary for orchestrator
- •Task is complete
Key Rules
- •ALWAYS run cleanup after implementation
- •NEVER skip cleanup
- •Fix errors directly using edit access
- •Keep working until cleanup passes cleanly
- •Verify .gitignore is correct