Repository navigation
feat(cli): build opencode commands in flat builds - #1390
Merged
Merged
Conversation
A flat build for OpenCode dropped a plugin's commands and warned they were out of scope, while an install delivered them. The tool's build contract now declares a commands artifact. A build and an install plan a command through one owner: placed in a folder of its plugin's name, named after the plugin, its links written in the tool's syntax and resolved to where the linked skill, agent or command lands. An install from a built tree owns those paths, and the out-of-scope warning no longer names commands for a tool whose build carries them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The support record read a tool's commands from its install profile for every layout, so a flat cell claimed commands a flat build does not write. A flat cell now reads the build contract; the marketplace cell reads the install profile. The command name prefix of opencode is read from its flat placement, one owner. A test proves an install keeps the tool's link syntax when its build carries no commands and the build's when it does. One built-tree read test covers commands, and the tests share the plugin root token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…layout Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
🎯 What & why
The OpenCode flat build now carries plugin commands. Before,
translate --as flatfor OpenCode dropped everycommands/entry, so a flat OpenCode install had no commands.🛠️ How it works
.opencode/commands/<plugin>/by the same flat install plan the install route already uses (flatCommandPlan:flatSectionPathplusprefixCommandName). The build reuses that route rather thancapabilities.commands, so the build output matches the install route byte for byte.name, so two plugins shipping the same file name (implement.md) do not collide.basenameincli/src/shared/domain/paths.model.ts. The duplicate copies inplugin-paths.ts,build-shared.tsandcopilot-content.model.tsare removed.[]in the build contract (one-line limit comment). The profile'slinkSyntaxkeeps its original form.installedCommandPlantakes prefix and link syntax from the build'scommandMarkdownwhen the build carries commands, and from the profile otherwise. A unit test pins both branches with a link the two syntaxes write differently (Kilo keeps its tool syntax, OpenCode its build's); each mutation of the line turns its own test red..opencode/commands/NN_x/...link through the profile'slinkSyntax(the build's is[]), and a link to a plugin file now lands where that file lands. Every other tool's install is unchanged.Open question for the reviewer: the route is
flatCommandPlan, notcapabilities.commands(aiddCommandsUnder,convertCommandFrontmatterNoHint). Confirm this is the intended route. If yes,capabilities.commandsremains the setup route only.🧪 How to verify
cd cli && pnpm exec vitest run tests/shared/domain/paths.model.unit.test.ts tests/contexts/translate/domain/layouts/build-flat-commands.unit.test.tsbasenamereplaced byreturn path;turns five tests red (the new "the file name of a path" test and four inbuild-flat-commands.unit.test.ts). Restored.opencode --version), modelopencode/big-pickle, throwaway HOME and project:opencode debug configlists both nested commands, keyedaidd-aidd-one:implementandaidd-aidd-two:implement.opencode run --commandon each returns its marker. Rebuild with--forceleaves the tree hash unchanged.cli/tests/golden/snapshots/tool-support/surface.jsonanddocs/COMPATIBILITY.md. A flat cell now reads the build contract, a marketplace cell the install profile. Cells that moved againstnext:aidd-prefix twice for a plugin whose own name starts withaidd-(aidd-aidd-one). The install route already writes it this way, and the build matches it.clibuild 924.0 KB against the 941 KB budget.🔗 Linked issue
Refs #789
✅ I certify
Support table
The support record reads rules and commands from the install profile on every layout, the same rule #1380 set for rules. A cell says what
aidddelivers. The flat commands cell moved from no to yes for Claude Code, Cursor, Copilot and Kilo, whose install profiles place commands, and for OpenCode, whose flat build now writes them.Not covered yet: no build-output golden carries a plugin with
commands/. The runtime check is one manual probe, on OpenCode 1.19.3.🤖 Generated with Claude Code