Skip to content

Getting Started

MonadicSharp for OpenCode brings green-code analysis and auto-migration into your OpenCode AI coding session.

Requirements

Install the integration

bash
# Install MonadicLeaf CLI (required)
dotnet tool install -g MonadicLeaf

# Clone the OpenCode integration
git clone https://github.com/Danny4897/MonadicSharp-OpenCode
cd MonadicSharp-OpenCode

# Install into OpenCode
opencode plugin install .

Available commands

Once installed, three slash commands are available inside any OpenCode session:

CommandDescription
/forge-analyzeAnalyze current file for green-code violations
/green-checkRun full Green Score on the project
/migrateAuto-migrate violations in the current file

Your first analysis

Open a C# file in OpenCode, then type:

/forge-analyze

MonadicSharp for OpenCode will:

  1. Send the file to MonadicLeaf for analysis
  2. Return a structured list of violations
  3. Suggest MonadicSharp-idiomatic fixes inline

Configure green-code defaults

Add a .monadicleaf.json at your project root to configure the minimum acceptable Green Score and which rules to enforce:

json
{
  "minGreenScore": 80,
  "failOnSeverity": "error",
  "excludePaths": ["**/Migrations/**"]
}

Next steps

Released under the MIT License.