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
npm install opencode-code-simplifier --save-devThis will automatically:
- Copy
skills/code-simplifier/SKILL.mdto.opencode/skills/ - Copy
rules/code-simplifier.mdto.opencode/rules/ - Copy
commands/simplify.mdto.opencode/commands/
Then add to your opencode.json:
{
"plugin": ["opencode-code-simplifier"]
}Restart OpenCode to activate.
Features
- 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
Usage
Command
/simplifyManual Tool
simplify-code file=path/to/file.jsWhat 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