Skip to main content
Back to how-to guides Use this pattern when a project has many assistants, specialists, tools, and workflows that need to be composed without duplicating responsibilities or creating routing ambiguity.

Concept

Reusable design in ABL starts with stable agent boundaries. A reusable agent owns a business capability, has a clear goal, accepts a predictable context package, and can be called from more than one supervisor or entry point. Do not make reuse mean “one giant shared agent.” Reuse works best when specialists are small enough to be reliable but broad enough to represent a durable business capability, such as product advice, order status, billing disputes, identity verification, or appointment scheduling. Reuse happens at four levels. Pick the smallest level that solves the problem. For tools, validation rejects the removed FROM ... USE and USE TOOL: syntax in agent files with error E720. Keep agent files focused on agent behavior. Declare tool signatures in the agent and manage tool implementations in Project Tools.

Minimal working example

This example assumes that your project sets customer_id and locale in the session before the handoff and gathers order_id earlier in the conversation. The example does not declare those sources, so add them to your supervisor. Each handoff target must exist in the same compilation. Validate the three files together. The supervisor alone fails with INVALID_HANDOFF_TARGET.

How it works

The supervisor is reusable because it routes to stable capability agents. The specialist agents are reusable because they describe their responsibility without depending on one specific entry point. The PASS fields are the integration contract between the supervisor and specialists. In a large project, keep the reusable boundary visible in three places: the agent goal, the routing condition, and the context package. If those three disagree, reuse becomes fragile. When a handoff omits HISTORY, the specialist receives the full conversation history. This is the platform default. Set HISTORY to change it:

Common variations

Shared specialist agent

Use one specialist from several supervisors when the business capability is truly the same. For example, Order_Status_Agent can serve commerce chat, WhatsApp, and voice entry points if the required context is consistent.

Channel-specific wrapper

Use a thin channel-specific supervisor when routing or welcome behavior differs by channel, while the underlying specialists remain shared.

Shared behavior profile

Use a standalone behavior profile when several agents share the same channel or customer-context rule. Attach it with USE BEHAVIOR_PROFILE: in each agent. Changing the profile changes every agent that uses it. See the behavior profiles article for the details.

Remote specialist

A handoff can target an agent that runs outside the project. Add LOCATION: REMOTE, an ENDPOINT, and a PROTOCOL to the HANDOFF entry. Use this when another team or system owns the specialist.

Project manifest composition

The project manifest (project.json) lists the agents, the entry agent, the tools, and the behavior profiles. For each agent it can record the file path, owner, ownerTeam, description, and version. It also records the handoff and delegate references between agents. Keep agent names stable, because handoff targets depend on them.

Shared tool implementations

Manage reusable tool implementations in Project Tools. The agent declares only the tool signature. The Project Tool is the authority for the implementation. If an agent signature differs from the Project Tool, compilation raises warning W721 with the changed fields. Implementation properties inside an agent TOOLS section raise an E720 warning.

Modules shared across projects

Use a module when another project needs your agents or tools. One project publishes a module release. Other projects import a release under an alias.
  • What a release provides. The release contains agents and tools. Its contract lists them.
  • What a release requires. The contract lists every environment variable ({{env.KEY}}), auth profile, connector, MCP server, and config key ({{config.KEY}}) that the agents and tools use. The importing project must supply them.
  • Mounted names. The importing project refers to a module agent as alias__AgentName. Use a double underscore. For example, an import with the alias orders exposes orders__Order_Status_Agent.
  • Config values. The importing project sets non-secret config keys that the contract declares. A key that the contract does not declare cannot be set. Secret keys cannot be set as overrides.
  • Peer modules. A module can require other modules without bundling them. The importing project must import each required module at a compatible version that provides the symbols the module uses. The version rule is exact (3 or =3) or minimum (>=2). Import is blocked until the peers are present.
  • Release selection. The importing project selects a release by version or by environment.
  • Upgrades. An upgrade preview compares contracts. Removed agents or tools and new required prerequisites count as breaking changes. Added agents and tools, and removed prerequisites, do not.
  • Publish safety. Publishing blocks HTTP tools that use literal credentials. Use an auth profile or a {{env.KEY}} or {{config.KEY}} template instead.
A supervisor in the importing project hands off to a module agent by its mounted name:
This snippet assumes that the project imported a module under the alias orders and that the module release provides Order_Status_Agent.

Verification

  • Validate the full project group, not only one agent file.
  • Confirm every handoff target exists in the same project or in an imported module.
  • Test each reusable specialist from every entry point that can route to it.
  • Confirm every PASS field has a source before handoff.
  • Inspect traces to prove the active agent changes to the intended specialist.
  • For a module import, confirm that every required environment variable, auth profile, connector, MCP server, config key, and peer module exists in the importing project.
  • Before you upgrade a module release, read the contract diff. Fix every breaking change first.

Production readiness checklist

  • Agent names are stable and unique.
  • Each reusable agent has one durable business capability.
  • Handoff context is minimal, explicit, and privacy-reviewed.
  • Each handoff sets HISTORY on purpose when the specialist should not see the full history.
  • Shared specialists have tests from each supervisor or channel entry point.
  • Tool signatures match Project Tools. No W721 warnings remain.
  • Tool bindings and permissions are configured in Project Tools.
  • Ownership is clear for shared modules so one team does not break another team’s entry point.
  • Module releases use auth profiles or templates, never literal credentials.
  • Consumers of a module release pin a version, or use an environment selector that you control.

Common mistakes

Troubleshooting