Epic: #268 | Phase: 1 — Structural | Priority: P0 | Complexity: L
Problem
agent.rs is 4695 lines with 30+ struct fields. Multiple 80-116 line functions.
Tasks
- R2.6 [S] Convert
agent.rs → agent/mod.rs directory
- R2.1 [M] Extract
AgentBuilder with builder pattern
- R2.2 [M] Extract MCP subsystem →
agent/mcp.rs
- R2.3 [M] Extract self-learning →
agent/learning.rs
- R2.5 [M] Extract code index →
agent/index.rs
- R2.4 [L] Extract context management →
agent/context_manager.rs
Order: R2.6 → R2.1 → (R2.2, R2.3, R2.5) → R2.4