Repository navigation
Description
What the user reported
A user on Windows installed the plugin by placing it in the loose-discovery
directory and the host reported:
Server plugin error
Plugin: D:\Ellie3\.opencode\plugins\self-improving-skills
Status: failed
Runtime: server
Source: D:\Ellie3\.opencode\plugins\self-improving-skills
Error: Plugin must export a default definition with an id and an effect or setup function.
The reported error does not name the cause
The default export is correct. src/index.ts:395 exports the plain V2
definition object with id and setup, PLUGIN_ID is the literal
"opencode-self-improvement" at src/index.ts:109, and the root index.ts
re-exports it as default. Loose discovery reads
<config>/plugins/<name>/index.ts, which is exactly the shim that file exists
to satisfy.
The module never evaluates, so the host sees no default export and blames the
export. The evaluation failure is a missing runtime dependency:
src/index.ts:107eagerly importssrc/tools/schema.ts.src/tools/schema.ts:17does a value import ofzfrom"zod".- Loose discovery copies files and installs nothing, so
D:\Ellie3\.opencode\plugins\self-improving-skillshas nonode_modulesand
zodcannot be resolved from it.
@babel/parser, the other runtime dependency, survives the same situation
because it is a lazy guarded require at src/recall/conflicts.ts:73. Zod is
the only eager one, so zod is what kills the load.
Reproduction
Copy the shipped file set (index.ts, tui.ts, package.json,
tsconfig.json, src, command, vendor) into a directory with no
node_modules and resolve the entry:
$ bun build --target=bun index.ts
17 | import { type ZodTypeAny, z } from "zod";
^
error: Could not resolve: "zod". Maybe you need to "bun install"?
at /private/tmp/loose/self-improving-skills/src/tools/schema.ts:17:36
Reproduced 2026-11-20 against the current main file set. The host surfaces
its generic export error for the same underlying resolution failure.
Workaround for the user
Either install through the package route, which resolves through
package.json exports and gets runtime dependencies from the npm plugin cache:
opencode plugin add opencode-self-improvementor keep the loose directory and install dependencies inside it:
cd "D:\Ellie3\.opencode\plugins\self-improving-skills" && bun installProposed fixes
- Make the entry degrade with the true cause. Have
index.tsimport
src/index.tsdynamically inside atry, and on failure default-export a
definition whosesetuplogs the real error and the directory it failed in.
A user then reads "cannot resolvezodin : runbun installhere or
install withopencode plugin add" instead of an export complaint that
points at code that is not wrong. - Remove zod from the plugin load path so a loose copy loads with zero
runtime dependencies.zodis load-bearing in two places only:
z.toJSONSchemaatsrc/tools/schema.ts:271andsafeParseat
src/tools/schema.ts:306, over a bounded surface (object,string,
enum,array,boolean,coerce.number,optional,max,describe,
iso.datetime). Either vendor a bundled build or hand-roll that surface.
This is the larger change and needs a decision on vendoring versus
replacing; error-text drift insafeParsemessages is the risk to pin with
tests. - Document it.
docs/reference/troubleshooting.mdhas no row for this
error string. A user who greps our own docs for the message they pasted
finds nothing.
Scope note
The string self-improving-skills appears nowhere in this repository or its
git history, so the directory name is the user's own or a third party's. The
diagnosis above is from the local reproduction, not from her host log. If she
copied something other than this package, the same failure shape still applies
to any loose copy of this plugin.
Authored by an AI Assistant on behalf of the maintainer.
Activity
fix(load): a missing dependency names itself, not the default export
fix(load): a missing dependency names itself, not the default export
chore(release): 0.33.6 [skip ci]
abogartz commentedon Nov 21, 2026
Verified fixed on main — closing.
The load path now catches the failed import and names the cause instead of blaming the export.
index.ts(root shim) wrapsawait import("./src/index.ts")in try/catch, logs the directory that failed, and prints:It also exports a literal-id
unloadeddefinition so the host still keys storage and diagnostics onopencode-self-improvementwhen the module never evaluated.Landed in PR #465 (
616d4dc,fix(load): a missing dependency names itself, not the default export), merged 2026-11-20. Verified againstorigin/main@c48aea6(v0.33.7).