13ty's profile picture
13ty

opencoder

Public

44 Downloads

README

Opencoder Plugin for LM Studio

Professional OpenCode command and plugin scaffolding tool for LM Studio.

Features

  • Refinement Engine: Transforms raw ideas into production-ready OpenCode commands
  • Standards Compliance: Enforces OpenCode specification (clean frontmatter, technical English, proper syntax)
  • Phase-based Architecture: Generates commands with Intent Gate, Parallel Exploration, Codemap, Test Assessment, and Verification protocols
  • OpenCode Syntax Injection: Automatically incorporates $ARGUMENTS, $1, @path/to/file, !`bash`

Installation

cd opencoder
npm install
npm run build

Then load the plugin in LM Studio:

  • Open LM Studio → Plugins
  • Click "Load Local Plugin"
  • Select the opencoder directory

Usage

In LM Studio chat, describe your command idea:

"Stwórz komendę do audytu bezpieczeństwa zależności w package.json"

The model will invoke refine_opencode_command and return a fully structured .md file ready for your .opencode/commands/ folder.

Tool: refine_opencode_command

ParameterTypeDescription
refined_contentstringComplete markdown with frontmatter and <command-instruction> block
suggested_filenamestringKebab-case filename (e.g., security-audit.md)
force_savebooleanIf true, saves to ./commands/ directory

Example Output

Input: "komenda do sprawdzania typów w TypeScript"

Output: check-types.md

---
description: "Run TypeScript type checking and report errors with suggested fixes"
agent: build
---
<command-instruction>
# TypeScript Type Check
## PHASE 0: INTENT GATE
Verify the project has a valid tsconfig.json...
## PHASE 1: PARALLEL ANALYSIS
Launch explore agents to find...
## VERIFICATION
Run `tsc --noEmit` after changes...
</command-instruction>

Architecture

The plugin follows the same pattern as the reference markdown-builder:

  • src/index.ts - Entry point registering tools
  • src/toolsProvider.ts - Tool definitions with expert-level system prompts
  • tsconfig.json - TypeScript configuration

Standards Enforced

  • No name/trigger in frontmatter - filename determines command name
  • Technical English - professional, precise, action-oriented
  • OpenCode Syntax - $ARGUMENTS, @file, !`cmd`
  • Phase-based structure - Intent Gate → Analysis → Plan → Execute → Verify
  • Verification loops - LSP diagnostics + test execution after every change