Token导航 LogoToken导航

Agent Skill · 研究检索

component-analysis(成分分析)

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

component-analysis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 13,990。

总安装 8,926周安装 264GitHub Stars 1下载 3,152核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ankish8/storybook-npm --skill 'Component Analysis'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

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

适用于 Codex、Claude、Cursor、Gemini CLI 中的信息检索任务。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

component-analysis 怎么安装?

在终端执行 npx skills add https://github.com/ankish8/storybook-npm --skill 'Component Analysis'。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

component-analysis 支持哪些 AI 工具?

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

component-analysis 需要什么权限?

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

component-analysis 是免费的吗?

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

component-analysis 用的人多吗?

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

component-analysis 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
component-analysis

成分分析 · 本页

8,9261需要联网未明确通过

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

SKILL.md 原文

Component Analysis Skill

This skill provides intelligent codebase analysis for component creation. It prevents duplication, suggests architectural improvements, and identifies reusable subcomponents.

When to Activate

Activate this skill when:

  • Creating a new component
  • User describes a UI element they need
  • Analyzing a Figma design
  • Planning component architecture
  • Deciding between new component vs variant

Analysis Steps

1. Component Existence Check — Deep Discovery

Build a Component Capability Map by scanning the entire component library:

a. Fetch ALL components:

Glob: src/components/ui/*.tsx (exclude __tests__/*, *.stories.tsx)
Glob: src/components/custom/*/*.tsx (exclude __tests__/*, *.stories.tsx)

b. Extract metadata per component using Grep:

  • export interface.*Props → props interfaces
  • variants: blocks → CVA variants and their names
  • export { or export const → public exports

c. Build and present a Capability Map:

| Component   | Location | Variants              | Key Props                |
|-------------|----------|-----------------------|--------------------------|
| Button      | ui/      | 7 variants, 4 sizes   | onClick, loading, leftIcon |
| Badge       | ui/      | 5 variants            | —                        |
| TextField   | ui/      | —                     | label, error, helperText |
| WalletTopup | custom/  | —                     | amounts, onPay, currency |

d. Match against new component:

  • Exact match: button.tsx exists → Component exists
  • Similar name: Looking for icon-button → Found button → Suggest variant
  • Functionality match: Looking for data-table → Found table → Suggest enhancement
  • Semantic similarity: Compare name AND description against capability map to catch non-obvious overlaps

2. Variant vs New Component Decision

Use this decision tree informed by the Capability Map:

Create a VARIANT when:

  • Component differs only in visual style (colors, sizes)
  • Component shares same structure and behavior
  • Component uses same props interface
  • The Capability Map shows an existing component with matching variants/props
  • Example: button with variant="icon" instead of new icon-button

Create a COMPOSITION when:

  • New component combines multiple existing components
  • The Capability Map shows several components that together form the new one
  • Example: user-settings-form composes form-modal + text-field + select-field + switch

Create a NEW COMPONENT when:

  • Component has different structure or behavior
  • Component needs different props interface
  • Component serves different purpose
  • No existing component in the Capability Map covers its functionality
  • Example: avatar is different from badge despite both being circular

Recommendation pattern:

Found existing component: `button` at src/components/ui/button.tsx

Capability Map excerpt:
| Component | Variants | Key Props |
|-----------|----------|-----------|
| Button | default, primary, secondary, destructive, outline, ghost, link | onClick, disabled, loading, leftIcon |

Analysis:
- Your "icon-button" differs only in having no text and centered icon
- It shares the same purpose (clickable action)
- It can use the same props (onClick, disabled, etc.)

Recommendation: Add a variant to `button` instead:

variant: {
  default: "...",
  primary: "...",
  icon: "h-10 w-10 p-0 justify-center items-center",  // NEW
}

This maintains consistency and reduces code duplication.

3. Subcomponent Identification

Analyze the component requirements and identify which existing components can be reused:

Form Components:

Requirement: "A form with name and email inputs"

Identified subcomponents:
✓ text-field (for name input with label)
✓ text-field (for email input with validation)
✓ button (for submit action)
✓ form-modal (if in a dialog)
✓ alert (for error messages)

Architecture:
- Composite component using existing primitives
- No need to create custom input components

Data Display Components:

Requirement: "A user profile card"

Identified subcomponents:
✓ typography (for name, role, description)
✓ badge (for status indicator)
✓ button (for action buttons)
✓ avatar (if available, else suggest creating)

Architecture:
- Container component with composition
- Uses existing UI primitives

Overlay Components:

Requirement: "A confirmation dialog with form"

Identified subcomponents:
✓ form-modal (provides dialog + form layout)
✓ text-field (for input fields)
✓ button (already included in form-modal)

Architecture:
- Use form-modal as base
- Add custom content inside

4. Component Category Detection

Determine the appropriate category for components.yaml:

CategoryWhen to UseExamples
coreEssential UI primitivesbutton, badge, typography
formForm inputs and controlsinput, select, checkbox, switch, text-field
dataData display componentstable, list, data-grid
overlayPopups, modals, menusdialog, dropdown-menu, tooltip, form-modal
feedbackStatus and notificationstag, alert, toast
layoutLayout and structureaccordion, page-header, tabs
customMulti-file complex componentsevent-selector, key-value-input

5. Dependency Analysis

Identify all dependencies for the component:

External dependencies:

dependencies:
  - "class-variance-authority"  # If using CVA
  - "clsx"  # If using cn()
  - "tailwind-merge"  # If using cn()
  - "lucide-react"  # If using icons
  - "@radix-ui/react-dialog@^1.1.15"  # If using Dialog
  - "@radix-ui/react-select@^2.2.6"  # If using Select

Internal dependencies (other components):

internalDependencies:
  - button  # If using Button component
  - input  # If using Input component
  - dialog  # If using Dialog component

6. Multi-File Structure Detection

Determine if component needs multiple files:

Single file components:

  • Simple primitives (Button, Badge, Input)
  • No internal state management
  • No complex sub-structures

Multi-file components:

  • Complex components with subcomponents (EventSelector, KeyValueInput)
  • Shared types across files
  • Multiple related components that work together

Multi-file structure:

src/components/custom/component-name/
├── component-name.tsx          # Main component (exported)
├── component-subpart.tsx       # Internal subcomponent
├── types.ts                    # Shared types
├── utils.ts                    # Helper functions
└── index.ts                    # Public exports

Analysis Output Format

Provide analysis in this structured format:

# Component Analysis: [ComponentName]

## Existence Check
- ❌ Component does not exist
- ✅ Similar component found: `button` at src/components/ui/button.tsx

## Recommendation
[CREATE VARIANT / CREATE NEW COMPONENT]

**Reasoning:**
[Explanation of decision]

## Identified Subcomponents

| Component | Location | Usage |
|-----------|----------|-------|
| text-field | src/components/ui/text-field.tsx | For labeled input fields |
| button | src/components/ui/button.tsx | For submit action |
| alert | src/components/ui/alert.tsx | For validation errors |

## Component Details

**Type:** [UI / Custom]
**Category:** [core / form / data / overlay / feedback / layout]
**Structure:** [Single file / Multi-file]

**Dependencies:**
- External: class-variance-authority, clsx, tailwind-merge
- Internal: button, text-field, alert

## Suggested Architecture

// Main component using identified subcomponents import { Button } from "./button" import { TextField } from "./text-field" import { Alert } from "./alert"

const Component = () => { return ( <div> <TextField label="Name" /> <TextField label="Email" type="email" /> {error && <Alert variant="destructive">{error}</Alert>} <Button type="submit">Submit</Button> </div> ) }


## Next Steps

1. Confirm architecture with user
2. Gather design context (Figma or manual)
3. Map colors to CSS variables
4. Generate component files
5. Create tests and stories

Examples

Example 1: Suggest Variant

Input: User wants to create "outlined-button"

Analysis:

# Component Analysis: OutlinedButton

## Existence Check
✅ Found: `button` at src/components/ui/button.tsx

## Recommendation
CREATE VARIANT

**Reasoning:**
The existing `button` component already has an `outline` variant:

variant: { default: "bg-primary text-primary-foreground", outline: "border border-input bg-background", // Already exists! // ... }


**Action:** Use existing `<Button variant="outline">` instead of creating new component.

Example 2: Create New Component

Input: User wants to create "avatar" component

Analysis:

# Component Analysis: Avatar

## Existence Check
❌ Component does not exist
✅ Similar: `badge` (circular shape) at src/components/ui/badge.tsx

## Recommendation
CREATE NEW COMPONENT

**Reasoning:**
While `badge` is circular, `avatar` serves a different purpose:
- Avatar displays user images with fallback
- Badge shows status indicators
- Different props (src, alt, fallback vs children)
- Different behavior (image loading vs static content)

## Identified Subcomponents
None - This is a primitive component

## Component Details
**Type:** UI
**Category:** core
**Structure:** Single file

**Dependencies:**
- External: class-variance-authority, clsx, tailwind-merge
- Internal: None

## Suggested Architecture

const avatarVariants = cva( "relative flex shrink-0 overflow-hidden rounded-full", { variants: { size: { xs: "h-6 w-6", sm: "h-8 w-8", md: "h-10 w-10", lg: "h-12 w-12", xl: "h-16 w-16", }, }, defaultVariants: { size: "md" }, } )

interface AvatarProps { src?: string alt?: string fallback?: string size?: "xs" | "sm" | "md" | "lg" | "xl" }

Example 3: Identify Subcomponents

Input: User wants to create "user-settings-form"

Analysis:

# Component Analysis: UserSettingsForm

## Existence Check
❌ Component does not exist

## Recommendation
CREATE NEW COMPONENT (Custom)

**Reasoning:**
This is an application-specific form, not a reusable primitive.
Should be created in `src/components/custom/`.

## Identified Subcomponents

| Component | Location | Usage |
|-----------|----------|-------|
| form-modal | src/components/ui/form-modal.tsx | Modal wrapper with save/cancel |
| text-field | src/components/ui/text-field.tsx | Name, email, phone inputs |
| select-field | src/components/ui/select-field.tsx | Timezone, language selects |
| switch | src/components/ui/switch.tsx | Notification toggles |
| button | src/components/ui/button.tsx | Included in form-modal |
| alert | src/components/ui/alert.tsx | Error/success messages |

## Component Details
**Type:** Custom
**Category:** custom
**Structure:** Single file (uses composition)

**Dependencies:**
- External: clsx, tailwind-merge
- Internal: form-modal, text-field, select-field, switch, alert

## Suggested Architecture

import { FormModal } from "@/components/ui/form-modal" import { TextField } from "@/components/ui/text-field" import { SelectField } from "@/components/ui/select-field" import { Switch } from "@/components/ui/switch" import { Alert } from "@/components/ui/alert"

const UserSettingsForm = ({ open, onOpenChange }) => { return ( <FormModal open={open} onOpenChange={onOpenChange} title="User Settings" onSave={handleSave} > <TextField label="Name" /> <TextField label="Email" type="email" /> <SelectField label="Timezone" options={timezones} /> <Switch label="Email notifications" /> {error && <Alert variant="destructive">{error}</Alert>} </FormModal> ) }

Best Practices

  1. Always search before suggesting creation - Avoid duplication
  2. Prefer variants over new components - Maintain consistency
  3. Identify ALL reusable subcomponents - Don't reinvent the wheel
  4. Consider component category - Organize properly
  5. Analyze dependencies - Keep dependency tree clean
  6. Suggest multi-file structure when needed - For complex components

Error Handling

  • No similar component found → Safe to create new component
  • Multiple similar components → Present options to user
  • Unclear if variant or new → Ask user for clarification
  • Missing dependency → Note in analysis and suggest adding

This skill ensures component library consistency, prevents duplication, and promotes proper architecture patterns.

平台分布

Codex

35.21%
按下载量换算1,110

Claude

29.43%
按下载量换算928

Cursor

17.36%
按下载量换算547

Gemini CLI

9%
按下载量换算284

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills