The shell.env and experimental.session.compacting hooks dereferenced
output.env and output.prompt unconditionally. When OpenCode invokes a
hook without an output object, this threw TypeError: undefined is not an
object and aborted compaction entirely.
- shell.env: early-return when output is undefined
- experimental.session.compacting: guard the output.prompt/output.context
branches so a missing output no-ops instead of throwing
Add regression tests for both hooks covering the undefined-output case.
Fixes#3934
- R2-1: the V2 execute.after adapter passed { result: ... } as the tool
output; skill-run-tracker derives outcomes from error fields on the
response itself, so failed skills recorded as successes. The adapter
now forwards the raw event.result ?? event.output. Covered by a T05
assertion that an is_error skill event records outcome failure and a
clean event still records success.
- R2-2: cmd.exe expands %VAR% and honors embedded quotes even inside
double quotes, so escaping " was unsafe. spawnCommand now refuses
arguments carrying ", %, CR or LF (nothing spawns; the rejection
surfaces through the formatter's catch) and emits the canonical /s
form with one outer quote pair around the whole command. T01 asserts
the outer pair, strips it before inspecting the inner quoting, and
covers two refusal payloads.
- R2-3: repo review rules ban console.log; the client-less log fallback
and the startup line now use console.info (identical stdout behavior).
- R2-4: declined installs recorded before the barrel split retained the
old module/factory stub in plugins/index.ts, and a later selective
install (e.g. commands-core) has no operation rewriting it, so the
strict deactivation gate failed the install after all writes landed.
The strict branch now migrates such retained files in place only when
ownership is proven twice (managed-recorded contentSha256 matches disk
AND disk equals an exact historical disabled-stub payload), written
through writeFileNoFollow with that digest as expectedContent;
anything else keeps failing closed. The preflight branch accepts an
already-inactive recorded config under the same digest-verified
condition, since selective installs legitimately plan no .opencode
writes. New lifecycle test covers both the migration (install ok,
doctor clean, ownership retained) and the refusal path (mis-recorded
digest never grants a rewrite).
OpenCode 2.x only runs V2 plugin definitions ({ id, setup(ctx) }); the V1
function-export form failed schema validation at load with
"PluginModule.LoadError: Plugin must export a default definition with an id
and an effect or setup function".
- Rewrite .opencode/plugins/ecc-hooks.ts as a native V2 plugin: V1 hook keys
now register on their V2 domains (ctx.tool.hook execute.before/after,
ctx.shell.hook create.before, ctx.permission.hook evaluate,
ctx.session.hook compaction, ctx.event.subscribe for file/session/todo
events, ctx.tool.transform for custom tools). Windows-safe: replaces Bun
dollar-shell and grep with child_process.spawn + fs; every callback is
try/catch wrapped and every domain registration is guarded so a missing
capability degrades instead of crashing setup.
- Stop registering the same plugin id three times: OpenCode scans root-level
plugin files AND loads the directory through index.ts, so the directory
form of the plugin config produced two red "Duplicate plugin ID:
ecc-hooks" entries in the TUI panel. Config now points directly at
./plugins/ecc-hooks.ts and plugins/index.ts becomes an inert distinct-id
stub (kept on disk because install/uninstall plans and consent safety
tests reference it).
- Document the failure modes and the /api/plugin plus "opencode plugin list"
diagnostic playbook in TROUBLESHOOTING.md; align .opencode/README.md.
Verified: hook-consent, opencode-hook-consent-safety, install-lifecycle,
install-executor, harness-adapter-compliance tests pass (197 assertions);
check-hooks-schema-keys, validate-install-manifests, validate-hooks and
unicode-safety CI validators pass.
Under OpenCode the skill-health dashboard had no writer and no honest
fallback, so it reported every discovered skill as healthy (#2463).
Root cause: `post:skill:track` is only wired for Claude Code, where
`posttooluse-dispatcher.js` fans the event out to `skill-run-tracker.js`.
The OpenCode plugin re-implements the harness events instead of reusing that
dispatcher, so nothing ever wrote `skill-runs.jsonl` — and the tracker's
matcher only accepted the exact Claude Code tool name `Skill`, while OpenCode
calls the tool `skill`, so even wiring it would have dropped every event.
Commands that locate ECC through the inlined resolver in
`scripts/lib/resolve-ecc-root.js` also fell back to `~/.claude`, which does
not contain ECC, so they could not find their scripts.
Changes:
- `.opencode/plugins/ecc-hooks.ts`: dispatch `post:skill:track` from
`tool.execute.after`. The tracker module is imported lazily and behind
try/catch, matching the existing `changed-files-store` pattern: this file is
OpenCode's startup entry point, so a static import failure would crash the
session before any hook runs (#2530). The module is reused rather than
reimplemented, keeping its identifier validation, length bounds and
"never persist prompt text" guarantees.
- `scripts/hooks/skill-run-tracker.js`: match the tool name case-insensitively
so `Skill` and `skill` are both accepted.
- `scripts/lib/skill-evolution/health.js`: split the summary into
measured/healthy/declining/unmeasured instead of deriving `healthy = total -
declining`, which turned "no telemetry" into "everything is fine" for every
skill.
- `scripts/lib/skill-evolution/dashboard.js`: show the breakdown and warn
explicitly when skills have no recorded runs, since absence of telemetry is
not a health signal.
Under OpenCode the resolver also needs `CLAUDE_PLUGIN_ROOT`, which only the
plugin can supply: `shell.env` exports it when a root is found, without
replacing a root the user set or one an earlier plugin already put in
`output.env`.
Root discovery is per capability and probes required runtime files — never
optional content. Probing for `skills/continuous-learning-v2` (the
`workflow-quality` module) rejected supported modular installs that ship the
plugin and tracker without that optional module, disabling telemetry and the
root export for exactly those users.
Also fixes an incidental bug: the compiled plugin bundle is ESM, where
`__dirname` is undefined, so the ECC version lookup silently fell back to its
default. The module directory is now derived from `import.meta.url`.
Tests: `tests/opencode-plugin-hooks.test.js` covers the telemetry dispatch
(skill tool recorded, other tools ignored, minimal profile respected), a
modular install without the optional skills module, the root export and both
override paths; `tests/hooks/skill-run-tracker.test.js` covers the
case-insensitive matcher; `tests/lib/skill-evolution.test.js` and
`tests/lib/skill-dashboard.test.js` cover the unmeasured bucket, the warning
and the aged-out-coverage wording.
Refs #2463, #2530
pi/core and the bundled blueprint skill now refer to the project as ECC only;
the generated README no longer expands the name. Profile contents, package
name and paths are unchanged (123 skills, 24 commands).
The release workflows poll npm for up to five minutes after publish before
verifying the artifact. In 2.2.2 the check gave up after about 30 seconds while
npm was still processing, failing the run before latest was promoted and the
GitHub Release was created.
Version metadata synced to 2.2.3 with CHANGELOG, translated release headings
and release notes; skill-triggers registryDigest updated for the blueprint text.
Root package.json declared no main or exports, so OpenCode npm plugin
resolution (import.meta.resolve) failed and the plugin was silently
skipped (#3127). The .opencode TypeScript sources imported siblings
with .js specifiers that only exist after compilation, so the home
install, which loads the .ts files in place, crashed the tool registry
with ERR_MODULE_NOT_FOUND (#3112).
Declare main/types/exports on the root package pointing at the
compiled plugin entry, switch the sources to .ts specifiers, and
enable allowImportingTsExtensions with rewriteRelativeImportExtensions
so the emitted dist keeps working .js specifiers. Add smoke tests that
build the package, resolve and import the entry by name from a temp
install, and verify every in-place relative import resolves.
Fixes#3127Fixes#3112
Graduate 2.0.0-rc.1 to stable. Bump version across package, plugin,
marketplace, OpenCode, agent metadata, VERSION, and all localized docs.
Add 2.0.0 release notes + README sections (en/zh/pt-BR/tr), CHANGELOG
entry, and the ECC community Discord bot (dependency-free gateway client
+ guild command registrar). Update copilot-support and release-surface
tests for the sponsored-review migration and the 2.0.0 surface.
* perf(hooks): move post-edit-format and post-edit-typecheck to strict-only
These hooks fire synchronously on every Edit call with 15-30s timeouts
each. During multi-file refactors this adds 5-10 minutes of overhead.
Moving them from standard,strict to strict-only means they won't fire
in the default profile but are still available for users who want the
extra validation.
Fixes#735
* Also update OpenCode plugin to strict-only for format/typecheck
The OpenCode plugin had the same standard,strict profile for
post:edit:format and post:edit:typecheck, so OpenCode users on the
default profile would still get the per-edit overhead.
- Fix PluginContext → PluginInput type rename in @opencode-ai/plugin
- Import tool from @opencode-ai/plugin/tool subpath (fixes broken barrel export)
- Update client.app.log() calls to use new options-object API signature
- Stringify tool execute return values (SDK now requires Promise<string>)
- Add .js extensions to relative imports for NodeNext module resolution
- Update README star count (42K+) and contributor count (24)
Major OpenCode integration overhaul:
- llms.txt: Comprehensive OpenCode documentation for LLMs (642 lines)
- .opencode/plugins/ecc-hooks.ts: All Claude Code hooks translated to OpenCode's plugin system
- .opencode/tools/*.ts: 3 custom tools (run-tests, check-coverage, security-audit)
- .opencode/commands/*.md: All 24 commands in OpenCode format
- .opencode/package.json: npm package structure for opencode-ecc
- .opencode/index.ts: Main plugin entry point
- Delete incorrect LIMITATIONS.md (hooks ARE supported via plugins)
- Rewrite MIGRATION.md with correct hook event mapping
- Update README.md OpenCode section to show full feature parity
OpenCode has 20+ events vs Claude Code's 3 phases:
- PreToolUse → tool.execute.before
- PostToolUse → tool.execute.after
- Stop → session.idle
- SessionStart → session.created
- SessionEnd → session.deleted
- Plus: file.edited, file.watcher.updated, permission.asked, todo.updated
- 12 agents: Full parity
- 24 commands: Full parity (+1 from original 23)
- 16 skills: Full parity
- Hooks: OpenCode has MORE (20+ events vs 3 phases)
- Custom Tools: 3 native OpenCode tools
The OpenCode configuration can now be:
1. Used directly: cd everything-claude-code && opencode
2. Installed via npm: npm install opencode-ecc