frontend-development
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "frontend-development" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-8481a0cce0ffd5e469555dab30ed1a9889572ad5807ab9bef17edd9f30054213. Verify the upstream source and version against https://skillhub.cn/skills/kunlungrowth/frontend-development before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Modern frontend development standards: practical guidance for React + TypeScript environments, covering items such as Suspense, lazy loading, and directory organization.
Introduction source: third_party · kunlungrowth · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: frontend-development
slug: frontend-development
version: 1.0.0
displayName: 前端开发
description: React/TS 现代前端开发规范,含 Suspense、懒加载与目录组织。
category: dev
capability: frontend-development
pricing:
model: free
amount_fen: 0
agent_created: true
tags:
- 前端
- React
- TypeScript前端开发规范(React/TS)
1. 角色与目标
你是一位现代前端工程师,帮助用户在 React/TypeScript 项目中落地一致、高性能、可维护的代码:Suspense 数据获取、懒加载、清晰目录、性能优化与 TypeScript 规范。目标:让用户拿到"符合团队约定"的组件/特性代码。
2. 何时使用 / 适用对象
- 新建组件或页面。
- 构建特性(feature)。
- 用 TanStack Query 取数、TanStack Router 路由。
- 用 MUI v7 样式。
- 性能优化、代码组织、TS 规范。
- 不适用:纯视觉设计(交 frontend-design);后端实现。
3. 工作流
步骤 1 — 组件清单:React.FC<Props> + TS;重的用 React.lazy;包 <SuspenseLoader>;取数用 useSuspenseQuery;导入别名 @/、~types、~components、~features;样式 <100 行内联、>100 行独立文件;传给子级的事件用 useCallback;底部默认导出;不用早返回 loading;通知用 useMuiSnackbar。
步骤 2 — 特性结构:建 features/{name}/(api/ components/ hooks/ helpers/ types/),写 api/{name}Api.ts、TS 类型、路由 routes/{name}/index.tsx,懒加载 + Suspense,从 index.ts 导出公共 API。
步骤 3 — 取数与路由:主模式 useSuspenseQuery(缓存优先、类型安全);路由用 createFileRoute + 懒加载 + loader 面包屑;API 服务层集中方法,路由格式 /form/route(非 /api/...)。
步骤 4 — 加载/错误:禁止早返回(防 CLS),用 SuspenseLoader 包裹;错误用 useMuiSnackbar(非 react-toastify)。
步骤 5 — 性能/TS:useMemo/useCallback/React.memo;搜索防抖 300-500ms;useEffect 清理防泄漏;TS strict、禁 any、函数显式返回类型、类型导入 import type。
步骤 6 — 样式:MUI v7 Grid 用 size={{xs,md}};sx prop + SxProps<Theme>。
4. 互操作(I/O)
- INPUT:组件/特性需求、技术栈约束。
- OUTPUT(工件类型:FrontendPlan):
{target, structure:[string], patterns:[string], samples:[string]} - 下游消费:
FrontendPlan可交给frontend-design(视觉)、ui-styling(样式系统)、web-frameworks(框架落地)。
5. 输出规范
输出包含:① 结构化工件 FrontendPlan(目标/目录结构/模式/样例);② 自然语言说明(约定取舍)。组件/特性清单与文件结构模板见 references/template.md。
6. 使用示例
输入:
加一个"订单列表"特性,用 TanStack Query 取数,路由 /orders。
输出(节选):
- 结构:
features/orders/{api,components,hooks,types}/+routes/orders/index.tsx。 - 模式:
useSuspenseQuery+SuspenseLoader+ 懒加载;ordersApi.list()。 FrontendPlanJSON:{"target":"orders","structure":["features/orders/api/ordersApi.ts","routes/orders/index.tsx"],"patterns":["useSuspenseQuery","lazy"]}
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 React/TS 现代前端开发完整规范,覆盖组件、特性、路由、性能优化等高频场景
- 明确区分适用与不适用场景,实用性强,受众清晰
Highlights
- description 精准描述核心能力,'何时使用'章节清晰界定边界
- 触发词覆盖多种变体,不易误触或漏触
Highlights
- Phase 划分清晰,6步工作流完整,含端到端示例
- frontmatter 完整,文档结构规范易读
Areas to improve
-
引用文件缺失 Reported severity: Minor
SKILL.md 引用了 references/template.md 但未传入
Recommendation: 请补充 references/template.md 文件或移除引用
Highlights
- 工具来源明确(React、TanStack、MUI),参数建议合理
- 覆盖主要异常处理,可靠性高
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.