Pattern Skills
reopt-responsibility-partitioning
Apply the responsibility-partitioning pattern when several agents collaborate.
OCLS OWN
Install
cp skills/patterns/reopt-responsibility-partitioning/SKILL.md <your-project>/.claude/skills/reopt-responsibility-partitioning/SKILL.mdCopy this repo's file into your project and the resource activates in your Claude Code session immediately.
markdownskills/patterns/reopt-responsibility-partitioning/SKILL.md
---
name: reopt-responsibility-partitioning
description: When several agents share work or role boundaries are unclear. Triggers on adding a new agent, refactoring to split capabilities, or attributing the cause of an incident.
---
# Responsibility Partitioning
OCLS phase: **OWN** · Name the owner of each outcome and draw the boundary around it.
## Core rules
- Decompose the system's final goal into sub-responsibilities and assign each to exactly one agent.
- The criterion for the cut is "what can this agent explain about its work."
- Each agent decides and acts inside its scope; anything outside is delegated through an explicit handoff.
- Once partitioned, give each boundary a Module Contract.
## Judgment question
**Is this responsibility independent enough to live in its own agent?**
## Application check
1. Can this agent's responsibility scope be stated in one sentence?
2. Are its goal, authority scope, and termination condition declared?
3. When this agent fails, who is the escalation target?
4. Do its responsibility boundaries not overlap with other agents'?
## Code example
```typescript
// ❌ All responsibilities crammed into one agent — incident attribution impossible
class CustomerAgent {
async handle(msg: string) {
const cat = await this.classify(msg);
const reply = await this.generate(cat);
const approved = await this.review(reply);
return approved ? reply : await this.escalate(msg);
}
}
// ✅ Responsibility split + explicit handoffs — each agent evaluated and replaced independently
interface IntakeAgent { classify(msg: string): Promise<IntakeResult> }
interface ResponseAgent { generate(ctx: IntakeResult): Promise<Response> }
interface QAAgent { review(r: Response): Promise<QAVerdict> }
interface EscalationAgent { route(v: QAVerdict): Promise<Action> }
```
## Antipatterns
**Customer support**: cramming every capability into one agent and "separating roles by prompt" produces interference between roles. Tuning the classification prompt changes the response tone.
**Data pipelines**: a single ETL agent doing extract + transform + validate + load collapses the whole pipeline on a schema change. Splitting into extract / transform / load agents lets each be tested and replaced independently.
## Invocation example
```
"CustomerAgent currently does classification, response, review, and escalation
all in one place. Apply reopt-responsibility-partitioning to split it into
3–4 agents, and declare each agent's goal, authority, and termination
condition in one sentence."
```
## Related patterns
- Module Contract — give each separated responsibility a contract
- Context Routing — rules for transferring information across responsibilities