wing-models

Enable copilot to collaborate with multiple models

3dfish
by 3dfish
Other · GPL-3.0 · JavaScript · Updated: 4 months ago
0
stars
0
Forks
community
BBB
Safety
high
A
Quality

name: wing-models description: "Use this skill whenever the user wants to route part of a message to an OpenAI-compatible model while keeping the rest as local agent instructions. Trigger on requests like '和模型聊聊', '帮我问问模型', '代问模型'." argument-hint: "user message, alias/model profile"

Wing-Models

This skill packages a repeatable OpenAI-compatible model conversation workflow.

Alias Credential Set (Mandatory)

If no profile set exists and the script is interactive, prompt user to enter profile entries.

When an agent needs to create .3rd.env directly after collecting fields in chat, use this structure:

WING_MODELS_PROFILE_SET=[{"alias":"<alias-from-chat>","baseURL":"https://openrouter.ai/api/v1","apiKey":"<api-key-from-chat>","modelId":"<model-id-from-chat>","note":""}]

Supported Providers

This skill works with any OpenAI-compatible API, including:

Output Contract

Security Rules (Mandatory)

Large File Authorization (Mandatory)

Before reading saved model output files (.md or attachments):

Required Assets

Runtime Readiness Check (Automatic)

Before executing the script, always verify runtime prerequisites automatically:

Pre-flight Checklist

  1. Check Node availability: Run node --version to verify Node.js is installed and accessible.
  2. Check npm availability: Run npm --version to verify npm is installed and accessible.
  3. Check dependency installation: Run npm list --prefix <skill-dir>/scripts openai dotenv to verify both dependencies are installed.

Auto-install Logic

If any check fails:

  1. If node or npm is unavailable, report the missing tool and halt execution. Ask user to install Node.js first.
  2. If dependencies are missing (exit code non-zero), auto-run:
    npm install --prefix <skill-dir>/scripts
    
  3. Re-run the dependency check after installation.
  4. If installation fails, report the error and halt execution.

Implementation Pattern

# Step 1: Check node
node --version || { echo "Node.js not found. Please install Node.js."; exit 1; }

# Step 2: Check npm
npm --version || { echo "npm not found. Please install Node.js with npm."; exit 1; }

# Step 3: Check dependencies
npm list --prefix <skill-dir>/scripts openai dotenv 2>/dev/null || npm install --prefix <skill-dir>/scripts

# Step 4: Proceed with script
node <skill-dir>/scripts/wing_models.mjs --alias <alias> --prompt "<prompt>"

One-time Install Verification

For first-time use or after clearing node_modules, the above pattern ensures dependencies are installed transparently without manual intervention.

Run Template

Install once:

npm install --prefix <skill-dir>/scripts

Call template:

node <skill-dir>/scripts/wing_models.mjs \
  --alias <alias> \
  --prompt "<user-prompt>"

Long prompt template:

node <skill-dir>/scripts/wing_models.mjs \
  --alias <alias> \
  --prompt-file <path-to-prompt.txt>

With attachment input (repeatable):

node <skill-dir>/scripts/wing_models.mjs \
  --alias <alias> \
  --prompt "<user-prompt>" \
  --attachment <path-or-url>

Reliability Notes

Completion Checks

🔓 Sign in to unlock more
Sign in with GitHub