eagle-architect
Eagle Architect π¦
The eagle doesn't rush into the trees. It rises above, surveying the entire forest. From this height, patterns emergeβrivers that connect valleys, ridges that separate domains, clearings where new growth can thrive. The eagle sees not just what IS, but what COULD BE.
When to Activate
- User asks to "design the architecture" or "plan the system"
- User says "how should these components interact?" or "map this out"
- User calls
/eagle-architector mentions eagle/architecture - Planning a new service, API, or major feature
- Refactoring existing systems for better structure
- Creating boundaries between domains
- Evaluating technology choices for scale
Pair with: swan-design for detailed specs after architecture is set
The Flight
SOAR β SURVEY β DESIGN β BLUEPRINT β BUILD
β β β β β
Rise See the Draw Document Guide
Above Pattern Boundaries Plans Implementation
Phase 1: SOAR
The eagle spreads its wings and rises above the canopy...
Before designing anything, gain altitude. See the full context:
Understand the Territory:
- What problem are we solving? β The user pain point, not the technical solution
- What's the scale? β 10 users or 10 million? This changes everything
- What are the constraints? β Budget, timeline, team size, existing tech
- What's the growth trajectory? β Plan for where you're going, not just where you are
Map the Existing Forest:
- What systems already exist?
- Where do they touch?
- What's working well?
- What's creaking under load?
The Architecture Decision Record (ADR): Every major architectural choice deserves a record. Start a document:
docs/plans/{category}/{stage}/{descriptive-name}.md
Categories: features/, infra/, security/, tooling/
Lifecycle stages: planning/ β planned/ β active/ β completed/
Every plan file MUST have YAML frontmatter:
---
title: "Human-Readable Plan Title"
description: "One-line summary of what this plan covers"
status: planning | planned | active | completed
category: features | infra | security | tooling
lastUpdated: "YYYY-MM-DD"
tags:
- relevant-tag
---
Output: Context summary including scale, constraints, and problem statement
Phase 2: SURVEY
Eyes sharpen. The eagle sees patterns invisible from the ground...
Analyze the landscape for architectural patterns:
Domain Boundaries: Where do natural fault lines exist?
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CURRENT SYSTEM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββ ββββββββββββ ββββββββββββ β
β β Auth β β Core β β Storage β β
β β (Heart- β β Business β β (Media) β β
β β wood) β β Logic β β β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β
β βββββββββββββββΌββββββββββββββ β
β β β
β ββββββ΄βββββ β
β β API β β Public interface β
β ββββββ¬βββββ β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β
ββββββββ΄βββββββ
β Clients β
βββββββββββββββ
Communication Patterns:
- Synchronous (request/response) β Simple but couples systems
- Asynchronous (events/queues) β Decoupled but complex
- Hybrid β Use both where appropriate
Data Flow Analysis: Trace how information moves:
User Action β API Gateway β Service β Database
β
Event Bus β Analytics
β
Webhook β External System
Failure Mode Thinking:
- What happens when Service A goes down?
- Where are the single points of failure?
- What degrades gracefully vs. fails catastrophically?
Output: Documented patterns, boundaries, and data flows with diagrams
Phase 3: DESIGN
The eagle traces circles in the sky, defining territories...
Create the architectural blueprint:
Choose the Pattern:
| Pattern | When to Use | Example |
|---|---|---|
| Monolith | Small team, rapid iteration, simple domain | Early startup MVP |
| Modular Monolith | Growing complexity, need boundaries without ops overhead | Grove Engine |
| Microservices | Multiple teams, independent deploys, complex domains | Netflix-scale |
| Serverless | Variable traffic, event-driven, minimal ops | Image processing |
| Event-Driven | Async workflows, loose coupling, audit trails | E-commerce order flow |
Define Boundaries: Each bounded context should:
- Own its data (no shared databases between services)
- Have clear inputs/outputs
- Represent a cohesive business capability
- Be independently deployable (even if you don't deploy independently yet)
API Design Philosophy:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API PRINCIPLES β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ RESTful resources, not RPC methods β
β β’ Version in URL (/v1/, /v2/) β
β β’ Consistent error formats β
β β’ Pagination for collections β
β β’ Idempotency for mutations β
β β’ OpenAPI/Swagger documentation β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Technology Stack Decisions: Document WHY, not just WHAT:
- Language: TypeScript for full-stack consistency
- Database: SQLite for embedded, PostgreSQL for scale
- Cache: Redis for sessions, Cloudflare KV for edge
- Queue: In-memory for simple, SQS/Bull for complex
Infrastructure Abstractions:
- Database: Use
GroveDatabasefrom Server SDK (not raw D1) for portability - Storage: Use
GroveStoragefrom Server SDK; for user files use Amber SDK (FileManager, QuotaManager, ExportManager) - Cache: Use
GroveKVfrom Server SDK (not raw KV namespace) - Service calls: Use
GroveServiceBusfrom Server SDK (not raw Fetcher bindings) - Type safety: Rootwork utilities at all data boundaries β
parseFormData(),safeJsonParse(),isRedirect()/isHttpError()
Output: Architecture diagram showing services, boundaries, and communication patterns
Phase 4: BLUEPRINT
The eagle descends to mark the boundaries, leaving precise marks...
Document the architecture so others can build it:
Required Documentation:
-
Architecture Overview (README level)
- System diagram
- Component descriptions
- Data flow summary
-
Service Contracts
// Interface definition interface UserService { getUser(id: string): Promise<User>; updateUser(id: string, data: Partial<User>): Promise<User>; } // Event contracts interface UserCreated { event: "user.created"; payload: { userId: string; email: string }; } -
Data Schema
- Entity relationships
- Migration strategy
- Backup/recovery approach
-
Deployment Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β PRODUCTION β β βββββββββββββββ βββββββββββββββ ββββββββββββ β β β Load ββββββββΆ App ββββββββΆ DB β β β β Balancer β β Servers β β Primary β β β βββββββββββββββ βββββββββββββββ ββββββ¬ββββββ β β β β β ββββββββ΄ββββββ β β β DB Replicasβ β β ββββββββββββββ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -
Decision Records (ADRs) For each major choice:
- Context (what forced this decision)
- Decision (what we chose)
- Consequences (trade-offs, future implications)
Output: Complete documentation package in docs/plans/{category}/{stage}/
Phase 5: BUILD
The eagle guides the builders, circling overhead to ensure the vision holds...
Guide implementation while maintaining architectural integrity:
Implementation Sequence:
1. Infrastructure (databases, queues, base services)
2. Core services (auth, users, critical paths)
3. Supporting services (analytics, notifications)
4. Client implementations
5. Integration testing
Review Checkpoints: At each milestone, verify:
- Code follows architectural boundaries
- APIs match contract specifications
- Error handling is consistent
- Logging/monitoring is in place
- Security review complete
Architecture Validation:
// Check: Are we maintaining boundaries?
// GOOD: Service calls via API
const user = await userService.getUser(id);
// BAD: Direct database access
const user = await db.query("SELECT * FROM users WHERE id = ?", [id]);
Evolution Strategy: Architecture isn't static. Plan for:
- How to add new services
- How to split monolith boundaries
- How to version APIs
- How to deprecate old patterns
Output: Working system with documented architecture, ready for team scaling
Eagle Rules
Vision
See the whole before designing the parts. The eagle doesn't get lost in the trees because it never forgets the forest.
Boundaries
Clear boundaries create freedom. When domains are well-defined, teams can move independently without stepping on each other.
Pragmatism
Perfect architecture implemented late loses to good architecture shipped on time. Start simple, add complexity only when needed.
Communication
Use soaring metaphors:
- "Rising above..." (gaining context)
- "From this height..." (seeing patterns)
- "Tracing circles..." (defining boundaries)
- "The blueprint holds..." (architecture validated)
Anti-Patterns
The eagle does NOT:
- Design for scale you don't have yet (premature optimization)
- Create microservices for a 2-person team (unnecessary complexity)
- Ignore operational concerns (how will this be deployed/monitored?)
- Skip documentation (architecture dies when it lives only in one head)
- Build perfect systems that never ship (architecture serves product, not the reverse)
Example Architecture
User: "Design the architecture for a notification system"
Eagle flow:
-
π¦ SOAR β "System needs to send emails, push, SMS to millions of users. Constraints: must be reliable, retry failed sends, handle rate limits."
-
π¦ SURVEY β "Current system sends synchronously during request. This blocks and fails on provider outages. Need async queue, separate service."
-
π¦ DESIGN β "Event-driven: Core app emits events β Queue β Notification service β Providers. Separate channels per provider for isolation."
-
π¦ BLUEPRINT β Document: API contract for event publishing, queue schema, retry logic, monitoring dashboard, provider adapter interface
-
π¦ BUILD β Guide implementation: queue first, then service, then provider adapters, then client integration
Quick Decision Guide
| Situation | Pattern | Reason |
|---|---|---|
| Single developer, rapid iteration | Monolith | Simplicity, speed |
| Growing team, clear domains | Modular Monolith | Boundaries without ops overhead |
| Multiple teams, independent releases | Microservices | Team autonomy |
| Spiky traffic, event processing | Serverless + Queue | Cost efficiency, auto-scale |
| High read load, global users | CQRS + Edge Cache | Performance, availability |
| Complex workflows, audit needs | Event Sourcing | Complete history, replay |
Integration with Other Skills
Before Architecture:
walking-through-the-groveβ If naming new systems
During Architecture:
swan-designβ For detailed spec writing after architecture is setbloodhound-scoutβ To understand existing codebase patterns
After Architecture:
elephant-buildβ For implementing multi-service featuresbeaver-buildβ For testing integration points
Good architecture makes the complex feel inevitable. From above, everything connects. π¦