Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

component-usage-analysis组件使用分析

Agent Skill

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

总安装

306

周安装

13

GitHub Stars

3

下载量

107
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/schalkneethling/webdev-agent-skills --skill component-usage-analysis

简介

分析组件依赖关系与使用模式,支持安全重构与移除决策。

  • 查找指定组件的所有引用、反向依赖与属性使用情况。
  • 识别潜在破坏性变更风险,评估组件可删除性。
  • 假设组件库位于 apps/component-library/src/components/ 路径下。
  • 输出依赖图谱与影响范围报告,辅助架构演进规划。

SKILL.md

Component Usage Analysis

Analyse component dependencies and usage patterns to support safe refactoring and removal.

Trigger Phrases

  • "Find all usages of <component>"
  • "Which components use <component>?"
  • "Check if <component> can be safely removed"
  • "Find components using <component> with property X"
  • "Audit dependencies for <component>"
  • "What would break if I change <component>?"

Configuration

This skill assumes the component library structure:

apps/component-library/
├── src/components/
│   ├── elements/
│   ├── patterns/
│   ├── template-components/
│   └── templates/

Analysis Methodology

Step 1: Identify the Target

Clarify with the user:

  1. Target component: Which component to analyse (e.g., elements/image)
  2. Properties of interest: Specific properties to filter by (optional)
  3. Analysis goal: Usage audit, removal check, or refactoring impact

Step 2: Twig Include Analysis

Find all components that include the target via Twig.

Search pattern:

grep -rn "{% include \"@<tier>/<component>" src/components/

Example for elements/image:

grep -rn '{% include "@elements/image' src/components/

For each match:

  1. Note the file path (consuming component)
  2. Extract the with {} block to identify which properties are passed
  3. Record whether target properties are present

Extracting the with block:

Twig includes may span multiple lines:

{% include "@elements/image/image.twig" with {
    src: item.image.src,
    alt: item.image.alt,
    description: item.image.description
} %}

Use multi-line search or examine files directly when the with block is complex.

See references/search-patterns.md for detailed patterns.

Step 3: Mock Reference Analysis

Find all components whose mocks reference the target component.

Search pattern:

grep -rn '\$ref: <tier>/<component>#' src/components/

Example for elements/image:

grep -rn '\$ref: elements/image#' src/components/

For each match:

  1. Note the file path and variant name referenced
  2. Look up the referenced variant in the target's mocks.yaml
  3. Check if the variant includes the properties of interest

Cross-referencing variants:

If a mock uses $ref: elements/image#with-caption, check elements/image/mocks.yaml to see what properties that variant defines.

Step 4: Categorise Results

Group findings into categories based on the analysis goal:

For property-specific analysis:

  • Uses WITH property X: Components that pass/use the property
  • Uses WITHOUT property X: Components that use the target but don't use property X

For removal analysis:

  • Direct Twig includes: Would break immediately
  • Mock references only: May need mock updates but won't break rendering
  • No dependencies: Safe to remove

For refactoring analysis:

  • Affected by change: Components using the property/feature being changed
  • Unaffected: Components using the target but not the changed aspect

Step 5: Verification

Ensure comprehensive coverage before reporting:

  1. Count total files: find src/components -name "*.twig" | wc -l find src/components -name "mocks.yaml" | wc -l
  2. Verify search found expected files:

- Spot-check known usages - Confirm count matches expectations

  1. Check for alternative patterns:

- Embedded includes: {% include "@elements/image/image.twig" %} - Variable includes: {% include image_template %} - Embed blocks: {% embed "@elements/image/image.twig" %}

  1. Report confidence level:

- High: All patterns checked, counts verified - Medium: Primary patterns checked - Low: Quick scan only

Output Format

Provide results in a clear structure:

## Component Usage Analysis: <component>

### Summary
- Total usages found: X
- Twig includes: Y
- Mock references: Z

### Uses WITH <property>
1. `patterns/card/card.twig` - passes description in with block
2. `patterns/teaser/mocks.yaml` - references variant with description

### Uses WITHOUT <property>
1. `patterns/hero/hero.twig` - only passes src, alt
2. `template-components/header/mocks.yaml` - references minimal variant

### Verification
- Searched X .twig files
- Searched Y mocks.yaml files
- Confidence: High

Common Scenarios

Scenario: Removing a Property

User: "Can I remove the copyright property from elements/image?"

  1. Search for Twig includes passing copyright
  2. Search for mock references to variants with copyright
  3. Report which components would need updates
  4. Recommend: Update consumers first, then remove property

Scenario: Safe Component Removal

User: "Is elements/legacy-button used anywhere?"

  1. Search for Twig includes of the component
  2. Search for mock references
  3. Search for library references in templates
  4. If zero results across all searches → safe to remove

Scenario: Refactoring Impact

User: "I want to rename description to caption in elements/image"

  1. Find all usages passing description
  2. Provide list of files requiring updates
  3. Estimate scope of change

Notes

  • Always verify comprehensively before recommending removal
  • Check both Twig files AND mocks.yaml files
  • Consider indirect dependencies (component A uses B which uses C)
  • Report confidence level with results

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.76%
按下载量换算41

Claude

27.13%
按下载量换算29

Cursor

17.46%
按下载量换算19

Gemini CLI

10.02%
按下载量换算11

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills