mas-compiler

Compiles multi-agent systems into single-agent skills via three-phase pipeline compression.

2|1|Updated Jun 10, 2026
One-click install
npx skills add https://github.com/Tencent/AdaSkill --skill mas-compiler-tencent
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mas-compiler
Source: https://github.com/Tencent/AdaSkill/tree/main/skills/mas-compiler_baseline
Command: npx skills add https://github.com/Tencent/AdaSkill --skill mas-compiler-tencent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Multi-agent systems incur coordination overhead, token costs, and latency from inter-agent communication. This Skill converts a MAS codebase or description into a single-agent skill with sequential phases, eliminating message-passing overhead while preserving behavior. ## Core Features & Use Cases - Compilability Checking: Verifies three formal conditions (serializable communication, shared history, homogeneous backbone) before compilation and reports violations. - Three-Phase Compilation: Performs capability decomposition, backend assignment (external tools vs. internal policies), and topology internalization that converts communication edges into output format constraints. - Structured Output Generation: Produces a compiled SKILL.md with ordered [PHASE] sections plus a tools/ directory of validated Python functions. - Use Case: Given a 3-agent GSM8K pipeline (Decomposer → Solver → Verifier), compile it into one skill with three sequential phases, cutting token usage by roughly half while maintaining accuracy. ## Quick Start Compile this multi-agent system codebase into a single-agent skill using the mas-compiler.

Frequently Asked Questions about mas-compiler

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

FAQPage Schema
How do I convert a multi-agent system into a single agent?▼

Use the three-phase compilation: decompose each agent's role into atomic capabilities, assign each capability an external tool or internal policy backend, then internalize the communication topology by embedding handover output constraints into each phase's policy.

What multi-agent architectures cannot be compiled to a single agent?▼

Architectures with cyclic communication like debate loops violate serializability, agents with private state or hidden objectives violate shared history, and mixed-model systems violate the homogeneous backbone condition. Adversarial negotiation and true parallel sampling are also non-compilable.

Does compiling a MAS to a single agent reduce accuracy?▼

Compiled single agents maintain accuracy within about ±4% of the original MAS according to the referenced paper's benchmarks. They reduce token usage by roughly 54% and latency by about 50% on average.

What output does the MAS compilation produce?▼

Compilation produces a directory containing a SKILL.md with one [PHASE] section per capability in topological order, plus a tools/ directory with one Python file per externalized capability. Each tool returns a flat dict and wraps errors in try/except.

When is MAS compilation not beneficial?▼

Compilation is not beneficial when skill selection cost exceeds the communication overhead eliminated, which occurs when skill libraries grow beyond roughly 50-100 entries. Selection accuracy collapses near 200 skills due to a scaling law phase transition.