Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

architecture-patterns架构模式

Agent Skill

architecture-patterns 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,038

周安装

42

GitHub Stars

141

下载量

326
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/romiluz13/cc10x --skill architecture-patterns

简介

architecture-patterns 用于查找、检索和筛选相关信息。

  • 适合在架构设计任务中快速定位模式和最佳实践。
  • 安装命令:npx skills add https://github.com/romiluz13/cc10x --skill architecture-patterns
  • 适用于 Codex、Claude、Cursor、Gemini CLI,通过 GitHub 安装,建议确认网络访问权限。
  • 可能触发外部搜索或文件读取,使用前请检查仓库维护状态。

SKILL.md

Architecture Patterns

Overview

Architecture exists to support functionality. Every architectural decision should trace back to a functionality requirement.

Core principle: Design architecture FROM functionality, not TO functionality.

This skill is advisory in v10. It frames decisions and tradeoffs; it does not outrank explicit user requirements, repo standards, or an approved plan/design doc.

Focus Areas (Reference Pattern)

  • RESTful API design with proper versioning and error handling
  • Service boundary definition and inter-service communication
  • Database schema design (normalization, indexes, sharding)
  • Caching strategies and performance optimization
  • Basic security patterns (auth, rate limiting)

The Iron Law

NO ARCHITECTURE DESIGN BEFORE FUNCTIONALITY FLOWS ARE MAPPED

If you haven't documented user flows, admin flows, and system flows, you cannot design architecture.

Intake Routing

First, determine what kind of architectural work is needed:

Request TypeRoute To
"Design API endpoints"API Design section
"Plan system architecture"Full Architecture Design
"Design data models"Data Model section
"Plan integrations"Integration Patterns section
"Make decisions"Decision Framework section

Universal Questions (Answer First)

ALWAYS answer before designing:

  1. What functionality are we building? - User stories, not technical features
  2. Who are the actors? - Users, admins, external systems
  3. What are the user flows? - Step-by-step user actions
  4. What are the system flows? - Internal processing steps
  5. What integrations exist? - External dependencies
  6. What are the constraints? - Performance, security, compliance
  7. What observability is needed? - Logging, metrics, monitoring, alerting

Functionality-First Design Process

Phase 1: Map Functionality Flows

Before any architecture:

User Flow (example):
1. User opens upload page
2. User selects file
3. System validates file type/size
4. System uploads to storage
5. System shows success message

Admin Flow (example):
1. Admin opens dashboard
2. Admin views all uploads
3. Admin can delete uploads
4. System logs admin action

System Flow (example):
1. Request received at API
2. Auth middleware validates token
3. Service processes request
4. Database stores data
5. Response returned

Phase 2: Map to Architecture

Each flow maps to components:

Flow StepArchitecture Component
User opens pageFrontend route + component
User submits dataAPI endpoint
System validatesValidation service
System processesBusiness logic service
System storesDatabase + repository
System integratesExternal client/adapter

Phase 3: Design Components

For each component, define:

  • Purpose: What functionality it supports
  • Inputs: What data it receives
  • Outputs: What data it returns
  • Dependencies: What it needs
  • Error handling: What can fail

Architecture Views

System Context (C4 Level 1)

┌─────────────────────────────────────────────┐
│                 SYSTEM                       │
│  ┌─────────┐  ┌─────────┐  ┌─────────┐     │
│  │   Web   │  │   API   │  │Database │     │
│  │   App   │──│ Service │──│         │     │
│  └─────────┘  └─────────┘  └─────────┘     │
└─────────────────────────────────────────────┘
       │              │              │
    ┌──┴──┐        ┌──┴──┐        ┌──┴──┐
    │User │        │Admin│        │ Ext │
    └─────┘        └─────┘        └─────┘

Container View (C4 Level 2)

  • Web App: React/Vue/Angular frontend
  • API Service: REST/GraphQL backend
  • Database: PostgreSQL/MongoDB/etc
  • Cache: Redis/Memcached
  • Queue: RabbitMQ/SQS for async

Component View (C4 Level 3)

  • Controllers: Handle HTTP requests
  • Services: Business logic
  • Repositories: Data access
  • Clients: External integrations
  • Models: Data structures

LSP-Powered Architecture Analysis

Use LSP to map actual code dependencies:

Architecture TaskLSP ToolOutput
Map component dependencieslspCallHierarchy(outgoing)What each component uses
Find all consumers of a servicelspCallHierarchy(incoming)Impact analysis
Verify interface implementationslspFindReferencesAll implementers
Trace data flowChain lspCallHierarchy callsFull flow map

Mapping Actual Architecture:

1. localSearchCode("ServiceName") → find entry points
2. lspCallHierarchy(outgoing) → map dependencies
3. For each dependency: repeat step 2
4. Build dependency graph from results

Use LSP BEFORE drawing architecture diagrams - verify assumptions with code.

CRITICAL: Always get lineHint from localSearchCode first. Never guess line numbers.

API Design (Functionality-Aligned)

Map user flows to endpoints:

User Flow: Upload file
→ POST /api/files
  Request: { file: binary, metadata: {...} }
  Response: { id: string, url: string }
  Errors: 400 (invalid), 413 (too large), 500 (storage failed)

User Flow: View file
→ GET /api/files/:id
  Response: { id, url, metadata, createdAt }
  Errors: 404 (not found), 403 (not authorized)

Admin Flow: Delete file
→ DELETE /api/files/:id
  Response: { success: true }
  Errors: 404, 403

API Design Checklist:

  • Each endpoint maps to a user/admin flow
  • Request schema matches flow inputs
  • Response schema matches flow outputs
  • Errors cover all failure modes
  • Auth/authz requirements documented

Integration Patterns

Map integration requirements to patterns:

RequirementPattern
Flaky external serviceRetry with exponential backoff
Slow external serviceCircuit breaker + timeout
Async processing neededMessage queue
Real-time updates neededWebSocket/SSE
Data sync neededEvent sourcing

For each integration:

### [Integration Name]

**Functionality**: What user flow depends on this?
**Pattern**: [Retry/Circuit breaker/Queue/etc]
**Error handling**: What happens when it fails?
**Fallback**: What's the degraded experience?

Dependency Classification

Before choosing a pattern, classify the dependency:

CategoryExamplesTesting Strategy
In-processPure computation, in-memory stateTest directly — merge modules and verify
Local-substitutableDatabase (PGLite), filesystem (in-memory FS)Test with local stand-in in test suite
Remote but ownedYour own microservices, internal APIsDefine port (interface), inject transport. Test with in-memory adapter
True externalStripe, Twilio, third-party APIsMock at boundary. Inject dependency as port

The category determines the pattern. In-process needs nothing. True external needs mocks. The middle two need ports and adapters.

Implementation ordering — build from leaves inward:

Level 0 (no deps):      [Pure utils] [Config]
        ↓
Level 1 (Level 0 only): [Repositories] [External clients]
        ↓
Level 2 (Level 0-1):    [Services]
        ↓
Level 3 (Level 0-2):    [Controllers] [API routes]

Level 0 components are testable immediately. Each subsequent level depends only on predecessors. This ordering eliminates mock-heavy tests in early phases and matches the planner's DAG constraint (phases depend only on predecessors, never on future phases).

Observability Design

For each component, define:

AspectQuestions
LoggingWhat events? What level? Structured format?
MetricsWhat to measure? Counters, gauges, histograms?
AlertsWhat thresholds? Who gets notified?
TracingSpan boundaries? Correlation IDs?

Minimum observability:

  • Request/response logging at boundaries
  • Error rates and latencies
  • Health check endpoint
  • Correlation ID propagation

Decision Framework

For each architectural decision:

### Decision: [Title]

**Context**: What functionality requirement drives this?

**Options**:
1. [Option A] - [Brief description]
2. [Option B] - [Brief description]
3. [Option C] - [Brief description]

**Trade-offs**:
| Criterion | Option A | Option B | Option C |
|-----------|----------|----------|----------|
| Performance | Good | Better | Best |
| Complexity | Low | Medium | High |
| Cost | Low | Medium | High |

**Decision**: [Option chosen]

**Rationale**: [Why this option best supports functionality]

Red Flags - STOP and Redesign

If you find yourself:

  • Designing architecture before mapping flows
  • Adding components without clear functionality
  • Choosing patterns because "it's best practice"
  • Over-engineering for hypothetical scale
  • Ignoring existing architecture patterns
  • Making decisions without documenting trade-offs

STOP. Go back to functionality flows.

Keep It Simple (Reference Pattern)

Approach for backend architecture:

  1. Start with clear service boundaries
  2. Design APIs contract-first
  3. Consider data consistency requirements
  4. Plan for horizontal scaling from day one
  5. Keep it simple - avoid premature optimization

Architecture Output Checklist:

  • API endpoint definitions with example requests/responses
  • Service architecture diagram (mermaid or ASCII)
  • Database schema with key relationships
  • Technology recommendations with brief rationale
  • Potential bottlenecks and scaling considerations

Always provide concrete examples. Focus on practical implementation over theory.

Rationalization Prevention

ExcuseReality
"This pattern is industry standard"Does it support THIS functionality?
"We might need it later"YAGNI. Design for now.
"Microservices are better"For this functionality? Justify it.
"Everyone uses this"That's not a trade-off analysis.
"It's more flexible"Flexibility without need = complexity.

Output Format

# Architecture Design: [Feature/System Name]

## Functionality Summary
[What this architecture supports - trace to user value]

## Flows Mapped

### User Flows
1. [Flow 1 steps]
2. [Flow 2 steps]

### System Flows
1. [Flow 1 steps]
2. [Flow 2 steps]

## Architecture

### System Context
[Diagram or description of actors and system boundaries]

### Components
| Component | Purpose (Functionality) | Dependencies |
|-----------|------------------------|--------------|
| [Name] | [What flow it supports] | [What it needs] |

### API Endpoints
| Endpoint | Flow | Request | Response |
|----------|------|---------|----------|
| POST /api/x | User uploads | {...} | {...} |

## Key Decisions

### Decision 1: [Title]
- Context: [Functionality driver]
- Options: [List]
- Trade-offs: [Table]
- Decision: [Choice]
- Rationale: [Why]

## Implementation Roadmap

### Critical (Must have for core flow)
1. [Component/feature]

### Important (Completes flows)
1. [Component/feature]

### Enhancement (Improves experience)
1. [Component/feature]

Final Check

Before completing architecture design:

  • All user flows mapped
  • All system flows mapped
  • Each component traces to functionality
  • Each API endpoint traces to flow
  • Decisions documented with trade-offs
  • Implementation roadmap prioritized

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

展示第三方安全扫描或审计结果

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

平台分布

Codex

34.31%
按下载量换算112

Claude

29.44%
按下载量换算96

Cursor

18.24%
按下载量换算59

Gemini CLI

8.11%
按下载量换算26

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills