eagle-architect

Design system architecture from 10,000 feet. Soar above the codebase, survey the landscape, and create blueprints that stand the test of time. Use when planning major features, refactoring systems, or

SKILL.md

GitHub

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-architect or 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

Before designing anything, gain altitude. See the full context:

Understand the Territory:

  1. What problem are we solving? โ€” The user pain point, not the technical solution
  2. What's the scale? โ€” 10 users or 10 million? This changes everything
  3. What are the constraints? โ€” Budget, timeline, team size, existing tech
  4. 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

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

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 GroveDatabase from Server SDK (not raw D1) for portability
  • Storage: Use GroveStorage from Server SDK; for user files use Amber SDK (FileManager, QuotaManager, ExportManager)
  • Cache: Use GroveKV from Server SDK (not raw KV namespace)
  • Service calls: Use GroveServiceBus from 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

Document the architecture so others can build it:

Required Documentation:

  1. Architecture Overview (README level)

    • System diagram
    • Component descriptions
    • Data flow summary
  2. 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 };
    }
    
  3. Data Schema

    • Entity relationships
    • Migration strategy
    • Backup/recovery approach
  4. Deployment Architecture

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                      PRODUCTION                          โ”‚
    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
    โ”‚  โ”‚   Load      โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ   App       โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ   DB     โ”‚ โ”‚
    โ”‚  โ”‚  Balancer   โ”‚      โ”‚  Servers    โ”‚      โ”‚ Primary  โ”‚ โ”‚
    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
    โ”‚                                                  โ”‚       โ”‚
    โ”‚                                           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ” โ”‚
    โ”‚                                           โ”‚  DB Replicasโ”‚ โ”‚
    โ”‚                                           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    
  5. 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

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.


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)

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 set
  • bloodhound-scout โ€” To understand existing codebase patterns

After Architecture:

  • elephant-build โ€” For implementing multi-service features
  • beaver-build โ€” For testing integration points

Good architecture makes the complex feel inevitable. From above, everything connects. ๐Ÿฆ