com um clique
cleanup
Clean up project files, remove cruft, and organize codebase
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Clean up project files, remove cruft, and organize codebase
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Generate changelog entries following Keep a Changelog format
Generate a well-structured pull request with summary and test plan
Cluster related instincts into skills, commands, or agents
Export instincts for sharing with teammates or backup
Import instincts from teammates or community collections
View learned instincts grouped by domain with confidence levels
| name | cleanup |
| description | Clean up project files, remove cruft, and organize codebase |
| user-invocable | true |
Clean up project files, remove cruft, and organize codebase.
/cleanup # Full cleanup scan
/cleanup --dead-code # Find unused code
/cleanup --deps # Find unused dependencies
/cleanup --files # Find unnecessary files
# Node.js - find unused packages
npx depcheck
# Python - find unused imports
autoflake --check .
# or
ruff check . --select F401
# List explicitly:
npx depcheck --json | jq '.dependencies'
Action: Remove from package.json/requirements.txt
# JavaScript/TypeScript
npx ts-prune # Find unused exports
npx unimported # Find unused files
# Python
vulture . # Find unused code
# General
grep -r "TODO\|FIXME\|HACK" src/
Action: Remove or document why it's kept
Find and remove:
## Files to Clean
### Build Artifacts
- [ ] dist/
- [ ] build/
- [ ] .next/
- [ ] __pycache__/
- [ ] *.pyc
### Logs
- [ ] *.log
- [ ] npm-debug.log
- [ ] yarn-error.log
### Editor/IDE
- [ ] .DS_Store
- [ ] Thumbs.db
- [ ] .idea/ (if not shared)
- [ ] .vscode/ (if not shared)
### Test Artifacts
- [ ] coverage/
- [ ] .nyc_output/
- [ ] .pytest_cache/
### Misc
- [ ] *.bak
- [ ] *.tmp
- [ ] *~
# Remove merged branches
git branch --merged main | grep -v main | xargs git branch -d
# Remove stale remote branches
git remote prune origin
# Find large files in history
git rev-list --objects --all | \
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \
awk '/^blob/ {print $3, $4}' | \
sort -rn | head -20
# Clean up reflog
git reflog expire --expire=now --all
git gc --prune=now
Find and evaluate:
# Find commented code blocks
grep -rn "// TODO\|# TODO\|/\*\|'''" src/
# Find disabled tests
grep -rn "\.skip\|@pytest.mark.skip\|xfail" tests/
Decision criteria:
# JavaScript/TypeScript
npx jscpd src/
# Python
pylint --disable=all --enable=duplicate-code src/
# General
# Review similar file names
find . -name "*.ts" | xargs basename -a | sort | uniq -d
Review and clean:
## Config Files to Review
### Package Configs
- [ ] package.json - remove unused scripts
- [ ] tsconfig.json - remove unused options
- [ ] .eslintrc - remove unused rules
### Environment
- [ ] .env.example - keep in sync with actual vars
- [ ] docker-compose.yml - remove unused services
### CI/CD
- [ ] .github/workflows/ - remove unused workflows
- [ ] .gitlab-ci.yml - clean up stages
## Project Cleanup Report
**Date**: [Date]
**Cleaned By**: [Name]
### Summary
| Category | Items Found | Items Removed | Size Freed |
|----------|-------------|---------------|------------|
| Dependencies | 5 | 3 | - |
| Dead code | 12 files | 10 files | 2.3 KB |
| Build artifacts | 1 dir | 1 dir | 45 MB |
| Git branches | 8 | 6 | - |
### Removed Dependencies
- lodash (unused)
- moment (replaced with date-fns)
- left-pad (unused)
### Removed Files
- src/components/OldButton.tsx (replaced by Button.tsx)
- src/utils/deprecated.ts (unused)
- tests/old-tests/ (obsolete tests)
### Kept (With Justification)
- src/legacy/adapter.ts - Still used by integration X
### Recommendations
- [ ] Consider replacing moment.js with lighter alternative
- [ ] Review src/utils for more cleanup opportunities
- [ ] Set up automated dead code detection
Add to CI:
# .github/workflows/cleanup-check.yml
name: Cleanup Check
on: [pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx depcheck
- run: npx ts-prune | grep -v "used in module"
| Task | Frequency | Automated? |
|---|---|---|
| Dependency audit | Weekly | Yes (Dependabot) |
| Dead code scan | Monthly | Partial |
| Branch cleanup | Monthly | Manual |
| Full cleanup | Quarterly | Manual |