← 返回 Skills 市场
bovinphang

React Project Standard

作者 Bovin Phang · GitHub ↗ · v2.4.0 · MIT-0
cross-platform ✓ 安全检测通过
52
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fec-react-project-standard
功能描述
Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composit...
使用说明 (SKILL.md)

React 项目规范

适用于 React + TypeScript 仓库中的中大型模块建设、页面重构和工程结构设计。

Purpose

为 React + TypeScript 项目提供工程结构、模块边界和默认实现约定,确保架构清晰、代码可维护。

Procedure

本 skill 主要解决 React 工程任务“如何设计和落地”的问题,不重复声明基础编码底线。处理 React 工程化任务时,按以下顺序执行:

  1. 识别仓库已有约定

    • 目录组织方式
    • 样式体系
    • 状态管理方案
    • 请求封装方式
    • 测试框架
    • UI 组件库 / 设计系统
  2. 判断目标属于哪一层

    • 路由页面
    • 页面私有组件
    • feature 业务模块
    • 全局通用组件
    • hooks / services / stores / utils
  3. 设计边界后再落代码

    • 哪些逻辑属于页面编排
    • 哪些逻辑属于 feature
    • 哪些逻辑应下沉为通用能力
    • 哪些状态应本地管理,哪些应交给 store / query / URL
    • 状态归属复杂时使用状态管理流程先做状态清单
    • DTO、公共 props 或泛型组件复杂时使用 TypeScript 类型安全流程先收敛类型契约
  4. 输出时补齐关键质量项

    • loading / error / empty / data 状态
    • 错误处理与重试
    • 类型约束
    • 关键测试入口
    • 必要的专项 skill 分流
    • 依赖是否已存在于 package.json,缺失时先给安装命令再使用
    • 重型 UI 能力(动效、图表、3D、编辑器、地图)是否隔离为 leaf component 并按需加载
    • 图片、视频、字体等资源是否本地化、可缓存,并避免占位 URL 进入交付
    • 页面级 Error Boundary、模块级 fallback、API 错误映射和用户可恢复动作是否一致
    • Tailwind token/variant 或响应式布局需求是否应分流到对应专项 skill

Detailed References

需要具体 React 项目结构、组件模式、Hooks、路由、状态归属、API 层形状、错误处理、样式默认值、TypeScript 约定或审查清单时,加载 references/react-project-details.md

Constraints

  • 默认遵守仓库现有全局规则和 React rule
  • 若仓库已有明确目录结构、样式体系、状态管理或请求封装,优先沿用仓库约定
  • 组件文件规模宜约 300 行内;逾 500 行或复杂度过高须拆分子组件、Hooks、utils、类型
  • 禁止新增类组件(Error Boundary 用 react-error-boundary 等库)
  • 禁止绕过模块出口,从 feature 深层路径导入
  • 不要用 useEffect + setState 模拟本可直接计算的派生值
  • 避免 prop drilling 过深却不考虑组合或局部封装
  • 不在通用页面组件里同步引入 GSAP、Three.js、Lottie、富文本编辑器或地图 SDK;需要时用动态导入、路由级分包或叶子组件隔离。
  • 不在 React 组件中散落裸 fetch、API URL、token refresh 或上传流程;跨边界请求应收敛到 API 集成层。
  • 不用 Error Boundary 处理普通 API 失败;请求错误应优先落到 loading/error/empty/data 状态和可恢复操作。

Expected Output

  • 组件边界清晰,pages/features/components 分层明确
  • Props 类型完整且明确,无 any 滥用
  • 可复用逻辑已提取为 hooks,loading/error/empty/data 状态齐全
  • API 层具备类型约束和统一错误处理,状态管理符合就近原则
  • URL 状态、服务端状态、表单状态和全局客户端状态边界明确
  • 关键行为有测试覆盖,关键模块已用 react-error-boundary 包裹
  • 超长列表已评估虚拟化,弹窗/复合组件具备键盘与焦点支持
  • 先尊重仓库现状,再给推荐结构
  • 给出必要的文件划分建议
  • 必要时说明为什么这样分层
  • 对新增模块,优先输出最小可落地结构,而不是一次性过度设计
  • 对重构任务,优先保证可迁移性和风险可控
安全使用建议
Install only if you want these ClawHub/Convex maintainer workflows available to your agent. Be aware that the autoreview helper defaults to a full-access nested Codex review mode; use its documented no-yolo option if you want normal sandbox prompts.
能力评估
Purpose & Capability
The artifacts are coherent with ClawHub and Convex development workflows: code review, UI proof, moderation, Convex setup, migrations, and performance audits.
Instruction Scope
Some skills use broad routing language and implicit invocation, but their instructions remain tied to specific development or maintainer tasks and include guardrails such as explicit targets for moderation actions.
Install Mechanism
No suspicious install hook or package-level persistence mechanism was found in the inspected skill files; scripts are invoked explicitly by the agent or user.
Credentials
The autoreview helper can run repo tests, fetch git refs, and invoke nested review tools with full-access flags by default; this is high authority but disclosed and purpose-aligned for local maintainer review.
Persistence & Privilege
No hidden persistence was found. Privileged actions such as moderation commands or full-access review are described in the artifacts and include user-control or opt-out paths.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fec-react-project-standard
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fec-react-project-standard 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.4.0
**v1.0.1 Summary:** Initial release of a modular React project standard, reorganizing documentation and adding comprehensive references for structure and conventions. - Renamed the skill and broadened its audience/purpose to guide overall React + TypeScript structure and conventions. - Added core documentation files: LICENSE, README.md, metadata.json, and a detailed project structure reference. - Removed outdated summary file (skill-card.md). - Updated guidelines to emphasize modular boundaries, code organization, practical constraints, and process for implementing or reviewing React project structure. - Directed detailed structural and component references to a separate file for easier lookup.
元数据
Slug fec-react-project-standard
版本 2.4.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

React Project Standard 是什么?

Use when designing or reviewing React + TypeScript project structure, feature/module boundaries, component architecture, hooks organization, routing composit... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 52 次。

如何安装 React Project Standard?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fec-react-project-standard」即可一键安装,无需额外配置。

React Project Standard 是免费的吗?

是的,React Project Standard 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

React Project Standard 支持哪些平台?

React Project Standard 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 React Project Standard?

由 Bovin Phang(@bovinphang)开发并维护,当前版本 v2.4.0。

💬 留言讨论