frontend-code-review
langgenius/dify
Review Dify frontend code for correctness, accessibility, component design, and performance.
What is frontend-code-review?
Audits TypeScript/React frontend code in the Dify web and dify-ui packages for accessibility, component architecture, data/query contracts, performance, and test coverage. Use it when reviewing staged changes, specific files, or code snippets in frontend contexts.
- Inspects pending changes, file-focused reviews, and diff/snippet reviews for frontend code
- Checks accessibility, semantic HTML, focus management, keyboard navigation, and ARIA compliance
- Validates Dify UI primitive usage, component ownership, props, state, and effect patterns
- Reviews TanStack Query contracts, workspace/auth boundaries, and data flow correctness
- Analyzes React/Next.js performance risks including memoization, bundle impact, and waterfall patterns
- Verifies test coverage for risky behavior and frontend test best practices
How to install frontend-code-review
npx skills add null --skill frontend-code-review- Access to the Dify repository with `web/`, `packages/dify-ui/`, and local contract files (AGENTS.md, overlay.md, test.md)
- Familiarity with React, TypeScript, TanStack Query, and Dify UI component library
- Git access to inspect pending changes and diffs
How to use frontend-code-review
- 1.Identify the review scope: pending changes, specific files, or code snippets
- 2.Read relevant local contracts: web/AGENTS.md, dify-ui/README.md, overlay.md, and test.md as needed
- 3.Provide the code, diff, or file paths to review
- 4.The skill will apply rule packs for accessibility, dify-ui usage, component architecture, data contracts, performance, testing, and code quality
- 5.Review findings are reported by severity (P0–P3) with file locations and concrete fix suggestions
Use cases
- Review staged frontend changes before committing to catch regressions and design-system drift
- Audit a new React component for accessibility and correct use of dify-ui primitives
- Inspect data-fetching logic to ensure TanStack Query contracts and auth boundaries are respected
- Analyze performance impact of a refactor affecting component memoization or bundle size
- Validate keyboard navigation and focus behavior in a complex overlay or form component
- Frontend engineers working on Dify web or dify-ui packages
- Code reviewers auditing React/TypeScript changes for accessibility and correctness
- Developers implementing new UI components or refactoring existing ones
- Teams ensuring compliance with Dify design tokens, overlay patterns, and component contracts
frontend-code-review FAQ
Use frontend-code-review for code under `web/`, `packages/dify-ui/`, or frontend-adjacent TypeScript. Use backend-code-review for code under `api/` or backend-only logic.
The skill supports diff/snippet review on a best-effort basis, but will ask you to provide relevant local contracts (AGENTS.md, overlay.md, etc.) or nearby file context if needed to verify ownership and correctness.
It reviews styling for design-system drift, token usage, and maintainability, but focuses primarily on accessibility, component structure, and data flow. For deep CSS audits, pair it with manual inspection or a linting tool.
P0 = security/auth leak, data loss, crash, or broken critical flow. P1 = user-visible regression, hydration failure, or serious a11y issue. P2 = maintainability or performance risk. P3 = minor cleanup (omitted unless requested).
By default, it reports findings with concrete fix directions. It will not apply fixes unless you explicitly ask for review plus implementation.
Full instructions (SKILL.md)
Source of truth, from langgenius/dify.
name: frontend-code-review
description: Review Dify frontend code for correctness, accessibility, component design, dify-ui usage, data/query boundaries, performance, and tests. Trigger for .tsx, .ts, .js, UI, React, Next.js, pending-change, or focused frontend review requests.
Frontend Code Review
When To Use
Use this skill when the user asks to review, audit, analyze, or sanity-check frontend code under web/, packages/dify-ui/, or frontend-adjacent TypeScript files.
Supported modes:
- Pending-change review: inspect staged and working-tree changes.
- File-focused review: inspect explicitly named files or paths.
- Diff/snippet review: review pasted diffs or snippets using best-effort references.
Do not use this skill for backend-only code under api/; use backend-code-review instead.
Required Context
Before reviewing, read the relevant local contracts:
web/AGENTS.mdfor Dify frontend workflow, overlays, design tokens, state, and tests.packages/dify-ui/README.mdandpackages/dify-ui/AGENTS.mdwhen code uses or changes@langgenius/dify-ui/*.web/docs/overlay.mdwhen reviewing dialogs, drawers, popovers, tooltips, menus, selects, comboboxes, or other floating UI.web/docs/test.mdand thefrontend-testingskill when reviewing tests or testability.karpathy-guidelinesfor scope control and focused, verifiable changes.how-to-write-componentwhen reviewing React component structure, ownership, effects, query/mutation contracts, or memoization.
For any UI, UX, or accessibility review, fetch the latest Web Interface Guidelines before finalizing findings. Treat them as a required baseline, not the complete source of accessibility truth:
https://raw.githubusercontent.com/vercel-labs/web-interface-guidelines/main/command.md
If the review depends on a current framework, SDK, browser API, or accessibility behavior and local code does not settle it, check the current official docs first. For browser compatibility, deprecation, or behavior-sensitive frontend APIs, verify MDN or the relevant standard.
Rule Packs
Apply every relevant rule pack:
- references/accessibility-ui.md — accessibility, semantic HTML, focus, forms, keyboard, disabled states, copy, and long-content behavior. Combines Web Interface Guidelines with Dify UI, Base UI, MDN, and local primitive contracts.
- references/dify-ui.md — Dify UI primitive usage, Base UI semantics, overlays, forms, tokens, radius mapping, and primitive boundaries.
- references/component-architecture.md — component ownership, props, state, effects, exports, wrappers, and feature organization.
- references/data-query-contracts.md — generated contracts, TanStack Query, mutations, workspace/auth/SSR boundaries, URL/local storage state.
- references/performance.md — React/Next performance review rules from Vercel guidance, scoped to real risk.
- references/testing.md — frontend test review rules.
- references/dify-invariants.md — stable Dify-specific runtime invariants that generic React/a11y rules will not catch.
- references/code-quality.md — general TypeScript, styling, naming, and maintainability rules.
Review Process
- Identify the review scope. For pending changes, inspect
git diff --stat,git diff, and staged diff if relevant. For file-focused reviews, stay within the named files unless a referenced owner/contract must be read. - Read code around the changed lines and the owning module. Do not review by isolated snippets when nearby ownership, labels, query inputs, or overlay structure decide correctness.
- Check user-visible regressions first: accessibility, broken interaction, auth/permission leaks, query/hydration errors, data loss, navigation mistakes, and impossible states.
- Then check maintainability and performance: ownership, effects, wrappers, memoization, bundle/waterfall risks, tests, and design-system drift.
- Report only actionable findings. Do not list speculative risks, style preferences, or broad refactors unless they are directly tied to a reproducible issue in scope.
Severity
- P0: security/privacy/auth leak, data loss, production crash, inaccessible critical flow, or broken primary workflow.
- P1: user-visible regression, hydration/SSR failure, invalid API/query contract, broken keyboard/focus behavior, or serious design-system/a11y violation.
- P2: maintainability or performance issue likely to cause bugs, duplicated state, incorrect ownership, missing tests for risky behavior, or non-critical a11y issue.
- P3: minor cleanup with clear value. Omit unless the user asked for a thorough audit.
Output Format
Lead with findings, ordered by severity. Use this structure:
## Findings
- [P1] Short issue title
File: `path/to/file.tsx:123`
Why it matters and how to reproduce or reason about it.
Suggested fix: concrete fix direction.
## Open Questions
- Question or assumption, if any.
## Summary
Brief secondary context. Mention tests not run or residual risk.
Rules:
- If there are no findings, say
No issues found.and mention any test gaps or residual risk. - Always include file and line when available.
- Keep findings concrete and reproducible.
- Do not include praise sections by default.
- Do not ask to apply fixes unless the user explicitly wants review plus implementation.
Related skills
More from langgenius/dify and the wider catalog.
frontend-testing
Generate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities.
orpc-contract-first
Guide for implementing oRPC contract-first API patterns in Dify frontend. Trigger when creating or updating contracts in web/contract, wiring router composition, integrating TanStack Query with typed contracts, migrating legacy service calls to oRPC, or deciding whether to call queryOptions directly vs extracting a helper or use-* hook in web/service.
backend-code-review
Review backend code for quality, security, maintainability, and best practices.
component-refactoring
Refactor high-complexity React components in Dify frontend using extraction patterns and automated analysis.

trading-quant
量化交易数据分析工具。A股/美股/港股/贵金属实时行情,多维度评分(技术面+资金面+基本面),涨跌停池,北向资金,分钟级资金流。Use when: (1) 查询任何股票实时行情和评分, (2) 分析A股涨跌停异动, (3) 查看北向资金流向, (4) 美股港股贵金属行情, (5) 全球市场概览, (6) 个股资金流分析。

lieflat-charts
Template-driven data visualization and report generation for HTML charts and multi-language reports with automatic color selection.