feat: add multi-assistant adapter framework with OpenCode support#3
feat: add multi-assistant adapter framework with OpenCode support#3cuioss-oliver merged 2 commits intomainfrom
Conversation
Add an adapter system that exports marketplace bundles to other AI assistant formats while keeping Claude Code as the native runtime. - Add adapter base class (AdapterBase ABC) and OpenCode implementation - OpenCode adapter transforms frontmatter to OpenCode spec (Agent Skills spec compliant skills, permission-based agent config, command templates) - Maps Claude Code tool names to OpenCode equivalents and model IDs to provider/model-id format - Handles Skill: directives with OpenCode skill tool annotations - Generates opencode.json with skills.paths configuration - Excludes agents dependent on Claude-only tools (Task, Skill) - Add 55 tests covering frontmatter transformation, tool/permission mapping, body directives, integration, and bundle filtering - Generalize ~24 Claude-specific terminology references in pm-plugin-development to vendor-neutral language - Document adapter system in CLAUDE.md with OpenCode usage guide, format mapping table, and limitations disclaimer Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Summary of ChangesHello @cuioss-oliver, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the interoperability of the marketplace by introducing a flexible adapter framework. This framework allows existing AI assistant bundles, originally designed for Claude Code, to be exported and utilized in other AI assistant environments, starting with OpenCode. The changes lay the groundwork for broader compatibility and broaden the utility of the existing marketplace bundles. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-designed adapter framework for multi-assistant support, with an initial implementation for OpenCode, including new adapter logic, comprehensive tests, documentation updates, and the generalization of Claude-specific terminology for vendor neutrality. However, a security audit identified two path traversal vulnerabilities within this new framework: one high-severity issue potentially leading to arbitrary directory deletion, and another medium-severity issue allowing access to unintended directories, both stemming from insufficient validation of user-provided command-line arguments. Additionally, the custom frontmatter parser in opencode_adapter.py has been noted as complex and potentially brittle, with a recommendation to replace it with a standard YAML parsing library for improved robustness and maintainability.
Address Gemini review findings: - Add _safe_rmtree() that validates paths are within output_dir before deletion, preventing arbitrary directory removal via crafted --output - Sanitize bundle names in _discover_bundles() to reject path traversal sequences (../, slashes), preventing escape from marketplace_dir - Add 4 security tests covering both fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
marketplace/adapters/) that exports marketplace bundles to other AI assistant formats while keeping Claude Code as the native runtimeagentskills.io) and OpenCode config schema — transforms frontmatter, maps tool names to OpenCode equivalents, generatesopencode.jsonwith skill pathspm-plugin-developmentbundle to vendor-neutral language (preserving factual Claude-specific technical notes and external URLs)CLAUDE.mdwith usage guide, format mapping table, and limitations disclaimer noting this is only tested with Claude CodeTest plan
./pw module-tests adapters) — covers frontmatter transformation, tool/permission mapping, body directives, agent filtering, bundle filtering, idempotent generation./pw module-tests)./pw compile)./pw quality-gate).opencode/structure against realpm-dev-javabundlegrep -r "Claude Code" pm-plugin-development/only returns acceptable exceptions (external URLs, factual technical notes)🤖 Generated with Claude Code