شعار Tailwind Best Practices

Tailwind Best Practices

مؤسسة
evilmartians
tailwind-best-practices

اكتب Tailwind CSS باتباع ممارسات تحافظ على سهولة صيانة قاعدة الشيفرة وسرعة الكتابة فيها: استخدم رموز التصميم بدلًا من القيم الاعتباطية، وأبقِ قوائم الأصناف قصيرة، واجمع الرموز دلاليًا، وأنشئ الأصناف بترتيب متسق، وتجنب @apply لاستخراج الأنماط المتكررة، واستخدم متغيرات ثابتة بدلًا من خصائص className الاعتباطية. استخدم هذه المهارة عند كتابة أصناف Tailwind أو مكوناتها أو إعداداتها أو تعديلها، وكذلك عند مراجعة مشروع Tailwind موجود أو تنظيفه أو إعادة هيكلته أو تدقيقه. لا تستخدمها لهندسة CSS العامة غير المرتبطة بـ Tailwind، أو لأدوات البناء غير المرتبطة بمخرجات CSS (مثل أدوات التجميع وتصغير JS وغيرها).

Add to TypingMind

نظرة عامة

الناشرevilmartians
المستودعagent-skills
اسم المهارةtailwind-best-practices
النجوم
52
التفريعات
8
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها evilmartians على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Tailwind Best Practices في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/evilmartians/agent-skills/tree/main/skills/tailwind-best-practices
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/evilmartians/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/tailwind-best-practices .claude/skills/tailwind-best-practices
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Tailwind Best Practices في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Tailwind Best Practices تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Tailwind Best Practices بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Tailwind CSS best practices

This skill is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups.

Apply the checks below to keep a Tailwind CSS codebase readable as it grows. Companion to https://evilmartians.com/chronicles/5-best-practices-for-preventing-chaos-in-tailwind-css.

Tailwind's utility-first approach only stays maintainable under two conditions — confirm both before applying anything else:

  1. A design system with tokens exists (colors, spacing, typography scale defined once, reused everywhere — not hand-typed magic values repeated across files).
  2. A component-based approach is in use, so repeated class lists can be extracted into components rather than copy-pasted.

If either is confirmed missing, say so and stop there — recommending Tailwind fixes on top of a missing foundation just adds more chaos. If you simply don't have enough context to tell (e.g. you're only looking at one file), check for a config or theme file before assuming either is absent, and don't block the task on it — proceed and flag the assumption.

Workflow

Each check is independently actionable.

1. Cut unnecessary utility classes

Look for shorthand before accepting a long class list:

  • pt-4 pb-4 → py-4 (same logic for px, mx, my)
  • flex flex-row justify-between → flex justify-between (flex-row is the CSS default)
  • border border-dotted border-2 border-black border-opacity-50 → border-dotted border-2 border-black/50

Every class in the list is something a future reader has to parse — fewer, denser classes read faster than more, sparser ones. Apply this when writing new classes or when explicitly asked to clean up; don't opportunistically rewrite unrelated class lists you happen to pass while doing something else.

2. Group design tokens and name them semantically

Never let tokens accumulate haphazardly. Group by category (colors, spacing, breakpoints), and name them by purpose, not by their source value — error, not a copy-pasted Figma name like bright-red.

colors: { primary, secondary, error }
spacing: { sm, md, lg }
screens: { sm, md }

Flag unused tokens too — they don't just clutter the config; they confuse anyone trying to understand what the design system actually uses. Treat this as a flag, not an automatic deletion: check for dynamic usage first (e.g. `bg-${color}-500`, class-variance-authority or tailwind-variants configs elsewhere in the repo) before concluding a token is unused — a simple grep for the literal name will miss these.

3. Keep class ordering consistent — automate it

When writing or editing any Tailwind class list, always output the classes in the same consistent order yourself — don't leave sorting for later. Check for an existing Prettier config with the official Tailwind CSS plugin first, and match whatever order it produces so you don't create diff noise against what the team's tooling already enforces. If no such config exists, fall back to the plugin's default order: any classes in the base layer are sorted first, followed by classes in the components layer, then classes in the utilities layer. Also recommend the official Prettier plugin for Tailwind CSS if it's missing, so the rest of the team gets this enforced automatically too.

4. Avoid @apply for extracting repeated styles

css
/* Avoid: */
.block {
  @apply bg-red-500 text-white p-4 rounded-lg hover:bg-blue-500;
}

This throws away Tailwind's actual advantages: no more naming classes, and style changes are no longer isolated to the component that uses them. It also increases CSS bundle size. Point to a real component instead (see prerequisite #2). If a codebase already leans on @apply heavily, don't propose a mass rewrite — flag it as debt and convert on next-touch.

5. Don't let design-system components accept arbitrary classes via props

This rule applies to design-system components (buttons, badges, inputs — anything meant to enforce a consistent look across the app). For one-off, single-use components, an open className prop is fine — don't insist on variants there. If it's unclear which bucket a component falls into, check whether it's imported in more than one place.

js
// Avoid, for a shared design-system component:
export const Button = ({ className = "bg-white" }) => (
  <button className={className}>Test</button>
);

Letting every call site invent its own utility combination for a shared component erodes visual consistency over time. Recommend a fixed variant map instead:

js
const BUTTON_VARIANTS = {
  primary: "bg-blue-500 hover:bg-blue-600 text-white",
  secondary: "bg-gray-500 hover:bg-gray-600 text-white",
};

export const Button = ({ className, variant = BUTTON_VARIANTS.primary }) => (
  <button className={clsx(className, variant)}>Test</button>
);

If the team resists fixed variants, tailwind-merge is an acceptable fallback for resolving class conflicts at runtime — but it adds bundle weight, so don't recommend it as the default.

Anti-patterns: push back on these

Refuse or explain the tradeoff instead of implementing outright:

  • Magic values in class lists (p-[123px]) when a token system exists — push the value into the token config instead.
  • One-off tokens added ad hoc (15px, 16px, 17px) instead of reusing or extending the existing scale — flag it and ask whether it should become a token, rather than refusing outright; sometimes a one-off value is genuinely correct (matching an external asset's exact dimensions, replicating a spec precisely).
  • @apply-heavy stylesheets proposed as "cleaner" — trades away Tailwind's real benefits for cosmetic tidiness.
  • Skipping minification of production CSS — check the Tailwind version first, via package.json or the lockfile. If it's v4, minification is automatic (built on Lightning CSS) and nothing needs to change. If it's v3, confirm the build's minification step is actually running, and if it isn't, recommend the user add it (--minify flag via the CLI, or cssnano in the PostCSS plugin list). If the version isn't visible from where you're working (e.g. editing a single file with no repo access), don't raise minification at all rather than guessing which branch applies.

The pattern is always the same: a shortcut that looks fine at small scale and turns into repeated find-and-replace work across the codebase later. Push toward the token/component version up front.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Tailwind Best Practices؟

اكتب Tailwind CSS باتباع ممارسات تحافظ على سهولة صيانة قاعدة الشيفرة وسرعة الكتابة فيها: استخدم رموز التصميم بدلًا من القيم الاعتباطية، وأبقِ قوائم الأصناف قصيرة، واجمع الرموز دلاليًا، وأنشئ الأصناف بترتيب متسق، وتجنب @apply لاستخراج الأنماط المتكررة، واستخدم متغيرات ثابتة بدلًا من خصائص className الاعتباطية. استخدم هذه المهارة عند كتابة أصناف Tailwind أو مكوناتها أو إعداداتها أو تعديلها، وكذلك عند مراجعة مشروع Tailwind موجود أو تنظيفه أو إعادة هيكلته أو تدقيقه. لا تستخدمها لهندسة CSS العامة غير المرتبطة بـ Tailwind، أو لأدوات البناء غير المرتبطة بمخرجات CSS (مثل أدوات التجميع وتصغير JS وغي...

لماذا تستخدم Tailwind Best Practices على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Tailwind Best Practices عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Tailwind Best Practices في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/evilmartians/agent-skills/tree/main/skills/tailwind-best-practices. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Tailwind Best Practices؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Tailwind Best Practices؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Tailwind Best Practices معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Tailwind Best Practices مجانية؟

نعم. نشرها evilmartians على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل
شعار affaan-m

Brand Discovery

affaan-m
المجتمعشائع

استخدمها عندما تحتاج علامة تجارية إلى اكتشاف هويتها أو صياغتها من خلال مقابلات منظّمة على جلسات متعددة. تغطي الغاية والتموضع والجمهور والشخصية والأسلوب والسرد والتوتر بين العلامة التجارية للمؤسس…

40.4K
270.2K
الملفات: 9
عرض
شعار affaan-m

Competitive Platform Analysis

affaan-m
المجتمعشائع

استخدمها عند تحديد نطاق المشهد التنافسي — أي تحديد المنافسين وتصنيفهم وفرزهم حسب النتائج قبل بدء أي مقارنة معيارية. تحدد من يُعد منافسًا، والفئة التي ينتمي إليها…

40.4K
270.2K
الملفات: 1
عرض
شعار affaan-m

Frontend Slides

affaan-m
المجتمعشائع

أنشئ عروض HTML تقديمية مذهلة وغنية بالرسوم المتحركة من الصفر أو بتحويل ملفات PowerPoint. استخدم هذه المهارة عندما تريد إعداد عرض تقديمي، أو تحويل PPT/PPTX إلى الويب، أو إنشاء شرائح ل…

40.4K
270.2K
الملفات: 2
عرض
شعار affaan-m

Plan Canvas

affaan-m
المجتمعشائع

افتح الخطط ومُخرَجات HTML في مساحة عمل محلية بالمتصفح، حيث يستطيع المستخدم إضافة تعليقات توضيحية إلى العناصر والدردشة والموافقة أو طلب التغييرات من دون مغادرة الصفحة. استخدمها عند عرض خطة للمراجعة، أو…

40.4K
270.2K
الملفات: 1
عرض

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇