feat(init): add OpenCode tool support#47
Conversation
… rules - Add 'opencode' to SupportedTools map in tool_templates.go with generateOpenCodeConfig() - Write skills to .opencode/skills/<name>/SKILL.md with YAML frontmatter - Write commands to .opencode/commands/ - Write lint rules to .claude/lint-rules/ (shared path used by mxcli lint) - Write opencode.json pointing to AGENTS.md and .ai-context/skills/ - Install VS Code extension for opencode tool same as claude - Add wrapSkillContent() and extractSkillDescription() helpers - Update cmd_add_tool.go Long description to list opencode - Add 13 tests (unit + integration) in init_test.go
- New dedicated tutorial page (docs-site/src/tutorial/opencode.md) - Add OpenCode to SUMMARY.md nav after claude-code.md - Update ai-assistants.md: count five -> six, add OpenCode row - Update other-ai-tools.md: add OpenCode section with link to dedicated page - Update mxcli-init.md Supported AI Tools table with OpenCode row - Update README.md intro sentence and Supported AI Tools table
There was a problem hiding this comment.
Pull request overview
Adds OpenCode as a first-class AI tool option across mxcli init/docs, including generated config, OpenCode-specific directory scaffolding, and tests.
Changes:
- Add
opencodeto supported tool templates andmxcli initgeneration (config +.opencode/structure + VS Code extension install). - Add OpenCode-focused documentation pages and navigation entries across the docs site + README.
- Add new
initunit/integration tests covering OpenCode outputs (skills frontmatter, commands, lint rules).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| docs-site/src/tutorial/other-ai-tools.md | Mentions OpenCode support and links to dedicated OpenCode page. |
| docs-site/src/tutorial/opencode.md | New OpenCode integration tutorial and workflow documentation. |
| docs-site/src/tutorial/ai-assistants.md | Adds OpenCode to the supported tools table/count. |
| docs-site/src/ide/mxcli-init.md | Documents --tool opencode outputs. |
| docs-site/src/SUMMARY.md | Adds OpenCode tutorial to docs navigation. |
| cmd/mxcli/tool_templates.go | Registers opencode tool and generates opencode.json. |
| cmd/mxcli/init.go | Implements .opencode directory creation, OpenCode skills/commands copying, and shared lint-rules behavior. |
| cmd/mxcli/init_test.go | New tests verifying OpenCode init output structure and frontmatter. |
| cmd/mxcli/cmd_add_tool.go | Updates supported tools list text to include opencode. |
| README.md | Adds OpenCode to supported tools list/table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ec6222b to
fb2b395
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add opencode to --tool flag help text - Fix extractSkillDescription comment (returns 'MDL skill', not the skill name) - Add yamlSingleQuote() helper; use it in wrapSkillContent to safely escape skill names and descriptions in YAML frontmatter - Update init_test.go assertions to match new single-quoted frontmatter format - Fix opencode.json doc example to match generateOpenCodeConfig actual output - Remove false panic claim from runInit test helper comment - Wire full OpenCode sidecar into cmd_add_tool.go (commands, lint-rules, skills) - Guard OpenCode lint-rule write with slices.Contains(tools, "claude") to prevent duplicate writes when both tools are selected or --all-tools is used - Capture and handle fs.WalkDir errors in cmd_add_tool.go OpenCode sidecar - Move success message in cmd_add_tool.go to after the OpenCode sidecar block - Add .opencode/skills/**/SKILL.md to generateOpenCodeConfig instructions - Update opencode.md doc example and prose to match generated config - Rename other-ai-tools.md heading to '# Other AI tools' - Fix stale link text in opencode.md to match renamed heading - Nil out vsixData in runInit test helper to prevent external CLI side effects - Fix lint-rule guard to use resolved 'tools' slice instead of 'initTools'
fb2b395 to
0eab8df
Compare
ako
left a comment
There was a problem hiding this comment.
Clean PR, good scope, solid test coverage (13 tests). Smart lint-rules dedup guard. Minor suggestion: the fs.WalkDir + write pattern is duplicated between init.go and cmd_add_tool.go (~180 lines) — a shared helper would clean that up, but not blocking.
Summary
--tool opencodetomxcli initandmxcli add-toolwith deep integration: skills, commands,opencode.json, and Starlark lint rules.opencode/skills/<name>/SKILL.mdwith YAML frontmatter (name,description,compatibility: opencode).opencode/commands/, lint rules to.claude/lint-rules/(shared path used bymxcli lintregardless of tool)opencodethe same way it is forclaudeCommits
feat(init): add OpenCode tool support with skills, commands, and lint rules—tool_templates.go,init.go,cmd_add_tool.go+ 13 new tests ininit_test.godocs: add OpenCode integration documentation— newdocs-site/src/tutorial/opencode.md, SUMMARY.md nav entry, updates toai-assistants.md,other-ai-tools.md,mxcli-init.md,README.mdNotes
TestAgentListenerAcceptsConnectionetc.) are unrelated — they fail on unmodifiedmaindue to a macOS Unix socket path length limit