Skip to content

Comments

feat: add multi-assistant adapter framework with OpenCode support#3

Merged
cuioss-oliver merged 2 commits intomainfrom
feature/skill_handling
Feb 23, 2026
Merged

feat: add multi-assistant adapter framework with OpenCode support#3
cuioss-oliver merged 2 commits intomainfrom
feature/skill_handling

Conversation

@cuioss-oliver
Copy link
Collaborator

Summary

  • Add adapter framework (marketplace/adapters/) that exports marketplace bundles to other AI assistant formats while keeping Claude Code as the native runtime
  • Implement OpenCode adapter following the Agent Skills specification (agentskills.io) and OpenCode config schema — transforms frontmatter, maps tool names to OpenCode equivalents, generates opencode.json with skill paths
  • Generalize ~24 Claude-specific terminology references in pm-plugin-development bundle to vendor-neutral language (preserving factual Claude-specific technical notes and external URLs)
  • Add comprehensive documentation in CLAUDE.md with usage guide, format mapping table, and limitations disclaimer noting this is only tested with Claude Code

Test plan

  • 55 adapter tests pass (./pw module-tests adapters) — covers frontmatter transformation, tool/permission mapping, body directives, agent filtering, bundle filtering, idempotent generation
  • Full test suite passes (1673 tests, ./pw module-tests)
  • mypy type checking passes (./pw compile)
  • ruff quality gate passes (./pw quality-gate)
  • Manual validation: adapter generates correct .opencode/ structure against real pm-dev-java bundle
  • Terminology audit: grep -r "Claude Code" pm-plugin-development/ only returns acceptable exceptions (external URLs, factual technical notes)

🤖 Generated with Claude Code

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>
@cla-assistant
Copy link

cla-assistant bot commented Feb 22, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link

cla-assistant bot commented Feb 22, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Multi-Assistant Adapter Framework: Introduced a new adapter framework within the marketplace to support exporting bundles to various AI assistant formats, while retaining Claude Code as the native runtime.
  • OpenCode Adapter Implementation: Implemented an OpenCode adapter that transforms existing marketplace bundles into the OpenCode specification, including frontmatter adjustments, tool mapping, and opencode.json generation.
  • Vendor-Neutral Terminology: Generalized approximately 24 Claude-specific terminology references across the pm-plugin-development bundle to be vendor-neutral, while retaining essential technical details and external URLs.
  • Comprehensive Documentation: Added extensive documentation in CLAUDE.md detailing multi-assistant support, OpenCode generation, usage, format mapping, and known limitations.
Changelog
  • CLAUDE.md
    • Added a new adapters/ directory entry to the marketplace structure.
    • Introduced a "Multi-Assistant Support" section with details on the adapter system, OpenCode generation, usage, format mapping, and limitations.
  • marketplace/.claude-plugin/marketplace.json
    • Updated the description for "pm-plugin-development" to use vendor-neutral language.
  • marketplace/adapters/init.py
    • Added the initialization file for the new adapters Python package.
  • marketplace/adapters/adapter_base.py
    • Defined the AdapterBase abstract class, establishing the contract for new marketplace adapters.
  • marketplace/adapters/generate.py
    • Created a CLI script for generating adapter output, allowing selection of target assistant formats and specific bundles.
  • marketplace/adapters/opencode_adapter.py
    • Implemented the OpenCodeAdapter for converting Claude Code bundles to OpenCode format, including frontmatter parsing, tool/model mapping, and body transformation.
  • marketplace/bundles/pm-plugin-development/.claude-plugin/plugin.json
    • Modified the bundle description to be vendor-neutral.
  • marketplace/bundles/pm-plugin-development/README.md
    • Updated the bundle's purpose description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plan-marshall-plugin/SKILL.md
    • Adjusted the module discovery description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plan-marshall-plugin/extension.py
    • Updated the skill domain description to be vendor-neutral.
  • marketplace/bundles/pm-plugin-development/skills/plan-marshall-plugin/scripts/plugin_discover.py
    • Revised the script description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/SKILL.md
    • Updated descriptions within the skill to be vendor-neutral.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/architecture-rules.md
    • Modified the architectural principles description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/askuserquestion-patterns.md
    • Updated the guide description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/core-principles.md
    • Renamed the title and updated the foundational principles description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/execution-directive.md
    • Updated the research basis description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/frontmatter-standards.md
    • Modified the frontmatter standards description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-architecture/references/minimal-wrapper-pattern.md
    • Updated the overview description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-create/SKILL.md
    • Adjusted the skill description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-create/references/agent-guide.md
    • Updated the agent creation guide description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-create/references/command-guide.md
    • Modified the command creation guide description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-create/references/skill-guide.md
    • Updated the skill creation guide description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-doctor/references/fix-catalog.md
    • Revised the exempt patterns description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-doctor/standards/doctor-skills.md
    • Adjusted the exempt patterns description for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-maintain/assets/readme-template.md
    • Updated installation instructions for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-maintain/references/readme-maintenance-guide.md
    • Modified installation instructions for vendor neutrality.
  • marketplace/bundles/pm-plugin-development/skills/plugin-maintain/scripts/_cmd_readme.py
    • Updated installation instructions within the script for vendor neutrality.
  • test/adapters/conftest.py
    • Added a new test configuration file for adapter tests.
  • test/adapters/test_adapter_base.py
    • Added unit tests for the AdapterBase abstract class.
  • test/adapters/test_opencode_adapter.py
    • Added unit and integration tests for the OpenCodeAdapter functionality.
Activity
  • 55 adapter-specific tests passed, covering various transformation and generation scenarios.
  • The full test suite, comprising 1673 tests, passed successfully.
  • Mypy type checking completed without issues.
  • Ruff quality gate checks passed, ensuring code quality.
  • Manual validation confirmed the correct generation of the .opencode/ structure for a real bundle.
  • A terminology audit verified that "Claude Code" references were appropriately generalized or retained where technically necessary.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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>
@cuioss-oliver cuioss-oliver merged commit d4c42b5 into main Feb 23, 2026
4 checks passed
@cuioss-oliver cuioss-oliver deleted the feature/skill_handling branch February 23, 2026 08:11
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.

1 participant