opencode-code-simplifier
v1.5.0
Published
Code simplifier plugin for OpenCode - simplifies and refines code for clarity while preserving functionality
Downloads
614
Maintainers
Readme
opencode-code-simplifier
Code simplifier plugin for OpenCode. Simplifies and refines code for clarity while preserving functionality.
Install
Add to your opencode.json:
{
"plugin": ["opencode-code-simplifier"]
}Restart OpenCode. The plugin will auto-create skills/code-simplifier/SKILL.md and rules/code-simplifier.md on first load.
Usage
Ask OpenCode to simplify code using the tool:
Use simplify-code tool on path/to/file.jsOr just describe what you want:
Simplify the code in src/utils.jsFeatures
- Reduces nesting and complexity
- Removes debug artifacts (unconditional console.log, debugger, commented code)
- Removes obvious comments
- Preserves conditional logging (if debug, if isDev, etc.)
- Converts nested ternaries to if/else chains
- Applies language-specific best practices
What Gets Removed
| Type | Action |
|------|--------|
| console.log('debug') | Removed |
| if (debug) console.log(...) | Kept |
| debugger | Removed |
| Commented-out code | Removed |
| Obvious comments | Removed |
| console.error | Kept |
| Logger calls with levels | Kept |
License
MIT
