شعار Shain Dls

Shain Dls

المجتمع
Dishain
shain-dls

Token-based design system skill for Figma + code handoff. Use whenever working with Figma components, design tokens, color variables, token migration, component creation, design-to-code handoff, or DS audits. Trigger on: design system, DS, DLS, tokens, figma variables, component spec, token naming, token hierarchy, which color to use, variant properties, theme config, dark mode. Even for "which color should I use" or "create a component" — use this skill.

نظرة عامة

الناشرDishain
المستودعShain-Design-System-Skill
اسم المهارةshain-dls
النجوم
8
التفريعات
0
الملفات المرفقة
2
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

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

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

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

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

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

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

التثبيت

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

1

التثبيت في TypingMind

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dishain/Shain-Design-System-Skill.git \
  .claude/skills/shain-dls
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Shain Design Language System (DLS)

A token-based design system for product UI work. Components use semantic tokens only — no hardcoded colors, spacing, or typography. Figma is the source of truth; code is generated or guided by Figma exports.

For the full Figma best practices reference, read references/figma-best-practices.md. For guidance on evolving the token system, read references/token-improvements.md.


1. Architecture

Three-tier token hierarchy

Primitive → Semantic → Component-specific (optional)

colors/blue/500          → #0097DB
action/primary/default   → {colors/blue/500}
button/bg/primary        → {action/primary/default}
  • Primitive — raw palette values (colors/blue/500, spacing/4, radius/md). Never referenced directly from components.
  • Semantic — purpose-named aliases (action/primary/default, text/primary, bg/surface). Components reference these.
  • Component-specific — optional per-component tokens when a component needs its own tuning knob (button/bg/primary). Use sparingly.

Sync flow

Figma Variables → figma-tokens.json → tokens/build.ts → tokens/dist/
                                                         ├── tokens.css
                                                         └── tokens.ts

Project structure

├── docs/           Documentation
├── tokens/         figma-tokens.json → CSS vars + TS
└── src/
    ├── components/ React components
    └── icons/      Figma → lucide-react catalog

2. Design principles

  1. Token-first — All visual values come from design tokens. No hardcoded colors, spacing, or typography in components.
  2. Semantic over raw — Semantic token names describe purpose, not appearance. Components reference destructive/default, not red/500.
  3. Figma as source of truth — Tokens and component specs live in Figma. Code is generated or guided by Figma exports.
  4. Mode-ready — All semantic tokens resolve through modes (Light/Dark, density, brand) so a single component definition adapts to any theme.

3. Token naming

Pattern

{category}/{purpose}/{state}
  • category — action, destructive, success, warning, info, text, bg, border, icon, overlay
  • purpose — primary, secondary, subtle, inverse, link, disabled
  • state — default, hover, pressed, focus, disabled, selected

Examples

Figma variableCSS custom property
action/primary/default--action-primary-default
action/primary/hover--action-primary-hover
destructive/default--destructive-default
text/primary--text-primary
bg/surface--bg-surface
border/default--border-default

Rules

  • Use lowercase, slashes in Figma, kebab-case as CSS vars.
  • Do not encode appearance in the name (red-hover is wrong; destructive-hover is right).
  • Stateful tokens always live at the third level (.../hover, .../pressed).
  • A token that exists on one category should exist on comparable categories (if action/primary/hover exists, so should destructive/hover).

4. Modes

Built-in modes

  • Theme: Light (default), Dark
  • Optional: Density (Comfortable, Compact), Brand (if multi-brand)

Rules

  • Every semantic token defines a value for every mode. No mode may be empty.
  • Components never branch on theme — they reference semantic tokens only.
  • Primitive collections do not need modes; modes live on the semantic layer.

Required dark-mode pairs (minimum)

SemanticLightDark
bg/canvas#FFFFFF#0B0D12
bg/surface#F7F8FA#141821
text/primary#0F1420#F2F4F8
text/secondary#4A5261#A7B0BF
border/default#E4E7EC#2A2F3A
action/primary/default#0097DB#3AB7F2

5. Component guidelines

File layout

src/components/[ComponentName]/
├── [ComponentName].tsx
├── [ComponentName].css
└── index.ts

CSS class naming (BEM-like)

  • Block: shain-[component] (e.g. shain-btn, shain-input)
  • Element: shain-[component]__[element] (e.g. shain-btn__label)
  • Modifier: shain-[component]--[modifier] (e.g. shain-btn--primary, shain-btn--sm)

Multiple modifiers combine: shain-btn shain-btn--primary shain-btn--md shain-btn--destructive.

Token usage in code

DoDon't
background-color: var(--action-primary-default)background-color: #0097DB
padding: var(--spacing-2) var(--spacing-3)padding: 8px 12px
border-radius: var(--radius-md)border-radius: 8px
color: var(--text-primary)color: #0F1420

Theme config pattern (variant styling)

For components with variants and states, use a config object instead of variant-specific CSS:

ts
enum ButtonVariant {
  Primary = "primary",
  Secondary = "secondary",
}

const theme = {
  [ButtonVariant.Primary]: {
    base:     ["--action-primary-default",  "--action-primary-default",  "--text-inverse"],
    hover:    ["--action-primary-hover",    "--action-primary-hover",    "--text-inverse"],
    pressed:  ["--action-primary-pressed",  "--action-primary-pressed",  "--text-inverse"],
    disabled: ["--action-disabled",         "--border-default",          "--text-disabled"],
  },
  [ButtonVariant.Secondary]: {
    base:     ["--bg-surface",              "--border-default",          "--action-primary-default"],
    hover:    ["--bg-surface-hover",        "--border-default",          "--action-primary-hover"],
    pressed:  ["--bg-surface-pressed",      "--border-default",          "--action-primary-pressed"],
    disabled: ["--bg-surface",              "--border-default",          "--text-disabled"],
  },
};
// Apply via CSS variables: --cmp-bg, --cmp-border, --cmp-color

Component anatomy

Interactive components support: variants (primary, secondary, outline, ghost, link), sizes (sm, md, lg, icon), states (default, hover, focus, pressed, disabled, loading).

Non-interactive components (e.g. Badge): no hover states or transitions, cursor: default.

Variant properties in Figma

Keep variant properties to 2–3 maximum. In exceptional cases 4 is acceptable with justification. Use boolean properties for optional elements (icons, badges) and instance swap for swappable elements.

Good — 9 variants + flexible toggles:
  Variant: Size (sm, md, lg) × Type (primary, secondary, outline)
  Boolean: Show Leading Icon, Show Trailing Icon
  Instance swap: Icon

Bad — 864 variants:
  Size (4) × Color (6) × Icon Position (3) × State (4) × Alignment (3)

Props convention

  • TypeScript interfaces with explicit types
  • Support className and spread remaining HTML attributes
  • forwardRef for form elements and focusable components
  • Default values match the most common use case

Icons

  • Use lucide-react
  • Accept LucideIcon type for icon props
  • Icon size: 16px inline with text; use tokens if a size scale exists
  • Catalog: src/icons/iconCatalog.ts maps Figma names → Lucide components

6. Accessibility

  1. Focus — :focus-visible for keyboard focus; avoid focus ring on mouse click.
  2. Disabled — disabled on interactive elements; aria-disabled only as fallback.
  3. Loading — aria-busy="true" when appropriate.
  4. Labels — All form controls have associated labels (visible or aria-label).
  5. Keyboard — Tab, Enter, Space, Escape for dropdowns/modals.
  6. Touch targets — Minimum 44×44px.
  7. Contrast — 4.5:1 for text, 3:1 for UI elements, verified in both Light and Dark.

7. Typography

  • Font family: sans-serif (configurable per brand)
  • Weights: 400 (normal), 600 (medium), 700 (bold)
  • Sizes: text/xs (12px) through text/3xl (32px)
  • Line heights: leading/1 (16px) through leading/6 (40px)

8. Spacing & Radius

Spacing scale:

TokenValue
spacing/00px
spacing/0.52px
spacing/14px
spacing/28px
spacing/312px
spacing/416px
spacing/520px
spacing/624px

Radius scale:

TokenValue
radius/none0px
radius/xs2px
radius/sm4px
radius/md8px
radius/lg12px
radius/xl24px
radius/full9999px

9. Anti-patterns

  1. Absolute positioning instead of auto layout — Always use auto layout with spacing tokens.
  2. Too many variants — 100+ variants means booleans and instance swaps are underused.
  3. Hardcoded values — Any raw hex, px value, or magic number should be a token reference.
  4. Appearance-based names — red-hover, blue-bg leak visuals into purpose names.
  5. Components referencing primitives — Primitives are internal; components reference semantic tokens.
  6. Unnamed layers — "Frame 123" is unacceptable. Name every layer by purpose.
  7. No component docs — Every component needs a doc from the template.
  8. Mixing presentation and content — Separate structural layers from content layers.
  9. Componentizing everything — Only reusable, consistent, interactive, or coded elements.
  10. Ignoring accessibility in Figma — 44×44px targets, contrast ratios, focus states.
  11. Deep nesting — Maximum 3 levels (e.g., Card → Button → Icon).
  12. Detached instances — Always use main component references inside other components.

10. Checklists

Figma-side (before handoff)

Structure: auto layout, descriptive layer names, ≤3 nesting levels, main component refs, proper constraints.

Properties: 2–3 variant props, booleans for optional elements, text props for content, instance swap for icons, sensible defaults.

Tokens: all fills use semantic variables (no hex), spacing variables, text styles, effect styles, no magic numbers. No primitive references from component layers.

States: default, hover, pressed/active, disabled, focus (keyboard).

Testing: works at different sizes, short/long content, no overflow, Light and Dark mode both pass contrast checks.

Code-side (new components)

  • All colors: var(--semantic-token-name) — never primitives
  • Variant colors via theme config
  • All spacing: var(--spacing-N)
  • All typography: var(--text-*) / var(--leading-*)
  • Border radius: var(--radius-*)
  • CSS classes: shain-[component] naming
  • TypeScript typed props
  • forwardRef for focusable elements
  • :focus-visible styles
  • Component doc from template

11. AI workflow for component generation

When generating components from Figma:

  1. Read component spec — Variants, sizes, states from Figma.
  2. Map to semantic tokens — Every fill, stroke, text, padding, radius, gap maps to a semantic token (never a primitive).
  3. Use the theme config pattern for variants with multiple states.
  4. Follow component guidelines — BEM naming (shain-*), forwardRef, accessibility.
  5. Verify both modes — Component must pass contrast in Light and Dark.
  6. Add changelog entry to the component doc.

Reference files

Read these when you need deeper context:

FileWhen to read
references/figma-best-practices.mdBuilding/reviewing Figma components, design tokens architecture, platform-specific guidelines (iOS/Android/Web), export settings
references/token-improvements.mdPlanning token system changes, adding new tokens, restructuring collections, brand expansion

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

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

ماذا تفعل مهارة الذكاء الاصطناعي Shain Dls؟

Token-based design system skill for Figma + code handoff. Use whenever working with Figma components, design tokens, color variables, token migration, component creation, design-to-code handoff, or DS audits. Trigger on: design system, DS, DLS, tokens, figma variables, component spec, token naming, token hierarchy, which color to use, variant properties, theme config, dark mode. Even for "which color should I use" or "create a component" — use this skill.

لماذا تستخدم Shain Dls على TypingMind؟

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

كيف أثبّت Shain Dls في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/Dishain/Shain-Design-System-Skill/tree/main. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Shain Dls؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Shain Dls؟

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

هل مهارة الذكاء الاصطناعي Shain Dls مجانية؟

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

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

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

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

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

عرض الكل

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

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