From d3ae074456030556e2b51ef2478065c9bc88bcb0 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Tue, 19 May 2026 21:16:10 +0800 Subject: [PATCH] chore(web): remove generic tailwind skill (#36402) --- .../skills/how-to-write-component/SKILL.md | 2 +- .agents/skills/tailwind-css-rules/SKILL.md | 367 ------------------ 2 files changed, 1 insertion(+), 368 deletions(-) delete mode 100644 .agents/skills/tailwind-css-rules/SKILL.md diff --git a/.agents/skills/how-to-write-component/SKILL.md b/.agents/skills/how-to-write-component/SKILL.md index ac77112993..55ad08941c 100644 --- a/.agents/skills/how-to-write-component/SKILL.md +++ b/.agents/skills/how-to-write-component/SKILL.md @@ -12,7 +12,7 @@ Use this as the decision guide for React/TypeScript component structure. Existin - Search before adding UI, hooks, helpers, or styling patterns. Reuse existing base components, feature components, hooks, utilities, and design styles when they fit. - Group code by feature workflow, route, or ownership area: components, hooks, local types, query helpers, atoms, constants, and small utilities should live near the code that changes with them. - Promote code to shared only when multiple verticals need the same stable primitive. Otherwise keep it local and compose shared primitives inside the owning feature. -- Use Tailwind CSS v4.1+ rules via the `tailwind-css-rules` skill. Prefer v4 utilities, `gap`, `text-size/line-height`, `min-h-dvh`, and avoid deprecated utilities and `@apply`. +- Follow Dify's CSS-first Tailwind v4 contract from `packages/dify-ui/README.md` and `packages/dify-ui/AGENTS.md`. Prefer design-system tokens, utilities, and radius mappings over generic Tailwind guidance. ## Ownership diff --git a/.agents/skills/tailwind-css-rules/SKILL.md b/.agents/skills/tailwind-css-rules/SKILL.md deleted file mode 100644 index 3528548036..0000000000 --- a/.agents/skills/tailwind-css-rules/SKILL.md +++ /dev/null @@ -1,367 +0,0 @@ ---- -name: tailwind-css-rules -description: Tailwind CSS v4.1+ rules and best practices. Use when writing, reviewing, refactoring, or upgrading Tailwind CSS classes and styles, especially v4 utility migrations, layout spacing, typography, responsive variants, dark mode, gradients, CSS variables, and component styling. ---- - -# Tailwind CSS Rules and Best Practices - -## Core Principles - -- **Always use Tailwind CSS v4.1+** - Ensure the codebase is using the latest version -- **Do not use deprecated or removed utilities** - ALWAYS use the replacement -- **Never use `@apply`** - Use CSS variables, the `--spacing()` function, or framework components instead -- **Check for redundant classes** - Remove any classes that aren't necessary -- **Group elements logically** to simplify responsive tweaks later - -## Upgrading to Tailwind CSS v4 - -### Before Upgrading - -- **Always read the upgrade documentation first** - Read https://tailwindcss.com/docs/upgrade-guide and https://tailwindcss.com/blog/tailwindcss-v4 before starting an upgrade. -- Ensure the git repository is in a clean state before starting - -### Upgrade Process - -1. Run the upgrade command: `npx @tailwindcss/upgrade@latest` for both major and minor updates -2. The tool will convert JavaScript config files to the new CSS format -3. Review all changes extensively to clean up any false positives -4. Test thoroughly across your application - -## Breaking Changes Reference - -### Removed Utilities (NEVER use these in v4) - -| ❌ Deprecated | ✅ Replacement | -| ----------------------- | ------------------------------------------------- | -| `bg-opacity-*` | Use opacity modifiers like `bg-black/50` | -| `text-opacity-*` | Use opacity modifiers like `text-black/50` | -| `border-opacity-*` | Use opacity modifiers like `border-black/50` | -| `divide-opacity-*` | Use opacity modifiers like `divide-black/50` | -| `ring-opacity-*` | Use opacity modifiers like `ring-black/50` | -| `placeholder-opacity-*` | Use opacity modifiers like `placeholder-black/50` | -| `flex-shrink-*` | `shrink-*` | -| `flex-grow-*` | `grow-*` | -| `overflow-ellipsis` | `text-ellipsis` | -| `decoration-slice` | `box-decoration-slice` | -| `decoration-clone` | `box-decoration-clone` | - -### Renamed Utilities - -Use the v4 name when migrating code that still carries Tailwind v3 semantics. Do not blanket-replace existing v4 classes: classes such as `rounded-sm`, `shadow-sm`, `ring-1`, and `ring-2` are valid in this codebase when they intentionally represent the current design scale. - -| ❌ v3 pattern | ✅ v4 pattern | -| ------------------- | -------------------------------------------------- | -| `bg-gradient-*` | `bg-linear-*` | -| old shadow scale | verify against the current Tailwind/design scale | -| old blur scale | verify against the current Tailwind/design scale | -| old radius scale | use the Dify radius token mapping when applicable | -| `outline-none` | `outline-hidden` | -| bare `ring` utility | use an explicit ring width such as `ring-1`/`ring-2`/`ring-3` | - -For Figma radius tokens, follow `packages/dify-ui/AGENTS.md`. For example, `--radius/xs` maps to `rounded-sm`; do not rewrite it to `rounded-xs`. - -## Layout and Spacing Rules - -### Flexbox and Grid Spacing - -#### Always use gap utilities for internal spacing - -Gap provides consistent spacing without edge cases (no extra space on last items). It's cleaner and more maintainable than margins on children. - -```html - -
Text with separate line height
-Text with named line height
- - -Text with line height modifier
-Text with specific line height
-``` - -### Font Size Reference - -Be precise with font sizes - know the actual pixel values: - -- `text-xs` = 12px -- `text-sm` = 14px -- `text-base` = 16px -- `text-lg` = 18px -- `text-xl` = 20px - -## Color and Opacity - -### Opacity Modifiers - -**Never use `bg-opacity-*`, `text-opacity-*`, etc.** - use the opacity modifier syntax: - -```html - -Small shadow with opacity
-``` - -### Masking (v4.1) - -Use the new composable mask utilities for image and gradient masks: - -```html - -