ποΈ System Overview: The 5-Layer Cake
Forget single-agent prompting. This is a full system architecture with separation of concerns. Each layer handles one job well.
π€ Layer 1: User Interface
Where you interact β Telegram, CLI, or Web Dashboard. You describe what you want in natural language.
π§ Layer 2: Orchestrator
The brain. Decomposes tasks, assigns agents, manages state, handles failures. This is where the magic happens.
π€ Layer 3: Specialized Agents
Focused workers β Coder, Reviewer, Tester, Researcher. Each is an instance of Claude Code with a specific role.
πΎ Layer 4: Memory and Context
Persistent knowledge β project memory, skills, session history, codebase index. Feeds context to agents.
π The Agentic Workflow
Here's how a task flows through the system:
User Request (Telegram/CLI)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β ORCHESTRATOR β
β 1. Parse request β
β 2. Load project memory + skills β
β 3. Decompose into subtasks β
β 4. Create execution plan β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββΌββββββββββ
βΌ βΌ βΌ
ββββββββββ ββββββββββ ββββββββββ
βRESEARCHβ β CODER β β CODER β β Parallel execution
β Agent β β Agent β β Agent β
βββββ¬βββββ βββββ¬βββββ βββββ¬βββββ
β β β
ββββββββββββΌβββββββββββ
βΌ
ββββββββββββββββ
β TESTER β β Automated verification
β Agent β
ββββββββ¬ββββββββ
β
ββββββββ΄ββββββββ
βΌ βΌ
βββββββββββ ββββββββββββ
β PASS β
β β FAIL β ββββ Back to Coder
ββββββ¬βββββ ββββββββββββ
βΌ
ββββββββββββ
β REVIEWER β β Human-like review
β Agent β
ββββββ¬ββββββ
βΌ
ββββββββββββ
β DEPLOYER β β Ship it
β Agent β
ββββββββββββ
πΎ Memory Architecture
The memory system is what separates this from "just using Claude Code." Three tiers:
π§ Tier 1: Project Memory
- Architecture decisions
- Tech stack choices
- Coding conventions
- Known gotchas
Stored: MEMORY.md in project root
π Tier 2: Skills Library
- Reusable patterns
- API documentation
- Tool-specific guides
- Proven workflows
Stored: ~/.hermes/skills/
π Tier 3: Session History
- Recent decisions
- Code changes made
- Test results
- User feedback
Stored: session transcripts
Key design decision: Memory is FILE-BASED, not database-based. This means any Claude Code session can read it, you can edit it manually, and Git tracks changes. Simple beats complex on a Mac Mini.
π Project Structure
The complete directory layout for the agentic system:
agentic-dev/
βββ orchestrator.yaml
βββ agents.yaml
βββ memory/
β βββ MEMORY.md
β βββ DECISIONS.md
β βββ skills/
βββ agents/
β βββ orchestrator.py
β βββ researcher.py
β βββ coder.py
β βββ tester.py
β βββ reviewer.py
β βββ deployer.py
βββ tools/
β βββ context_manager.py
β βββ git_ops.py
β βββ test_runner.py
β βββ notifier.py
βββ pipelines/
β βββ feature.py
β βββ bugfix.py
β βββ refactor.py
βββ dashboard/
β βββ index.html
βββ config/
βββ models.yaml
βββ quality.yaml
β‘ Model Routing Strategy
Not every task needs the most expensive model. Route intelligently:
π’ Fast/Cheap (Haiku/GPT-4o-mini)
- Code formatting
- Simple file edits
- Test execution
- Documentation updates
- Search and indexing
π΄ Powerful (Sonnet/Opus)
- Architecture decisions
- Complex debugging
- Multi-file refactoring
- Code review
- Security analysis
Cost optimization: Route 70% of tasks to cheap models, 30% to powerful ones. Estimated savings: 60% vs using Sonnet for everything. Your Mac Mini handles the routing β no cloud dependency.
π Quality Gates
Every piece of code passes through these gates before reaching you:
Code Generated by Coder Agent
β
βΌ
ββββββββββββββββββββββββββββ
β Gate 1: Syntax + Types β β ruff, mypy, typescript
ββββββββββββββββββββββββββββ€
β Gate 2: Unit Tests β β pytest, jest, go test
ββββββββββββββββββββββββββββ€
β Gate 3: Integration β β docker-compose test env
ββββββββββββββββββββββββββββ€
β Gate 4: Security Scan β β bandit, semgrep
ββββββββββββββββββββββββββββ€
β Gate 5: Code Review β β Reviewer Agent
ββββββββββββββββββββββββββββ€
β Gate 6: Human Approval β β You (optional for minor)
ββββββββββββββββββββββββββββ
β
βΌ
MERGED β