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.

referencescode-quality.md

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

Code Quality Rules

Scope Control

Flag changes that expand beyond the requested feature or review scope:

  • Repo-wide cleanup mixed into a targeted fix.
  • Compatibility exports, aliases, shims, or wrapper layers added without an explicit migration requirement.
  • Shared abstractions created before there is stable cross-feature reuse.
  • Business components moved into generic shared locations without a clear ownership boundary.

TypeScript

Flag:

  • any or broad Record<string, any> where generated/API types or local domain types exist.
  • Re-declared API shapes instead of importing generated or returned types.
  • Weak route/query param typing that leaks string | string[] | undefined deep into components.
  • Runtime wrappers added only to satisfy TypeScript when a narrower type boundary would preserve the existing runtime shape.

Prefer:

  • Explicit domain names that match the API contract.
  • Type narrowing at route/API boundaries.
  • Small conversion helpers colocated with the component that needs them.

Styling

For Dify UI/Base UI state styling and callback composition, apply the package's Styling contract, including its documented reasons for direct state access.

Flag:

  • New CSS modules or ad hoc CSS when Tailwind utilities and Dify tokens cover the need.
  • Component-level plain .css files or component CSS imported through globals.css; use scoped *.module.css only when Tailwind and component variants cannot express the style.
  • Generic color utilities where Dify semantic tokens exist.
  • Hardcoded magic class values for colors, spacing, radius, shadow, z-index, or typography when Dify tokens, component variants, or standard Tailwind radius classes match the required design value. Apply Styling when choosing radius classes.
  • ! important modifiers or important CSS overrides without a narrow, documented reason.
  • Manual class-list assembly through string concatenation, template strings, array .join(' '), or a custom conditional combiner instead of cn(...). Conditional values passed to cn(...) remain valid.
  • Incoming className placed before default classes in cn(...), preventing call-site overrides.
  • Arbitrary z-index or one-off layering fixes on overlays.

Use:

  • cn(...) from the local package or utility already used by the file.
  • Dify semantic tokens and Tailwind v4 utilities.
  • Existing component variants before one-off class forks.
  • Component-level variants, semantic tokens, and normal cascade/order before ! overrides. Use ! only for a contained compatibility override that cannot be expressed through the component API or local selector structure.

Imports

Flag:

  • Barrel imports from @langgenius/dify-ui; consumers must use subpath exports.
  • New overlay imports from legacy @/app/components/base/modal, dialog, or drawer.
  • Cross-feature imports that bypass explicit top-level public files.
  • Direct imports from generated/internal implementation files when a feature contract already exposes the intended surface.

Copy And i18n

Flag:

  • User-facing hardcoded strings in web/.
  • Added or renamed i18n keys that are not present in every supported locale file for the touched namespace.
  • Translation namespace drift, especially using unrelated module namespaces for local feature copy.
  • Generic button labels like Continue where the action is specific.
  • Error messages that state only the failure and not the next step.

Use feature-local translation keys by default. Alias only when crossing namespaces. pnpm i18n:check --file <name> should pass for any touched translation namespace.

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 20 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.