Agent Skills › github/replica › react-components

react-components

GitHub

指导在 React 项目中正确导入和使用 UI 组件,区分 CoreAI 包与本地适配器的边界,强调查阅官方文档而非依赖默认行为,确保语义化使用链接和按钮。

starters/coreai/.agents/skills/react-components/SKILL.md github/replica

Trigger Scenarios

编辑 .tsx 文件 选择或引入 UI 组件 编写组件导入语句

Install

npx skills add github/replica --skill react-components -g -y
More Options

Non-standard path

npx skills add https://github.com/github/replica/tree/main/starters/coreai/.agents/skills/react-components -g -y

Use without installing

npx skills use github/replica@react-components

指定 Agent (Claude Code)

npx skills add github/replica --skill react-components -a claude-code -g -y

安装 repo 全部 skill

npx skills add github/replica --all -g -y

预览 repo 内 skill

npx skills add github/replica --list

SKILL.md

Frontmatter
{
    "name": "react-components",
    "description": "CoreAI Sandbox component usage: import boundaries, published CoreAI documentation, and local adapter inspection. USE WHEN: editing any `*.tsx` file, picking a component, or writing component imports."
}

CoreAI Sandbox Component Usage

Import Boundary

Import CoreAI components, styling APIs, and tokens directly from @coreai-ds/react-components.

import { Button, Dropdown, Spinner } from '@coreai-ds/react-components';

Import CoreAI-Sandbox-owned components and adapters from ~/components/common.

import { Card, ExternalLink, Image, Link, TabLinkList } from '~/components/common';

The app barrel exports only repository-owned behavior. It does not re-export CoreAI. Never import components from @fluentui/react-components directly. Direct imports from @fluentui/react-icons remain supported.

Use the local Link for React Router navigation, ExternalLink for external URLs, Card for all cards, and Image for theme-aware and deployment-safe image sources. ESLint restricts direct Link, Card, and Image imports from @coreai-ds/react-components; only the local adapter implementations may import those underlying CoreAI components.

Skill Boundary

  • This skill owns CoreAI Sandbox's repository boundary: decide whether the need is satisfied by CoreAI or by an existing app-owned adapter, composition, hook, theme utility, or asset.
  • coreai-ds-fluentui-react owns external package documentation retrieval and version checks. Invoke it for every CoreAI component or prop decision instead of restating its catalog here.
  • Local source under app/components/common/** is authoritative only for CoreAI-Sandbox-owned behavior; it is not a substitute for CoreAI documentation.

Choose and Verify Components

  1. Invoke the coreai-ds-fluentui-react skill and retrieve the relevant published documentation before selecting, changing, or reviewing a component or its props. Follow its discovery, version-check, and retrieval-failure workflow. Do not infer APIs from stock Fluent behavior.
  2. Verify the selected API against the installed package when documented versions differ. Report missing guidance or unsupported APIs rather than silently substituting prior knowledge.
  3. Check app/components/common/index.ts for an existing CoreAI-Sandbox-owned export only when the requested behavior is product-specific or integrates an app concern such as React Router.
  4. When a local export exists, read its source under app/components/common/** before using it. Published package documentation does not define CoreAI-Sandbox-owned behavior.
  5. Prefer an existing documented component or template over recreating the same interaction with custom markup and CSS.

Do not maintain a static component catalog in this skill. Published CoreAI documentation is the source of truth for CoreAI components, and the app barrel and local source are the source of truth for repository-owned exports.

Semantics

Use links for navigation and buttons for actions. Do not make a Button navigate or use a link to perform an action. Use Link for app routes and ExternalLink for URLs outside the app.

Related skills

  • css-styling — required when writing styles for the component
  • icons — for icon selection and bundling
  • coreai-ds-fluentui-react — required for CoreAI component documentation and API decisions

Version History

  • f19c050 Current 2026-11-07 08:51

Same Skill Collection

.github/extensions/replica-prototype/skills/replica-pick-and-polish/SKILL.md
.github/extensions/replica-prototype/skills/replica-publish-prototype/SKILL.md
.github/extensions/replica-prototype/skills/review-hub-feedback/SKILL.md
.github/skills/code-review/SKILL.md
.github/skills/write-tests/SKILL.md
starters/coreai/.agents/skills/coreai-ds-fluentui-react/SKILL.md
starters/coreai/.agents/skills/css-styling/SKILL.md
starters/coreai/.agents/skills/icons/SKILL.md
starters/coreai/.agents/skills/interpreting-html/SKILL.md
starters/coreai/.agents/skills/lint/SKILL.md
starters/coreai/.agents/skills/new-variant/SKILL.md
starters/coreai/.agents/skills/routing/SKILL.md
starters/coreai/.agents/skills/start-app/SKILL.md
starters/coreai/.agents/skills/state-management/SKILL.md
starters/shared/.agents/context-templates/SKILL.md
starters/shared/.agents/skills/accessibility-audit/SKILL.md
starters/shared/.agents/skills/add-seed-data/SKILL.md
starters/shared/.agents/skills/agent-browser/SKILL.md
starters/shared/.agents/skills/browser-canvas-validation/SKILL.md
starters/shared/.agents/skills/component-design-system-review/SKILL.md
starters/shared/.agents/skills/create-prototype/SKILL.md
starters/shared/.agents/skills/developer-handoff/SKILL.md
starters/shared/.agents/skills/prepare-feedback-proposals/SKILL.md
starters/shared/.agents/skills/product-design/SKILL.md
starters/shared/.agents/skills/prototype-controls/SKILL.md
starters/shared/.agents/skills/responsive-audit/SKILL.md
starters/shared/.agents/skills/review-hub-feedback/SKILL.md
starters/shared/.agents/skills/setup-skills/SKILL.md
starters/shared/.agents/skills/visual-design-review/SKILL.md
starters/coreai/.agents/skills/features-variants/SKILL.md

Metadata

Files
0
Version
f19c050
Hash
3b93c658
Indexed
2026-11-07 08:51

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-07 09:36
浙ICP备14020137号-1