platform-detection
ما الذي تفعله
تحدد هذه المهارة منصة الاختبار وإطاره في مشروع .NET، وهل إعداداته متسقة. وهي لمطورين يحتاجون إلى معرفة كيف تُشغَّل اختباراتهم قبل تغييرها أو تشغيلها.
متى تستخدمها
- ✓عندما تسأل أي منصة اختبار أو إطار يستعمله مشروع .NET.
- ✓عندما تحتاج إلى معرفة هل المشروع يستعمل VSTest أو Microsoft.Testing.Platform.
- ✓عندما تبدو إعدادات الاختبار متعارضة وتحتاج إلى معرفة ما الذي يشغّل الاختبارات فعلًا.
رابط المهارة
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/platform-detection/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل حلّي في .NET يشغّل اختباراته بـ VSTest أو Microsoft.Testing.Platform، وأي إطار اختبار يستعمل؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يفحص الوكيل الإعدادات العامة وملفات المشروع ومراجع الحزم، ثم يذكر المنصة والإطار اللذين يشغّلان الاختبارات فعلًا مع الدليل الذي بُني عليه ذلك.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Test Platform and Framework Detection
Determine which test platform (VSTest or Microsoft.Testing.Platform) and which test framework (MSTest, xUnit, NUnit, TUnit) a project uses.
Response contract
Honor the user's requested labels and order exactly, substituting the actual
classification for every placeholder. Start with the verdict: never put a
heading, scratch analysis, tool syntax, or an echoed template before it. Follow
with one concise evidence sentence naming the repository facts needed to justify
every requested classification. When Framework is requested, name the package
or project SDK that identifies it. Use a second sentence only for a conflict, an
incomplete configuration, or target-framework-specific differences.
Platform means the platform that actually executes tests: VSTest or
MTP. If conflicting or incomplete configuration prevents execution, report
it as unavailable rather than inventing a successful platform.
Never classify the executed platform from global.json test.runner alone.
That setting selects dotnet test command mode; even an explicit VSTest
value can bridge to an executable MTP application. Continue through the project
runner, bridge, and output-shape signals before writing Platform:.
Apply this scope gate before drafting the evidence:
| User asks for | Evidence to include | Omit |
|---|---|---|
| Platform and framework | Final runner selector and its winning source; package or project SDK identifying the framework; when needed, the property that makes it executable | Command mode; common SDK facts; OutputType unless it is missing or conflicting |
| The single deciding signal | That runner-selection property, why its source wins, and why a competing package does not select or imply VSTest; still name the package or project SDK identifying a requested framework | Bridge, OutputType, SDK mode, and unrelated prerequisites when the configuration is complete |
| Platforms per target framework | Only the conditional final values that differ by target | Common properties and project-wide SDK commentary |
| Explicit opt-out | Final UseVSTest value and its winning source |
Superseded defaults unless they create a conflict |
dotnet test mode |
The separate command-mode and executed-platform classifications | None of the requested axes |
If the requested labels omit dotnet test mode, do not state or explain command
mode anywhere in the response. An exact bridge property may still be decisive
platform evidence, but do not turn it into SDK or CLI-mode commentary.
When the user asks which single signal decides between an explicit runner
property and Microsoft.NET.Test.Sdk, the evidence sentence must say both that
the runner property selects MTP and that Microsoft.NET.Test.Sdk does not
select or imply VSTest.
When import precedence decides a property, state why the winning source wins (for example, it is imported later or its condition applies), not merely that it contains the final value or overrides another assignment.
Keep the explanation on the requested axis:
- An SDK version pin in
global.jsonis context, not a platform selector. Claim thatglobal.jsonselects VSTest or native MTP only when itstest.runnersetting actually does so. - If
UseVSTest=trueis decisive, say that directly. Do not speculate about an absenttest.runneror describe SDK pinning as an additional platform choice. - If command mode was not requested, do not add it, even when it was needed internally to determine the executed platform.
When a classic-project request also asks for the command family, add a direct
line such as Command family: MSBuild + vstest.console.exe; do not turn it into
an optional alternative or add an unnecessary build qualifier.
For a file-backed request, enumerate the following configuration names once,
then read every relevant file that is present in one batched operation:
global.json, .csproj, packages.config, Directory.Build.props,
Directory.Build.targets, Directory.Packages.props, and explicit imported
.props / .targets. A setting absent from the project file may be defined by
an import, so never infer its final value from the .csproj alone. Do not search
the web or inspect unrelated files when repository configuration is sufficient.
Resolve properties in the actual MSBuild import order, not with a fixed "project beats props" rule. For every applicable target framework
الأسئلة الشائعة
هل تكفي الإعدادات العامة لمعرفة المنصة؟
لا. قد يختار الإعداد وضع أمر دون أن يحدد المنصة الحقيقية، لذلك تفحص المهارة إشارات أخرى.
ماذا لو كان الإعداد غير مكتمل؟
تقول المهارة إن المنصة لا يمكن تحديدها، بدلًا من التخمين.
هل تغطي مشاريع غير .NET؟
لا. إنها لمشاريع .NET وإعدادات اختباراتها فقط.
التفاصيل
الوصف الأصلي من المؤلف
Identify a .NET project's test platform, framework, command mode, and SDK-style vs classic project system. Use only for "which test platform/framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and incompatible or conflicting VSTest/MTP configuration. Resolves global.json, project, packages.config, Directory.Build.props, and Directory.Packages.props precedence for MSTest/xUnit/NUnit/TUnit. DO NOT USE when the user asks to run/filter tests or for commands, flags, TRX/dumps, or test-command/filter errors; use run-tests directly. D
repo: dotnet/skills
الشعبية
- نجوم GitHub
- 5.8k
- الترتيب
- #14634
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
create-custom-agent
5.8kيساعد وكيلك على إنشاء ملفات وكلاء مخصصين لـVS Code، لكل منهم أدواته وتعليماته وتسليماته إلى وكلاء آخرين.
create-skill
5.8kيساعد وكيلك على إنشاء مهارة وكيل جديدة باسم صالح ووصف محفّز واضح وملف SKILL.md يتبع المعيار.
csharp-scripts
5.8kيساعد وكيلك على تشغيل برنامج C# صغير كملف واحد بأداة سطر أوامر .NET، دون إنشاء مشروع كامل.
dotnet-pinvoke
5.8kيساعد وكيلك على استدعاء مكتبات C أو C++ الأصلية من .NET بشكل صحيح، مع التوقيعات ومعالجة النصوص والذاكرة والمقابض الآمنة.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.