Token导航 LogoToken导航

Agent Skill · 前端设计

architecture-design(建筑设计)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

architecture-design 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 3,141。

总安装 1,551周安装 64GitHub Stars 1下载 507核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/swiftyjourney/architecture-design-skill --skill architecture-design

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

建筑设计技能用于辅助界面设计、视觉规范和交互体验优化,适合页面结构整理。它能生成 UI 方案、检查视觉一致性并改进组件层级,需要结合品牌和设计系统使用。通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 了解具体用法。

涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出和对齐表现。architecture-design 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/architecture-design

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/swiftyjourney/architecture-design-skill --skil…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

architecture-design 怎么安装?

在终端执行 npx skills add https://github.com/swiftyjourney/architecture-design-skill --skill architec…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

architecture-design 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

architecture-design 需要什么权限?

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

architecture-design 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

architecture-design 用的人多吗?

公开数据是累计安装 1,551 次,近一周安装 64 次,下载 507 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

architecture-design 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
architecture-design

建筑设计 · 本页

1,5511需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Architecture & Design Principles Skill

Transform codebases into maintainable, testable, and scalable architectures using Clean Architecture principles, SOLID design patterns, and industry best practices from the Essential Developer methodology.

Overview

This skill guides you through a structured 5-step process to:

  1. Analyze Requirements → Identify components, responsibilities, and boundaries
  2. Apply SOLID Principles → Design with SRP, OCP, LSP, ISP, DIP
  3. Define Clean Architecture → Establish layers, boundaries, and dependency rules
  4. Design Testing Strategy → Plan unit tests, integration tests, and test boundaries
  5. Document Decisions → Create Architecture Decision Records (ADRs)

Core Philosophy

"Good architecture is a byproduct of good team processes and communication"

This skill follows these principles:

  • Framework Independence - Business logic doesn't depend on frameworks
  • Testability - Architecture enables easy testing
  • UI Independence - UI can change without affecting business rules
  • Database Independence - Business rules don't know about the database
  • External Agency Independence - Business rules don't depend on external services

The 5-Step Process

Step 1: Analyze Requirements

Objective: Identify components, responsibilities, and architectural boundaries

Actions:

  1. Break down feature into distinct responsibilities
  2. Identify core business logic vs infrastructure concerns
  3. Recognize cross-cutting concerns (logging, analytics, caching)
  4. Map data flow through the system
  5. Identify potential architectural boundaries

Key Questions to Ask:

  • What is the core business logic?
  • What are the external dependencies (network, database, UI)?
  • What needs to be testable in isolation?
  • What components might change independently?
  • What are the inputs and outputs of each component?

Output: Component diagram with clear responsibilities

Reference: See references/modular_design.md for component identification patterns


Step 2: Apply SOLID Principles

Objective: Design components following SOLID principles

S - Single Responsibility Principle (SRP)

Each class/module has one reason to change. Separate business logic from infrastructure.

  • ❌ A class that loads data AND presents it
  • ✅ Separate UseCase for business logic; separate Presenter for view logic
O - Open/Closed Principle (OCP)

Open for extension via protocols/interfaces, closed for modification:

// Open for extension via protocol (Swift example — same idea in any language)
protocol ItemLoader {
    func load() async throws -> [Item]
}

// Closed for modification — implementations extend behavior
final class RemoteItemLoader: ItemLoader { ... }
final class CachedItemLoader: ItemLoader { ... }
final class FallbackItemLoader: ItemLoader { ... }
L - Liskov Substitution Principle (LSP)

Subtypes must be substitutable for base types. Contracts must be honored by all implementations.

I - Interface Segregation Principle (ISP)

Clients shouldn't depend on interfaces they don't use. Create focused, specific protocols.

  • ❌ protocol DataStore {func save(_:); func load(); func delete(); func migrate(); func backup()}
  • ✅ protocol ItemReader {func retrieve() throws -> [Item]?} + separate ItemCache
D - Dependency Inversion Principle (DIP)

High-level modules depend on abstractions, not concretions.

class ItemListViewController {
    private let loader: ItemLoader  // depends on abstraction, not concrete type
    init(loader: ItemLoader) { self.loader = loader }
}

Output: SOLID-compliant component design

Reference: See references/solid_principles.md for detailed patterns and anti-patterns


Step 3: Define Clean Architecture

Objective: Establish clear architectural layers with proper dependency flow

The Clean Architecture Layers:

┌─────────────────────────────────────────┐
│          Presentation Layer             │
│    (UI, ViewModels, Presenters)        │
└─────────────────┬───────────────────────┘
                  │ depends on
┌─────────────────▼───────────────────────┐
│         Domain/Business Layer           │
│      (Use Cases, Entities, Rules)      │
└─────────────────┬───────────────────────┘
                  │ depends on
┌─────────────────▼───────────────────────┐
│         Infrastructure Layer            │
│   (Network, Database, Framework Code)  │
└─────────────────────────────────────────┘

Dependency Rule: Source code dependencies point inward only

Key Patterns:

  1. Use Cases — contain business rules, orchestrate data flow, independent of UI and frameworks
  2. Boundaries (Protocols) — define contracts between layers, enable testability
  3. Adapters — convert data between layers, implement boundary protocols
  4. Composition Root — wire dependencies together, configure the object graph

Output: Layered architecture with clear boundaries

Reference: See references/clean_architecture.md for detailed layer definitions; examples/generic/layered_architecture.md for a language-agnostic example; examples/swift/ for Swift/iOS real implementations


Step 4: Design Testing Strategy

Objective: Plan comprehensive testing at all architectural layers

Testing Pyramid:

        ┌──────────┐
        │    UI    │ Few - End to End
        ├──────────┤
        │Integration│ Some - Integration
        ├──────────┤
        │   Unit   │ Many - Fast & Isolated
        └──────────┘

Testing Boundaries:

  1. Domain Layer (Unit Tests) — test use cases in isolation, mock all dependencies
  2. Infrastructure Layer (Integration Tests) — test adapters with real dependencies
  3. Presentation Layer (Unit Tests) — test presenters/view models, mock use cases

Test Double Vocabulary:

  • Stubs: Provide canned answers
  • Spies: Record calls for verification
  • Mocks: Verify behavior expectations
  • Fakes: Working implementations for testing

Testing Strategies:

  • Test behavior, not implementation details
  • Use native async test primitives; avoid manual callback synchronization when the language supports await
  • Factory helper pattern: create the system under test (SUT) and its dependencies together in a makeSUT() helper to keep individual test methods clean
  • Arrange, Act, Assert structure; extract helpers for clarity

Output: Comprehensive testing strategy document

Reference: See references/testing_strategies.md for patterns and best practices


Step 5: Document Decisions

Objective: Create clear architectural documentation and decision records

ADR Format:

# ADR-NNN: <Decision Title>
## Status: Accepted | Superseded | Deprecated
## Context: Why this decision was needed
## Decision: What was decided
## Consequences: Positive and negative outcomes
## Alternatives Considered: What was rejected and why

See examples/generic/ for a complete ADR example.

Documentation Requirements:

  1. Architecture Overview — system context diagram, component diagram, layer relationships
  2. Component Documentation — purpose, dependencies, usage examples
  3. Design Patterns Used — which patterns and why, trade-offs
  4. Testing Strategy — what gets tested and how

Output: Complete architectural documentation

Reference: See references/ for detailed documentation patterns


Best Practices

DO ✅

  • Separate business logic from infrastructure
  • Depend on abstractions, not concretions
  • Make dependencies explicit through initializer injection
  • Write tests for all business logic
  • Use async IO protocols at network/network boundaries; synchronous protocols for in-process storage
  • Isolate presentation types to the main/UI thread using the language's concurrency primitives
  • Design for testability from the start

DON'T ❌

  • Let business logic depend on frameworks
  • Use singletons for dependency management
  • Mix presentation and business logic
  • Create god classes with multiple responsibilities
  • Use manual callback/completion-handler patterns where the language's native async/await is available
  • Dispatch to the UI thread manually — use structured concurrency instead
Swift/iOS: Use async throws at network boundaries, sync throws at cache boundaries, @MainActor for presentation types, and Sendable for value types crossing actor boundaries. See the Swift Concurrency section below.

Common Architectural Patterns

  1. Clean Architecture (Recommended) — clear separation of concerns, dependency rule: inward only
  2. Hexagonal Architecture (Ports & Adapters) — business logic at the center, ports define boundaries
  3. MVVM — separation of UI and logic, testable view models
  4. MVC — traditional separation, controller as composition root

Reference: See examples/generic/layered_architecture.md for a language-agnostic layered example; examples/swift/ for MVVM+Coordinator, Composition Root, and Two-Layer View in Swift/iOS


Language-Specific Guidance

Swift/iOS

  • Use async throws protocols for network boundaries
  • Use sync throws for cache/store boundaries; bridge to async via Scheduler protocol
  • Apply @MainActor to presentation types (ResourceView, LoadResourcePresenter)
  • Mark domain value types Sendable (e.g. FeedImage: Hashable, Sendable)
  • Use LoadResourcePresenter<Resource, View> generic presenter — one type for all features
  • Use WeakRefVirtualProxy<T> to break retain cycles without per-type boilerplate
  • Apply Composition Root pattern in SceneDelegate; extract infrastructure into @MainActor service objects (see examples/swift/composition_root.md)

Reference: See examples/swift/ for Swift-specific patterns

Generic/Agnostic

  • Apply SOLID principles universally
  • Use interfaces/traits/protocols depending on language
  • Adapt patterns to language features
  • Maintain Clean Architecture layers

Reference: See examples/generic/ for language-agnostic examples


Swift Concurrency *(Swift/iOS only)*

The concepts in this section — async IO boundaries, main-thread isolation, value-type thread safety, generic presenter, memory-safe proxies — apply universally. The syntax and APIs below are Swift-specific. For the detailed implementations, see references/concurrency_patterns.md.

Async Protocol Boundaries

Network protocols use async throws; store protocols use sync throws:

// Network boundary — async because IO is inherently async
public protocol HTTPClient {
    func get(from url: URL) async throws -> (Data, HTTPURLResponse)
}

// Cache/store boundary — sync because the store runs on its own queue (bridged via Scheduler)
// Apply this pattern to any persistent store: CoreData, SQLite, in-memory, Realm, etc.
public protocol ItemStore {
    func delete() throws
    func insert(_ items: [LocalItem], timestamp: Date) throws
    func retrieve() throws -> CachedItems?
}
// Essential Feed uses FeedStore with identical structure for FeedImage caching

@MainActor Isolation

Presentation layer types are @MainActor — no manual thread dispatching:

@MainActor public protocol ResourceView {
    associatedtype ResourceViewModel
    func display(_ viewModel: ResourceViewModel)
}

@MainActor public final class LoadResourcePresenter<Resource, View: ResourceView> {
    public typealias Mapper = (Resource) throws -> View.ResourceViewModel
    public init(resourceView: View, loadingView: ResourceLoadingView,
                errorView: ResourceErrorView, mapper: @escaping Mapper)
    public init(resourceView: View, loadingView: ResourceLoadingView,
                errorView: ResourceErrorView) where Resource == View.ResourceViewModel
    public func didStartLoading()
    public func didFinishLoading(with resource: Resource)
    public func didFinishLoading(with error: Error)
}

Sendable Value Types

Domain entities crossing actor boundaries must be Sendable. All stored properties must themselves be Sendable; the compiler verifies this:

// Generic pattern — apply to any domain entity
public struct Item: Hashable, Sendable {
    public let id: UUID
    public let title: String
    // String, UUID, URL are all Sendable — compiler is satisfied
}

// Concrete example from Essential Feed:
// public struct FeedImage: Hashable, Sendable { ... }

WeakRefVirtualProxy

Prevents retain cycles via a single generic type with conditional conformances:

final class WeakRefVirtualProxy<T: AnyObject> {
    private weak var object: T?
    init(_ object: T) { self.object = object }
}

extension WeakRefVirtualProxy: ResourceErrorView where T: ResourceErrorView {
    func display(_ viewModel: ResourceErrorViewModel) { object?.display(viewModel) }
}

extension WeakRefVirtualProxy: ResourceLoadingView where T: ResourceLoadingView {
    func display(_ viewModel: ResourceLoadingViewModel) { object?.display(viewModel) }
}

Scheduler Protocol

Bridges sync FeedStore into async contexts without making the store async:

protocol Scheduler {
    @MainActor
    func schedule<T>(_ action: @escaping @Sendable () throws -> T) async rethrows -> T
}

Reference: See references/concurrency_patterns.md for full implementations and migration guide


Integration with Requirements Engineering

  1. Start with requirements → Use Cases → BDD scenarios
  2. Apply this skill → Architecture → Component design
  3. Implement → Following architectural patterns
  4. Test → Using defined testing strategy

References

Inside references/:

  • clean_architecture.md - Clean Architecture layers and rules
  • solid_principles.md - Detailed SOLID explanations with examples
  • design_patterns.md - Common patterns (Adapter, Decorator, Composite, Null Object, etc.)
  • null_object_pattern.md - Null Object Pattern with testing examples
  • command_query_separation.md - CQS principle for cache design
  • dependency_management.md - DI patterns and strategies
  • testing_strategies.md - Testing patterns and best practices
  • modular_design.md - Module organization and boundaries
  • concurrency_patterns.md - Swift Concurrency: async/await, @MainActor, Sendable, Scheduler

Inside examples/:

  • swift/ - Real implementations from Essential Feed (Swift 6)
  • generic/ - Language-agnostic examples

Output Format

When applying this skill, provide:

  1. Component Analysis - Identified components and responsibilities
  2. SOLID Review - Applied principles with rationale
  3. Architecture Diagram - Layers and dependencies (Mermaid)
  4. Testing Strategy - Test structure and coverage plan
  5. ADRs - Key decisions documented
  6. Implementation Guide - Step-by-step refactoring or implementation plan

Credits

Based on the Essential Developer's proven architecture methodology:


Version History

  • 2.1.0 - Generalized for multi-project use: domain-neutral SOLID examples, separated Swift-specific guidance, added scope labels, created generic ADR template and updated generic architecture example
  • 2.0.0 - Swift 6 migration: async/await, @MainActor, Sendable, LoadResourcePresenter, Scheduler, WeakRefVirtualProxy
  • 1.0.0 - Initial release with 5-step process

平台分布

Codex

35.75%
按下载量换算181

Claude

27.91%
按下载量换算142

Cursor

17.29%
按下载量换算88

Gemini CLI

9.32%
按下载量换算47

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills