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

design-patterns设计模式

Agent Skill

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

总安装

312

周安装

13

GitHub Stars

2

下载量

104
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/masanao-ohba/claude-manifests --skill design-patterns

简介

design-patterns 辅助界面设计、视觉规范和交互体验优化,支持页面结构和 UI 方案生成。

  • 适用于品牌一致性检查、组件层级改进和响应式布局调整等场景。
  • 通过现有设计系统和用户任务结合实现设计方案输出。
  • 涉及真实页面改动时应通过截图或浏览器预览检查文本溢出和对齐。
  • 安装命令为 npx skills add https://github.com/masanao-ohba/claude-manifests --skill design-patterns。

SKILL.md

Design Patterns

A technology-agnostic skill for software architecture and design patterns.

Architectural Patterns

Layered Architecture

pattern: layered_architecture
description: "Separation of concerns through horizontal layers"

layers:
  presentation:
    responsibility: "User interface and input handling"
    communicates_with: [application]

  application:
    responsibility: "Business logic orchestration"
    communicates_with: [domain, infrastructure]

  domain:
    responsibility: "Core business rules and entities"
    communicates_with: [none - pure domain logic]

  infrastructure:
    responsibility: "External systems, persistence, APIs"
    communicates_with: [domain]

rules:
  - "Dependencies point inward (presentation → domain)"
  - "Each layer only knows about adjacent layers"
  - "Domain layer has no external dependencies"

Clean Architecture

pattern: clean_architecture
description: "Dependency inversion with entities at center"

rings:
  entities:
    description: "Enterprise business rules"
    dependencies: none

  use_cases:
    description: "Application business rules"
    dependencies: [entities]

  interface_adapters:
    description: "Controllers, presenters, gateways"
    dependencies: [use_cases, entities]

  frameworks:
    description: "External frameworks and drivers"
    dependencies: [interface_adapters]

key_principle: "Dependencies always point inward"

Hexagonal Architecture (Ports & Adapters)

pattern: hexagonal_architecture
description: "Core logic isolated from external concerns"

components:
  core:
    description: "Domain logic, independent of I/O"
    contains: [entities, services, ports]

  ports:
    description: "Interfaces defining boundaries"
    types:
      - primary: "Driven by external (API, UI)"
      - secondary: "Driving external (DB, messaging)"

  adapters:
    description: "Implementations connecting to external systems"
    examples:
      - "REST controller (primary adapter)"
      - "Repository implementation (secondary adapter)"

benefit: "Core can be tested without external systems"

Component Design Patterns

Repository Pattern

pattern: repository
description: "Abstract data access behind collection-like interface"

structure:
  interface:
    methods:
      - "find(id): Entity"
      - "findAll(criteria): Entity[]"
      - "save(entity): void"
      - "delete(entity): void"

  implementation:
    responsibility: "Handle actual persistence"
    examples:
      - DatabaseRepository
      - InMemoryRepository
      - CacheDecoratorRepository

use_when:
  - "Separate domain from data access"
  - "Enable testing with in-memory implementations"
  - "Support multiple data sources"

Service Pattern

pattern: service
description: "Encapsulate business operations"

types:
  domain_service:
    description: "Operations that don't belong to a single entity"
    example: "TransferService for money transfers between accounts"

  application_service:
    description: "Orchestrate use cases"
    example: "OrderService coordinating payment, inventory, shipping"

  infrastructure_service:
    description: "External system interactions"
    example: "EmailService, PaymentGatewayService"

guidelines:
  - "Services are stateless"
  - "One public method per specific operation"
  - "Coordinate, don't contain business rules"

Factory Pattern

pattern: factory
description: "Encapsulate object creation logic"

types:
  simple_factory:
    use_when: "Creation logic is complex but static"
    example: "UserFactory.create(type)"

  factory_method:
    use_when: "Subclasses need to determine creation"
    example: "Abstract Document with createPage() method"

  abstract_factory:
    use_when: "Create families of related objects"
    example: "UIFactory creating buttons, dialogs, menus"

benefits:
  - "Centralize creation logic"
  - "Enforce invariants at creation"
  - "Support testing with mock factories"

Database Design Patterns

Entity Relationship Patterns

patterns:
  one_to_many:
    description: "Parent has many children"
    implementation:
      - "Foreign key in child table"
      - "ON DELETE CASCADE if children are owned"
    example: "User has many Posts"

  many_to_many:
    description: "Both sides have many of each other"
    implementation:
      - "Junction/pivot table"
      - "Consider if junction has attributes"
    example: "Users and Roles via user_roles table"

  one_to_one:
    description: "Exactly one on each side"
    implementation:
      - "Foreign key with unique constraint"
      - "Or same primary key in both tables"
    example: "User has one Profile"

Query Optimization Patterns

optimization_patterns:
  indexing:
    description: "Speed up queries on specific columns"
    guidelines:
      - "Index columns in WHERE, JOIN, ORDER BY"
      - "Consider composite indexes for multi-column queries"
      - "Avoid over-indexing (slows writes)"

  eager_loading:
    description: "Load related data in fewer queries"
    use_when: "Always need related data"
    avoid_when: "Related data rarely used"

  pagination:
    description: "Limit result set size"
    techniques:
      - "LIMIT/OFFSET for simple cases"
      - "Cursor-based for large datasets"

API Design Patterns

RESTful Resource Design

rest_patterns:
  resource_naming:
    rules:
      - "Use nouns, not verbs (/users, not /getUsers)"
      - "Use plural form (/users, not /user)"
      - "Use kebab-case for multi-word (/user-profiles)"
      - "Nest for relationships (/users/{id}/posts)"

  http_methods:
    GET: "Retrieve resource(s)"
    POST: "Create new resource"
    PUT: "Replace entire resource"
    PATCH: "Partial update"
    DELETE: "Remove resource"

  response_codes:
    200: "OK - Successful GET, PUT, PATCH"
    201: "Created - Successful POST"
    204: "No Content - Successful DELETE"
    400: "Bad Request - Invalid input"
    401: "Unauthorized - Auth required"
    403: "Forbidden - No permission"
    404: "Not Found - Resource doesn't exist"
    422: "Unprocessable - Validation failed"
    500: "Server Error - Unexpected failure"

Request/Response Patterns

patterns:
  envelope:
    description: "Wrap response in metadata"
    structure:
      data: "The actual response data"
      meta: "Pagination, timestamps, etc."
      errors: "Error details if applicable"

  hateoas:
    description: "Include links to related actions"
    example:
      data: {id: 1, name: "..."}
      links:
        self: "/users/1"
        posts: "/users/1/posts"
        delete: "/users/1"

Integration

Used By Agents

primary_users:
  - design-architect: "Pattern selection and application"

secondary_users:
  - code-developer: "Implementing designed patterns"
  - quality-reviewer: "Validating pattern compliance"

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.95%
按下载量换算36

Claude

30.98%
按下载量换算32

Cursor

18.55%
按下载量换算19

Gemini CLI

10.9%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills