switchai-architect

Guide SwitchAI Local architecture, Go host, and Lua plugin system design.

2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/traylinx/switchAILocal --skill switchai-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: switchai-architect
Source: https://github.com/traylinx/switchAILocal/tree/main/plugins/cortex-router/skills/switchai-architect
Command: npx skills add https://github.com/traylinx/switchAILocal --skill switchai-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance on the SwitchAI Local architecture, the Go host, and the Lua plugin system, helping teams design, troubleshoot, and optimize deployments.

Core Features & Use Cases

  • Understand the Go host structure (internal/, cmd/) and how HTTP handling and I/O are optimized.
  • Understand the Lua Engine integration (gopher-lua) and the plugin model (plugins/ with schema.lua and handler.lua).
  • Guidelines for crafting safe, high-performance plugins and for configuring Cortex Router within SwitchAI Local.

Quick Start

Use this skill to review architecture decisions or outline how to extend Cortex Router with a new plugin and Lua bindings.

Frequently Asked Questions about switchai-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I architect a Go host with Lua plugins in SwitchAI Local?

SwitchAI Local architecture combines a Go host (organized in internal/ and cmd/ directories for optimized HTTP handling and I/O) with a Lua plugin system using gopher-lua. Design plugins via schema.lua and handler.lua files, then coordinate SDK components through Cortex Router for reliable, high-performance routing.

What's the best way to configure Cortex Router within SwitchAI Local?

Configure Cortex Router by understanding the Go host structure and Lua plugin model. Define plugin schemas and handlers, embed the Lua engine safely, and coordinate SDK components. This approach optimizes routing logic while maintaining high performance and integration between Go and Lua layers.

How do I build high-performance Lua plugins for SwitchAI Local?

Craft safe, high-performance plugins by following the plugin model: structure each plugin with schema.lua for configuration and handler.lua for logic. Leverage gopher-lua integration within the Go host, and coordinate with SDK components through Cortex Router to achieve reliable routing.

Can I extend SwitchAI Local's routing with custom Lua bindings?

Yes. Extend Cortex Router by creating new plugins with Lua bindings integrated into the Go host. Use the gopher-lua engine to embed Lua logic, define schemas and handlers, and coordinate components through the SDK for seamless custom routing extensions.

What are the limitations of embedding Lua in a Go host for routing?

Safe integration requires careful coordination between Lua and Go layers. Performance depends on plugin design and schema efficiency. The plugin model enforces boundaries via schema.lua and handler.lua, limiting what logic can execute per plugin while maintaining routing reliability.