mcpField
A
architect

architect

github.com/iankikuDevelopment1841 installsUpdated 13w ago
Repository

About architect

A system design skill for software teams that helps assess constraints and choose an architecture before implementation. It covers databases, project structure, APIs, caching, and scaling, with an emphasis on starting with a simple design for current needs.

Key features

  1. 01Assess constraints before design
  2. 02Compare common architecture patterns
  3. 03Choose databases by use case
  4. 04Project structure examples across stacks
  5. 05Default API and caching guidance
  6. 06Scaling bottleneck checklist

Use cases

  1. 01Choosing an architecture for a new project
  2. 02Planning database and API design
  3. 03Organizing an existing codebase
  4. 04Assessing potential scaling bottlenecks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/iankiku/forwward-teams --skill architect

After installing, type/architectin Claude Code to confirm it loaded.

Details

From the project README

Architect — System Design

Structure the system before building it. Good architecture makes everything easier. Bad architecture makes everything a rewrite.

Step 0: Understand Constraints

Before designing, answer:

  1. Scale — 100 users or 100,000? Determines everything.
  2. Team size — Solo founder or 10 engineers? Simpler systems for smaller teams.
  3. Budget — Bootstrapped or funded? Managed services vs self-hosted.
  4. Timeline — MVP in 2 weeks or v1 in 3 months?
  5. Compliance — HIPAA, SOC 2, GDPR? Constrains architecture choices.

Architecture Patterns

PatternWhen to UseWhen to Avoid
Monolith<10 engineers, single product, moving fastMultiple teams needing independent deploys
Modular monolithGrowing team, want boundaries without infra costNeed independent scaling per service
Microservices20+ engineers, distinct domains, independent scalingSmall team, early stage, unclear boundaries
ServerlessEvent-driven, spiky traffic, want zero opsLong-running processes, cost-sensitive at scale
Event-drivenAsync workflows, decoupled systems, audit trailsSimple CRUD, real-time requirements

Default: Monolith until it hurts. Premature microservices is the #1 architecture mistake.

Database Selection

NeedDatabaseWhy
General purpose, relationalPostgreSQLACID, JSON support, extensions, ecosystem
Key-value, cachingRedis / ValkeySub-ms reads, TTL, pub/sub
Document store, flexible schemaMongoDBRapid prototyping, nested documents
Full-text searchPostgreSQL FTS or MeilisearchPostgres built-in is good enough until it isn't
Time-seriesTimescaleDB (Postgres extension)Keep one database engine
Graph relationshipsPostgreSQL with recursive CTEsDon't add Neo4j unless graph is the core product
Vector / embeddingspgvector (Postgres extension)Same — keep one database

Rules:

  • Start with Postgres. Add specialized databases only when Postgres can't do the job.
  • Managed always (Supabase, Neon, RDS). Don't manage your own database.
  • One database engine until you have a DBA. Two databases = two problems.

Project Structure

Detect the stack first. Check package.json, go.mod, Gemfile, pyproject.toml, pom.xml, or Cargo.toml before recommending a structure. Apply the principles below to whatever stack the project uses.

Universal rules — apply to every stack:

  • Feature code stays together. Don't scatter a feature across 8 directories.
  • Services contain business logic. Routes are thin — validate, call service, respond.
  • One service per domain, not one file per function.
Example: TypeScript / Next.js
src/
├── app/                    # Next.js app router — pages and layouts
│   ├── (auth)/             # Route groups for auth pages
│   ├── (dashboard)/        # Route groups for app pages
│   └── api/                # API routes
├── lib/                    # Shared utilities, config, constants
│   ├── db/                 # Database client, schema, migrations
│   ├── auth/               # Auth config and helpers
│   └── utils/              # Pure utility functions
├── services/               # Business logic — one file per domain
├── components/             # React components
│   ├── ui/                 # Primitives (button, input, card)
│   └── features/           # Feature-specific composites
└── types/                  # Shared TypeScript types
Example: Python / FastAPI
src/
├── api/
│   ├── v1/                 # Versioned endpoints
│   └── deps.py             # Shared dependencies (auth, db session)
├── core/                   # Config, security, constants
├── models/                 # ORM models
├── schemas/                # Request/response schemas
├── services/               # Business logic — one file per domain
├── repositories/           # Data access layer
└── tests/
    ├── unit/
    └── integration/
Example: Go
cmd/
├── api/                    # Application entrypoint
internal/
├── handler/                # HTTP handlers (thin — validate + call service)
├── service/                # Business logic
├── repository/             # DB access layer
├── model/                  # Domain types
└── config/                 # Config loading
pkg/                        # Shared, importable packages
Example: Ruby on Rails
app/
├── controllers/            # Thin — params, call service, render
├── models/                 # ActiveRecord + domain logic
├── services/               # Complex business logic extracted from models
├── views/                  # Templates or JSON serializers
└── jobs/                   # Background jobs (Sidekiq)
config/
db/
├── migrate/                # Migrations
└── schema.rb

For other stacks (Java/Spring, .NET, Rust, Elixir): apply the same principle — thin routes, services for business logic, repositories for data access, tests alongside the code they test.

API Design

DecisionDefault
ProtocolREST for CRUD, tRPC for type-safe full-stack, GraphQL only if multiple clients need different shapes
VersioningURL path: /api/v1/ — simple, explicit
AuthBearer token in Authorization header
PaginationCursor-based for feeds, offset for admin tables
Errors{ error: { code: "NOT_FOUND", message: "User not found" } }
Rate limiting100 req/min default, lower for auth endpoints

Caching Strategy

LayerToolTTLUse When
BrowserCache-Control headersVariesStatic assets, API responses
CDNCloudflare / Vercel Edge1-60 minPublic pages, images
ApplicationRedis / in-memory5-60 minExpensive queries, session data
DatabaseMaterialized viewsRefresh on writeAggregations, dashboards

Rules:

  • Cache reads, not writes. Invalidate on mutation.
  • Start with no cache. Add caching when you measure a bottleneck.
  • Every cache needs an invalidation strategy. "TTL and hope" works until it doesn't.

Scaling Checklist

Only optimize when you hit the problem:

UsersLikely BottleneckFix
0-1KNothingDon't optimize
1K-10KDatabase queriesAdd indexes, optimize N+1s
10K-100KDatabase connectionsConnection pooling (PgBouncer)
100K-1MRead throughputAdd Redis cache layer
1M+Write throughputRead replicas, sharding, queue writes

The best architecture is the simplest one that handles your current scale + 10×.

Comments

Markdown supported