react-container-presentation-component
ما الذي تفعله
تنشئ هذه المهارة مكونات برمجية لموقع أو تطبيق مبني بـ React. تساعد على تنظيم الكود باتباع نمط محدد يسمى « الحاوية/العرض ».
متى تستخدمها
- ✓عندما تريد إنشاء مكون برمجي جديد في مشروع React.
- ✓عندما تحتاج إلى تنظيم كود مشروعك وفق نمط محدد.
- ✓عندما تريد التأكد من أن الكود يتبع قواعد التنظيم والتنسيق المحددة.
رابط المهارة
https://github.com/github/awesome-copilot/blob/main/skills/react-container-presentation-component/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ مكون React باسم « UserProfile » بنمط الحاوية والعرض، وصنّفه كـ « ui ».”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تحدد اسم المكون وما إذا كان للواجهة « ui » أو للميزات « features ». ثم تنشئ المهارة الملفات اللازمة، مع الالتزام بتنظيم المشروع وقواعد التنسيق فيه.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Container/Presentation Component
Use this skill to create a React component under src/components that follows the Container/Presentation pattern.
Refer to this skill's bundled references for detailed rules.
references/component-architecture.mdreferences/typescript-and-scss-rules.md
If the /react-container-presentation-component input is incomplete, ask questions first before creating files.
When To Use
- When the user runs
/react-container-presentation-component - When the user explicitly asks for a React component that follows the Container/Presentation pattern
- When the user wants help deciding or implementing
uivsfeaturesclassification within the Container/Presentation pattern
Required Questions
If any of the following information is missing, ask the user using ask_user.
- Component name
- Type (
uiorfeatures) - Whether to replace existing components (only when creating
ui)
Question requirements:
- Provide the type as options (
ui,features) - Require the component name to be in PascalCase
- For
ui, ask whether direct usage of Mantine or other UI libraries in existingfeaturesshould be replaced with the new component
Procedure
- Check existing components
- Check whether
src/components/ui/<ComponentName>orsrc/components/features/<ComponentName>already exists. - If it exists, do not overwrite; confirm the preferred approach with the user.
- Decide target directory
ui:src/components/ui/<ComponentName>features:src/components/features/<ComponentName>
- Re-check classification (only when
uiis specified)
- Even when
uiis specified, before creating files, reviewReclassification Ruleinreferences/component-architecture.md. - If the implementation includes state management, side effects, async processing, context/store updates, or business logic, treat it as
features. - If the result is closer to
features, do not proceed asui; useask_userand confirm one of the following before continuing.Create as featuresKeep ui and move state/logic to parent or features
- Create required files
ui:index.tsx,index.module.scss,index.stories.tsxfeatures:index.tsx,use<ComponentName>.tsx,presentation.tsx,types.ts,presentation.module.scss,presentation.stories.tsx
- Replace existing usages (only when creating
ui)
- Only when the user approves, replace equivalent direct implementations using Mantine or other UI libraries in existing
featureswith the newuicomponent.
- Validate
- Run build and lint commands, and ensure both pass; if issues are introduced by newly added or updated files, fix them.
- Follow
Storybook Minimuminreferences/component-architecture.mdfor story state decisions. - Ask the user via
ask_userwhether to run a Storybook check (for example: "Run" / "Skip for now"). - Run
npm run storybookonly if the user selects "Run". - If the user selects "Skip for now", explicitly mention in the final report that Storybook execution was skipped.
Output Contract
- Report the list of files created.
- If replacements were performed, report the list of changed files and replacement details.
- Provide one usage example of the created component.
- Report whether Storybook verification was executed (run/skip), and if run, include the command used.
- Explain why the component was classified as
uiorfeatures. - Summarize where state, side effects, and rendering responsibilities were placed.
- Confirm whether there were any dependency direction violations.
- Clearly state any unresolved items.
الأسئلة الشائعة
ما هو نمط الحاوية والعرض؟
هو طريقة لتنظيم الكود يتولى فيها مكون « الحاوية » المنطق والبيانات، بينما يتولى مكون « العرض » فقط طريقة عرض الأشياء على الشاشة.
ما المقصود بـ « ui » و« features »؟
مكونات « ui » للمظهر فقط، مثل الأزرار وحقول النص. أما مكونات « features » فلها منطق، مثل جلب البيانات أو إدارة النموذج.
ماذا يحدث إذا كان هناك مكون بالاسم نفسه؟
لن تكتب المهارة فوقه تلقائيًا. بل ستسألك عما تفضّله، مثل تغيير الاسم أو عدم الإنشاء.
التفاصيل
الوصف الأصلي من المؤلف
Create a React component using the Container/Presentation pattern in src/components by asking for the component name and type (ui or features), then scaffold files that follow this repository's TypeScript, Storybook, and SCSS conventions. Use when the user explicitly asks for a Container/Presentation-based component or runs /react-container-presentation-component.
repo: github/awesome-copilot
الشعبية
- نجوم GitHub
- 40k
- الترتيب
- #7382
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
acquire-codebase-knowledge
40kيساعد وكيلك على فهم مشروع برمجي موجود وتوثيقه. مفيد لتعريف الأشخاص الجدد أو للحصول على نظرة عامة على البنية.
acreadiness-assess
40kيمكّن وكيلك من تقييم جاهزية مشروع للذكاء الاصطناعي وإنشاء تقرير. مفيد لمعرفة مدى استعداد المشروع لاستخدام أدوات الذكاء الاصطناعي.
acreadiness-generate-instructions
40kيساعد وكيلك على إنشاء تعليمات لأدوات الذكاء الاصطناعي بناءً على تقييم. مفيد لتحسين طريقة تفاعل الذكاء الاصطناعي مع الكود وسد الثغرات المحددة.
acreadiness-policy
40kيمكّن وكيلك من تحديد أو تطبيق سياسات لتقييم مشاريع الذكاء الاصطناعي. مفيد لتوحيد طريقة تقييم المشاريع وضمان الالتزام.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.