Agent Skills
› OpenAEV-Platform/openaev
› review-frontend
review-frontend
GitHub提供OpenAEV前端React/TypeScript代码审查清单,涵盖组件结构、表单验证、设计系统规范及权限控制等,用于PR审核或前端功能审计。
触发场景
进行前端代码PR审查
审计前端功能实现
安装
npx skills add OpenAEV-Platform/openaev --skill review-frontend -g -y
SKILL.md
Frontmatter
{
"name": "review-frontend",
"description": "Frontend review checklist for OpenAEV React\/TypeScript code: component patterns, Filigran Design System adoption, forms, MUI usage, permissions, i18n, state management, dead code. Use when reviewing PRs or auditing frontend features."
}
Frontend Review
Procedure
Step 1 — Check component structure
- One component per file, one folder per feature
- Functional components with
FunctionComponenttyping - No class components in new code (
.jsx→.tsxmigration required when touching) - Props defined via explicit
interface Props(not inline)
Step 2 — Check forms
- Zod for validation via
zodImplement<T>().with({...}) - React Hook Form via
useForm<T>+FormProvider - Field controllers:
TextFieldController,SelectFieldController,TagFieldController - Form layout: flexbox with
gap: theme.spacing(2), no MUI Grid - Validate types match
api-types.d.ts(auto-generated, never manual) - Forms hosting a
requiredlibrary field setnoValidate(otherwise the native browser check hides the Zod message) - Library labels only (
SelectLabel,ComboboxLabel), no MUIInputLabelbeside a library field
Step 3 — Check design system, MUI & styling
Rules: frontend.instructions.md → Design System & Layout.
- Library first — no new
@mui/*import of a component the design system replaces, unless it carries// fds:keep-mui <reason>:node fds-migration/scripts/check-mui-regression.mjs --base origin/main node fds-migration/scripts/check-fds-conformity.mjs - No local look-alike of a library component, no MUI control inside a converted library container
- Library prop contracts —
IconButtongetsicon+aria-label; variant/priority named explicitly;Paper paddingin0/8/16/24/32andtitlenever''; control sizes match their row (smin rows, forms, cards andPaperheaders) - Navigation — buttons/chips/cards that navigate wrap a real
Link/<a>(asChild), noonClick={navigate} - Colours — no
alpha()/darken()/lighten()on a value that may be a token (usetint()fromutils/tint.ts):cd openaev-front && yarn test src/__tests__/utils/tokenColoursNotInAlpha.test.ts - No arbitrary utility classes — every class string used on a library component must exist in the shipped sheet:
grep -c "\.<class>{" openaev-front/node_modules/@filigran/design-system/dist/index.css # 0 = the class is a silent no-op - No MUI for layout — native
div,section,header, flexbox/grid sxon MUI,styleon library components — neverstyle={{ }}on a MUI component; when movingsx→style, every bare spacing number must be converted to px (p: 2→16)- Theme tokens — use
theme.palette,theme.spacing(),theme.shape,theme.typographyor design-system tokens for all visual values; no hardcoded#hex,rgba(), or rawpx(fixedwidthexempt).src/components/fds-tokens.generated.tsis never hand-edited - Visual delta — for a conversion, ask for a before/after measurement in the running app (both themes); lint and type-check do not see most design-system regressions
Step 4 — Check permissions
- Create/Edit: wrapped with
<Can I={ACTIONS.X} a={SUBJECTS.Y}> - No hardcoded role checks — use CASL
ability.can() - New subjects → added in
src/utils/permissions/types.ts
Step 5 — Check i18n
t()called early — pass translated strings to child components- Keys = English text:
t('Organization name'), nott('organization_name') - No missing translations:
cd openaev-front && yarn i18n-checker 2>&1 | tail -20
Step 6 — Check data loading patterns
- Paginated lists:
useQueryableWithLocalStorage+PaginationComponentV2 - Actions: simple calls in
actions/{feature}/{feature}-actions.ts - Hooks: custom hook per feature (e.g.,
useOrganizations.ts) for local state
Step 7 — Check TypeScript
- No
anytypes - No
@ts-ignorewithout explanatory comment - Auto-generated types from API used (not manual interfaces for API responses):
grep -rn "interface.*Input\|interface.*Output" openaev-front/src/ --include="*.ts" --include="*.tsx" | grep -v api-types | grep -v node_modules | head -20
Step 8 — Check dead code
- No unused imports (ESLint catches most)
- No orphaned
.jsxfiles if a.tsxreplacement exists - No components imported but not rendered
- No dead props — grep all call-sites of modified components; any prop declared in
interface Propsthat no consumer passes must be removed
Step 9 — Report
Document findings using conventional comments format:
issue (blocking):for pattern violations that cause bugs or inconsistencysuggestion (non-blocking):for improvements and modernizationnitpick:for style preferencespraise:for well-implemented patterns
版本历史
- 3.261016.0 当前 2026-10-19 22:29


