Token导航 LogoToken导航

Agent Skill · 前端设计

ui-component-patterns(ui 组件模式)

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

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

总安装 1,988周安装 82GitHub Stars 11下载 649核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akillness/oh-my-skills --skill ui-component-patterns

这个 Skill 是做什么的

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

用于识别可复用组件的压力点,提出最小有效架构方案。适合分类共享与局部组件边界,避免全局模式泛滥。使用时需显式区分父组件与子组件职责,合理路由样式与逻辑。

安装命令:npx skills add https://github.com/akillness/oh-my-skills --skill ui-component-patterns 建议结合品牌系统与用户任务设计,而非堆砌装饰性元素。

来源仓库内路径:skills/ui-component-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

ui-component-patterns 怎么安装?

在终端执行 npx skills add https://github.com/akillness/oh-my-skills --skill ui-component-patterns。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ui-component-patterns 支持哪些 AI 工具?

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

ui-component-patterns 需要什么权限?

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

ui-component-patterns 是免费的吗?

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

ui-component-patterns 用的人多吗?

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

ui-component-patterns 安全吗?

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

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

值得选的地方

  • 同时适配 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只读未明确通过
ui-component-patterns

ui 组件模式 · 本页

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

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

SKILL.md 原文

UI Component Patterns

Use this skill when the job is to classify the reusable component problem, choose one primary component packet, and leave behind a short component-architecture brief instead of a giant React-pattern dump.

The job is not to catalog every possible component pattern. The job is to:

  1. identify the reusable component pressure first,
  2. choose one bounded packet,
  3. keep shared-vs-local and parent-vs-component ownership visible,
  4. separate alternate-root composition from broader system or accessibility work,
  5. route neighboring frontend concerns honestly.

Read these support docs first:

When to use this skill

  • A team has too many similar buttons, cards, dialogs, field wrappers, or nav patterns and needs one shared primitive or component-family boundary.
  • A request mixes variants, slots, controlled-vs-uncontrolled behavior, wrappers, and docs expectations and needs routing before implementation.
  • You need to decide whether something should stay product-local, become a shared primitive, or split into primitive plus wrapper.
  • A component API is growing escape hatches and someone needs to shrink it into one honest packet.
  • The tricky part is alternate-root composition (button vs a/router Link, slotted child, custom wrapper) rather than pure styling.
  • Storybook/examples exist, but the docs/verification packet for states, usage rules, or edge cases is still unclear.

When not to use this skill

  • The main task is token governance, visual-language rules, primitive naming policy, or cross-product system direction → design-system
  • The main task is keyboard/focus behavior, semantics, labels, announcements, contrast, or manual accessibility remediation → web-accessibility
  • The main task is viewport/container adaptation, breakpoint strategy, reflow, or responsive media → responsive-design
  • The main task is broader app/workflow state ownership, server/client boundaries, or cross-screen state coordination → state-management
  • The main task is rerender churn, hydration, route performance, or bundle/runtime behavior → react-best-practices
  • The reusable component boundary is already settled and the real job is just implementing it; in that case implement directly instead of reopening the architecture decision

Instructions

Step 1: Frame the reusable component job before naming props

Capture the minimum intake packet first.

component_intake:
  surface: button-action | form-field | dialog-overlay | nav-menu | card-list-item | table-toolbar | mixed | unknown
  workflow_type: new-primitive | duplicate-cleanup | api-review | wrapper-split | docs-verification | unknown
  primary_packet: primitive-boundary | slot-anatomy | controlled-ownership | alternate-root-composition | docs-verification | mixed | unknown
  ownership_pressure: shared-vs-local | parent-state | wrapper-proliferation | type-safety | docs-drift | mixed | unknown
  signal_source: repeated-components | bug-report | code-review | storybook-gap | design-review | migration | mixed | unknown
  confidence: high | medium | low

Rule: do not start with “add a prop.” First label the reusable component pressure.

Step 2: Choose exactly one primary component packet

Use the router in references/intake-packets-and-route-outs.md.

Primary packets:

  1. primitive-boundary
  2. slot-anatomy
  3. controlled-ownership
  4. alternate-root-composition
  5. docs-verification

Pick the packet that resolves the current decision. List anything else as follow-up, not as equal co-owners.

Step 3: Keep the invariants visible

These rules survive every serious answer:

  • shared components should solve repeated work, not invent a local framework for one screen
  • product-specific copy, analytics, workflow rules, and layout quirks usually belong in wrappers, not the primitive
  • variants should express stable meaning (tone, size, density, state) rather than one-off screen exceptions
  • slots/subcomponents are for structured flexibility, not for hiding a confused API
  • if both controlled and uncontrolled behavior are offered, the contract must be explicit and coherent
  • alternate-root composition changes semantics and accessibility responsibility; keep that visible
  • Storybook/examples are evidence surfaces, not proof that the component boundary is healthy

Step 4: Build the component packet

Return this structure:

# Component Architecture Packet

## Scope
- Surface:
- Workflow type:
- Primary packet:
- Confidence: high | medium | low

## Current signal
- Main symptom:
- Ownership pressure:
- What is already known:
- What still needs direct verification:

## Recommended first slice
1. ...
2. ...
3. ...

## Component decisions
- Shared vs local:
- Primitive / wrapper split:
- Variants or slots:
- Controlled vs uncontrolled:
- Alternate-root or wrapper rules:

## Docs and verification
- Stories/examples required:
- State / variant matrix:
- Accessibility follow-up:
- Responsive follow-up:

## Ownership and route-outs
- Primary owner:
- Adjacent skills / teams:

Step 5: Use the packet, not a giant pattern gallery

Pull the packet from references/intake-packets-and-route-outs.md.

Packet rules:

  • primitive-boundary → decide shared vs local scope, primitive vs wrapper split, and what absolutely stays outside the shared API
  • slot-anatomy → define subcomponents/slots, variant boundaries, composition rules, and anatomy expectations for reusable structure
  • controlled-ownership → decide whether parent state, workflow state, or component-local defaults own the lifecycle
  • alternate-root-composition → handle asChild / component / wrapper-root behavior, prop spreading, refs, and semantic constraints when the primitive must compose onto another element
  • docs-verification → define Storybook/examples, state matrix, anti-usage notes, and the smallest credible verification surface for the component family

Step 6: Keep mechanism choice separate from ownership choice

Use this split in serious answers:

  • Mechanism — variants, slots, subcomponents, controlled props, polymorphic root, wrapper split, docs matrix
  • Ownership — ui-component-patterns, design-system, web-accessibility, responsive-design, state-management, or react-best-practices

If the request starts from screenshots, Storybook drift, or a code diff, say explicitly that those artifacts are the signal, not the finished component decision.

Step 7: Route adjacent work explicitly

Use these route-outs when the problem crosses boundaries:

  • token governance, primitive naming, contribution policy, or cross-product component standards → design-system
  • keyboard/focus remediation, label/announcement issues, ARIA, contrast, reduced motion, or manual a11y verification → web-accessibility
  • viewport/container adaptation, reflow, responsive media, or dense-data layout strategy → responsive-design
  • app/workflow state ownership, server/client state boundaries, URL/form/global-store decisions → state-management
  • rerender churn, hydration, bundle/runtime performance, or route-level performance behavior → react-best-practices

When mixed requests appear, keep ui-component-patterns on the reusable component packet and name the routed follow-up explicitly.

Step 8: Prefer honest boundaries over over-generalized props

When a component keeps accumulating booleans, escape hatches, or product-specific rules:

  1. check whether the API should split into primitive plus wrapper,
  2. collapse accidental variants into a smaller semantic set,
  3. move layout- or workflow-specific behavior out of the primitive,
  4. route systemic or remediation-heavy follow-ups outward instead of widening the skill.

Examples

Example 1: Button family drift

Input: “We have five button implementations and people keep adding one-off props.”

Good output direction:

  • choose primitive-boundary as the primary packet
  • keep one shared action primitive plus a narrower icon/button-group wrapper if needed
  • collapse random booleans into a small variant/tone/size set
  • keep analytics and screen-specific layout wrappers outside the primitive
  • route token naming to design-system

Example 2: Modal state confusion

Input: “Should our modal manage its own state or always be controlled by the parent workflow?”

Good output direction:

  • choose controlled-ownership as the primary packet
  • classify the modal as a reusable composite pattern
  • recommend controlled ownership when workflow state, routing, or async submit logic matters
  • allow an uncontrolled convenience path only if the contract remains explicit
  • route keyboard/focus remediation details to web-accessibility

Example 3: Link-button composition

Input: “Our design-system button sometimes needs to render as a router link. How should we support that without breaking types or semantics?”

Good output direction:

  • choose alternate-root-composition as the primary packet
  • make prop spreading, ref forwarding, and semantic/accessibility constraints explicit
  • keep route-level navigation policy or token governance outside the primitive decision
  • leave behind a bounded wrapper/root contract instead of a vague “just add an as prop” answer

Example 4: Storybook drift

Input: “The component exists, but teams keep using it differently and Storybook is missing the edge cases.”

Good output direction:

  • choose docs-verification as the primary packet
  • define the minimum state/variant matrix and example set
  • add anti-usage notes and wrapper expectations
  • route accessibility-only or responsive-only follow-up packets outward

Best practices

  1. Prefer the smallest reusable primitive that removes repeated work without inventing a local framework.
  2. Keep packet choice explicit; one component decision should not silently absorb governance, remediation, responsive strategy, and runtime tuning.
  3. Treat slots and subcomponents as structured API tools, not as a way to dodge ownership decisions.
  4. Make controlled vs uncontrolled behavior an explicit contract, not an accidental half-state hybrid.
  5. Keep alternate-root composition honest about refs, prop spreading, and semantics.
  6. Use Storybook/examples as part of the evidence surface, but still write down the docs/verification packet.
  7. Revisit the abstraction when consumers repeatedly need escape hatches or app-specific wrappers to use it.

References

平台分布

Codex

32.47%
按下载量换算211

Claude

31.81%
按下载量换算206

Cursor

20.82%
按下载量换算135

Gemini CLI

9.8%
按下载量换算64

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills