/wbClean — Command Hub
/wbClean scans a package for unused exports, orphan files, stale reports, dead code, and forgotten dev artifacts. It produces a cleanup report grouped by confidence — but it never deletes. The two-step discipline (detect, then remove) prevents silent loss of code the AI misclassified.
🎯 Strategic Position
Dead code accumulates silently. Every console.log left in production, every commented-out block from three weeks ago, every file with zero import references — they each cost a reader a moment of confusion. /wbClean surfaces that entropy so you can delete it intentionally, not accidentally.
- End of day / end of a work session — catches what you left behind while still fresh.
- Before
/wbAudit— clean first, then audit the clean result. - Before
/wbRelease— confirm no debug code leaking to npm. - After inheriting a package — baseline the debt.
🛠️ Operating Modes
| Mode | Trigger | Output |
|---|---|---|
| Standard scan | /wbClean <pkg-or-app> | Cleanup report grouped by priority |
| Preview | --dry-run | Shows what would be deleted without touching anything |
✅ What a useful clean report contains
- Forgotten dev artifacts —
console.log,debugger,TODO: hackcomments. HIGH confidence. - Dead files — 0 import references detected. MEDIUM confidence (could be dynamic).
- Unused imports — imported, never referenced. HIGH confidence.
- Commented-out blocks — still there from weeks ago. MEDIUM confidence.
- TODOs — informational, not a delete candidate.
- "What this clean did NOT check" — declaring coverage gaps.
🚫 What it cannot do
| Not this | Use instead |
|---|---|
| Refactor live code | /wbRefactor |
| Audit code quality or design flaws | /wbAudit |
| Delete files without confirmation | Two-step: the report surfaces candidates; you approve deletion separately |
| Find a specific bug | /wbDebug |
| Verify release-readiness | /wbAudit |
📚 Reading Order
- ELI5 — the one-paragraph mental model.
- Practical — step-by-step cleanup walkthrough.
- Expert — confidence levels, dynamic imports, and edge cases.
- Examples — annotated cleanup transcripts.
- Exhaustive simulation · Live demo.
🔗 Related
wbClean.md— the command reference this hub orients you around./wbAudit— finds design flaws, not debris./wbRefactor— restructures live code without changing behaviour./wbPlan— generate a safe execution matrix for deletions.
Quick Reference
bash
/wbClean packages/wb-dataviewer # scan a package for entropy
wbClean --dry-run # preview what would be deleted← Home · Commands · Install | wb-flow on npm · flow.wbc-ui.com · wi-bg.com
