Frontend Code Review

作者 langgenius2b65f0e89309无许可证157K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Use only when the user explicitly requests a review or audit of frontend code under `web/` or `packages/dify-ui/`. Supports pending-change, file-focused, and pasted-diff reviews. Do not use for implementation-only requests, diagnosis without review intent, or backend-only code.

AI 生成的概览

审查 web/ 或 packages/dify-ui/ 下的前端代码,找出缺陷与契约违规,并按严重程度输出发现。

功能
该技能对 web/ 与 packages/dify-ui/ 路径下的前端代码执行审查或审计,支持待提交变更、指定文件以及粘贴的 diff 三种范围。它先确定审查范围,阅读改动行与相关的 AGENTS.md,再按需查阅无障碍、Dify UI、组件架构、数据与查询契约、测试、性能、运行时不变式及代码质量等参考包。产出按严重程度(P0 至 P3)排序的发现,每条包含文件与行号、观察到的失败或项目规则,以及具体的修复方向。该技能仅为说明文档,不附带脚本。
适用场景
当用户明确要求审查或审计 web/ 或 packages/dify-ui/ 下的前端代码时使用。它支持待提交变更、指定文件和粘贴 diff 的审查。不适用于仅要求实现、没有审查意图的诊断,或仅涉及后端的代码。
运行要求
除智能体外无需任何脚本或软件包。该技能会读取随附的参考文件,并可能查阅项目文件,如 packages/dify-ui/README.md、AGENTS.md、docs/overlays.md 和 web/docs/test.md;当本地参考无法确定某项行为时,还会查阅当前官方文档。

Frontend Code Review

Review the requested scope for concrete defects and violations of explicit project contracts. This skill owns review decisions; its references route to canonical rules without activating another skill's implementation workflow.

Evidence First

  1. Establish the review scope from the requested files or current diff.
  2. Read the changed lines, their behavior owner, and the nearest scoped AGENTS.md.
  3. Trace public consumers, generated contracts, primitive APIs, or runtime configuration only when they decide correctness.
  4. Report findings tied to an observable failure, violated contract, security boundary, or demonstrated maintenance risk. Explicit team conventions are contracts: establish their scope and exceptions, and do not invent user impact to justify a convention finding.

Rule Routing

Read only the packs matched by the diff:

  • DOM semantics, focus, keyboard, forms, disabled state, or visible interaction: references/accessibility-ui.md [blocked]
  • Dify UI imports, Base UI wrappers, overlays, tokens, or primitive contracts: references/dify-ui.md [blocked]
  • Component ownership, props, state, Effects, navigation, or module boundaries: references/component-architecture.md [blocked]
  • Generated clients, Query, mutations, auth, SSR, URL state, or persistence: references/data-query-contracts.md [blocked]
  • Test files or a concrete missing-regression-test finding: references/testing.md [blocked]
  • Bundle, waterfall, rendering, or subscription cost supported by evidence: references/performance.md [blocked]
  • Stable Dify runtime invariants in the named paths: references/dify-invariants.md [blocked]
  • General TypeScript or styling quality not owned above: references/code-quality.md [blocked]

Read packages/dify-ui/README.md, packages/dify-ui/AGENTS.md, packages/dify-ui/docs/overlays.md, or web/docs/test.md only when the reviewed code falls under that contract. Check current official documentation when local code and bundled references do not settle a framework, browser, or accessibility behavior.

Severity And Output

  • P0: security or privacy leak, data loss, production crash, or inaccessible critical workflow.
  • P1: user-visible regression, invalid API or authorization contract, hydration failure, or broken primary interaction.
  • P2: concrete maintainability, performance, test, or accessibility defect, or a material violation of an explicit project contract.
  • P3: minor actionable cleanup; omit unless the user requested a thorough audit.

Lead with findings ordered by severity. Include a tight file and line reference, the observed failure or applicable project rule, and a concrete fix direction. Explain the rule's applicability for convention findings; describe downstream consequences only when supported by evidence. When no findings remain, say so briefly and state any material verification gap. Do not add praise sections, speculative risks, or an unsolicited offer to implement fixes.

来源与署名

来源:langgenius/dify位于.agents/skills/frontend-code-review提交2b65f0e

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架