npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@musuhi-ng/platform-adapters

v1.0.1

Published

Multi-platform AI integration adapters for MUSUHI 2.0 SDD framework

Readme

@musuhi-ng/platform-adapters

Multi-platform AI integration adapters for MUSUHI 2.0 Specification Driven Development framework.

Overview

@musuhi-ng/platform-adapters provides a unified interface for integrating MUSUHI 2.0 with 8 major AI coding assistant platforms. This enables platform-agnostic SDD workflows that work seamlessly across different development environments.

Features

✅ AC-8.1: Platform-Agnostic Core

Core SDD logic remains independent of specific AI platforms.

✅ AC-8.2: CLI Interface Support

Adapters for CLI-based platforms:

  • Claude Code (Anthropic) - Primary platform
  • Codex CLI (OpenAI)
  • Gemini CLI (Google)
  • Qwen Code (Alibaba)

✅ AC-8.3: IDE Extension Support

Adapters for IDE-based platforms:

  • VS Code + GitHub Copilot
  • Cursor (AI-first editor)
  • Zed (high-performance editor)
  • Windsurf IDE (AI-native IDE)

✅ AC-8.4: Unified Configuration

Single .musuhi/config.yaml format shared across all platforms.

✅ AC-8.5: Context Sharing

Maintains project context (steering/, specs/, changes/, archive/) across platform switches.

✅ AC-8.6: Platform-Specific Optimizations

Integrates platform-specific features while maintaining common interface.

✅ AC-8.7: LLM Abstraction Layer

Supports Claude, GPT-4, Gemini, Qwen models transparently.

✅ AC-8.8: Auto-Detection

Automatically detects and configures appropriate platform integration.

✅ AC-8.9: Compatibility Matrix

Comprehensive documentation of feature availability per platform.

Installation

pnpm add @musuhi-ng/platform-adapters

Usage

Auto-Detection (Recommended)

import { AdapterFactory } from '@musuhi-ng/platform-adapters';

// Auto-detect and initialize
const adapter = await AdapterFactory.createAutoDetected('/path/to/project');

// Use the adapter
const response = await adapter.invokeAgent(
  { name: 'requirements-analyst', role: 'requirements' },
  {
    cwd: '/path/to/project',
    steering: {
      structure: 'structure.md',
      tech: 'tech.md',
    },
  }
);

console.log(response.message);

Manual Platform Selection

import {
  AdapterFactory,
  ClaudeCodeAdapter,
} from '@musuhi-ng/platform-adapters';

// Option 1: Use factory
const adapter = AdapterFactory.createAdapter('claude-code', '/path/to/project');
await adapter.initialize();

// Option 2: Direct instantiation
const claudeAdapter = new ClaudeCodeAdapter('/path/to/project');
await claudeAdapter.initialize();

LLM Abstraction Layer

import { ClaudeProvider, OpenAIProvider } from '@musuhi-ng/platform-adapters';

// Use Claude LLM
const claude = new ClaudeProvider({
  model: 'claude-3-sonnet-20240229',
  temperature: 0.7,
});

const response = await claude.invoke(
  'Generate TypeScript interface for User model'
);

// Switch to GPT-4 (same interface)
const gpt4 = new OpenAIProvider({
  model: 'gpt-4-turbo-preview',
  temperature: 0.7,
});

const response2 = await gpt4.invoke(
  'Generate TypeScript interface for User model'
);

Platform Detection

Auto-detection follows this priority:

  1. Environment Variables (highest priority)

    • CLAUDE_CODE=1 → Claude Code
    • CURSOR_IDE=1 → Cursor
    • VSCODE_PID=12345 + GITHUB_COPILOT=1 → VS Code + Copilot
    • ZED_EDITOR=1 → Zed
    • WINDSURF_IDE=1 → Windsurf
    • OPENAI_CODEX=1 → Codex CLI
    • GOOGLE_GEMINI=1 → Gemini CLI
    • QWEN_CODE=1 → Qwen Code
  2. Installed Extensions/Plugins

    • .cursor/ directory → Cursor
    • .vscode/extensions/github.copilot → VS Code + Copilot
    • .zed/ directory → Zed
    • .windsurf/ directory → Windsurf
  3. CLI Availability

    • which claude → Claude Code
    • which cursor → Cursor
    • which code → VS Code
    • which zed → Zed
    • which windsurf → Windsurf
    • which codex → Codex CLI
    • which gemini → Gemini CLI
    • which qwen → Qwen Code
  4. Config File (.musuhi/config.yaml)

    platform: claude-code
  5. Default Fallback

    • Falls back to claude-code

Compatibility Matrix

| Feature | Claude Code | Cursor | VS Code | Zed | Windsurf | Codex | Gemini | Qwen | | ------------------------- | ----------- | ------ | ------- | --- | -------- | ----- | ------ | ---- | | Constitutional Governance | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Change Workflow | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Multi-Agent Orchestration | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Parallel Execution | ✅ | ✅ | ✅ | ✅ | ✅ | ⚠️ | ⚠️ | ⚠️ | | Gap Analysis | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Dashboard (TUI) | ✅ | ✅ | ⚠️ | ✅ | ⚠️ | ✅ | ✅ | ✅ | | Streaming Support | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ |

Legend:

See Compatibility Matrix for detailed feature comparison.

Architecture

Base Classes

abstract class BasePlatformAdapter implements IPlatformAdapter {
  abstract readonly platform: PlatformType;
  abstract readonly version: string;
  abstract invokeAgent(
    agent: AgentConfig,
    context: AgentContext
  ): Promise<AgentResponse>;
  abstract readSteering(path: string): Promise<string>;
  abstract writeDelta(path: string, delta: Delta): Promise<void>;
  abstract enforcePhaseGate(gate: PhaseGate): Promise<GateResult>;
  abstract getCapabilities(): PlatformCapabilities;
}

abstract class CLIAdapterBase extends BasePlatformAdapter {
  protected abstract cliCommand: string;
  protected async execCLI(args: string[]): Promise<string>;
  protected async isCLIAvailable(): Promise<boolean>;
}

Platform Adapters

  • ClaudeCodeAdapter (extends CLIAdapterBase)
  • CodexCLIAdapter (extends CLIAdapterBase)
  • GeminiCLIAdapter (extends CLIAdapterBase)
  • QwenCodeAdapter (extends CLIAdapterBase)
  • CursorAdapter (extends BasePlatformAdapter)
  • VSCodeCopilotAdapter (extends BasePlatformAdapter)
  • ZedAdapter (extends BasePlatformAdapter)
  • WindsurfAdapter (extends BasePlatformAdapter)

LLM Providers

  • ClaudeProvider (implements ILLMProvider)
  • OpenAIProvider (implements ILLMProvider)
  • GeminiProvider (implements ILLMProvider)
  • QwenProvider (implements ILLMProvider)

API Reference

AdapterFactory

class AdapterFactory {
  static detectPlatform(projectRoot?: string): PlatformType;
  static createAdapter(
    platform: PlatformType,
    projectRoot?: string
  ): IPlatformAdapter;
  static async createAutoDetected(
    projectRoot?: string
  ): Promise<IPlatformAdapter>;
}

IPlatformAdapter

interface IPlatformAdapter {
  readonly platform: PlatformType;
  readonly version: string;

  initialize(): Promise<void>;
  invokeAgent(
    agent: AgentConfig,
    context: AgentContext
  ): Promise<AgentResponse>;
  readSteering(path: string): Promise<string>;
  writeDelta(path: string, delta: Delta): Promise<void>;
  enforcePhaseGate(gate: PhaseGate): Promise<GateResult>;
  getCapabilities(): PlatformCapabilities;
}

ILLMProvider

interface ILLMProvider {
  readonly name: string;
  readonly model: string;

  invoke(prompt: string, context?: Record<string, unknown>): Promise<string>;
  supportsStreaming(): boolean;
  stream?(
    prompt: string,
    context: Record<string, unknown> | undefined,
    onChunk: (chunk: string) => void
  ): Promise<void>;
}

Constitutional Principles

This package adheres to MUSUHI 2.0's 9 Constitutional Articles:

  • Article 1 (Library-First): Reuses @musuhi-ng/core types and interfaces
  • Article 2 (Test-First): 72+ tests with 80%+ coverage
  • Article 4 (Documentation-First): Comprehensive README and compatibility matrix
  • Article 5 (Simplicity-First): Abstract base classes reduce duplication
  • Article 6 (SOLID): Each adapter implements single responsibility

Testing

# Run all tests
pnpm test

# Run with coverage
pnpm test:coverage

# Run in watch mode
pnpm test:watch

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

MIT © MUSUHI Team

Related Packages

  • @musuhi-ng/core - Core types and utilities
  • @musuhi-ng/constitutional-governance - Constitutional validation
  • @musuhi-ng/change-workflow - Change management
  • @musuhi-ng/multi-agent-orchestrator - Agent orchestration

Support