All skills
langgenius avatar

/frontend-code-review

@dde1d50
by langgeniuslanggenius/dify158k stars
24,861

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.

Use this Skill: https://skilld.dev/gh/langgenius/dify/frontend-code-review

This session only. Nothing lands on disk.

referencesperformance.md

≈805 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Performance Rules

Review performance only where there is realistic impact. Do not request memo, useMemo, useCallback, virtualization, or caching as style preferences.

Async Waterfalls

Flag:

  • Awaiting remote feature flags or fetches before checking cheap synchronous conditions.
  • Sequential awaits for independent operations.
  • API routes or server components starting requests late when they could start early.
  • Nested per-item fetches running serially when each item can fetch in parallel.
  • Suspense boundaries that force the whole page to wait when a lower boundary could stream or isolate loading.

Prefer Promise.all for independent work and branch-local awaits for conditionally needed data.

Bundle Size

Flag:

  • Barrel imports from heavy libraries or @langgenius/dify-ui.
  • Dynamic paths that prevent static trace analysis.
  • Heavy components loaded eagerly when hidden behind a dialog, tab, command, or feature activation.
  • Analytics, logging, editor, visualization, or third-party SDK code loaded before it is needed.
  • Feature-local optional modules imported at top level only for rare flows.

Use direct imports and next/dynamic where the user-visible path benefits.

Server Rendering

Flag:

  • Request-specific mutable state stored at module scope in SSR/RSC paths.
  • Large duplicate data serialized across RSC/client boundaries.
  • Static I/O repeated per request when it could be hoisted safely.
  • Cross-request cache without a bounded invalidation strategy.
  • Server actions lacking API-route-equivalent auth checks.

Use request-scoped deduplication such as React.cache() when repeated server reads in one request are the problem.

Re-rendering

Flag:

  • Effects or subscriptions reading broad state when a derived boolean or narrower selector is enough.
  • Components defined inside components.
  • Derived rendering state stored in state/effects.
  • Non-primitive default props recreated for memoized children.
  • Expensive work recalculated on every render where it affects real interaction cost.
  • High-frequency transient values stored in state when refs or CSS variables would avoid render loops.

Do not flag simple primitive expressions wrapped or not wrapped in useMemo; prefer no memo for simple work.

Require stable object/array/function identity only when:

  • The child is memoized and identity affects renders.
  • The value is an effect/query dependency.
  • A library API requires stable references.
  • Profiling or local behavior shows avoidable re-rendering.

DOM, Lists, And Rendering

Flag:

  • Layout reads in render (getBoundingClientRect, offset*, scrollTop).
  • Interleaved DOM reads/writes that can cause layout thrashing.
  • Large lists rendering without virtualization, pagination, or content-visibility.
  • SVG/animation code animating expensive properties when transform/opacity would work.
  • transition-all.
  • Long-running non-critical browser work performed immediately instead of idle/deferred scheduling.

React Flow

Use Dify invariants for React Flow node/edge consumption and provider availability in RAG Pipe template rendering. Callback-only reads or mutations can use useStoreApi.

Source: SKILL.md on GitHub

2 warnings9d5 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill provides a structured framework for conducting frontend code reviews, specifically focusing on accessibility, component architecture, data query contracts, and performance. It references official guidelines from a well-known organization (Vercel) and shows no signs of malicious intent, credential exfiltration, or unauthorized command execution.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    4 files scanned · No issues

  • ZeroLeaks5mo

    1 finding · Score: 69/100

Signed by skilld at dde1d50. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 4 weeks ago

README badge

README badge for langgenius/dify/frontend-code-review

Reviews Dify frontend code in `web/` and `packages/dify-ui/` for correctness, accessibility, component design, dify-ui primitive usage, data/query contracts, performance, and tests. Targets React, Next.js, and TypeScript frontend files, with support for pending-change, file-focused, and diff-based reviews against local contracts and Web Interface Guidelines.

Generated from the current SKILL.md.

What code does this skill review?
Frontend code under `web/`, `packages/dify-ui/`, and frontend-adjacent TypeScript files. It does not review backend code under `api/` — use `backend-code-review` for that.
What review modes does this skill support?
Pending-change review (staged and working-tree diffs), file-focused review (explicitly named files or paths), and diff/snippet review (pasted diffs with best-effort references).
Does this skill check accessibility?
Yes. It applies accessibility rules from Web Interface Guidelines, Dify UI primitives, and MDN, covering semantic HTML, focus, keyboard navigation, disabled states, and long-content behavior.
Will this skill review my tests?
Yes, it includes frontend test review rules. For deeper testing guidance or test implementation, see the `frontend-testing` skill.
Does this skill require local context?
Yes. It reads local contracts like `web/AGENTS.md`, `packages/dify-ui/AGENTS.md`, overlay docs, and component guidelines before finalizing findings. It also fetches the latest Web Interface Guidelines from Vercel Labs.

Generated from the current SKILL.md. These answers refresh after source changes.