component-icon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSKILL: component-icon
SKILL: component-icon
Generate an fpkit-style accessible Icon component directly into a developer's project.
直接在开发者的项目中生成一个fpkit风格的无障碍Icon组件。
Workflow
工作流程
- Read the source doc. Prefer the neutral in this skill directory (the spec-driven source of truth). Read its
icon.component.mdadapter (Generation Contract on its## Target: reactline,generation:, and## Props Interface(s)), plus## TSX Templateand## Accessibility. Icon is presentational — it has no## Examples/SCSS section and no## Stylessection. If## Behavioris absent, fall back toicon.component.md(canonical templates, Generation Contract, Props Interface, CSS Variables, Accessibility, Usage Examples). Both yield byte-identical output (golden-guarded).reference.md - Init check — run . If foundation (
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/detect_target.py <cwd>) is missing, run Step A ofui.tsxto initialize it before generating this component.${CLAUDE_PLUGIN_ROOT}/skills/kit-core/SKILL.md - Dependencies — Icon has no upstream dependencies (it is a leaf component). Skip dep resolution.
- Generate — apply the Generation Contract to produce:
- from the
<targetDir>/icon.tsx(under## TSX Templatein## Target: react, or top-level inicon.component.md) Icon has no SCSS template (renders via props/reference.mdon the host element). SubstitutecurrentColor,{{IMPORT_SOURCE:...}},{{NAME}}placeholders if present.{{FIELDS}}
- Verify — run and print the summary to the developer.
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/verify_integration.py <projectRoot>
- 阅读源文档:优先使用本技能目录中的中立文档****(基于规范的权威来源)。阅读其中的
icon.component.md适配器(## Target: react行的生成约定、generation:以及## Props Interface(s)),还有## TSX Template和## Accessibility部分。Icon是展示性组件——它没有## Examples/SCSS章节和## Styles章节。如果## Behavior不存在,则退而使用icon.component.md(标准模板、生成约定、Props接口、CSS变量、无障碍规范、使用示例)。两者生成的内容完全一致(受黄金标准校验)。reference.md - 初始化检查——运行。如果基础组件(
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/detect_target.py <cwd>)缺失,在生成此组件前,先执行ui.tsx中的步骤A来初始化。${CLAUDE_PLUGIN_ROOT}/skills/kit-core/SKILL.md - 依赖项——Icon没有上游依赖项(它是一个叶子组件)。跳过依赖解析步骤。
- 生成组件——应用生成约定来创建:
- 从(来自
## TSX Template中的icon.component.md部分,或## Target: react的顶层内容)生成reference.mdIcon没有SCSS模板(通过宿主元素的props/<targetDir>/icon.tsx渲染)。 如果存在currentColor、{{IMPORT_SOURCE:...}}、{{NAME}}占位符,请进行替换。{{FIELDS}}
- 从
- 验证——运行并将验证总结打印给开发者。
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/verify_integration.py <projectRoot>
Reference
参考资料
Templates and documentation live in (the neutral spec-driven source) alongside this SKILL.md, with kept as the byte-identical fallback. The shared generation contract, accessibility patterns, SCSS conventions, and CSS variable strategy are documented in .
icon.component.mdreference.md${CLAUDE_PLUGIN_ROOT}/skills/kit-core/references/模板和文档存放在与本SKILL.md同级的(基于中立规范的源文件)中,作为内容完全一致的备用文件。通用的生成约定、无障碍模式、SCSS规范以及CSS变量策略都记录在目录下。
icon.component.mdreference.md${CLAUDE_PLUGIN_ROOT}/skills/kit-core/references/