Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问clear审计未展示

architecture-selection架构选择

Agent Skill

architecture-selection 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

282

周安装

12

GitHub Stars

265

下载量

99
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:architecture-selection(架构选择)
来源仓库:https://github.com/rsmdt/the-startup
仓库路径:skills/architecture-selection
安装命令:
npx skills add https://github.com/rsmdt/the-startup --skill architecture-selection
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rsmdt/the-startup --skill architecture-selection

简介

该技能提供架构模式选择的系统化指导,匹配需求、团队能力与扩展目标。

  • 适用于新系统搭建或现有架构评估,涵盖单体、微服务、事件驱动等多种模式。
  • 通过对比部署模型、数据管理与通信机制,输出适配度矩阵与迁移路径建议。
  • 安装前应检查是否允许读取外部案例与生成架构图,建议结合团队技能栈定制推荐。
  • 不提供具体技术实现,侧重模式特性与适用边界,适合前期设计阶段使用。

SKILL.md

Architecture Pattern Selection

Systematic guidance for selecting and implementing architecture patterns that match requirements, team capabilities, and scalability needs.

When to Activate

  • Designing new system architectures
  • Evaluating monolith vs microservices vs serverless
  • Planning scalability strategies
  • Selecting technology stacks
  • Creating architecture documentation
  • Reviewing architecture decisions

Architecture Patterns

Monolithic Architecture

A single deployable unit containing all functionality.

┌─────────────────────────────────────────────────────────────┐
│                    Monolithic Application                    │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐         │
│  │  Web UI     │  │  API Layer  │  │  Admin UI   │         │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘         │
│         │                │                │                 │
│         └────────────────┼────────────────┘                 │
│                          │                                  │
│  ┌───────────────────────┴───────────────────────────┐     │
│  │              Business Logic Layer                  │     │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────┐        │     │
│  │  │ Orders   │  │ Users    │  │ Products │        │     │
│  │  └──────────┘  └──────────┘  └──────────┘        │     │
│  └───────────────────────┬───────────────────────────┘     │
│                          │                                  │
│  ┌───────────────────────┴───────────────────────────┐     │
│  │              Data Access Layer                     │     │
│  └───────────────────────┬───────────────────────────┘     │
│                          │                                  │
└──────────────────────────┼──────────────────────────────────┘
                           │
                    ┌──────┴──────┐
                    │  Database   │
                    └─────────────┘

When to Use:

  • Small team (< 10 developers)
  • Simple domain
  • Rapid iteration needed
  • Limited infrastructure expertise

Trade-offs:

ProsCons
Simple deploymentLimited scalability
Easy debuggingLarge codebase to manage
Single codebaseTechnology lock-in
Fast development initiallyTeam coupling
Transactional consistencyFull redeploy for changes

Microservices Architecture

Independently deployable services organized around business capabilities.

┌────────┐   ┌────────┐   ┌────────┐   ┌────────┐
│ Web UI │   │Mobile  │   │ Admin  │   │External│
└───┬────┘   └───┬────┘   └───┬────┘   └───┬────┘
    │            │            │            │
    └────────────┴────────────┴────────────┘
                       │
              ┌────────┴────────┐
              │   API Gateway   │
              └────────┬────────┘
                       │
    ┌──────────────────┼──────────────────┐
    │                  │                  │
┌───┴───┐         ┌────┴───┐         ┌───┴───┐
│ Order │         │ User   │         │Product│
│Service│         │Service │         │Service│
├───────┤         ├────────┤         ├───────┤
│  DB   │         │   DB   │         │  DB   │
└───────┘         └────────┘         └───────┘
    │                  │                  │
    └──────────────────┴──────────────────┘
                       │
              ┌────────┴────────┐
              │  Message Bus    │
              └─────────────────┘

When to Use:

  • Large team (> 20 developers)
  • Complex, evolving domain
  • Independent scaling needed
  • Different tech stacks for different services
  • High availability requirements

Trade-offs:

ProsCons
Independent deploymentOperational complexity
Technology flexibilityNetwork latency
Team autonomyDistributed debugging
Targeted scalingData consistency challenges
Fault isolationMore infrastructure

Event-Driven Architecture

Services communicate through events rather than direct calls.

┌─────────────────────────────────────────────────────────────┐
│                      Event Bus / Broker                      │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   OrderPlaced    UserCreated    PaymentReceived             │
│                                                             │
└──────┬──────────────┬──────────────┬───────────────────────┘
       │              │              │
       ▼              ▼              ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│   Order     │ │   User      │ │  Payment    │
│   Service   │ │   Service   │ │   Service   │
│             │ │             │ │             │
│ Publishes:  │ │ Publishes:  │ │ Publishes:  │
│ OrderPlaced │ │ UserCreated │ │ PaymentRcvd │
│             │ │             │ │             │
│ Subscribes: │ │ Subscribes: │ │ Subscribes: │
│ PaymentRcvd │ │ OrderPlaced │ │ OrderPlaced │
└─────────────┘ └─────────────┘ └─────────────┘

When to Use:

  • Loose coupling required
  • Asynchronous processing acceptable
  • Complex workflows spanning multiple services
  • Audit trail needed
  • Event sourcing scenarios

Trade-offs:

ProsCons
Temporal decouplingEventual consistency
Natural audit logComplex debugging
ScalabilityMessage ordering challenges
ExtensibilityInfrastructure requirements
ResilienceLearning curve

Serverless Architecture

Functions executed on-demand without managing servers.

┌────────────────────────────────────────────────────────────┐
│                         Client                              │
└────────────────────────────┬───────────────────────────────┘
                             │
┌────────────────────────────┴───────────────────────────────┐
│                      API Gateway                            │
└────────────────────────────┬───────────────────────────────┘
                             │
    ┌────────────────────────┼────────────────────────┐
    │                        │                        │
    ▼                        ▼                        ▼
┌──────────┐          ┌──────────┐          ┌──────────┐
│ Function │          │ Function │          │ Function │
│ GetUser  │          │CreateOrder│         │ SendEmail│
└────┬─────┘          └────┬─────┘          └────┬─────┘
     │                     │                     │
     ▼                     ▼                     ▼
┌──────────┐          ┌──────────┐          ┌──────────┐
│ Database │          │  Queue   │          │  Email   │
│          │          │          │          │ Service  │
└──────────┘          └──────────┘          └──────────┘

When to Use:

  • Variable/unpredictable workloads
  • Event-triggered processing
  • Cost optimization for low traffic
  • Rapid development needed
  • Short-running operations

Trade-offs:

ProsCons
No server managementCold start latency
Pay-per-useExecution time limits
Auto-scalingVendor lock-in
Rapid deploymentComplex local development
Reduced ops burdenStateless constraints

Pattern Selection Guide

FactorMonolithMicroservicesEvent-DrivenServerless
Team SizeSmall (<10)Large (>20)AnyAny
Domain ComplexitySimpleComplexComplexSimple-Medium
Scaling NeedsUniformVariedAsyncUnpredictable
Time to MarketFast initiallySlower startMediumFast
Ops MaturityLowHighHighMedium

C4 Model

Hierarchical way to document architecture at multiple levels of detail.

Level 1: System Context

Shows system in its environment with external actors and systems.

┌──────────────────────────────────────────────────────────────┐
│                     System Context Diagram                    │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│   ┌──────────┐                           ┌──────────┐       │
│   │ Customer │                           │  Admin   │       │
│   │  [User]  │                           │  [User]  │       │
│   └────┬─────┘                           └────┬─────┘       │
│        │                                      │              │
│        │     Places orders                    │ Manages      │
│        │                                      │ products     │
│        ▼                                      ▼              │
│   ┌────────────────────────────────────────────────┐        │
│   │              E-Commerce System                  │        │
│   │                [Software System]               │        │
│   └───────────┬─────────────────┬──────────────────┘        │
│               │                 │                            │
│               │                 │                            │
│               ▼                 ▼                            │
│   ┌───────────────┐    ┌───────────────┐                    │
│   │ Payment       │    │ Email         │                    │
│   │ Gateway       │    │ Provider      │                    │
│   │ [External]    │    │ [External]    │                    │
│   └───────────────┘    └───────────────┘                    │
│                                                              │
└──────────────────────────────────────────────────────────────┘

Level 2: Container

Shows the high-level technology choices and how containers communicate.

┌──────────────────────────────────────────────────────────────┐
│                      Container Diagram                        │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│   ┌──────────────────┐        ┌──────────────────┐          │
│   │    Web App       │        │   Mobile App     │          │
│   │  [React SPA]     │        │  [React Native]  │          │
│   └────────┬─────────┘        └────────┬─────────┘          │
│            │                           │                     │
│            │         HTTPS             │                     │
│            └───────────┬───────────────┘                     │
│                        ▼                                     │
│            ┌───────────────────────┐                         │
│            │      API Gateway      │                         │
│            │       [Kong]          │                         │
│            └───────────┬───────────┘                         │
│                        │                                     │
│       ┌────────────────┼────────────────┐                   │
│       │                │                │                    │
│       ▼                ▼                ▼                    │
│  ┌─────────┐     ┌─────────┐     ┌─────────┐               │
│  │ Order   │     │ User    │     │ Product │               │
│  │ Service │     │ Service │     │ Service │               │
│  │ [Node]  │     │ [Node]  │     │ [Go]    │               │
│  └────┬────┘     └────┬────┘     └────┬────┘               │
│       │               │               │                     │
│       ▼               ▼               ▼                     │
│  ┌─────────┐     ┌─────────┐     ┌─────────┐               │
│  │ Orders  │     │ Users   │     │Products │               │
│  │   DB    │     │   DB    │     │   DB    │               │
│  │[Postgres│     │[Postgres│     │ [Mongo] │               │
│  └─────────┘     └─────────┘     └─────────┘               │
│                                                              │
└──────────────────────────────────────────────────────────────┘

Level 3: Component

Shows internal structure of a container.

┌──────────────────────────────────────────────────────────────┐
│                Component Diagram: Order Service               │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌───────────────────────────────────────────────────────┐  │
│  │                     API Layer                          │  │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │  │
│  │  │ OrdersCtrl  │  │ HealthCtrl  │  │ MetricsCtrl │   │  │
│  │  └──────┬──────┘  └─────────────┘  └─────────────┘   │  │
│  └─────────┼─────────────────────────────────────────────┘  │
│            │                                                 │
│  ┌─────────┼─────────────────────────────────────────────┐  │
│  │         ▼           Domain Layer                       │  │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │  │
│  │  │OrderService │  │ OrderCalc   │  │ Validators  │   │  │
│  │  └──────┬──────┘  └─────────────┘  └─────────────┘   │  │
│  └─────────┼─────────────────────────────────────────────┘  │
│            │                                                 │
│  ┌─────────┼─────────────────────────────────────────────┐  │
│  │         ▼       Infrastructure Layer                   │  │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │  │
│  │  │ OrderRepo   │  │PaymentClient│  │ EventPub    │   │  │
│  │  └─────────────┘  └─────────────┘  └─────────────┘   │  │
│  └───────────────────────────────────────────────────────┘  │
│                                                              │
└──────────────────────────────────────────────────────────────┘

Level 4: Code

Shows implementation details (class diagrams, sequence diagrams).

*Use standard UML when needed at this level.*

Scalability Patterns

Horizontal Scaling

Add more instances of the same component.

                    Load Balancer
                         │
         ┌───────────────┼───────────────┐
         │               │               │
         ▼               ▼               ▼
    ┌─────────┐     ┌─────────┐     ┌─────────┐
    │Instance │     │Instance │     │Instance │
    │    1    │     │    2    │     │    3    │
    └─────────┘     └─────────┘     └─────────┘

Requirements:
- Stateless services
- Shared session storage
- Database can handle connections

Caching

Reduce load on slow resources.

┌─────────────────────────────────────────────────────┐
│                  Caching Layers                      │
├─────────────────────────────────────────────────────┤
│                                                     │
│  Browser Cache → CDN → App Cache → Database Cache  │
│                                                     │
│  Examples:                                          │
│  - Browser: Static assets, API responses           │
│  - CDN: Static content, cached API responses       │
│  - App: Redis/Memcached for sessions, computed data│
│  - Database: Query cache, connection pooling       │
│                                                     │
└─────────────────────────────────────────────────────┘

Cache Invalidation Strategies:
- TTL (Time to Live): Simplest, eventual consistency
- Write-through: Update cache on write
- Write-behind: Async update for performance
- Cache-aside: App manages cache explicitly

Database Scaling

StrategyUse CaseTrade-off
Read ReplicasRead-heavy workloadsReplication lag
ShardingLarge datasetsQuery complexity
PartitioningTime-series dataPartition management
CQRSDifferent read/write patternsSystem complexity

Reliability Patterns

PatternPurposeImplementation
Circuit BreakerPrevent cascade failuresFail fast after threshold
BulkheadIsolate failuresSeparate thread pools
RetryHandle transient failuresExponential backoff
TimeoutBound wait timesDon't wait forever
Rate LimitingPrevent overloadThrottle requests
Circuit Breaker States:

    ┌────────┐
    │ CLOSED │ ──── Failure Threshold ──► ┌────────┐
    │(normal)│                            │  OPEN  │
    └────────┘                            │(failing│
         ▲                                └────┬───┘
         │                                     │
    Success                              Timeout
    Threshold                                  │
         │                                     ▼
    ┌────┴────┐                          ┌─────────┐
    │HALF-OPEN│ ◄─── Test Request ────── │         │
    └─────────┘                          └─────────┘

Technology Selection

Selection Criteria

CriterionQuestions
FitDoes it solve the actual problem?
MaturityProduction-proven? Community size?
Team SkillsCan the team use it effectively?
PerformanceMeets requirements? Benchmarks?
OperationsHow hard to deploy, monitor, debug?
CostLicense, infrastructure, learning curve?
Lock-inExit strategy? Standards compliance?
SecurityTrack record? Compliance certifications?

Evaluation Matrix

| Technology | Fit | Maturity | Skills | Perf | Ops | Cost | Score |
|------------|-----|----------|--------|------|-----|------|-------|
| Option A   | 4   | 5        | 3      | 4    | 4   | 3    | 3.8   |
| Option B   | 5   | 3        | 4      | 5    | 2   | 4    | 3.8   |
| Option C   | 3   | 4        | 5      | 3    | 5   | 5    | 4.2   |

Weights: Fit(25%), Maturity(15%), Skills(20%), Perf(15%), Ops(15%), Cost(10%)

Architecture Decision Records (ADRs)

ADR Template

# ADR-[NUMBER]: [TITLE]

## Status
[Proposed | Accepted | Deprecated | Superseded by ADR-XXX]

## Context
[What is the issue we're facing? What decision needs to be made?]

## Decision
[What is the change we're proposing/making?]

## Consequences
### Positive
- [Benefit 1]
- [Benefit 2]

### Negative
- [Trade-off 1]
- [Trade-off 2]

### Neutral
- [Observation]

## Alternatives Considered
### Alternative 1: [Name]
- Pros: [...]
- Cons: [...]
- Why rejected: [...]

Anti-Patterns

Anti-PatternProblemSolution
Big Ball of MudNo clear architectureEstablish bounded contexts
Distributed MonolithMicroservices without independenceTrue service boundaries
Resume-DrivenChoosing tech for experienceMatch tech to requirements
Premature OptimizationScaling before neededStart simple, measure, scale
Ivory TowerArchitecture divorced from realityEvolutionary architecture
Golden HammerSame solution for every problemEvaluate each case

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.06%
按下载量换算30

OpenCode

24.34%
按下载量换算24

windsurf

16.87%
按下载量换算17

Codex

12.78%
按下载量换算13

Gemini CLI

6.97%
按下载量换算7

Antigravity

3.57%
按下载量换算4

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills