Repository navigation
fix: write opencode events plugin to auto-discovered .opencode/plugins/ dir - #15
Merged
Merged
Conversation
…s/ dir
OpenCode auto-loads local plugins only from .opencode/plugins/ (plural)
and the plugin array in config. adlc-cli was writing to .opencode/plugin/
(singular), which is never discovered by the agent.
- registry.mjs: fix config_file path
- events.test.mjs: update 12 path assertions + mkdir join part
- e2e-{workspace,profiles}.sh: assert plugins/ (not plugin/)
- README.md: document correct path
Closes team-context auto-injection failure (team-diagnose link 5).
Two canonical events mapping to the same native event (e.g. file_edited and post_tool_use both → PostToolUse) silently overwrote each other: the build functions assigned result[nativeEvent] = entries, dropping every entry except the last canonical event processed. Latent until now (no manifest declared colliding canonical events); the file_edited mapping makes collisions live on claude-code, cursor, and codex. buildJsonNestedHooks (claude-code/cursor/devin) and buildCopilotHooks now accumulate into the existing array instead of overwriting.
Boot skills already capture decision drafts to .adlc/drafts/{type}/. This
adds the injection channel that nudges the agent to run the matching
existing clarify skill when a draft lands — replacing the unworkable
session_end dependency for opencode (no native session.end event).
- registry.mjs: file_edited canonical event; mappings for opencode
(file.edited), claude-code (PostToolUse + hookSpecificOutput envelope),
codex (PostToolUse + suppress), cursor (postToolUse, inherits "*":
suppress); explicit null for gemini/qwen/copilot/devin/tabnine until a
native surface is documented. CANONICAL_EVENTS updated (7→8).
- events.mjs (opencode generator): generic `event` subscription handler
(file.edited has no named hook key), runEvent payload param → dispatcher
stdin, _pendingNudge stash drained into the last user message by
messages.transform BEFORE the EXTREMELY_IMPORTANT early-return guard
(which would strand a mid-session nudge), standalone drainer when no
session_start handler is declared, own [pending-drafts] dedup marker.
- dispatcher.mjs: ADLC_EVENT env var so multi-mode skill scripts can
branch without payload sniffing.
- Tests: 5 new suites (generator shape, standalone drainer, accumulation
regression + envelope, codex/cursor suppression, unmapped agents skip).
- README: 8 canonical events table + file_edited per-agent delivery matrix.
kanfil
added a commit
to tikalk/adlc-team-skills
that referenced
this pull request
Sep 27, 2026
…l nudge
Boot skills already capture decision drafts to .adlc/drafts/{type}/; this
adds only the timely nudge toward the existing clarify skill, replacing
the unworkable session_end dependency for opencode (no native event).
- boot.sh/boot.ps1: ADLC_EVENT=file_edited mode — extract the edited file
path from the payload (opencode flat/nested + claude-code tool_input
shapes), stay silent unless it matches .adlc/drafts/**, then echo one
[pending-drafts] line naming the matching skill (adr→/architect-clarify,
pdr→/product-clarify, chdr→/change-clarify, cdr→/team-learn,
evals→/evals-clarify). Default session-start output byte-identical.
- .events.json: declare file_edited (timeout 10, matcher Edit|Write —
consumed only by agents that support it).
- docs/event-hook-contract.md: draft-nudge contract + per-agent delivery
matrix (opencode stash-drain, claude-code additionalContext, codex/cursor
suppressed no-ops).
- tests: 6 new functional tests (nudge mapping, non-draft silence, payload
shapes, garbage silence, default-mode untouched, ps1 parity).
Companion: tikalk/adlc-cli#15 (canonical event wiring + generator).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope (expanded)
.opencode/plugins/dirfile_editedcanonical event — draft-written clarify-skill nudge1. Plugin path fix
OpenCode auto-loads local plugins only from
.opencode/plugins/(plural) or thepluginconfig array (docs). adlc-cli was writing to.opencode/plugin/(singular) — never discovered..adlc/init-options.jsonconfiguredjqon PATHboot.shemits block2. Accumulation fix
buildJsonNestedHooks/buildCopilotHooksassignedresult[nativeEvent] = entries, so two canonical events sharing one native event silently overwrote each other. Latent untilfile_editedmade collisions live (file_edited + post_tool_use → PostToolUse).3.
file_editedcanonical eventBoot skills already capture decision drafts to
.adlc/drafts/{type}/; this adds the injection channel that nudges the agent toward the matching clarify skill when a draft lands — replacing the unworkablesession_enddependency for opencode.file.edited(genericeventsubscription)messages.transform(pre-guard)PostToolUse+matcherhookSpecificOutput.additionalContextPostToolUsepostToolUsenulluntil documentedAlso: dispatcher passes
ADLC_EVENTenv to skill scripts;CANONICAL_EVENTS7→8.Verification
Companion: tikalk/adlc-team-skills#40 (team-boot payload mode).