一键导入
max-router
Analyzes user task descriptions and dispatches to the correct specialist agent(s) for MAX/MSP generation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyzes user task descriptions and dispatches to the correct specialist agent(s) for MAX/MSP generation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate Gen~ GenExpr DSP code, signal processing patches, and audio effect chains
Generate MAX patches with control flow, message routing, subpatcher organization, and MIDI handling
Design and position UI controls for MAX patches in presentation and patching mode
Orchestrates the generate-review-revise loop using Python critic modules for quality assurance
Manages MAX project creation, status tracking, project switching, and test protocol execution
Generate JavaScript code for Max js objects (V8) and Node for Max scripts (N4M)
| name | max-router |
| description | Analyzes user task descriptions and dispatches to the correct specialist agent(s) for MAX/MSP generation |
| allowed-tools | ["Read","Write","Bash","Glob","Grep"] |
| preconditions | ["Active project must exist (patches/.active-project.json)"] |
The router is the entry point for all MAX generation tasks. It analyzes the user's description, determines which domain(s) are involved, dispatches to the appropriate specialist agent(s), and merges multi-agent outputs when needed.
Before dispatching:
patches/.active-project.json to identify the active projectcontext.md for project visionconfig.json via load_project_config() from src.maxpat.project
config.json does not exist (returns None): STOP and tell the user "Run /max-new or /max-config to set packages before building." Do NOT dispatch to any agent.config.json exists: extract packages list and pass to specialist agents as allowed_packagesAnalyze the user's task description for domain keywords and intent. See references/dispatch-rules.md for the full keyword-to-agent mapping.
Quick reference:
| Domain | Agent | Trigger Keywords |
|---|---|---|
| Patch/Control | max-patch-agent | patch, object, route, trigger, message, subpatcher, send, receive, metro, counter, gate |
| DSP/Gen~ | max-dsp-agent | signal, audio, synth, gen~, oscillator, filter, delay, reverb, feedback, GenExpr, gain, mix |
| RNBO Export | max-rnbo-agent | rnbo, export, vst, au, plugin, web audio, c++ target |
| JavaScript | max-js-agent | javascript, node, n4m, script, node.script, js object, max-api, handler |
| Externals | max-ext-agent | external, sdk, c++, compile, mxo, min-devkit |
| UI/Layout | max-ui-agent | layout, presentation, ui, controls, dial, slider, panel, display, visual |
Many tasks span multiple domains. When this happens:
references/merge-protocol.mdCommon multi-domain patterns:
When dispatching to multiple agents, minimize total SKILL.md context loaded.
Loading tiers:
| Agents | Strategy |
|---|---|
| 1 | Full SKILL.md |
| 2 | Both full |
| 3+ | Lead: full SKILL.md. Secondaries: load ONLY "Domain Context Loading" + "Capabilities" sections |
Per-agent section map:
| Section | Classification | Present In |
|---|---|---|
| Domain Context Loading | domain-specific (always load) | all agents |
| Capabilities (+ subsections) | domain-specific (always load) | all agents |
| Python API References | domain-specific (always load) | rnbo |
| Editing Existing Patches | shared -- skip for secondaries | all agents |
| Output Protocol (New Patches) | shared -- skip for secondaries | all agents |
| Output Protocol (Edited Patches) | shared -- skip for secondaries | all agents |
| When to Use / When NOT to Use | shared -- skip for secondaries | all agents |
| Bpatcher Argument Substitution | shared -- skip for secondaries | patch, dsp |
| Shared Capabilities reference | shared -- skip for secondaries | all agents |
Example -- "MIDI-controlled FM synth with presets":
Target: Keep total loaded SKILL.md context under ~250 lines per generation task.
patcher.analyze()) alongside the modification request. This analysis informs dispatch decisions by revealing which domains are present in the existing patch (e.g., signal chains -> DSP agent, presentation mode -> UI agent).allowed_packages from project config to specialist agent(s) -- they use it when constructing Patcher instances/max-build invocation routes through the router/max-iterate invocation routes through the router/max-verify -- invokes critics directly, not the router/max-test -- generates test checklists, not patches/max-status, /max-switch -- project management, no generation/max-discuss, /max-research -- conversation phases, no generation