fix(install): expose Ring skills as opencode slash commands#401
Open
alexgarzao wants to merge 1 commit into
Open
fix(install): expose Ring skills as opencode slash commands#401alexgarzao wants to merge 1 commit into
alexgarzao wants to merge 1 commit into
Conversation
The opencode TUI silently filters source="skill" entries from the `/` autocomplete (see autocomplete.tsx in packages/opencode), so only real command-source files appear. Previously, only `/ring:dev-license` showed up because it was the lone file under `*/commands/`; all 69 skills were invisible to the autocomplete despite being registered. Add an opt-in `--emit-opencode-skill-shim` mode to the codex frontmatter helper that reads a SKILL.md and emits a minimal slash-command shim (preserving the skill name and description). install-symlinks.sh now calls it once per skill during the opencode build, skipping shared-patterns and any destination already produced by a real command file so existing commands keep precedence. X-Lerian-Ref: 0x1
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds infrastructure to generate Opencode command shims from Ring skills. A new Python CLI mode reads skill frontmatter, validates required fields, and writes minimal shims containing name, description, and an invocation line. A corresponding shell helper iterates per-team skill folders and generates shims during the ring build process, respecting ChangesOpencode Skill Command Shim Generation
Comment |
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.
Summary
/slash-command autocomplete as/ring:<skill-name>(e.g./ring:codereview,/ring:dev-cycle,/ring:commit)..ring-build/opencode/command/<team>/<skill>.md; real command files (today onlydev-team/commands/dev-license.md) keep precedence — shims never overwrite.--emit-opencode-skill-shimmode added toscripts/_codex_frontmatter.py(stdlib-only, reuses the existing frontmatter parser).Why
When the user types
/in the opencode TUI, only/ring:dev-licenseshows up among Ring entries — the other 69 skills are missing. Tracing it down:packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx:The TUI explicitly drops every command whose
sourceis"skill". Skills are still loaded by the runtime (Skill.Service.all() works, and the agent can invoke them via the Skill tool), but they never surface to the/autocomplete. Only files placed undercommand/orcommands/register withsource: "command"and pass the filter.Before this fix, the Ring repo had a single
commands/file (dev-team/commands/dev-license.md), so/ring:dev-licensewas the only Ring command visible to opencode users. Verified live againsthttp://127.0.0.1:9876/command:/)* the 23 remaining
source=skillentries are from~/.claude/skills/(opencode also scans Claude Code's external skills dir) — these are leftovers from older Ring installs and are outside this fix's scope.The shim approach mirrors what other plugins (e.g. Optimus) do to expose their skills to opencode — a minimal
.mdthat delegates back to the skill tool.Implementation
scripts/_codex_frontmatter.py— adds--emit-opencode-skill-shimmode:SKILL.md, extractsnameanddescriptionfrom frontmatter (reuses_extract_descriptionso multi-line block scalars collapse correctly).tmp + os.replace.install-symlinks.sh— addsbuild_make_opencode_skill_commands():$RING_DIR/<team>/skills/*/SKILL.md, skippingshared-patterns.build_copy_opencode_commandsruns first and keeps precedence for real commands).DRY_RUNandvlog.do_build()right afterbuild_copy_opencode_commands.Coupling is tight: bash invokes the Python helper per skill. Single atomic commit because splitting would land a helper flag that nothing calls, then a bash function whose runtime dependency is in the previous commit.
Test plan
bash install-symlinks.sh buildproduces.ring-build/opencode/command/with 70 files (1 realdev-license.md+ 69 shimmed skills).wc -l .ring-build/opencode/command/dev-team/dev-license.mdstill matches the source (102 lines) — real command file unmodified by the shim pass.commit), multi-line block scalar (codereview), folded YAML (pre-dev-research).bash install-symlinks.sh doctor --opencodereports all opencode targets PASS.curl http://127.0.0.1:9876/commandafteropencode serveboot: 70 Ring entries withsource: "command"(was 1)./ring:— confirm/ring:codereview,/ring:dev-cycle,/ring:commitetc. appear in autocomplete./ring:codereviewand confirm the shim template delegates to the skill via the Skill tool.Out of scope
source=skillRing entries that remain visible to the opencode runtime come from~/.claude/skills/(opencode scans Claude Code's external skill dir). These are stale skills from older Ring installs in that directory, not from this repo. Cleaning them up is a separate housekeeping task.