fix(opencode): rename .opencode/command/ → .opencode/commands/ to match OpenCode's discovery convention#130
Open
fcmfcm01 wants to merge 1 commit into
Conversation
…tch OpenCode's discovery convention OpenCode auto-discovers commands from .opencode/commands/ (plural, per the official docs at https://opencode.ai/docs/commands), but ponytail shipped them in .opencode/command/ (singular), so the slash commands (/ponytail, /ponytail-audit, /ponytail-review, /ponytail-debt, /ponytail-help) were never auto-loaded. The plugin's system-prompt injection worked, but the README claim 'adds the /ponytail commands' was effectively false for everyone except someone running OpenCode from inside this repo's checkout with manual discovery. Changes: - git mv .opencode/command .opencode/commands (rename detected, history preserved) - tests/commands.test.js: update path assertion to .opencode/commands/ - docs/agent-portability.md: update OpenCode row to .opencode/commands/ - README.md: add global install instructions (symlink into ~/.config/opencode/commands/) for cross-project use
slamp
suggested changes
Jun 17, 2026
|
|
||
| ```bash | ||
| mkdir -p ~/.config/opencode/commands | ||
| ln -s "$PWD"/.opencode/commands/*.md ~/.config/opencode/commands/ |
There was a problem hiding this comment.
$PWD extends to where you run it, not to the root of the repository, it's easy to miss it even if it's written a few lines above. Instead, in the README we could write:
mkdir -p ~/.config/opencode/commands
ln -sf /path/to/ponytail/.opencode/commands/*.md ~/.config/opencode/commands/I added the -f , because rerunning fails with "File exists" on existing symlinks
/cc @fcmfcm01
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.

Problem
OpenCode auto-discovers custom commands from
.opencode/commands/(plural), per the official docs:Ponytail shipped them in
.opencode/command/(singular), so the slash commands (/ponytail,/ponytail-audit,/ponytail-review,/ponytail-debt,/ponytail-help) were never auto-loaded by OpenCode. The plugin'sexperimental.chat.system.transformhook correctly injected the ruleset and persisted/ponytailmode switches, but typing any of those commands in the TUI produced no completion and no execution — the entire string was passed through as a user message.The README's claim that the plugin "adds the
/ponytailcommands" was effectively false for everyone except someone running OpenCode from inside this repo's checkout (and even then, only by accident of the plugin-relative path).Fix
Rename the directory to match OpenCode's convention:
git mv .opencode/command .opencode/commands(rename detected by git, file history preserved at 100% similarity)tests/commands.test.js: path assertion updated to.opencode/commands/docs/agent-portability.md: OpenCode row updated to.opencode/commands/README.md: add a paragraph in the OpenCode install section documenting how to use the commands globally across projects (symlink into~/.config/opencode/commands/), since the plugin path only auto-discovers commands when running OpenCode from this repo's rootVerification
The 5 commands tests in
tests/commands.test.jsall pass after the path update. The single failure is a pre-existing CSV benchmark env issue (same# fail 1onmainwithout my changes).Notes
hooks/,skills/,command/— all singular), but OpenCode's spec requires pluralcommands/. Aligning to the spec is the smaller change than asking OpenCode to accept both forms.Run once from the repo root; rerun if a new command is added; restart OpenCode.