DEV Community

Cover image for sweep + doctor: Keep Your OpenCode Project Healthy
Faris Han
Faris Han

Posted on Edited on

sweep + doctor: Keep Your OpenCode Project Healthy

sweep + doctor: Keep Your OpenCode Project Healthy

Agent-built repos rot fast. Dead code accumulates, configs drift, and six weeks
later nobody knows which files are load-bearing. Two small plugins attack this
directly: sweep finds unused code; doctor checks config health.

sweep

sweep scans an OpenCode project for unused code: unreferenced functions,
orphaned files, stale imports. It reports what it found with sizes and locations
before touching anything, and supports dry-run. It never deletes what it cannot
verify is unused.

Use it:

  • Before a release, to shrink the surface area.
  • After a refactor, to remove leftovers.
  • On a schedule, to keep drift visible.

doctor

doctor checks the health of an OpenCode project's configuration: missing or
inconsistent settings, broken references, and common misconfigurations. It
prints a report with pass/warn/fail per check and suggested fixes.

Use it:

  • When onboarding a new repo.
  • After changing provider or model config.
  • In CI, as a gate.

Together

sweep keeps the codebase small; doctor keeps the config honest. Run both
before /ship:

sweep --dry-run
doctor
wf-verify
Enter fullscreen mode Exit fullscreen mode

If all three pass, the repo is in better shape than most.

Get it

sweep and doctor are OpenCode plugins that ship with the OpenCode Dev
Toolkit (Pro). The core workflow kit is free (MIT).

Takeaway

Agent-built code does not rot because agents are bad. It rots because nobody
runs the janitor. sweep and doctor are the janitor.

Top comments (0)