Originally published on Towards AI.
Skills as traits
Two tools fit in a match statement. Three start to feel cramped. By six, the dispatcher is a swamp of clones, retries, error formatting, and case branches that all look almost but not quite alike. The agent loop is still simple. The space around it is not.

The article proposes replacing the brittle match-based dispatcher with a typed trait approach: define each “skill” as its own trait implementation with associated input types, runtime metadata (read-only vs destructive and concurrency safety), and standardized error handling so the system can reason about failures. It introduces a registry to own dispatch, generate JSON Schema from Rust structs (so model and code stay in sync), and run multiple tool calls in parallel when safe. Beyond dispatch, it covers resilience via retry helpers for transient errors, cross-cutting behavior via pre/post “hooks” (permissions, logging, redaction, caching), and scaling strategies (deferring large tool sets using search hints, aliases, and on-demand loading). Finally, it distills three rules—atomic skills, result-based outputs, and safety-first input handling—and shows how the pattern fits Eugene v0.3 in practice.
Read the full blog for free on Medium.
Published via Towards AI
Towards AI Academy
We Build Enterprise-Grade AI. We'll Teach You to Master It Too.
15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.
Start free — no commitment:
→ 6-Day Agentic AI Engineering Email Guide — one practical lesson per day
→ Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages
Our courses:
→ AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.
→ Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.
→ AI for Work — Understand, evaluate, and apply AI for complex work tasks.
Note: Article content contains the views of the contributing authors and not Towards AI.




























