Spaces:
Sleeping
Sleeping
Commit ·
fcde778
1
Parent(s): ca5b1f7
plan: OOP orchestrator, routing engine, design state refactor
Browse filesCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs/superpowers/plans/2026-04-11-oop-orchestrator-routing.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OOP Orchestrator & Routing Implementation Plan
|
| 2 |
+
|
| 3 |
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task.
|
| 4 |
+
|
| 5 |
+
**Goal:** Extract routing into RoutingEngine class, add BaseOrchestrator ABC, move DesignState extraction to method, refactor agent definitions to load from config.yaml.
|
| 6 |
+
|
| 7 |
+
**Architecture:** RoutingEngine replaces free functions in prompts.py. BaseOrchestrator ABC provides shared interface for all orchestrators. Agent definitions loaded from config.yaml via Settings. DesignState.update_from_messages() replaces standalone extract_decisions(). All existing tests must keep passing.
|
| 8 |
+
|
| 9 |
+
**Tech Stack:** Python ABC, Pydantic, config.yaml
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
### Task 1: Create RoutingEngine class
|
| 14 |
+
|
| 15 |
+
Create `agents/routing.py` with a class that encapsulates all routing logic currently in `agents/prompts.py` (parse_mentions, route_by_keywords, CAD_TRIGGER_KEYWORDS). Load keywords from config.yaml.
|
| 16 |
+
|
| 17 |
+
### Task 2: Create BaseOrchestrator ABC
|
| 18 |
+
|
| 19 |
+
Create `agents/base.py` with abstract base class that MockChatBackend, SingleCallOrchestrator, and CrewOrchestrator will inherit from.
|
| 20 |
+
|
| 21 |
+
### Task 3: Refactor DesignState — move extract_decisions into method
|
| 22 |
+
|
| 23 |
+
Move the standalone `extract_decisions()` function into `DesignState.update_from_messages()`. Load materials, material_grades, dimension_contexts from config.yaml.
|
| 24 |
+
|
| 25 |
+
### Task 4: Refactor agent definitions to load from config
|
| 26 |
+
|
| 27 |
+
Update `agents/definitions.py` to load agent data from `config.yaml` via Settings, keeping backward compatibility with AGENTS dict, AGENT_COLORS, AGENT_NAMES, AGENT_AVATARS.
|
| 28 |
+
|
| 29 |
+
### Task 5: Wire RoutingEngine into orchestrators
|
| 30 |
+
|
| 31 |
+
Update orchestrator.py and crew_orchestrator.py to use RoutingEngine instead of importing free functions from prompts.py.
|
| 32 |
+
|
| 33 |
+
### Task 6: Make orchestrators inherit BaseOrchestrator
|
| 34 |
+
|
| 35 |
+
Update MockChatBackend, SingleCallOrchestrator to inherit BaseOrchestrator. Update get_orchestrator factory.
|
| 36 |
+
|
| 37 |
+
### Task 7: Update tests and verify
|
| 38 |
+
|
| 39 |
+
Update all test imports, add new tests for RoutingEngine and BaseOrchestrator, run full suite.
|