dotfiles/.config/opencode/command/clean.md
C4 Patino fb3431a922
Some checks failed
sync tailscale acls / acls (push) Failing after 7s
feat: update all opencode configurations to support newest opencode features
2026-07-01 13:38:05 -05:00

25 lines
1.1 KiB
Markdown

---
description: Clean up code — remove debug artifacts, format, sort imports, fix lint issues
---
# Clean
When the user runs this command, clean the specified files or directories (or recently modified files if none given).
## Cleanup Pipeline
1. **Remove debug code** — Strip console.log, debugger statements, commented-out code blocks, and temporary debugging artifacts.
2. **Format** — Run the project's formatter if available (e.g., `prettier`, `rustfmt`, `gofmt`, `black`, `shfmt`). Otherwise apply consistent indentation and spacing manually.
3. **Optimize imports** — Sort, group, and remove unused imports. Use absolute paths where the project convention dictates.
4. **Fix lint issues** — Run the project's linter with auto-fix if available. Report any issues that need manual attention.
5. **Type validation** — Run the project's type checker if available. Fix obvious type issues.
6. **Tidy comments** — Remove redundant or obvious comments. Improve unclear ones. Ensure public APIs have doc comments matching the language convention.
## Report
Summarize files processed, actions taken, and any issues requiring manual intervention.