Max router

From taylorbrook/MAX-MSP_CC_Framework · View interactive version

Max router is an AI agent skill from the GitHub repository taylorbrook/MAX-MSP_CC_Framework. Analyzes user task descriptions and dispatches to the correct specialist agent(s) for MAX/MSP generation

How to use this skill

Skill file

Router Agent

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.

Domain Context Loading

Before dispatching:

  1. Read patches/.active-project.json to identify the active project
  2. Read the active project's context.md for project vision
  3. Read the active project's config.json via load_project_config() from src.maxpat.project
  1. Do NOT load object database JSON files -- specialists handle their own context loading.

Dispatch Rules

Analyze 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 |

Domain Overlays -- not agents: a matched overlay sets the lead, adds secondaries, and passes its required reading and checks to every specialist. Full rules (detect keywords, DB-checked object references, checks) are in references/dispatch-rules.md "Domain Overlays".

| Overlay | Lead | Also | Detect |

|---------|------|------|--------|

| Jitter | max-patch-agent | max-dsp-agent (jit.gen / jit.pix codeboxes, audio bridges), max-ui-agent, max-js-agent | jitter, video, camera, texture, OpenGL, shader, mesh, any jit.* ("matrix" alone is not Jitter) |

| M4L (experimental) | max-dsp-agent (audio effect / instrument), max-patch-agent (MIDI effect) | max-ui-agent, max-js-agent | max for live, m4l, ableton, Live device, amxd, plugin~ / plugout~ / live.thisdevice ("live" alone is not M4L) |

| poly~ | max-dsp-agent (voice) | max-patch-agent (host), max-ui-agent | poly~, polyphony, N-voice synth, voice allocation / stealing, thispoly~ |

Multi-Domain Dispatch

Many tasks span multiple domains. When this happens:

  1. Identify the lead agent -- the domain that dominates the task
  2. Dispatch to all relevant agents
  3. Merge outputs using the protocol in references/merge-protocol.md

Common multi-domain patterns:

Context Budget

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 | shared-capabilities.md (pointer in all agents) |

| Builder API (stub) | shared -- skip for secondaries | patch, ui (full block in shared-capabilities.md) |

| 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.

Capabilities

Output Protocol

  1. Analyze the task and determine agent(s)
  2. Log dispatch decision: which agent(s) and why
  3. Load and pass relevant context (project context) to specialist(s); when a domain overlay matched, also pass that overlay's required reading and checks (references/dispatch-rules.md "Domain Overlays")

3b. Pass allowed_packages from project config to specialist agent(s) -- they use it when constructing Patcher instances

  1. Invoke specialist skill(s)
  2. If multi-agent: merge outputs per merge-protocol.md
  3. Pass merged output to critic loop for review
  4. Return final output to caller

When to Use

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.