Package Exports
- opencode-code-simplifier
- opencode-code-simplifier/dist/plugin.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opencode-code-simplifier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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