πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

@prismer/opencode-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismer/opencode-plugin

Evolution-aware plugin for OpenCode β€” connects task execution to the Prismer Evolution Network for cross-agent learning

latest
Source
npmnpm
Version
1.9.0
Version published
Weekly downloads
12
-91.95%
Maintainers
1
Weekly downloads
Β 
Created
Source

@prismer/opencode-plugin (v1.9.0)

Evolution-aware plugin for OpenCode (v2). Implements the three-stage evolution model: sync pull at session start, local journal with stuck detection mid-session, and gene creation + feedback at session end.

How It Works (v2 Three-Stage Model)

Session Start (event: session.created)
  β”œβ”€β”€ Sync pull: trending genes + hot strategies
  └── Inject evolution context via system.transform

Mid-Session (tool.execute.before / after)
  β”œβ”€β”€ In-memory journal tracks signal counts
  β”œβ”€β”€ Stuck detection: same error >= 2x β†’ query /analyze
  └── NO remote writes (local journal only, reduces noise)

Session End (event: session.ended)
  β”œβ”€β”€ Record gene feedback outcomes
  β”œβ”€β”€ Report session summary for repeated errors
  └── Sync push batch outcomes

Key Changes from v1

Aspectv1v2
/analyze queriesEvery tool with error contextOnly when stuck (same error >= 2x)
Error reportingEvery failure β†’ remote /reportIn-memory journal; batch at session end
System contextNonePassive injection of proven strategies
Gene feedbackPer-commandPer-session (task-level granularity)

Quick Start

Add to opencode.json:

{
  "plugin": ["@prismer/opencode-plugin"]
}

Set API Key

export PRISMER_API_KEY="sk-prismer-..."

Get your API key at prismer.cloud/dashboard.

Environment Variables

VariableDefaultDescription
PRISMER_API_KEY(required)Your Prismer API key
PRISMER_BASE_URLhttps://prismer.cloudAPI base URL
PRISMER_SCOPEAuto-detected from project nameEvolution data scope
PRISMER_EVOLVEonSet to off to disable (shell wrapper only)

Components

1. Event Hooks (5 Lifecycle Points)

HookTriggerPurpose
shell.envBefore shell executionInject PRISMER_API_KEY + PRISMER_BASE_URL
experimental.chat.system.transformSystem prompt buildInject proven strategies as passive context
tool.execute.beforeBefore any toolStuck detection β†’ conditional /analyze query
tool.execute.afterAfter tool completesLocal journal + gene feedback tracking
event (session.created/ended)Session lifecycleSync pull on start, gene creation + feedback on end

2. Session Journal (In-Memory)

During a session, the plugin tracks in memory:

  • Signal counts: Map<string, number> β€” how many times each error type appeared
  • Gene suggestions: which genes were recommended and when
  • Gene feedback: success/failure outcomes for recommended genes
  • Tool entries: all tool executions with error detection

3. Skills (3 Slash Commands)

SkillDescription
/prismer-evolve-analyzeQuery evolution for known fix strategies
/prismer-evolve-createCreate a new gene from a discovered pattern
/prismer-evolve-recordRecord outcome after applying a strategy

4. Shell Wrapper (Alternative)

For standalone use without the plugin system:

prismer-codex "Fix the timeout bug"

5. Workspace Projection Renderer (v1.8.0)

At session start, the plugin syncs workspace strategies from Prismer Cloud and renders them as local SKILL.md files using renderer.ts. This gives OpenCode access to proven evolution genes as native skills.

~/.config/opencode/skills/fix-timeout/SKILL.md    ← Gene β†’ SKILL.md
.opencode/skills/optimize-api/SKILL.md             ← Project-level (if .opencode/ exists)

How it works:

  • EvolutionClient.getWorkspace(scope, ['strategies']) fetches the workspace superset
  • renderForOpenCode() converts each gene strategy into a SKILL.md with frontmatter
  • Checksum-based incremental sync β€” only writes files when content has changed (.prismer-meta.json tracks checksums)
  • Dual-layer write: project-level (.opencode/) + user-level (~/.config/opencode/)

6. Evolution Harness (TypeScript API)

For programmatic integration:

import { executeWithEvolution } from '@prismer/opencode-plugin/harness';

const outcome = await executeWithEvolution('Fix the bug', {
  execute: async (advice) => {
    // advice.strategies available if gene matched
    return { output: 'Fixed!', exitCode: 0 };
  },
});

File Structure

sdk/opencode-plugin/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts                 # Plugin entry: 5 hooks + session end handler
β”‚   β”œβ”€β”€ evolution-client.ts      # Evolution HTTP client (best-effort, never throws)
β”‚   β”œβ”€β”€ renderer.ts              # Workspace Projection Renderer (gene β†’ SKILL.md)
β”‚   β”œβ”€β”€ resolve-config.ts        # Config resolution (env β†’ config.toml fallback)
β”‚   └── signals.ts               # Signal detection patterns (11 patterns)
β”œβ”€β”€ harness/
β”‚   └── evolution-harness.ts     # TypeScript harness for batch task execution
β”œβ”€β”€ skills/
β”‚   β”œβ”€β”€ prismer-evolve-analyze/SKILL.md
β”‚   β”œβ”€β”€ prismer-evolve-create/SKILL.md
β”‚   └── prismer-evolve-record/SKILL.md
β”œβ”€β”€ bin/
β”‚   └── prismer-codex            # Shell wrapper for codex exec
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ functional.test.ts       # E2E test with gene seeding
β”‚   └── integration.test.ts      # API + hook contract tests
β”œβ”€β”€ dist/                        # Built output (tsup ESM + DTS)
β”œβ”€β”€ DESIGN.md                    # Design document
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── LICENSE                      # MIT

Build

npm install
npm run build   # tsup β†’ dist/

Cross-Tool Learning

This plugin shares the same evolution backend as:

  • @prismer/claude-code-plugin β€” Claude Code hooks + MCP + skills
  • @prismer/mcp-server β€” MCP Server with 33 evolution tools
  • @prismer/openclaw-channel β€” OpenClaw messaging channel + 15 tools
  • @prismer/sdk CLI β€” prismer evolve commands

All tools contribute to and benefit from the same global knowledge graph.

License

MIT

Keywords

prismer

FAQs

Package last updated on 22 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts