.opencode/commands/refactor-clean.md
Analyze and clean up the codebase: $ARGUMENTS
# Find unused exports
npx knip
# Find unused dependencies
npx depcheck
# Find unused TypeScript exports
npx ts-prune
After cleanup:
npm run build - builds successfullynpm test - all tests passnpm run lint - no new lint errorsDead Code Analysis
==================
Removed:
- file.ts: functionName (unused export)
- utils.ts: helperFunction (no callers)
Consolidated:
- formatDate() and formatDateTime() → dateUtils.format()
Remaining (manual review needed):
- oldComponent.tsx: potentially unused, verify with team
CAUTION: Always verify before removing. When in doubt, ask or add // TODO: verify usage comment.