git:20260609.e2e224a to git:20260611.9d7f5e4

94 added, 94 removed. Audit A to A.

---
name: fec-code-review
- description: Use when the user asks for general frontend code review, PR review, merge-readiness assessment, architecture maintainability, type-safety, rendering/state risks, style consistency, testability gaps, or a cross-cutting review summary. Delegate deep security, accessibility, E2E, or performance investigations to their specialized skills; Chinese triggers include 代码审查, 代码评审, review.
+ description: Use when the user asks for general frontend code review, PR review, merge-readiness assessment, architecture maintainability, type-safety, rendering/state risks, style consistency, testability gaps, or a cross-cutting review summary. Delegate deep security, accessibility, E2E, or performance investigations to their specialized skills; Chinese triggers include code review, code review, review.
---
- # 前端代码评审
+ # Front-end code review
## Purpose
- 从架构、类型安全、可访问性、样式一致性、性能和可测试性等 8 个维度审查前端代码质量,输出分级评审报告。
+ Review the front-end code quality from 8 dimensions including architecture, type safety, accessibility, style consistency, performance and testability, and output a graded review report.
## Procedure
- 1. 先读项目事实:package scripts、框架、目录约定、最近 diff、现有测试和相关规则。
- 2. 按风险找问题,而不是按个人偏好挑风格;每个发现都要能指向具体文件、行号和用户影响。
- 3. 用五轴收敛结论:正确性、可维护性、类型/接口、用户体验、验证覆盖。
- 4. 对安全、无障碍、E2E、性能等深水区只做初筛;需要专项调查时明确分流。
- 5. 多维评审时先按职责拆分,再合并同类发现;同一文件同一根因只保留一条主发现,避免重复噪声。
- 6. 报告先列阻塞问题,再列建议项;没有证据的问题不要写成确定结论。
+ 1. Read the project facts first: package scripts, frameworks, directory conventions, recent diffs, existing tests and related rules.
+ 2. Find problems based on risk, rather than picking styles based on personal preference; each finding must be able to point to specific files, line numbers, and user impacts.
+ 3. Use five axes to converge conclusions: correctness, maintainability, type/interface, user experience, and verification coverage.
+ 4. Only preliminary screening will be done for deep water areas such as safety, accessibility, E2E, and performance; diversion will be clearly defined when special investigation is needed.
+ 5. During multi-dimensional review, first split according to responsibilities, and then merge similar findings; only one main finding for the same root cause of the same file is retained to avoid repeated noise.
+ 6. List blocking issues first in the report, then recommendations; do not write firm conclusions on issues without evidence.
- ## 多维评审编排
+ ## Multi-dimensional review arrangement
- 当改动跨越多个质量维度时,按“主评审 + 专项分流”组织,而不是让所有维度重复检查同一处代码。
+ When changes span multiple quality dimensions, organize them according to "main review + special diversion" instead of having all dimensions repeatedly check the same code.
- | 维度 | 触发条件 | 分流边界 |
+ | Dimension | Trigger condition | Diversion boundary |
| ------------------- | ---------------------------------------------------- | ------------------------------------ |
- | TypeScript 工程与类型契约 | DTO、泛型、公共类型、类型守卫、`any`、断言、tsconfig | 深入类型建模和 TS 配置交给 TypeScript 流程 |
- | 状态管理 | 状态归属、全局 store、URL 状态、派生状态、跨页面同步 | 状态选型与迁移交给状态管理专项流程 |
- | 安全 | 用户输入、HTML 渲染、token、上传、第三方脚本 | 漏洞级分析交给安全专项流程 |
- | 无障碍 | 弹窗、菜单、表单、键盘操作、焦点管理 | WCAG 细查交给无障碍专项流程 |
- | 性能 | 大列表、重依赖、重复请求、长任务、包体积 | 性能证据与预算交给性能专项流程 |
- | E2E | 关键用户路径、登录态、支付、跨页面流程 | 浏览器用例与 trace 交给 E2E 专项流程 |
+ | TypeScript Projects and Type Contracts | DTOs, generics, public types, type guards, `any`, assertions, tsconfig | In-depth type modeling and TS configuration handed over to the TypeScript process |
+ | State management | State attribution, global store, URL state, derived state, cross-page synchronization | State selection and migration are handed over to the state management special process |
+ | Security | User input, HTML rendering, token, upload, third-party script | Vulnerability level analysis is handed over to the security-specific process |
+ | Accessibility | Pop-up windows, menus, forms, keyboard operations, focus management | WCAG scrutinizes the special accessibility process |
+ | Performance | Large lists, heavy dependencies, repeated requests, long tasks, package sizes | Handle performance evidence and budget to the performance-specific process |
+ | E2E | Key user path, login status, payment, cross-page process | Browser use cases and traces are handed over to E2E special process |
- 发现合并规则:
+ Discover merge rules:
- - 同一根因出现在多个维度时,只保留最高严重级别,并在 `Dimension` 中列出相关维度。
- - 同一文件多处重复模式,合并为一条模式级发现,列出代表性位置。
- - 置信度不足的问题放入 Open Questions,不升级为阻塞项。
- - 自动化可稳定捕获的格式问题交给 lint/format,不作为人工评审主发现。
+ - When the same root cause appears in multiple dimensions, only the highest severity level is retained and the related dimensions are listed in `Dimension`.
+ - Repeated patterns in multiple places in the same file are merged into one pattern-level discovery, and representative locations are listed.
+ - Questions with insufficient confidence are placed in Open Questions and will not be upgraded to blocked items.
+ - Format issues that can be stably captured by automation are handed over to lint/format and are not discovered by human reviewers.
- ## 评审维度
+ ## Review dimensions
- 1. 架构
+ 1. Architecture
- - 组件边界是否清晰
- - 展示逻辑与业务逻辑是否分离
- - 是否有可复用抽象
- - 是否存在上帝组件
+ - Is the component boundary clear?
+ - Whether display logic and business logic are separated
+ - Is there a reusable abstraction?
+ - Whether there is a God component
- 2. 类型安全
+ 2. Type safety
- - 是否存在不必要的 `any`
- - props 类型是否明确
- - hooks/composables 返回值是否稳定
- - 在可行情况下 API 契约是否有类型约束
+ - Whether there is unnecessary `any`
+ - Is the props type clear?
+ - Is the return value of hooks/composables stable?
+ - Whether the API contract has type constraints where feasible
- 3. 渲染与状态
+ 3. Rendering and status
- - 是否存在不必要的重复渲染
- - key 的使用是否稳定
- - 可推导状态是否被重复存储
- - 本地状态是否耦合过深
- - 全局 store 是否只保存真正跨边界共享的客户端状态
- - URL 状态、服务端状态、表单状态和浏览器持久化是否边界清晰
+ - Is there unnecessary repeated rendering?
+ - Is the use of key stable?
+ - Whether the deducible state is stored repeatedly
+ - Is the local state coupled too deeply?
+ - Whether the global store only saves client state that is truly shared across borders
+ - Whether the boundaries between URL state, server state, form state and browser persistence are clear
- 4. 样式
+ 4. Style
- - 已有 Token 时是否还在使用 magic number
- - 类名是否与仓库约定一致
- - 响应式处理是否明确
- - 是否无必要地混用了多套样式体系
+ - Whether the magic number is still used when there is already a Token
+ - Whether the class name is consistent with the warehouse convention
+ - Is responsive processing clear?
+ - Are multiple style systems being mixed unnecessarily?
- 5. 可访问性
+ 5. Accessibility
- - 语义结构是否合理
- - 是否在需要时正确使用 label 和 aria
- - 是否支持键盘操作
- - 浮层和菜单的焦点管理是否正确
+ - Is the semantic structure reasonable?
+ - Whether label and aria are used correctly when needed
+ - Whether to support keyboard operation
+ - Is the focus management of floating layers and menus correct?
- 6. 可维护性
+ 6. Maintainability
- - 组件/页面文件规模是否合理(宜约 **300 行**内;逾 **500 行**或复杂度过高须拆分,见共享 React / Vue 规则中的「组件文件规模」)
- - 命名质量是否良好
- - 是否有应该提取的重复逻辑
- - 是否存在死代码、过期注释或临时性 hack
- - 业务状态、类型、标识是否用裸数字/裸字符串(应对齐 `templates/shared/rules/fec-typescript.md`「禁止 Magic Number / Magic String」)
+ - Is the component/page file size reasonable (it should be within **300 lines**; if it exceeds **500 lines** or is too complex, it must be split. See "Component file size" in the shared React/Vue rules)
+ - Is the naming quality good?
+ - Is there any repetitive logic that should be extracted
+ - Whether there is dead code, outdated comments or temporary hacks
+ - Whether the business status, type, and identification use bare numbers/naked strings (should be aligned with `templates/shared/rules/fec-typescript.md` "Magic Number / Magic String is prohibited")
- 7. 测试
+ 7. Test
- - 是否缺少关键测试覆盖
- - 是否存在脆弱的选择器或不稳定的测试模式
+ - Is critical test coverage missing?
+ - Is there a fragile selector or unstable test mode?
- 8. 安全
+ 8. Security
- - 无明显 XSS 风险(dangerouslySetInnerHTML / v-html 必须审查)
- - 无敏感信息硬编码
- - 无未校验的用户输入直接渲染
+ - No obvious XSS risks (dangerouslySetInnerHTML/v-html must be reviewed)
+ - No sensitive information hardcoded
+ - Direct rendering without unvalidated user input
- 9. 性能与体验证据
+ 9. Performance and experience evidence
- - 是否引入首屏重依赖、重复请求、大列表渲染或长任务
- - loading、empty、error、disabled、focus 等状态是否完整
- - 响应式布局是否有可验证断点和文本溢出保护
+ - Whether to introduce heavy dependencies on the first screen, repeated requests, large list rendering or long tasks
+ - Whether the status of loading, empty, error, disabled, focus, etc. is complete
+ - Whether the responsive layout has verifiable breakpoints and text overflow protection
- 10. 必检项(阻塞合并)
+ 10. Must-check items (blocking merge)
- - [ ] TypeScript 类型完整,无 `any`
- - [ ] 外部输入、DTO、公共类型边界无无守卫断言
- - [ ] 无 XSS 风险
- - [ ] 无敏感信息硬编码
- - [ ] 核心逻辑有单元测试
+ - [ ] TypeScript complete type, no `any`
+ - [ ] No guardless assertions for external input, DTO, and public type boundaries
+ - [ ] No XSS risk
+ - [ ] No sensitive information hardcoded
+ - [ ] Core logic has unit tests
- 11. 质量项(建议修改)
+ 11. Quality items (suggested modifications)
- - [ ] 组件文件规模符合约定(约 300 行内为佳;逾 500 行或高复杂度已拆子组件 / Hooks / Composables / utils)
- - [ ] 无重复代码(DRY 原则)
- - [ ] 无未使用的 import
+ - [ ] The size of the component file complies with the agreement (within about 300 lines is preferred; if it exceeds 500 lines or is highly complex, the sub-components/Hooks/Composables/utils have been disassembled)
+ - [ ] No duplicate code (DRY principle)
+ - [ ] No unused imports
- 12. 规范项(风格建议)
+ 12. Normative items (style suggestions)
- - [ ] 命名语义清晰
- - [ ] 注释覆盖复杂逻辑
+ - [ ] clear naming semantics
+ - [ ] comments cover complex logic
- ## 详细参考
+ ## Detailed reference
- 撰写代码评审报告时,加载 [references/report-template.md](references/report-template.md)。发现必须具体且可操作;不要写"优化性能"等空泛建议而不指出具体代码模式。
+ When writing a code review report, load [references/report-template.md](references/report-template.md). Findings must be specific and actionable; don't write general recommendations such as "optimize performance" without pointing out specific code patterns.
## Constraints
- - 不把个人风格偏好写成阻塞问题;阻塞项必须有明确用户影响、运行时风险、安全风险或维护成本证据。
- - 不在缺少 diff、文件位置或复现线索时给确定结论。
- - 深度安全、无障碍、E2E 和性能问题只做初筛;需要证据链时分流到专项 skill。
- - 同一根因不要重复报多条;合并为一条代表性发现并列出影响范围。
- - 自动化工具稳定覆盖的格式问题交给 lint/format,不作为人工评审主发现。
+ - Do not write personal style preferences as blocking issues; blocking items must have clear evidence of user impact, runtime risk, security risk, or maintenance cost.
+ - Don't give conclusions when diff, file location or reproduction clues are missing.
+ - In-depth security, accessibility, E2E and performance issues are only screened initially; when an evidence chain is needed, they will be diverted to special skills.
+ - Do not report multiple reports for the same root cause; merge them into one representative finding and list the scope of impact.
+ - Format issues that are stably covered by automated tools are handed over to lint/format and are not discovered by human reviewers.
## Expected Output
- - 分级评审报告(CRITICAL / HIGH / MEDIUM / LOW)
- - 每个问题关联具体文件和行号,附修复建议
- - 阻塞项(CRITICAL)修复前不建议合并
- - 评审报告保存为 `reports/code-review-YYYY-MM-DD-HHmmss.md`
- - 多维评审要合并重复发现,并说明已分流到哪些专项能力
- - 对不确定项标注需要的验证命令或补充上下文,不把猜测写成事实
+ - Grading review report (CRITICAL / HIGH / MEDIUM / LOW)
+ - Each problem is associated with a specific file and line number, with suggestions for repairing it.
+ - It is not recommended to merge the blocking item (CRITICAL) until it is repaired
+ - The review report is saved as `reports/code-review-YYYY-MM-DD-HHmmss.md`
+ - Multi-dimensional reviews should consolidate duplicate findings and explain which special capabilities have been diverted to
+ - Label uncertain items with required verification commands or supplementary context, and do not write guesses into facts