Skip to content

feat(init): add OpenCode tool support#47

Merged
ako merged 3 commits intomendixlabs:mainfrom
retran:feat/opencode-tool-support
Mar 27, 2026
Merged

feat(init): add OpenCode tool support#47
ako merged 3 commits intomendixlabs:mainfrom
retran:feat/opencode-tool-support

Conversation

@retran
Copy link
Copy Markdown
Contributor

@retran retran commented Mar 27, 2026

Summary

  • Adds --tool opencode to mxcli init and mxcli add-tool with deep integration: skills, commands, opencode.json, and Starlark lint rules
  • OpenCode skills use .opencode/skills/<name>/SKILL.md with YAML frontmatter (name, description, compatibility: opencode)
  • Commands go to .opencode/commands/, lint rules to .claude/lint-rules/ (shared path used by mxcli lint regardless of tool)
  • VS Code extension is installed for opencode the same way it is for claude
  • Claude Code remains the default tool

Commits

  • feat(init): add OpenCode tool support with skills, commands, and lint rulestool_templates.go, init.go, cmd_add_tool.go + 13 new tests in init_test.go
  • docs: add OpenCode integration documentation — new docs-site/src/tutorial/opencode.md, SUMMARY.md nav entry, updates to ai-assistants.md, other-ai-tools.md, mxcli-init.md, README.md

Notes

  • Pre-existing TUI test failures (TestAgentListenerAcceptsConnection etc.) are unrelated — they fail on unmodified main due to a macOS Unix socket path length limit

retran added 2 commits March 27, 2026 17:17
… 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
Copilot AI review requested due to automatic review settings March 27, 2026 16:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 opencode to supported tool templates and mxcli init generation (config + .opencode/ structure + VS Code extension install).
  • Add OpenCode-focused documentation pages and navigation entries across the docs site + README.
  • Add new init unit/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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@retran retran requested a review from Copilot March 27, 2026 17:39
@retran retran force-pushed the feat/opencode-tool-support branch from ec6222b to fb2b395 Compare March 27, 2026 17:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
@retran retran force-pushed the feat/opencode-tool-support branch from fb2b395 to 0eab8df Compare March 27, 2026 17:49
Copy link
Copy Markdown
Collaborator

@ako ako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ako ako merged commit 0f75fae into mendixlabs:main Mar 27, 2026
1 check passed
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.

3 participants