Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

architecture-patterns架构模式

Agent Skill

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

总安装

3,574

周安装

146

GitHub Stars

160

下载量

1,145
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill architecture-patterns

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合项目协作管理。

  • 围绕仓库状态、代码变更或协作事项进行信息整理,支持多宿主环境使用。
  • 通过 npx skills add 命令从 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • architecture-patterns 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Architecture Patterns

Consolidated architecture validation and enforcement patterns covering clean architecture, backend layer separation, project structure conventions, and test standards. Each category has individual rule files in references/ loaded on-demand.

Quick Reference

CategoryRulesImpactWhen to Use
Clean Architecture3HIGHSOLID principles, hexagonal architecture, ports & adapters, DDD
Project Structure2HIGHFolder conventions, nesting depth, import direction, barrel files
Backend Layers3HIGHRouter/service/repository separation, DI, file naming
Test Standards3MEDIUMAAA pattern, naming conventions, coverage thresholds
Right-Sizing2HIGHArchitecture tier selection, over-engineering prevention, context-aware enforcement

Total: 13 rules across 5 categories

Quick Start

# Clean Architecture: Dependency Inversion via Protocol
class IUserRepository(Protocol):
    async def get_by_id(self, id: str) -> User | None: ...

class UserService:
    def __init__(self, repo: IUserRepository):
        self._repo = repo  # Depends on abstraction, not concretion

# FastAPI DI chain: DB -> Repository -> Service
def get_user_service(db: AsyncSession = Depends(get_db)) -> UserService:
    return UserService(PostgresUserRepository(db))
# Project Structure: Unidirectional Import Architecture
shared/lib  ->  components  ->  features  ->  app
(lowest)                                    (highest)

# Backend Layers: Strict Separation
Routers (HTTP) -> Services (Business Logic) -> Repositories (Data Access)

Clean Architecture

SOLID principles, hexagonal architecture, ports and adapters, and DDD tactical patterns for maintainable backends.

RuleFileKey Pattern
Hexagonal Architecture${CLAUDE_SKILL_DIR}/references/clean-hexagonal-ports-adapters.mdDriving/driven ports, adapter implementations, layer structure
SOLID & Dependency Rule${CLAUDE_SKILL_DIR}/references/clean-solid-dependency-rule.mdProtocol-based interfaces, dependency inversion, FastAPI DI
DDD Tactical Patterns${CLAUDE_SKILL_DIR}/references/clean-ddd-tactical-patterns.mdEntities, value objects, aggregate roots, domain events

Key Decisions

DecisionRecommendation
Protocol vs ABCProtocol (structural typing)
Dataclass vs PydanticDataclass for domain, Pydantic for API
Repository granularityOne per aggregate root
Transaction boundaryService layer, not repository
Event publishingCollect in aggregate, publish after commit

Project Structure

Feature-based organization, max nesting depth, unidirectional imports, and barrel file prevention.

RuleFileKey Pattern
Folder Structure & Nesting${CLAUDE_SKILL_DIR}/references/structure-folder-conventions.mdReact/Next.js and FastAPI layouts, 4-level max nesting, barrel file rules
Import Direction & Location${CLAUDE_SKILL_DIR}/references/structure-import-direction.mdUnidirectional imports, cross-feature prevention, component/hook placement

Blocking Rules

RuleCheck
Max NestingMax 4 levels from src/ or app/
No Barrel FilesNo index.ts re-exports (tree-shaking issues)
Component LocationReact components in components/ or features/ only
Hook LocationCustom hooks in hooks/ or features/*/hooks/ only
Import DirectionUnidirectional: shared -> components -> features -> app

Backend Layers

FastAPI Clean Architecture with router/service/repository layer separation and blocking validation.

RuleFileKey Pattern
Layer Separation${CLAUDE_SKILL_DIR}/references/backend-layer-separation.mdRouter/service/repository boundaries, forbidden patterns, async rules
Dependency Injection${CLAUDE_SKILL_DIR}/references/backend-dependency-injection.mdDepends() chains, auth patterns, testing with DI overrides
File Naming & Exceptions${CLAUDE_SKILL_DIR}/references/backend-naming-exceptions.mdNaming conventions, domain exceptions, violation detection

Layer Boundaries

LayerResponsibilityForbidden
RoutersHTTP concerns, request parsing, auth checksDatabase operations, business logic
ServicesBusiness logic, validation, orchestrationHTTPException, Request objects
RepositoriesData access, queries, persistenceHTTP concerns, business logic

Test Standards

Testing best practices with AAA pattern, naming conventions, isolation, and coverage thresholds.

RuleFileKey Pattern
AAA Pattern & Isolation${CLAUDE_SKILL_DIR}/references/testing-aaa-isolation.mdArrange-Act-Assert, test isolation, parameterized tests
Naming Conventions${CLAUDE_SKILL_DIR}/references/testing-naming-conventions.mdDescriptive behavior-focused names for Python and TypeScript
Coverage & Location${CLAUDE_SKILL_DIR}/references/testing-coverage-location.mdCoverage thresholds, fixture scopes, test file placement rules

Coverage Requirements

AreaMinimumTarget
Overall80%90%
Business Logic90%100%
Critical Paths95%100%
New Code100%100%

Right-Sizing

Context-aware backend architecture enforcement. Rules adjust strictness based on project tier detected by scope-appropriate-architecture.

Enforcement procedure:

  1. Read project tier from scope-appropriate-architecture context (set during brainstorm/implement Step 0)
  2. If no tier set, auto-detect using signals in Read("${CLAUDE_SKILL_DIR}/rules/right-sizing-tiers.md")
  3. Apply tier-based enforcement matrix — skip rules marked OFF for detected tier
  4. Security rules are tier-independent — always enforce SQL parameterization, input validation, auth checks
RuleFileKey Pattern
Architecture Sizing Tiers${CLAUDE_SKILL_DIR}/rules/right-sizing-tiers.mdInterview/MVP/production/enterprise sizing matrix, LOC estimates, detection signals
Right-Sizing Decision Guide${CLAUDE_SKILL_DIR}/rules/right-sizing-decision.mdORM, auth, error handling, testing recommendations per tier, over-engineering tax

Tier-Based Rule Enforcement

RuleInterviewMVPProductionEnterprise
Layer separationOFFWARNBLOCKBLOCK
Repository patternOFFOFFWARNBLOCK
Domain exceptionsOFFOFFBLOCKBLOCK
Dependency injectionOFFWARNBLOCKBLOCK
OpenAPI documentationOFFOFFWARNBLOCK

Manual override: User can set tier explicitly to bypass auto-detection (e.g., "I want enterprise patterns for this take-home to demonstrate skill").

Decision Flowchart

Is this a take-home or hackathon?
  YES --> Flat architecture. Single file or 3-5 files. Done.
  NO  -->

Is this a prototype or MVP with < 3 months runway?
  YES --> Simple layered. Routes + services + models. No abstractions.
  NO  -->

Do you have > 5 engineers or complex domain rules?
  YES --> Clean architecture with ports/adapters.
  NO  --> Layered architecture. Add abstractions only when pain appears.

When NOT to Use

Not every project needs architecture patterns. Match complexity to project tier:

PatternInterviewHackathonMVPGrowthEnterpriseSimpler Alternative
Repository patternOVERKILL (~200 LOC)OVERKILLBORDERLINEAPPROPRIATEREQUIREDDirect ORM calls in service (~20 LOC)
DI containersOVERKILL (~150 LOC)OVERKILLLIGHT ONLYAPPROPRIATEREQUIREDConstructor params or module-level singletons (~10 LOC)
Event-driven archOVERKILL (~300 LOC)OVERKILLOVERKILLSELECTIVEAPPROPRIATEDirect function calls between services (~30 LOC)
Hexagonal architectureOVERKILL (~400 LOC)OVERKILLOVERKILLBORDERLINEAPPROPRIATEFlat modules with imports (~50 LOC)
Strict layer separationOVERKILL (~250 LOC)OVERKILLWARNBLOCKBLOCKRoutes + models in same file (~40 LOC)
Domain exceptionsOVERKILL (~100 LOC)OVERKILLOVERKILLBLOCKBLOCKBuilt-in ValueError/HTTPException (~5 LOC)

Rule of thumb: If a pattern shows OVERKILL for the detected tier, do NOT use it. Use the simpler alternative. A take-home with hexagonal architecture signals over-engineering, not skill.

Anti-Patterns (FORBIDDEN)

# CLEAN ARCHITECTURE
# NEVER import infrastructure in domain layer
from app.infrastructure.database import engine  # In domain layer!

# NEVER leak ORM models to API layer
@router.get("/users/{id}")
async def get_user(id: str, db: Session) -> UserModel:  # Returns ORM model!

# NEVER have domain depend on framework
from fastapi import HTTPException
class UserService:
    def get(self, id: str):
        raise HTTPException(404)  # Framework in domain!

# PROJECT STRUCTURE
# NEVER create files deeper than 4 levels from src/
# NEVER create barrel files (index.ts re-exports)
# NEVER import from higher layers (features importing from app)
# NEVER import across features (use shared/ for common code)

# BACKEND LAYERS
# NEVER use database operations in routers
# NEVER raise HTTPException in services
# NEVER instantiate services without Depends()

# TEST STANDARDS
# NEVER mix test files with source code
# NEVER use non-descriptive test names (test1, test, works)
# NEVER share mutable state between tests without reset

Related Skills

  • ork:scope-appropriate-architecture - Project tier detection that drives right-sizing enforcement
  • ork:quality-gates - YAGNI gate uses tier context to validate complexity
  • ork:distributed-systems - Distributed locking, resilience, idempotency patterns
  • ork:api-design - REST API design, versioning, error handling
  • ork:testing-unit - Unit testing: AAA pattern, fixtures, mocking, factories
  • ork:testing-e2e - E2E testing: Playwright, page objects, visual regression
  • ork:testing-integration - Integration testing: API endpoints, database, contracts
  • ork:python-backend - FastAPI, SQLAlchemy, asyncio patterns
  • ork:database-patterns - Schema design, query optimization, migrations

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Claude

31.99%
按下载量换算366

Codex

31.49%
按下载量换算361

Cursor

19.24%
按下载量换算220

Gemini CLI

9.14%
按下载量换算105

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills