Agent Skills › OpenAEV-Platform/openaev › review-frontend

review-frontend

GitHub

提供OpenAEV前端React/TypeScript代码审查清单,涵盖组件结构、表单验证、设计系统规范及权限控制等,用于PR审核或前端功能审计。

.claude/skills/review-frontend/SKILL.md OpenAEV-Platform/openaev

触发场景

进行前端代码PR审查 审计前端功能实现

安装

npx skills add OpenAEV-Platform/openaev --skill review-frontend -g -y
更多选项

非标准路径

npx skills add https://github.com/OpenAEV-Platform/openaev/tree/main/.claude/skills/review-frontend -g -y

不安装直接使用

npx skills use OpenAEV-Platform/openaev@review-frontend

指定 Agent (Claude Code)

npx skills add OpenAEV-Platform/openaev --skill review-frontend -a claude-code -g -y

安装 repo 全部 skill

npx skills add OpenAEV-Platform/openaev --all -g -y

预览 repo 内 skill

npx skills add OpenAEV-Platform/openaev --list

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 FunctionComponent typing
  • No class components in new code (.jsx → .tsx migration 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 required library field set noValidate (otherwise the native browser check hides the Zod message)
  • Library labels only (SelectLabel, ComboboxLabel), no MUI InputLabel beside 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 — IconButton gets icon + aria-label; variant/priority named explicitly; Paper padding in 0/8/16/24/32 and title never ''; control sizes match their row (sm in rows, forms, cards and Paper headers)
  • Navigation — buttons/chips/cards that navigate wrap a real Link / <a> (asChild), no onClick={navigate}
  • Colours — no alpha() / darken() / lighten() on a value that may be a token (use tint() from utils/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
  • sx on MUI, style on library components — never style={{ }} on a MUI component; when moving sx → style, every bare spacing number must be converted to px (p: 2 → 16)
  • Theme tokens — use theme.palette, theme.spacing(), theme.shape, theme.typography or design-system tokens for all visual values; no hardcoded #hex, rgba(), or raw px (fixed width exempt). src/components/fds-tokens.generated.ts is 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'), not t('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 any types
  • No @ts-ignore without 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 .jsx files if a .tsx replacement exists
  • No components imported but not rendered
  • No dead props — grep all call-sites of modified components; any prop declared in interface Props that no consumer passes must be removed

Step 9 — Report

Document findings using conventional comments format:

  • issue (blocking): for pattern violations that cause bugs or inconsistency
  • suggestion (non-blocking): for improvements and modernization
  • nitpick: for style preferences
  • praise: for well-implemented patterns

版本历史

  • 3.261016.0 当前 2026-10-19 22:29

同 Skill 集合

.claude/skills/add-contract-output-type/SKILL.md
.claude/skills/add-migration/SKILL.md
.claude/skills/add-test/SKILL.md
.claude/skills/create-feature-module/SKILL.md
.claude/skills/reduce-tx-baseline/SKILL.md
.claude/skills/review-chaining-engine/SKILL.md
.claude/skills/review-code/SKILL.md
.claude/skills/review-docs/SKILL.md
.claude/skills/review-migration/SKILL.md
.claude/skills/review-multi-tenancy/SKILL.md
.claude/skills/review-performance/SKILL.md
.claude/skills/review-security/SKILL.md
.github/skills/add-contract-output-type/SKILL.md
.github/skills/add-migration/SKILL.md
.github/skills/add-test/SKILL.md
.github/skills/create-feature-module/SKILL.md
.github/skills/reduce-tx-baseline/SKILL.md
.github/skills/review-code/SKILL.md
.github/skills/review-docs/SKILL.md
.github/skills/review-frontend/SKILL.md
.github/skills/review-migration/SKILL.md
.github/skills/review-multi-tenancy/SKILL.md
.github/skills/review-performance/SKILL.md
.github/skills/review-security/SKILL.md
.claude/skills/activate-tenant-table/SKILL.md
.github/skills/activate-tenant-table/SKILL.md

元信息

文件数
0
版本
3.261016.0
Hash
9cd99255
收录时间
2026-10-19 22:29

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-21 16:18
浙ICP备14020137号-1