Skip to content

/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 ​

ModeTriggerOutput
Standard scan/wbClean <pkg-or-app>Cleanup report grouped by priority
Preview--dry-runShows what would be deleted without touching anything

✅ What a useful clean report contains ​

  1. Forgotten dev artifacts — console.log, debugger, TODO: hack comments. HIGH confidence.
  2. Dead files — 0 import references detected. MEDIUM confidence (could be dynamic).
  3. Unused imports — imported, never referenced. HIGH confidence.
  4. Commented-out blocks — still there from weeks ago. MEDIUM confidence.
  5. TODOs — informational, not a delete candidate.
  6. "What this clean did NOT check" — declaring coverage gaps.

🚫 What it cannot do ​

Not thisUse instead
Refactor live code/wbRefactor
Audit code quality or design flaws/wbAudit
Delete files without confirmationTwo-step: the report surfaces candidates; you approve deletion separately
Find a specific bug/wbDebug
Verify release-readiness/wbAudit

📚 Reading Order ​

  1. ELI5 — the one-paragraph mental model.
  2. Practical — step-by-step cleanup walkthrough.
  3. Expert — confidence levels, dynamic imports, and edge cases.
  4. Examples — annotated cleanup transcripts.
  5. Exhaustive simulation · Live demo.
  • 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