AGENT SKILL

React 组件使用与导入

react-components

CoreAI Sandbox 组件使用:导入边界、CoreAI MCP 文档以及本地适配器检查。适用场景:编辑任意 `*.tsx` 文件、选择组件或编写组件导入语句时。

License 许可
CC-BY-4.0
最近更新
2026-11-14
Stars
★ 2
Forks
1

01 前言 Front Matter

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

03 SKILL.md 正文

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 Foundry-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.
  • prototype-app-coreai-ds-fluentui-react owns the external package API and its mandatory CoreAI-first MCP workflow. 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 Foundry-owned behavior; it is not a substitute for CoreAI documentation.

Choose and Verify Components

  1. Invoke the prototype-app-coreai-ds-fluentui-react skill and successfully call the CoreAI MCP before selecting, changing, or reviewing a component or its props. Do not infer APIs from stock Fluent behavior.
  2. If the CoreAI MCP tools are missing or a call fails, stop CoreAI-dependent work. Tell the user the MCP is required, ask them to start or reconnect coreai-ds-docs-localhost, help them troubleshoot it, and retry the call after they respond. Do not silently substitute package source, prior knowledge, or Fluent component documentation.
  3. Check app/components/common/index.ts for an existing Foundry-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. The CoreAI MCP cannot document Foundry-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. CoreAI's MCP 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

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

04 同仓库更多 Skills

microsoft
microsoft/coreai-design-system

CoreAI React 组件开发

coreai-ds-fluentui-react

文档/技能 v0.1.1;包 v0.12.0。使用 @coreai-ds/react-components 构建、设置样式、审查或调试 React UI 时使用。通过 HTTPS 获取 CoreAI Markdown 文档,了解组件、API、默认值、模板、设计 token 和无障碍指南。

软件开发工程师前端开发与界面实现
★ 2
microsoft
microsoft/coreai-design-system

前端查询状态管理

state-management

CoreAI Sandbox 的简化版 TanStack Query + mock-JSON 数据层。使用场景:编辑数据获取 hooks(`app/hooks/use*.ts`)、在 `app/data/` 中添加模拟数据,或将组件接入查询状态。

软件开发工程师前端开发与界面实现
★ 2
microsoft
microsoft/coreai-design-system

开发服务器启动

start-app

启动 CoreAI Sandbox 开发服务器,并使用可用的浏览器工具将其打开。适用场景:用户要求“启动应用”、“运行开发服务器”、“打开应用”或“启动 CoreAI Sandbox”时。

软件开发工程师开发环境与工具链管理
★ 2
microsoft
microsoft/coreai-design-system

React Router 路由配置

routing

本 SPA 的 React Router v7 路由约定。适用场景:编辑 `app/routes.ts`、添加/删除路由或更改导航时。

软件开发工程师前端开发与界面实现
★ 2
microsoft
microsoft/coreai-design-system

新建设计变体

new-variant

使用内置的功能/变体系统为页面创建新的设计变体或备选方案。使用场景:设计师想尝试不同的布局、创建“方案 B”或“版本 2”、并排对比设计、添加 A/B 备选方案,或探索替代版本。不要构建自定义的切换方案。

界面设计师前端开发与界面实现
★ 2
microsoft
microsoft/coreai-design-system

代码 Lint 检查

lint

运行完整的 lint 工作流:格式化、类型检查、CSS 检查、JS 检查。使用场景:用户要求执行“lint”、“修复 lint”、“运行检查器”、“检查类型”,或在完成需要验证的代码修改之后。

软件开发工程师代码实现
★ 2