Skip to content

feat: add opencode plugin compatibility#15

Closed
gailingmic wants to merge 1 commit into
DietrichGebert:mainfrom
gailingmic:main
Closed

feat: add opencode plugin compatibility#15
gailingmic wants to merge 1 commit into
DietrichGebert:mainfrom
gailingmic:main

Conversation

@gailingmic

Copy link
Copy Markdown

Add .opencode/ directory with plugin, commands, and skill definitions. Update hooks and statusline scripts to detect opencode flag path (~/.config/opencode/.ponytail-active) alongside existing Claude Code and Codex paths.

Add .opencode/ directory with plugin, commands, and skill definitions.
Update hooks and statusline scripts to detect opencode flag path
(~/.config/opencode/.ponytail-active) alongside existing Claude Code
and Codex paths.
@DietrichGebert

DietrichGebert commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Thanks for kicking off OpenCode support, @gailingmic. It prompted a proper dig into the OpenCode plugin API.

One blocker worth flagging: this plugin is built on hooks that don't exist in the current OpenCode API. session.created and tui.prompt.append aren't real OpenCode hooks, and there's no output.systemPrompt to mutate in a session hook, so as written it would load but silently no-op (nothing injected, no mode tracking).

The real mechanism (verified against OpenCode 1.17.4 source plus a live run):

  • Inject via the experimental.chat.system.transform hook (mutate output.system: string[]).
  • Server plugins export default async (input) => hooks.
  • Plugins are discovered through the opencode.json "plugin" array, not a .opencode-plugin/plugin.json or a package.json block.

I've opened #16 with a version rebuilt on that API. It also reuses the shared instruction builder (hooks/ponytail-instructions.js) instead of copying SKILL.md and the filter/fallback logic, so there's one source of truth. End-to-end tested on 1.17.4: the hook fires and the ruleset reaches the model.

Credit to you for the idea and the nudge to support OpenCode 🙏

@DietrichGebert

Copy link
Copy Markdown
Owner

Closing in favor of #16, which is rebuilt on the real OpenCode plugin API and verified end-to-end. Thanks again @gailingmic for raising OpenCode support.

DietrichGebert added a commit that referenced this pull request Jun 13, 2026
Thin OpenCode plugin injecting the ponytail ruleset via experimental.chat.system.transform, reusing the shared instruction builder. Verified end-to-end on OpenCode 1.17.4. Supersedes #15.
maxfelker pushed a commit to maxfelker/ponytail that referenced this pull request Jun 15, 2026
Thin OpenCode plugin injecting the ponytail ruleset via experimental.chat.system.transform, reusing the shared instruction builder. Verified end-to-end on OpenCode 1.17.4. Supersedes DietrichGebert#15.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants