用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/qu-yquan/ratel-manager --skill ratel-view-development命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | ratel-view-development |
| description | Ratel前端项目开发规范与指南,包含目录结构、命名规范、组件开发、微前端配置等,只要涉及到前端代码开发必读。 |
| type | skill |
| 文档 | 说明 | 适用场景 |
|---|---|---|
| 01-project-and-conventions.md | 项目结构、样式规范、命名规范 | 编写任何前端代码 |
| 02-components-and-pages.md | 组件/页面开发、WCAG 2.1、data-ai-approval | 创建页面或组件 |
| 03-core-library-and-api.md | @gwsu/core 完整指南、API 规范、状态管理、事件 | 使用共享库、调用接口 |
| 04-list-page-pattern.md | 列表页模式、操作列、权限控制 | 开发列表页 |
| 05-checklist.md | 开发检查清单 | 自查 |
aria-label,装饰性图标 aria-hidden="true"*.module.less,禁止 CSS-in-JSimport styles from './index.module.less'className={styles.xxx}import { ThemeLayout, useThemeContext, AuthGate, FileUpload, FileDownloadButton, FileScope } from '@gwsu/core';
import { get, post, put, del } from '@gwsu/core';
import { useUserStore, useMenuStore, useAuthStore } from '@gwsu/core';
import { useAuth, useFileUpload, useFileDownload } from '@gwsu/core';
import { EventType, emitEvent, onEvent } from '@gwsu/core';
import { fetchDictValuesBatch, fetchConfigsBatch } from '@gwsu/core';
禁止自行封装,使用 @gwsu/core 组件:
// 上传(组件方式)
<FileUpload property={{ scope: FileScope.PROTECTED, categorize: 'doc' }} maxSize={50*1024*1024} onChange={(ids) => ...} />
// 下载(组件方式)
<FileDownloadButton fileId={record.fileId} fileName={record.fileName} />
// 上传(Hook方式,自定义UI时)
const { upload, progress, abort } = useFileUpload({ scope: FileScope.PROTECTED });
// 下载(Hook方式)
const { download, progress, abort } = useFileDownload();
一个页面多个字典/配置时,必须只调用一次接口:
const dictMap = await fetchDictValuesBatch(['user_status', 'gender']);
const configMap = await fetchConfigsBatch(['site_name', 'max_upload_size']);
权限标识必须定义为常量(permissionConstants.ts),禁止硬编码:
<AuthGate buttonKey={PERM_ADD}><Button type="primary">新增</Button></AuthGate>
const canEdit = useAuth(PERM_EDIT);
核心:按钮点击后是否立即触发后端数据变更。需要则加,不需要则不加。
| 需要 | 不需要 |
|---|---|
| 删除、状态切换、保存/提交 | 新增(打开空表单)、详情、搜索 |
import { ThemeLayout } from '@gwsu/core';
const Layout: React.FC = () => <ThemeLayout><Outlet /></ThemeLayout>;
基于 SOC 职业分类