platform-detection
Skill này làm gì
Skill này xác định dự án .NET dùng nền tảng test và framework test nào, đồng thời kiểm tra các cài đặt có nhất quán hay không. Dành cho lập trình viên cần biết test được chạy thế nào trước khi thay đổi hoặc chạy chúng.
Khi nào nên dùng
- ✓Khi bạn hỏi dự án .NET dùng nền tảng hoặc framework test nào.
- ✓Khi bạn cần biết dự án dùng VSTest hay Microsoft.Testing.Platform.
- ✓Khi cấu hình test có vẻ mâu thuẫn và bạn cần biết thứ thực sự chạy test là gì.
Liên kết skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/platform-detection/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Solution .NET của tôi chạy test bằng VSTest hay Microsoft.Testing.Platform, và nó dùng framework test nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra cài đặt chung, các tệp dự án và tham chiếu package, rồi báo cáo nền tảng và framework thực sự chạy test cùng bằng chứng đi kèm.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Chỉ cài đặt chung có thể cho biết nền tảng không?
Không. Một cài đặt có thể chọn chế độ lệnh mà không quyết định nền tảng thực sự, nên skill kiểm tra thêm các dấu hiệu khác.
Nếu cấu hình chưa đầy đủ thì sao?
Skill sẽ báo rằng không thể xác định nền tảng, thay vì đoán.
Nó có áp dụng cho dự án không phải .NET không?
Không. Skill chỉ dành cho dự án .NET và cài đặt test của chúng.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14634
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-custom-agent
5.8kGiúp agent của bạn tạo file custom agent cho VS Code, với các tool, hướng dẫn và handoff riêng sang agent khác.
create-skill
5.8kGiúp agent của bạn tạo một agent skill mới với tên hợp lệ, mô tả kích hoạt rõ ràng và file SKILL.md đúng tiêu chuẩn.
csharp-scripts
5.8kGiúp agent của bạn chạy một chương trình C# nhỏ dưới dạng một file duy nhất bằng công cụ dòng lệnh .NET, không cần tạo project đầy đủ.
dotnet-pinvoke
5.8kGiúp agent của bạn gọi các thư viện native C hoặc C++ từ .NET đúng cách, gồm khai báo chữ ký, xử lý chuỗi, bộ nhớ và safe handle.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.