Skip to content
Conduit

skill

nexus-dev-mmf

Multi-Model Fusion Engine — Adaptive multi-model orchestrator that decomposes, routes, executes in parallel, and synthesizes results from multiple GLM models via z-ai-web-dev-sdk

roman-ryzenadvanced/nexus-dev-mmfcommunitylistedunreviewed

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/roman-ryzenadvanced/nexus-dev-mmf itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Oct 25, 2026

🧠 Nexus-Dev MMFE

Multi-Model Fusion Engine

An intelligent multi-model orchestration framework that decomposes complex tasks, adaptively routes subtasks to the optimal GLM models, executes them in parallel, and synthesizes a single unified answer — with MTP hyperthreading, code review, and AI SLOPE elimination for design tasks.

Version License: MIT Node.js TypeScript npm

Installation · Quick Start · Nexus Code TUI · Architecture · API Reference · Design Skill · Code Review · MTP


Table of Contents


Overview

Nexus-Dev MMFE is an adaptive orchestration layer that transforms any complex request into a coordinated, parallel execution across multiple GLM models. Rather than relying on a single model for everything — and accepting its weaknesses alongside its strengths — Nexus-Dev decomposes your request, assigns each piece to the model best suited for it, runs them all simultaneously, and then intelligently merges the results into one polished, unified answer.

Think of it as assembling a team of specialists: a reasoning expert, a speed demon, a creative writer, a code synthesizer — all working in parallel on different aspects of your request, with a lead architect who combines their outputs into something better than any individual could produce alone.

Why Multi-Model?

Single ModelMulti-Model Fusion
One model's strengths & weaknesses applied to everythingEach subtask gets a model specialized for it
Sequential processing of complex tasksParallel execution across independent subtasks
Quality limited by the weakest capability of one modelQuality elevated by the strongest capability of each model
Fixed speed/quality tradeoffDynamically adjustable via execution modes
Generic AI design outputAI SLOPE elimination for design tasks
Single-perspective code reviewMulti-model review with independent fact-checking

Key Features

  • Nexus Code TUI — Terminal AI coding assistant with Ink + React, multi-provider chat, slash commands, streaming, tool calling, MCP support, settings hub, provider management, and MMFE built in
  • Adaptive Routing Layer (ARL) — Weighted multi-factor scoring (capability 40pts, mode 30pts, complexity 20pts, load balance) routes each subtask to the optimal model
  • Parallel Execution — Dependency-aware wave-based parallel execution with automatic retry on alternative models
  • Intelligent Synthesis — Flagship model merges all subtask results with quality scoring and automatic refinement loops
  • 4 Execution Modes — speed, quality, balanced, creative — each adjusts routing weights to favor different model profiles
  • MTP Hyperthreading — CPU-like speculative decomposition, speculative execution, incremental synthesis, and concurrent quality scoring for up to 2.83x speedup
  • Code Review Engine — 5-phase pipeline adapted from Alibaba Open Code Review with 14 language-specific rule sets and independent fact-checking filter
  • Design Skill with AI SLOPE Elimination — BM25 search across 9 design domains (600+ entries), design system generation, and 10-category AI SLOPE detection/elimination
  • Multi-Turn Conversations — Context persistence across turns with conversation tracking
  • Budget-Aware Routing — Cap total cost weight per orchestration run
  • Event Streaming — Real-time pipeline events for monitoring and integration
  • Performance Tracking — Record and query model reliability statistics over time

How It Works

1. You submit a complex request
2. The Decomposer (glm-5.2) breaks it into independent subtasks
3. The Adaptive Router scores each subtask against all models
4. The Parallel Executor runs subtasks simultaneously (respecting dependencies)
5. The Synthesizer (glm-5.2 + glm-4.7) merges all results
6. Quality scoring determines if re-synthesis is needed
7. You receive a unified, polished answer

Architecture

Pipeline Overview

┌─────────────┐     ┌──────────────┐     ┌────────────────┐     ┌────────────┐
│   Request    │────▶│  Decomposer  │────▶│  Adaptive Router│────▶│  Parallel  │
│             │     │  (glm-5.2)   │     │     (ARL)      │     │  Executor  │
└─────────────┘     └──────────────┘     └────────────────┘     └─────┬──────┘
                                                                        │
                          ┌──────────────┐                              │
                          │  Synthesizer │◀─────────────────────────────┘
                          │  (glm-5.2 +  │
                          │   glm-4.7)   │
                          └──────┬───────┘
                                 │
                          ┌──────▼───────┐
                          │ Unified Result│
                          └──────────────┘

Component Diagram

Nexus-Dev MMFE
├── Core Pipeline
│   ├── Decomposer ──────────── Task splitting with dependency graph
│   ├── Adaptive Router ─────── Multi-factor weighted scoring + topological sort
│   ├── Parallel Executor ───── Wave-based concurrent execution with retry
│   └── Synthesizer ─────────── Merge + quality scoring + refinement loop
│
├── Specialized Pipelines
│   ├── MTP Engine ──────────── Hyperthreaded pipeline (9 thread types, 8 phases)
│   ├── Code Review Engine ──── 5-phase review (Plan → Review → Synth → Filter → Re-Loc)
│   └── Design Skill Engine ─── 8-phase design with AI SLOPE elimination
│
├── Infrastructure
│   ├── Model Registry ──────── 6 GLM models with 16+ capabilities each
│   ├── Budget Routing ──────── Cost-weight-aware model selection
│   ├── Conversation Manager ── Multi-turn context persistence
│   ├── Event Emitter ───────── Real-time pipeline streaming
│   ├── Performance Tracker ─── Model reliability statistics
│   └── Embedding Similarity ── Task similarity for cache/reuse

Data Flow

Request → [Analyze] → [Decompose] → [Route] → [Execute Wave 1] → [Execute Wave 2] → ... → [Synthesize] → [Quality Score] → Result
                                    ↕                                    ↕                        ↕
                              Routing Decision              SubTaskResult[]          QualityScore > threshold?
                                    ↕                                    ↕                        ↓ yes
                              Model Assignment              Partial results           [Re-Synthesize with feedback]

v4.0 Features — Multi-Provider

Nexus-Dev MMFE v4.0 introduces a Provider Abstraction Layer that enables routing across multiple LLM providers — not just ZAI/GLM models. The same orchestration pipeline (decompose → route → execute → synthesize) now works with models from any provider.

Supported Providers

ProviderAdapterAuthModels
ZAI (default)ZAIProviderAuto-detected via z-ai-web-dev-sdkglm-5.2-1m, glm-5.2, glm-5.1, glm-5, glm-5v-turbo, glm-4.7
OpenAIOpenAIProviderOPENAI_API_KEY env var or configgpt-4o, gpt-4.1, gpt-4.1-mini, o3, o4-mini
AnthropicAnthropicProviderANTHROPIC_API_KEY env var or configclaude-opus-4, claude-sonnet-4, claude-haiku-3.5
GoogleGoogleProviderGOOGLE_API_KEY / GEMINI_API_KEY env var or configgemini-2.5-pro, gemini-2.5-flash, gemini-2-flash

Multi-Provider Configuration

import { createOrchestrator } from 'nexus-dev-mmf';

const orch = createOrchestrator({
  providers: {
    defaultProvider: 'zai',
    enableFallback: true,
    providers: {
      zai: { provider: 'zai' }, // Auto-detected
      openai: { provider: 'openai', apiKey: process.env.OPENAI_API_KEY },
      anthropic: {
        provider: 'anthropic',
        apiKey: process.env.ANTHROPIC_API_KEY,
      },
      google: { provider: 'google', apiKey: process.env.GOOGLE_API_KEY },
    },
  },
});

await orch.initialize(); // Initialize all configured providers

// Now the router can assign subtasks to any available model across providers
const result = await orch.process('Explain quantum computing and write a Python simulation');
// May route: reasoning → o3, code → gpt-4.1, creative-explanation → claude-sonnet-4

Provider Prefix Routing

You can explicitly route to a specific provider using the provider/model prefix:

// Explicit provider routing
const result = await orch.process('Analyze this code', {
  customSystemPrompt: 'Use openai/o3 for deep reasoning on this task',
});

// In the model registry, models can be referenced with or without prefix:
// "gpt-4o"           → routes to OpenAI (auto-detected from registry)
// "openai/gpt-4o"    → explicitly routes to OpenAI
// "claude-sonnet-4"  → routes to Anthropic (auto-detected from registry)

Cross-Provider Pipeline

The real power of multi-provider is mixing models from different providers in the same pipeline:

Task: "Design and implement a fintech API"
├── Decompose: glm-5.2 (ZAI) — understands the full context
├── Route: reasoning → o3 (OpenAI), code → gpt-4.1 (OpenAI), design → claude-sonnet-4 (Anthropic)
├── Execute: All subtasks run in parallel across 3 providers
├── Synthesize: gemini-2.5-pro (Google) — merges all results
└── Quality Score: 92/100

Environment Variables

# ZAI — auto-detected, no env vars needed in chat.z.ai
# ZAI_PROVIDER_BASE_URL=https://custom-endpoint  # Optional override

# OpenAI
OPENAI_API_KEY=sk-...
# OPENAI_BASE_URL=https://api.openai.com/v1      # Optional override
# OPENAI_ORG_ID=org-...                            # Optional

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...
# ANTHROPIC_BASE_URL=https://api.anthropic.com # Optional override (no /v1 — appended automatically)

# Google
GOOGLE_API_KEY=AIza...     # or GEMINI_API_KEY
# GOOGLE_AI_BASE_URL=...   # Optional override

Custom Provider

You can implement your own provider by implementing the LLMProvider interface:

import { LLMProvider, ProviderId, ProviderConfig, ProviderMessage, ProviderCompletionOptions, ProviderCompletionResult } from 'nexus-dev-mmf';

class MyCustomProvider implements LLMProvider {
  readonly providerId: ProviderId = 'zai';  // or register a new ID
  readonly name = 'My Custom Provider';
  readonly supportedModels = ['my-model-1'];
  get isReady() { return true; }

  async initialize(config: ProviderConfig) { /* ... */ }
  async complete(model, messages, options) { /* ... */ }
  async healthCheck() { return true; }
  listModels() { return this.supportedModels; }
  supportsModel(id) { return this.supportedModels.includes(id); }
  async shutdown() { /* ... */ }
}

// Register with the orchestrator
const orch = createOrchestrator({ /* ... */ });
orch.getProviderRouter().registerProvider(new MyCustomProvider());

Supported Models

Model Profiles

ZAI (GLM Models) — Default Provider

ModelTierCost WeightContextKey Strengths
glm-5.2-1mFlagship3.01M tokensAdvanced reasoning, complex decomposition, SLOPE detection, long-context analysis
glm-5.2Flagship2.0128K tokensHigh-performance baseline, design generation, balanced quality-speed
glm-5.1Standard1.5128K tokensNuanced language, context sensitivity, design copy, multi-turn
glm-5Fast0.532K tokensSpeed, efficiency, rapid drafts, high-throughput tasks
glm-5v-turboFast0.532K tokensAccelerated feedback, vision support, quick iteration
glm-4.7Creative2.0128K tokensCreative generation, deep knowledge, design systems, synthesis

OpenAI Models

ModelTierCost WeightContextKey Strengths
gpt-4oFlagship2.5128K tokensMultimodal, strong reasoning + code + vision
gpt-4.1Flagship2.01M tokensHigh intelligence, complex instruction following, long context
gpt-4.1-miniStandard1.01M tokensBalanced intelligence and speed, 1M context
o3Flagship4.0200K tokensDeep chain-of-thought reasoning, math, science, complex logic
o4-miniStandard1.5200K tokensFast reasoning, good balance of capability and cost

Anthropic Models (Claude)

ModelTierCost WeightContextKey Strengths
claude-opus-4Flagship5.0200K tokensMost capable, complex reasoning, creative writing, SLOPE detection
claude-sonnet-4Flagship3.0200K tokensBalanced performance, excellent code and reasoning, design
claude-haiku-3.5Fast0.8200K tokensFast and affordable, high-throughput tasks

Google Models (Gemini)

ModelTierCost WeightContextKey Strengths
gemini-2.5-proFlagship3.01M tokens1M context + thinking, multimodal, complex reasoning
gemini-2.5-flashFast0.51M tokensFast with 1M context + thinking, efficient
gemini-2-flashFast0.31M tokensUltra-fast, simple tasks and vision at minimal cost

Capability Matrix

Each model is rated across 16+ capabilities. The router uses these scores alongside mode weights to pick the best model for each subtask.

Capabilityglm-5.2-1mglm-5.2glm-5.1glm-5glm-5v-turboglm-4.7
reasoning959082726878
code908880756572
creative-writing788285706592
analysis938880726875
summarization888582807880
translation828590827578
math928575686270
science908275656072
design708280686590
code-review888578706575
slope-detection858072605870
design-system687875626088

Execution Modes

ModeWeight ProfileBest For
speedPrioritizes fast models (glm-5, glm-5v-turbo)Drafts, rapid iteration, time-critical tasks
qualityPrioritizes flagship models (glm-5.2, glm-5.2-1m)Final deliverables, accuracy-critical work
balancedBalances speed and quality across all modelsGeneral-purpose (default)
creativeBiases toward creative models (glm-4.7)Writing, design, brainstorming

Installation

Prerequisites

  • Node.js 18+ (recommended: 20+)
  • z-ai-web-dev-sdk installed and configured with valid credentials
  • TypeScript 5.4+ (for building from source)

Install from Source

# Clone the repository
git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git
cd nexus-dev-mmf

# ⭐ ONE COMMAND installs everything AND enables the `nexus` TUI globally:
node scripts/setup.mjs

That's it — after the script finishes, the nexus command works from anywhere. The script does six things for you:

  1. Verifies Node.js ≥ 18
  2. Installs + builds the root orchestrator SDK (dist/)
  3. Installs + builds the Nexus Code TUI (packages/nexus-code/dist/)
  4. Links nexus + nexus-code onto your global PATH (handles the npm-workspaces quirk that breaks plain npm link)
  5. Verifies nexus --version actually resolves
  6. Prints clear next steps for your API key

You can run npm run setup instead of node scripts/setup.mjs — both are equivalent.

Manual / step-by-step (if you prefer)

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git
cd nexus-dev-mmf

npm install          # install root deps
npm run build        # build the orchestrator SDK
cd packages/nexus-code
npm install          # install TUI deps
npm run build        # build the TUI
node bin/nexus.js    # run the TUI from source (no global command yet)

The manual steps build the TUI but do not create a global nexus command. Run node scripts/setup.mjs (or npm run setup) to get nexus on your PATH, or run the TUI directly with node packages/nexus-code/bin/nexus.js.

Verify installation

node dist/cli.js --help   # the orchestrator CLI
nexus --version           # the TUI (global command, if you ran setup)

SDK Configuration

Nexus-Dev uses z-ai-web-dev-sdk to access GLM models. The SDK must be configured before use:

# The SDK reads configuration from .z-ai-config or environment variables
# Ensure your credentials are set up (the SDK auto-detects in most environments)

The .env file in the project root is used for local development overrides:

# Nexus-Dev MMFE Configuration
NEXUS_MODE=balanced
NEXUS_MAX_PARALLEL=6
NEXUS_TIMEOUT=120000

Quick Start

Basic Usage

import { createOrchestrator } from 'nexus-dev-mmf';

const orch = createOrchestrator({
  defaultMode: 'balanced',
  maxParallelSubTasks: 6,
});

const result = await orch.process('Explain the tradeoffs between microservices and monoliths, then write a TypeScript implementation of a service mesh');

console.log(result.answer);
console.log(`Quality: ${result.qualityScore}/100`);
console.log(`Models used: ${result.routingDecisions.map(d => d.modelId).join(', ')}`);

CLI Usage

# General query
nexus-dev "Explain the difference between microservices and monoliths"

# Quality mode for critical tasks
nexus-dev "Design a database schema" --mode quality

# Speed mode for drafts
nexus-dev "Quick summary of React hooks" --mode speed

# Creative mode for writing
nexus-dev "Write a creative product description" --mode creative

Design Command

# Design with AI SLOPE elimination
nexus-dev design "Create a fintech dashboard landing page" --brand PayFlow

# With industry and stack context
nexus-dev design "SaaS homepage" --brand Acme --industry tech --stack nextjs --mode creative

# Disable SLOPE detection (faster, but may produce generic output)
nexus-dev design "Healthcare app UI" --no-slope

# Verbose output with pipeline metrics
nexus-dev design "E-commerce product page" --verbose

Code Review Command

# Basic code review
node scripts/code-review.mjs "$(git diff HEAD~1)"

# With MTP hyperthreading for faster reviews
node scripts/code-review.mjs "$(git diff HEAD~1)" --mtp

# Review a specific file's changes
node scripts/code-review.mjs "$(git diff -- myfile.ts)"

MTP Hyperthreading

# Run with MTP hyperthreading (speculative decomposition + execution)
node scripts/mtp-fusion.mjs "Complex multi-step task requiring multiple model capabilities"

Nexus Code — Terminal AI Coding Assistant

Nexus Code (nexus-code) is a terminal UI client for chatting with GLM, OpenAI, Anthropic, and any OpenAI-compatible endpoint — with the Multi-Model Fusion Engine built in. It lives at packages/nexus-code/.

🖥️ Is it a terminal app or a web app?

It is a terminal/TUI app first. Nexus Code runs inside your terminal — it is not a hosted web product.

ModeCommandWhat it is
Terminal UI (primary)nexusA full-screen, interactive terminal UI built with Ink + React. Runs natively in your console — no browser, no server, nothing hosted online. This is what most people use.
Local web UI (optional)nexus --webFor convenience only. Boots a small HTTP server bound to 127.0.0.1:3000 (your own machine) and serves a browser chat page. The "web" UI runs entirely on localhost from the same CLI binary — it is never deployed or reachable over the network.

There are no hosted/web screenshots in this repository. Every visual you see is a terminal/ANSI render of the TUI, not a web page. If a screenshot looks like a polished app, that is the TUI rendering in a terminal — not a browser.

Install

npm install -g nexus-code

Or run from source:

cd packages/nexus-code
npm install
npm run build
node bin/nexus.js

Features

  • Three provider kinds: OpenAI-compatible, Anthropic, Z.ai (MMFE native), FreeModel
  • Auto-detect provider — picks a working provider from saved keys on boot (resolves #6)
  • Settings hub — /settings opens a mimo-style scrollable menu for provider/model/mode/theme
  • Provider management — Add/Edit/Remove providers via the Manage providers submenu
  • Inline API-key capture — masked key entry when switching to a provider with no key
  • Auto-fetch models via /v1/models for OpenAI + Anthropic
  • Manual model add via /add slash command or config file
  • MMFE orchestrator built in — mode switcher, routing panel, quality score
  • Provider unlocked — bypass MMFE with /mmfe off for direct provider calls
  • Streaming responses with token-by-token rendering
  • 21 slash commands: /settings, /mode, /model, /provider, /clear, /save, /load, /fetch, /add, /mcp, /diff, /init, /branch, /theme, /status, /history, /plugins, /help, /exit, and more
  • Input history (up/down arrow navigation, persisted to ~/.nexus/history.json)
  • Session persistence — save and load chat transcripts
  • File context tools (fs, shell, diff, apply_diff)
  • MCP support (Model Context Protocol) — stdio + HTTP transports
  • Plugin system — load custom tools/commands from ~/.nexus/plugins/*.js
  • Command palette (Ctrl+P) — fuzzy-filter slash commands
  • Web UI (nexus --web) — local HTTP server + browser chat with SSE streaming
  • Pipe mode — echo "prompt" | nexus for scripting
  • 3 TUI themes: tech-dark, editorial-light, hacker-terminal
  • 230+ tests passing with 61% coverage

Screenshots

Web UI — Browser-based chat interface launched with nexus --web. Features SSE streaming, provider/model/mode selectors, MMFE toggle, and quality scoring.

Dashboard — Interactive HTML5 monitoring dashboard with live pipeline stats, model performance, cost tracking, and event log.

Quick Start

# Set API keys (any subset)
export ZAI_API_KEY=...
export OPENAI_API_KEY=...
export ANTHROPIC_API_KEY=...

# Boot the TUI
nexus

First-Run Setup

On first launch, nexus-code creates ~/.nexus/config.json with three default providers (zai, openai, anthropic). Edit it to add custom providers, API keys, or manual model entries.

Adding a Custom Provider

Edit ~/.nexus/config.json:

{
  "providers": [
    {
      "id": "openrouter",
      "kind": "openai",
      "name": "OpenRouter",
      "baseURL": "https://openrouter.ai/api/v1",
      "apiKey": "sk-or-...",
      "mmfe": false,
      "defaultModel": "anthropic/claude-3.5-sonnet"
    },
    {
      "id": "ollama-local",
      "kind": "openai",
      "name": "Ollama (local)",
      "baseURL": "http://localhost:11434/v1",
      "mmfe": false,
      "defaultModel": "llama3.1:8b"
    }
  ]
}

Nexus Code Documentation

DocDescription
FeaturesEvery feature, version added, how to use
TestsEvery test suite, coverage, how to run
Root Cause AnalysisEvery bug, root cause, exact fix
Release Notes v1.1.7Consolidated release notes
ProvidersProvider setup and configuration
Slash CommandsFull command reference
MCP IntegrationModel Context Protocol setup
ArchitectureInternal architecture overview
Example ConfigFull config example

Design Skill — AI SLOPE Elimination

What is AI SLOPE?

AI SLOPE = AI-generated Sameness, Lack of Originality, Over-reliance on Patterns, Emptiness

AI SLOPE is the generic, template-like quality that makes AI-generated designs instantly recognizable as machine-produced. Common indicators include:

  • Default blue (#3B82F6) or AI purple (#6366F1) as primary colors
  • Centered hero + 3-column features + CTA (the "AI special" layout)
  • "Empower your workflow", "Revolutionize your X" cliché microcopy
  • Backdrop-blur on every element without purpose
  • Uniform spacing and border-radius everywhere — no rhythm
  • No signature visual element unique to the brand
  • Inter-only typography with no hierarchy
  • Lucide icons without customization — every AI app looks the same

Design Pipeline

The design skill runs an 8-phase pipeline that detects and eliminates AI SLOPE:

1. ANALYZE        → Detect design sub-domain, product type, style keywords
2. SEARCH         → BM25 search across design knowledge base (9 domains, 600+ entries)
3. GENERATE DS    → Aggregate search results into a design system with reasoning rules
4. PROMPT ENGINE  → Build SLOPE-aware design prompts for each model
5. EXECUTE        → Multi-model parallel design generation (3 models per request)
6. SLOPE DETECT   → Cross-model review for 10 categories of AI SLOPE
7. ELIMINATE      → Re-generate with anti-slope instructions if threshold exceeded
8. SYNTHESIZE     → Merge best elements from all model outputs into final result

Design Sub-Domains

Sub-domainPurposeExample Use
brandBrand identity, voice, assetsBrand guidelines, color palette, tone of voice
design-systemToken architecture, specsDesign tokens, component specs, spacing scale
ui-stylingComponent implementationshadcn/ui theming, Tailwind config, CSS variables
logoAI logo generationSVG logo with brand personality
cipCorporate Identity ProgramLetterheads, business cards, presentations
slidesHTML presentationsPitch decks with Chart.js visualizations
bannerBanner designSocial media ads, web banners, print
iconSVG icon generationCustom icon set with brand style
social-photosSocial media imagesOG images, profile graphics
ux-auditUX reviewAccessibility audit, heuristic evaluation

AI SLOPE Detection Categories

CategorySeverityKey IndicatorAnti-Pattern
generic-colors🔴 HighDefault blue (#3B82F6), AI purple (#6366F1)Product-specific palettes from knowledge base
template-layout🔴 HighCentered hero + 3-column features + CTAAsymmetric layouts, unique grid structures
missing-brand-identity🔴 HighNo signature visual elementBrand-specific color, shape, or pattern
stock-imagery🟡 MediumGeneric hero imagesProduct-specific illustration style
flat-typography🟡 MediumNo hierarchy, Inter-onlyVaried weights, brand fonts, contrast
overused-effects🟡 MediumBackdrop-blur on everythingPurposeful effects, selective application
cliche-microcopy🟢 Low"Empower your workflow"Product-specific language, personality
uniform-spacing🟢 LowSame padding everywhereRhythm variation, intentional density
default-icon-sets🟢 LowLucide without customizationBranded icons, custom illustrations
predictable-animations🟢 LowFade-in-up on everythingVaried timing, unexpected motion

Design Knowledge Base

The design skill includes a comprehensive BM25-searchable knowledge base:

DomainRowsContent
Products161Product-specific style recommendations
Styles84UI styles with colors, effects, accessibility
Colors161Product-specific color palettes (17 tokens each)
Typography73Font pairings with Google Fonts URLs
Landing34Landing page patterns and CTA strategies
Charts25Chart type recommendations by data type
UX Guidelines99UX best practices with Do/Don't examples
UI Reasoning161Decision rules and anti-patterns per product
Stacks14React, Next.js, Vue, Svelte, Flutter, etc.

Design Skill SDK

import { createDesignSkillEngine } from 'nexus-dev-mmf';

const engine = createDesignSkillEngine({
  enableSlopeDetection: true,
  enableDesignSystem: true,
  slopeThreshold: 40, // Re-generate if SLOPE score >= 40
  maxSlopeRetries: 2, // Max elimination attempts
  defaultMode: 'balanced',
});

const result = await engine.process({
  id: 'design-001',
  query: 'Design a fintech dashboard landing page',
  productType: 'Fintech/Crypto',
  brandName: 'PayFlow',
  industry: 'fintech',
  enableSlopeDetection: true,
  enableDesignSystem: true,
  mode: 'balanced',
});

console.log(result.designOutput);
console.log(`SLOPE Score: ${result.slopeReport.slopeScore}/100`);
console.log(`Originality: ${result.slopeReport.originalityScore}/100`);
console.log(`Detected SLOPE categories: ${result.slopeReport.detectedCategories.join(', ')}`);

Code Review Engine

Adapted from Alibaba Open Code Review with multi-model fusion enhancements.

5-Phase Review Pipeline

1. PLAN          → Risk analysis, identify critical areas in the diff
2. REVIEW        → Multi-model parallel code review with language-specific rules
3. SYNTHESIZE    → Flagship model merges all review findings
4. FILTER        → Independent fact-checking filter (falsify, not verify)
5. RE-LOCATE     → Re-locate filtered comments to precise code lines

Supported Languages

14 language-specific rule sets with tailored review prompts:

LanguageRules Focus
TypeScriptType safety, null handling, async patterns
JavaScriptScope, coercion, prototype pitfalls
PythonType hints, resource management, concurrency
JavaNull safety, streams, exceptions
RustOwnership, lifetimes, unsafe blocks
GoError handling, goroutines, channels
C++Memory management, RAII, UB prevention
C#LINQ, async/await, disposables
RubyDuck typing, blocks, metaprogramming
PHPType safety, SQL injection, XSS
SwiftOptionals, value types, concurrency
KotlinNull safety, coroutines, extensions
ScalaPattern matching, implicits, collections
Shell/BashQuoting, error handling, portability

Code Review SDK

import { createCodeReviewEngine } from 'nexus-dev-mmf';

const engine = createCodeReviewEngine({
  defaultMode: 'quality',
  enableMTP: false,
});

const result = await engine.review({
  diff: unifiedDiffContent,
  language: 'typescript',
  context: 'Pull request #42: Add payment processing',
});

console.log(`Found ${result.comments.length} review comments`);
for (const comment of result.comments) {
  console.log(`  [${comment.path}:${comment.startLine}] ${comment.content}`);
}

MTP (Multi-Threaded Pipeline)

MTP brings CPU-like hyperthreading to LLM orchestration by overlapping pipeline stages that would otherwise run sequentially.

Thread Types

ThreadPhasePurpose
decompose-flagshipDecomposeFlagship model performs thorough decomposition
decompose-fastDecomposeFast model pre-decomposes for speculative execution
routeRouteAdaptive router scores and assigns models
execute-primaryExecutePrimary model execution for each subtask
execute-speculativeExecuteFast models draft answers before routing completes
synthesize-partialSynthesizeIncremental synthesis as results arrive
synthesize-finalSynthesizeFinal merge of all subtask results
quality-scoreQualityConcurrent quality assessment
quality-refineQualityRe-synthesis if quality is below threshold

MTP Performance

PipelineAvg TimeSpeedup vs Sequential
Sequential (1 model)~45s1.0x
Nexus Parallel (6 models)~19s~2.4x
Nexus MTP (hyperthreaded)~16s~2.8x

Using Nexus with Agentic Tools

Nexus-Dev MMFE can be used as a skill plugin or MCP server in any agentic coding tool. Below are integration instructions for popular platforms.

Universal Integration Principle

All integrations follow the same pattern:

  1. Clone the Nexus-Dev repo into your workspace or skill directory
  2. Configure the tool to invoke Nexus scripts as custom commands
  3. Map /nexus to the appropriate script for your workflow
  4. Set your z-ai-web-dev-sdk credentials

Claude Code

Claude Code supports custom slash commands via .claude/commands/ markdown files.

Setup:

# Clone Nexus into your project or globally
git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Create custom command:

mkdir -p .claude/commands
cat > .claude/commands/nexus.md << 'EOF'
Execute the Nexus-Dev MMFE multi-model fusion pipeline.

Arguments: $ARGUMENTS

Run the following command and return the synthesized result:
```bash
node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "$ARGUMENTS"

If the task is a design task, use:

node ~/nexus-dev-mmf/scripts/design-fusion.mjs "$ARGUMENTS" --mode creative

If the task is a code review, use:

node ~/nexus-dev-mmf/scripts/code-review.mjs "$ARGUMENTS"

For maximum speed with MTP hyperthreading:

node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs "$ARGUMENTS"

EOF


**Usage in Claude Code:**

/nexus Explain the tradeoffs between REST and GraphQL /nexus design Create a fintech landing page --brand PayFlow /nexus review


---

### OpenAI Codex

Codex supports custom agents via `codex.yaml` or the Codex agent configuration.

**Setup:**

```bash
git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to codex.yaml:

agents:
  nexus:
    name: Nexus Multi-Model Fusion
    description: Routes tasks across 6 GLM models for parallel execution and synthesis
    command: node ~/nexus-dev-mmf/scripts/direct-fusion.mjs
    args:
      - '{{input}}'
    tools:
      - name: nexus-design
        description: Design with AI SLOPE elimination
        command: node ~/nexus-dev-mmf/scripts/design-fusion.mjs
        args: ['{{input}}', '--mode', 'creative']
      - name: nexus-review
        description: Multi-model code review
        command: node ~/nexus-dev-mmf/scripts/code-review.mjs
        args: ['{{input}}']
      - name: nexus-mtp
        description: MTP hyperthreaded execution
        command: node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs
        args: ['{{input}}']

Open Code

Open Code supports custom skills via the skill registry.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

# Link as an Open Code skill
ln -s ~/nexus-dev-mmf ~/.open-code/skills/nexus-dev-mmf

Register in ~/.open-code/config.yaml:

skills:
  - name: nexus-dev-mmf
    path: ~/.open-code/skills/nexus-dev-mmf
    triggers:
      - pattern: '/nexus'
        script: scripts/direct-fusion.mjs
      - pattern: '/nexus design'
        script: scripts/design-fusion.mjs
      - pattern: '/nexus review'
        script: scripts/code-review.mjs
      - pattern: '/nexus mtp'
        script: scripts/mtp-fusion.mjs

Zcode

Zcode supports custom extensions and command plugins.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to zcode-config.json:

{
  "extensions": {
    "nexus-dev-mmf": {
      "commands": {
        "nexus": {
          "description": "Multi-model fusion pipeline",
          "exec": "node",
          "args": ["~/nexus-dev-mmf/scripts/direct-fusion.mjs", "{input}"]
        },
        "nexus-design": {
          "description": "Design with AI SLOPE elimination",
          "exec": "node",
          "args": ["~/nexus-dev-mmf/scripts/design-fusion.mjs", "{input}", "--mode", "creative"]
        },
        "nexus-review": {
          "description": "Multi-model code review",
          "exec": "node",
          "args": ["~/nexus-dev-mmf/scripts/code-review.mjs", "{input}"]
        }
      }
    }
  }
}

Hermes Agent

Hermes Agent supports tool registration via its plugin system.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Register in hermes-tools.yaml:

tools:
  - name: nexus_fusion
    type: shell
    description: 'Nexus-Dev MMFE: Decompose, route, execute in parallel, and synthesize across 6 GLM models'
    command: node ~/nexus-dev-mmf/scripts/direct-fusion.mjs
    input_arg: '{{prompt}}'

  - name: nexus_design
    type: shell
    description: 'Design skill with AI SLOPE elimination — eliminates generic AI patterns in design output'
    command: node ~/nexus-dev-mmf/scripts/design-fusion.mjs
    input_arg: '{{prompt}}'
    default_args: ['--mode', 'creative']

  - name: nexus_review
    type: shell
    description: 'Multi-model code review adapted from Alibaba Open Code Review'
    command: node ~/nexus-dev-mmf/scripts/code-review.mjs
    input_arg: '{{diff}}'

  - name: nexus_mtp
    type: shell
    description: 'MTP hyperthreaded execution — speculative decomposition and parallel execution'
    command: node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs
    input_arg: '{{prompt}}'

OpenClaw

OpenClaw supports custom command definitions in its configuration.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to claw-config.toml:

[commands.nexus]
description = "Multi-model fusion pipeline (6 GLM models)"
exec = "node ~/nexus-dev-mmf/scripts/direct-fusion.mjs"
args_pattern = "{input}"

[commands.nexus-design]
description = "Design with AI SLOPE elimination"
exec = "node ~/nexus-dev-mmf/scripts/design-fusion.mjs"
args_pattern = "{input} --mode creative"

[commands.nexus-review]
description = "Multi-model code review"
exec = "node ~/nexus-dev-mmf/scripts/code-review.mjs"
args_pattern = "{input}"

[commands.nexus-mtp]
description = "MTP hyperthreaded execution"
exec = "node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs"
args_pattern = "{input}"

Pi (Inflection)

Pi supports custom integrations through its agent framework.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Register as a Pi agent tool:

{
  "tools": [
    {
      "name": "nexus_fusion",
      "description": "Multi-model fusion pipeline that decomposes tasks across 6 GLM models",
      "type": "function",
      "execute": {
        "command": "node",
        "args": ["~/nexus-dev-mmf/scripts/direct-fusion.mjs", "{{args.query}}"]
      },
      "parameters": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "The task or query to process"
          },
          "mode": {
            "type": "string",
            "enum": ["speed", "quality", "balanced", "creative"]
          }
        },
        "required": ["query"]
      }
    },
    {
      "name": "nexus_design",
      "description": "Design with AI SLOPE elimination for non-generic design output",
      "type": "function",
      "execute": {
        "command": "node",
        "args": ["~/nexus-dev-mmf/scripts/design-fusion.mjs", "{{args.query}}", "--mode", "creative"]
      }
    }
  ]
}

Kimi Code

Kimi Code supports custom command extensions.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to .kimi/commands.json:

{
  "commands": {
    "/nexus": {
      "description": "Multi-model fusion pipeline",
      "exec": "node ~/nexus-dev-mmf/scripts/direct-fusion.mjs",
      "args": "{selection}"
    },
    "/nexus-design": {
      "description": "Design with AI SLOPE elimination",
      "exec": "node ~/nexus-dev-mmf/scripts/design-fusion.mjs",
      "args": "{selection} --mode creative"
    },
    "/nexus-review": {
      "description": "Multi-model code review",
      "exec": "node ~/nexus-dev-mmf/scripts/code-review.mjs",
      "args": "{selection}"
    }
  }
}

Mimo Code

Mimo Code supports skill-based extensions.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Register in mimo-skills.yaml:

skills:
  - id: nexus-dev-mmf
    name: Nexus Multi-Model Fusion
    description: Adaptive orchestration across 6 GLM models with MTP, code review, and AI SLOPE elimination
    version: 3.2.0
    commands:
      nexus:
        description: General fusion pipeline
        run: node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "{{input}}"
      nexus-design:
        description: Design with AI SLOPE elimination
        run: node ~/nexus-dev-mmf/scripts/design-fusion.mjs "{{input}}" --mode creative
      nexus-review:
        description: Multi-model code review
        run: node ~/nexus-dev-mmf/scripts/code-review.mjs "{{input}}"
      nexus-mtp:
        description: MTP hyperthreaded execution
        run: node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs "{{input}}"

Antigravity

Antigravity supports tool plugins via its plugin registry.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Register in .antigravity/tools.yaml:

tools:
  - name: nexus-fusion
    type: shell-command
    description: 'Nexus-Dev MMFE: Multi-model fusion with adaptive routing'
    command: node ~/nexus-dev-mmf/scripts/direct-fusion.mjs
    input: '{{prompt}}'
    aliases: ['/nexus']

  - name: nexus-design
    type: shell-command
    description: 'Design skill with AI SLOPE elimination'
    command: node ~/nexus-dev-mmf/scripts/design-fusion.mjs
    input: '{{prompt}} --mode creative'
    aliases: ['/nexus-design']

  - name: nexus-review
    type: shell-command
    description: 'Multi-model code review (Alibaba OCR adapted)'
    command: node ~/nexus-dev-mmf/scripts/code-review.mjs
    input: '{{diff}}'
    aliases: ['/nexus-review']

Gemini CLI

Google's Gemini CLI supports custom tools via MCP (Model Context Protocol) or shell tool definitions.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Option A: Shell Tool Definition

Add to .gemini/tools.json:

{
  "tools": [
    {
      "name": "nexus_fusion",
      "description": "Multi-model fusion pipeline: decomposes tasks, routes to 6 GLM models, executes in parallel, synthesizes results",
      "command": "node",
      "args": ["~/nexus-dev-mmf/scripts/direct-fusion.mjs", "${input}"],
      "type": "shell"
    },
    {
      "name": "nexus_design",
      "description": "Design with AI SLOPE elimination: BM25 knowledge base, design system generation, 10-category SLOPE detection",
      "command": "node",
      "args": ["~/nexus-dev-mmf/scripts/design-fusion.mjs", "${input}", "--mode", "creative"],
      "type": "shell"
    },
    {
      "name": "nexus_review",
      "description": "Multi-model code review with 5-phase pipeline adapted from Alibaba Open Code Review",
      "command": "node",
      "args": ["~/nexus-dev-mmf/scripts/code-review.mjs", "${input}"],
      "type": "shell"
    }
  ]
}

Option B: MCP Server

Create an MCP server wrapper:

# Install MCP SDK
npm install @modelcontextprotocol/sdk

# Create MCP wrapper
cat > ~/nexus-dev-mmf/mcp-server.mjs << 'SCRIPT'
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { execSync } from 'child_process';

const server = new Server({ name: 'nexus-dev-mmf', version: '3.2.0' });

server.setRequestHandler('tools/list', async () => ({
  tools: [
    { name: 'nexus_fusion', description: 'Multi-model fusion pipeline', inputSchema: { type: 'object', properties: { query: { type: 'string' } }, required: ['query'] } },
    { name: 'nexus_design', description: 'Design with AI SLOPE elimination', inputSchema: { type: 'object', properties: { query: { type: 'string' } }, required: ['query'] } },
    { name: 'nexus_review', description: 'Multi-model code review', inputSchema: { type: 'object', properties: { diff: { type: 'string' } }, required: ['diff'] } },
  ]
}));

server.setRequestHandler('tools/call', async (request) => {
  const scripts = {
    nexus_fusion: 'direct-fusion.mjs',
    nexus_design: 'design-fusion.mjs',
    nexus_review: 'code-review.mjs',
  };
  const script = scripts[request.params.name];
  const input = request.params.arguments.query || request.params.arguments.diff;
  const result = execSync(`node ~/nexus-dev-mmf/scripts/${script} '${input.replace(/'/g, "\\'")}'`, { encoding: 'utf-8', timeout: 120000 });
  return { content: [{ type: 'text', text: result }] };
});

const transport = new StdioServerTransport();
await server.connect(transport);
SCRIPT

Then add to .gemini/settings.json:

{
  "mcpServers": {
    "nexus-dev-mmf": {
      "command": "node",
      "args": ["~/nexus-dev-mmf/mcp-server.mjs"]
    }
  }
}

Cursor

Cursor supports custom tools via .cursorrules and the Run Command feature.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to .cursorrules:

# Nexus-Dev MMFE Integration

When the user asks a complex multi-domain question, design task, or code review, use the Nexus multi-model fusion pipeline.

## Commands
- General: `node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "<query>"`
- Design: `node ~/nexus-dev-mmf/scripts/design-fusion.mjs "<query>" --mode creative`
- Code Review: `node ~/nexus-dev-mmf/scripts/code-review.mjs "<diff>"`
- MTP: `node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs "<query>"`

## When to use
- Complex tasks spanning multiple domains (use general fusion)
- Any design/UI/UX task (use design with AI SLOPE elimination)
- Code review requests (use review pipeline)
- Speed-critical tasks (use MTP hyperthreading)

## Design tasks always use SLOPE elimination to avoid:
- Default blue (#3B82F6) or AI purple (#6366F1)
- Centered hero + 3-column template layouts
- "Empower your workflow" cliché copy
- Generic AI-generated aesthetics

Windsurf / Codeium

Windsurf supports custom tools via .windsurfrules and command definitions.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to .windsurfrules:

# Nexus-Dev MMFE Integration

## Available Tools
- `nexus_fusion(query)`: Multi-model fusion pipeline → `node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "<query>"`
- `nexus_design(query)`: Design with AI SLOPE elimination → `node ~/nexus-dev-mmf/scripts/design-fusion.mjs "<query>" --mode creative`
- `nexus_review(diff)`: Multi-model code review → `node ~/nexus-dev-mmf/scripts/code-review.mjs "<diff>"`
- `nexus_mtp(query)`: MTP hyperthreaded execution → `node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs "<query>"`

## Usage Rules
- For any design task, always use nexus_design to eliminate AI SLOPE
- For code reviews, use nexus_review for multi-model analysis
- For complex multi-step tasks, use nexus_fusion or nexus_mtp
- The --mode flag accepts: speed, quality, balanced, creative

Aider

Aider supports custom commands via its command system and .aider.conf.yml.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to .aider.conf.yml:

# Custom commands map
custom-commands:
  nexus: 'node ~/nexus-dev-mmf/scripts/direct-fusion.mjs'
  nexus-design: 'node ~/nexus-dev-mmf/scripts/design-fusion.mjs'
  nexus-review: 'node ~/nexus-dev-mmf/scripts/code-review.mjs'
  nexus-mtp: 'node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs'

Usage in Aider chat:

# Nexus commands are invoked via shell
!node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "Analyze this architecture"
!node ~/nexus-dev-mmf/scripts/design-fusion.mjs "Design a fintech dashboard" --mode creative

Continue

Continue supports custom tools via config.yaml or config.json.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Add to ~/.continue/config.yaml:

tools:
  - name: nexus_fusion
    description: 'Multi-model fusion pipeline across 6 GLM models'
    type: shell
    command: node ~/nexus-dev-mmf/scripts/direct-fusion.mjs
    args: '{{input}}'

  - name: nexus_design
    description: 'Design with AI SLOPE elimination'
    type: shell
    command: node ~/nexus-dev-mmf/scripts/design-fusion.mjs
    args: '{{input}} --mode creative'

  - name: nexus_review
    description: 'Multi-model code review'
    type: shell
    command: node ~/nexus-dev-mmf/scripts/code-review.mjs
    args: '{{input}}'

Cline

Cline supports custom commands via .clinerules and MCP integration.

Setup:

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Option A: .clinerules

# Nexus-Dev MMFE Integration

When processing complex tasks, design requests, or code reviews, delegate to Nexus:

## Custom Command Mapping
/nexus → node ~/nexus-dev-mmf/scripts/direct-fusion.mjs "<args>"
/nexus-design → node ~/nexus-dev-mmf/scripts/design-fusion.mjs "<args>" --mode creative
/nexus-review → node ~/nexus-dev-mmf/scripts/code-review.mjs "<args>"
/nexus-mtp → node ~/nexus-dev-mmf/scripts/mtp-fusion.mjs "<args>"

Option B: MCP Server (same as Gemini CLI MCP setup above)

Add to .cline/mcp.json:

{
  "mcpServers": {
    "nexus-dev-mmf": {
      "command": "node",
      "args": ["~/nexus-dev-mmf/mcp-server.mjs"]
    }
  }
}

Generic Integration Pattern

For any agentic tool not listed above, follow this universal pattern:

Step 1: Clone and Build

git clone https://github.com/roman-ryzenadvanced/nexus-dev-mmf.git ~/nexus-dev-mmf
cd ~/nexus-dev-mmf && npm install && npm run build

Step 2: Identify Integration Point

Most agentic tools support one of these integration methods:

MethodHow It WorksBest For
Custom CommandsDefine /nexus as a shell commandCLI-based tools (Claude Code, Aider)
Tool/Function RegistryRegister Nexus as a callable toolAgent frameworks (Hermes, Pi)
Config FileAdd to YAML/JSON configConfig-driven tools (Open Code, Zcode)
MCP ServerRun Nexus as an MCP serverMCP-compatible tools (Gemini CLI, Cline)
Rules FileAdd instructions to .cursorrules, .clinerules, etc.IDE-based tools (Cursor, Windsurf)

Step 3: Map Commands

CommandScriptUse Case
General fusionscripts/direct-fusion.mjsAny complex multi-domain query
Designscripts/design-fusion.mjsUI/UX design with AI SLOPE elimination
Code reviewscripts/code-review.mjsMulti-model code review
MTP hyperthreadingscripts/mtp-fusion.mjsSpeed-critical complex tasks

Step 4: Set Credentials

Ensure z-ai-web-dev-sdk is configured. The SDK auto-detects credentials in most environments. For custom setups, set environment variables as needed.


API Reference

Orchestrator

import { createOrchestrator } from 'nexus-dev-mmf';

const orch = createOrchestrator({
  defaultMode: 'balanced',
  maxParallelSubTasks: 6,
  qualityThreshold: 70,
  subTaskTimeout: 120000,
  enableThinking: true,
  enableMTP: false,
  enableSlopeDetection: true,
  enablePerformanceTracking: true,
  enableEvents: true,
});

// Process a request
const result = await orch.process('Your complex query here');

// With options
const result2 = await orch.process('Another query', {
  conversationId: result.conversationId,
  maxCostWeight: 6.0,
});

Orchestrator API

MethodDescription
process(prompt, options?)Process a request through the full pipeline
getPerformanceTracker()Get the PerformanceTracker instance
getEventEmitter()Get the NexusEventEmitter instance
getModelRegistry()Get the ModelRegistry instance
getConversationManager()Get the ConversationManager instance
getState()Get current pipeline state

Types

interface OrchestrationRequest {
  prompt: string;
  mode?: 'speed' | 'quality' | 'balanced' | 'creative';
  systemPrompt?: string;
  conversationId?: string;
  maxCostWeight?: number;
  metadata?: Record<string, unknown>;
}

interface OrchestrationResult {
  answer: string;
  qualityScore: number;
  routingDecisions: RoutingDecision[];
  subTaskResults: SubTaskResult[];
  totalCostWeight: number;
  conversationId?: string;
  pipelineTimeMs: number;
  metadata: Record<string, unknown>;
}

interface RoutingDecision {
  subTaskId: string;
  modelId: string;
  score: number;
  reasoning: string;
}

interface SubTask {
  id: string;
  description: string;
  capability: string;
  complexity: number;
  dependencies: string[];
  priority: number;
}

interface SubTaskResult {
  subTaskId: string;
  modelId: string;
  output: string;
  executionTimeMs: number;
  qualityScore: number;
}

Model Registry API

const registry = orch.getModelRegistry();

// List all models
const models = registry.listModels();

// Get a specific model
const model = registry.getModel('glm-5.2');

// Register a custom model
registry.registerModel({
  id: 'custom-model',
  name: 'My Custom Model',
  tier: 'standard',
  costWeight: 1.5,
  capabilities: { reasoning: 80, code: 85 },
});

// Get best model for a capability
const best = registry.getBestModelForCapability('reasoning');

Configuration API

import { createOrchestrator } from 'nexus-dev-mmf';

const orch = createOrchestrator({
  // Pipeline settings
  defaultMode: 'balanced', // speed | quality | balanced | creative
  maxParallelSubTasks: 6, // Max concurrent model calls
  qualityThreshold: 70, // Score threshold for re-synthesis
  subTaskTimeout: 120000, // Timeout per subtask (ms)
  enableThinking: true, // Chain-of-thought reasoning

  // MTP (Multi-Threaded Pipeline)
  enableMTP: false, // Enable hyperthreading
  mtpConfig: {
    maxThreads: 8, // Maximum concurrent threads
    speculativeDecomposition: true, // Fast model pre-decomposes
    speculativeExecution: true, // Fast models draft early
    incrementalSynthesis: true, // Progressive result building
  },

  // Design Skill
  enableSlopeDetection: true, // AI SLOPE detection
  slopeThreshold: 40, // Re-generate if score >= 40
  maxSlopeRetries: 2, // Max elimination attempts

  // Budget
  maxTotalCostWeight: Infinity, // Cap total cost per run

  // Tracking
  enablePerformanceTracking: true, // Model reliability tracking
  enableEvents: true, // Pipeline event streaming
});

Routing Algorithm

Scoring Formula

Each subtask is scored against each available model using a weighted multi-factor formula:

Score = (capability_score × 40) + (mode_alignment × 30) + (complexity_fit × 20) - (load_penalty × 3)
FactorWeightDescription
Capability Score40 ptsHow well the model's rated capability matches the subtask requirement
Mode Alignment30 ptsHow well the model's tier aligns with the execution mode preference
Complexity Fit20 ptsWhether the model's processing depth matches the subtask complexity
Load Balance-3 pts/assignmentPenalty for each existing assignment to prevent overloading one model

Mode Influence

ModePreferred TiersEffect on Scoring
speedFast (1.0×)Boosts fast model scores by 30%
qualityFlagship (2.0-3.0×)Boosts flagship model scores by 30%
balancedAll tiers equallyNo tier bias
creativeCreative (1.2×)Boosts creative model scores by 30%

Load Balancing

The router tracks how many subtasks have been assigned to each model. Each existing assignment adds a -3 penalty to that model's score for subsequent subtasks. This prevents the situation where one model is assigned all subtasks while equally capable models sit idle.

Dependency Resolution

Subtasks are organized into execution waves using topological sort:

  1. Build a dependency graph from subtask dependencies arrays
  2. Assign each subtask to the earliest wave where all its dependencies are satisfied
  3. Execute all subtasks in a wave concurrently
  4. Proceed to the next wave when all subtasks in the current wave complete
Wave 0: [subtask-1, subtask-2]     ← No dependencies, run immediately
Wave 1: [subtask-3]                ← Depends on subtask-1
Wave 2: [subtask-4, subtask-5]     ← Depends on subtask-2 and subtask-3

Advanced Usage

Custom System Prompts

const result = await orch.process('Explain quantum computing', {
  systemPrompt: 'You are a physics professor. Use analogies and real-world examples.',
});

Context-Aware Processing

// Multi-turn conversation
const result1 = await orch.process('Design a REST API for a todo app');

const result2 = await orch.process('Add authentication to it', {
  conversationId: result1.conversationId,
});

Quality Assurance Pipeline

const orch = createOrchestrator({
  qualityThreshold: 80, // Require higher quality
  subTaskTimeout: 180000, // Allow more time
});

const result = await orch.process('Write a production-ready authentication module');
// If qualityScore < 80, the pipeline automatically re-synthesizes with feedback

Runtime Configuration

// Override mode per-request
const fastResult = await orch.process('Quick summary of React hooks', {
  mode: 'speed',
});

const qualityResult = await orch.process('Critical: Design our API schema', {
  mode: 'quality',
  maxCostWeight: 4.0,
});

Pipeline Monitoring

const orch = createOrchestrator({ enableEvents: true });
const emitter = orch.getEventEmitter();

emitter.on('pipeline:start', e => console.log('Pipeline started'));
emitter.on('subtask:complete', e => console.log(`Subtask ${e.subTaskId} done`));
emitter.on('pipeline:complete', e => console.log(`Pipeline complete: ${e.qualityScore}/100`));
emitter.on('quality:refine', e => console.log('Re-synthesizing...'));

CLI Reference

# General query
nexus-dev "Your query here"

# With mode
nexus-dev "Complex task" --mode quality

# Design command (AI SLOPE elimination)
nexus-dev design "Design a fintech dashboard" --brand PayFlow --industry fintech --stack nextjs

# Code review
nexus-dev review "$(git diff HEAD~1)"

# Verbose output
nexus-dev "Explain microservices" --verbose

# Help
nexus-dev --help
FlagDescription
--mode <mode>Execution mode: speed, quality, balanced, creative
--verboseShow detailed pipeline output
--brand <name>Brand name for design tasks
--industry <type>Industry for design context
--stack <stack>Tech stack for stack-specific guidelines
--no-slopeDisable AI SLOPE detection
--no-design-systemSkip design system generation
--mtpEnable MTP hyperthreading
--product <type>Product type for design context

Configuration

Full Options Table

OptionTypeDefaultDescription
defaultModestring'balanced'Default execution mode
maxParallelSubTasksnumber6Maximum concurrent model calls
enableThinkingbooleantrueEnable chain-of-thought reasoning
subTaskTimeoutnumber120000Timeout per subtask (ms)
qualityThresholdnumber70Score threshold for re-synthesis
enableMTPbooleanfalseEnable MTP hyperthreading
maxTotalCostWeightnumberInfinityMaximum cost weight per run
enablePerformanceTrackingbooleantrueTrack model performance
enableEventsbooleantrueEnable event streaming
enableSlopeDetectionbooleantrueAI SLOPE detection in design
slopeThresholdnumber40SLOPE score for re-generation
maxSlopeRetriesnumber2Max SLOPE elimination attempts

Preset Configurations

Speed Preset:

const orch = createOrchestrator({
  defaultMode: 'speed',
  maxParallelSubTasks: 8,
  qualityThreshold: 50,
  subTaskTimeout: 60000,
  enableThinking: false,
});

Quality Preset:

const orch = createOrchestrator({
  defaultMode: 'quality',
  maxParallelSubTasks: 4,
  qualityThreshold: 85,
  subTaskTimeout: 180000,
  enableThinking: true,
  maxTotalCostWeight: 8.0,
});

Creative/Design Preset:

const orch = createOrchestrator({
  defaultMode: 'creative',
  enableSlopeDetection: true,
  slopeThreshold: 30,
  maxSlopeRetries: 3,
  enableDesignSystem: true,
});

Project Structure

nexus-dev-mmf/
├── src/
│   ├── cli.ts                          # CLI entry point
│   ├── index.ts                        # SDK entry point
│   ├── core/
│   │   ├── config.ts                   # Configuration types and defaults
│   │   ├── types.ts                    # Core type definitions
│   │   ├── models.ts                   # Model profiles and capabilities
│   │   ├── model-registry.ts           # Dynamic model registration
│   │   ├── orchestrator.ts             # Central pipeline coordinator
│   │   ├── executor.ts                 # Wave-based parallel execution
│   │   ├── mtp-engine.ts              # MTP hyperthreaded pipeline
│   │   ├── mtp-types.ts              # MTP type definitions
│   │   ├── budget-routing.ts          # Cost-aware routing
│   │   ├── conversation.ts            # Multi-turn conversation manager
│   │   ├── events.ts                  # Pipeline event emitter
│   │   ├── performance-tracker.ts     # Model reliability tracking
│   │   ├── embedding-similarity.ts    # Task similarity for cache/reuse
│   │   └── utils/uuid.ts              # UUID generation
│   ├── decomposer/
│   │   └── decomposer.ts              # Task decomposition engine
│   ├── router/
│   │   └── adaptive-router.ts         # ARL scoring and routing
│   ├── synthesis/
│   │   └── synthesizer.ts             # Result synthesis + quality scoring
│   ├── providers/                     # ★ v4.0: Multi-Provider Abstraction
│   │   ├── types.ts                   # LLMProvider interface, ProviderConfig, etc.
│   │   ├── provider-router.ts         # Unified provider router + registry
│   │   ├── zai-provider.ts            # ZAI (GLM) adapter
│   │   ├── openai-provider.ts         # OpenAI adapter (GPT-4o, o3, etc.)
│   │   ├── anthropic-provider.ts      # Anthropic adapter (Claude)
│   │   ├── google-provider.ts         # Google adapter (Gemini)
│   │   └── index.ts                   # Module exports
│   ├── code-review/
│   │   ├── types.ts                   # Review type definitions
│   │   ├── review-engine.ts           # 5-phase review pipeline
│   │   ├── diff-parser.ts             # Unified diff parsing
│   │   ├── prompts.ts                 # Language-specific review prompts
│   │   └── rules.ts                   # Review rule definitions
│   └── design-skill/
│       ├── types.ts                   # Design + AI SLOPE types
│       ├── design-engine.ts           # 8-phase design pipeline
│       ├── search-engine.ts           # BM25 search across knowledge base
│       ├── index.ts                   # Module exports
│       └── data/                      # Knowledge base (9 domains, 600+ entries)
│           ├── products.csv           # Product-specific styles
│           ├── styles.csv             # UI style patterns
│           ├── colors.csv             # Color palettes
│           ├── typography.csv         # Font pairings
│           ├── landing.csv            # Landing page patterns
│           ├── charts.csv             # Chart recommendations
│           ├── ux-guidelines.csv      # UX best practices
│           ├── ui-reasoning.csv       # Decision rules
│           └── stacks/               # 14 stack-specific guidelines
│               ├── react.csv
│               ├── nextjs.csv
│               ├── vue.csv
│               ├── svelte.csv
│               ├── angular.csv
│               ├── flutter.csv
│               └── ...
├── scripts/
│   ├── direct-fusion.mjs             # General /nexus command
│   ├── mtp-fusion.mjs               # MTP hyperthreaded execution
│   ├── design-fusion.mjs            # Design with SLOPE elimination
│   ├── code-review.mjs             # Code review pipeline
│   ├── quick-run.mjs               # Quick pipeline runner
│   └── runner.mjs                   # Test runner
├── dashboard/
│   └── index.html                    # Web dashboard for pipeline monitoring
├── examples/
│   ├── basic-usage.ts                # SDK usage example
│   └── mode-comparison.ts           # Mode comparison example
├── tests/
│   └── runner.mjs                    # Test suite (125+ pipelines)
├── SKILL.md                          # Skill definition for chat.z.ai
├── CHANGELOG.md                      # Version history
├── package.json
└── tsconfig.json

Testing

# Run all tests
npm test

# Quick test suite (subset)
npm run test:quick

# Run specific test sections
node --test tests/runner.mjs --section routing
node --test tests/runner.mjs --section synthesis

Test Sections

SectionTestsDescription
Decomposition20Task splitting, dependency detection
Routing25ARL scoring, mode influence, load balance
Execution20Parallel execution, retry, timeout
Synthesis20Quality scoring, refinement
Code Review15Diff parsing, review pipeline
Design Skill15SLOPE detection, knowledge base search
MTP10Hyperthreaded pipeline
Total125

Examples

// Example 1: Basic orchestration
import { createOrchestrator } from 'nexus-dev-mmf';
const orch = createOrchestrator();
const result = await orch.process('Explain quantum entanglement and its applications in computing');

// Example 2: Design with SLOPE elimination
import { createDesignSkillEngine } from 'nexus-dev-mmf';
const engine = createDesignSkillEngine({ enableSlopeDetection: true });
const design = await engine.process({
  id: '1',
  query: 'Design a SaaS pricing page',
  brandName: 'CloudPay',
  industry: 'fintech',
});

// Example 3: Code review
import { createCodeReviewEngine } from 'nexus-dev-mmf';
const reviewer = createCodeReviewEngine();
const review = await reviewer.review({
  diff: myDiff,
  language: 'typescript',
});

// Example 4: Budget-constrained execution
const orch = createOrchestrator({ maxTotalCostWeight: 4.0 });
const result = await orch.process('Complex analysis task');
console.log(`Total cost: ${result.totalCostWeight}×`);

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Open a Pull Request

Roadmap

  • Streaming response support (token-by-token delivery)
  • Web API server mode (REST/WebSocket endpoints)
  • Additional model provider support (OpenAI, Anthropic, etc.)
  • Visual pipeline builder UI
  • Plugin system for custom decomposition/synthesis strategies
  • Distributed execution across multiple machines
  • MCP server for universal tool integration

Changelog

See CHANGELOG.md for version history.


License

MIT © 2026 Nexus-Dev

↑↓ navigate openesc close