Skip to content

Multi-Provider AI Architecture Research & Detail #157

@snipcodeit

Description

@snipcodeit

Research: Multi-Provider Extensibility for MGW

Currently, MGW is tightly coupled to the claude-code CLI. To support Gemini and OpenCode, the following architectural changes are required:

1. Provider Abstraction

Refactor lib/claude.cjs into a provider-based system.

  • Define a Provider interface: assertAvailable(), invoke(commandFile, userPrompt, options).
  • Implement ClaudeProvider (default), GeminiProvider, and OpenCodeProvider.
  • Use a ProviderManager to resolve the active provider via config or flags (--provider).

2. GSD Integration Generalization

The gsd-adapter.cjs currently assumes GSD is installed at ~/.claude/get-shit-done/.

  • Support GSD_TOOLS_PATH environment variable.
  • Support a configurable GSD path in .mgw/config.json.
  • Generalize gsd-tools invocation so it doesnt depend on the Claude environment.

3. Command Installation

The mgw-install.cjs script is hardcoded to ~/.claude/commands/mgw/.

  • Detect the active AI CLI and install to the appropriate command directory (e.g., ~/.gemini/commands/mgw/).

4. GSD Route Compatibility

Ensure that GSD routes (quick, plan-phase, etc.) work correctly when executed via Gemini or OpenCode. This may require updating the prompt templates in commands/*.md to be more LLM-agnostic or providing provider-specific overrides.

Task List

  • Define Provider interface and refactor lib/claude.cjs to lib/provider-claude.cjs
  • Implement GeminiProvider
  • Implement OpenCodeProvider
  • Update gsd-adapter.cjs with configurable GSD path resolution
  • Update mgw-install.cjs for multi-CLI support
  • Verify mgw:run pipeline on Gemini CLI

/cc @snipcodeit

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture and design patternsenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions