JSPM

opencode-code-simplifier

1.3.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 17
    • Score
      100M100P100Q83665F
    • License MIT

    Code simplifier plugin for OpenCode - simplifies and refines code for clarity while preserving functionality

    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-dev

    This will automatically:

    1. Copy skills/code-simplifier/SKILL.md to .opencode/skills/
    2. Copy rules/code-simplifier.md to .opencode/rules/
    3. Copy commands/simplify.md to .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

    /simplify

    Manual Tool

    simplify-code file=path/to/file.js

    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