Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.
日本語の概要は準備中です。原文の説明を表示しています。
Convert .NET tests from NUnit 3/4 to MSTest v4 while preserving VSTest or MTP. Use for replacing NUnit/NUnit3TestAdapter packages, Test/TestCase/ TestCaseSource/Values attributes, constraint assertions, SetUp/TearDown, OneTimeSetUp, SetUpFixture, FixtureLifeCycle, TestContext, categories, retries, timeouts, and NUnit parallelization. Also use when a "convert NUnit to MSTest" request may already be migrated: inspect and report the no-op. Do not use for NUnit version upgrades, xUnit/TUnit conversion, MSTest upgrades, or runner-only VSTest-to-MTP migration.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Convert NUnit 3 or 4 tests to MSTest v4 without changing the target framework or test platform. A successful migration builds, discovers the same test cases, and preserves pass/fail, lifecycle, data, filtering, and concurrency semantics.
Use this skill only when the project contains NUnit packages or source and the user wants MSTest. If the project already uses MSTest and contains no NUnit tests, report that no framework migration is needed and make no changes.
Do not combine this framework conversion with a target-framework upgrade or VSTest/MTP migration. Complete and verify one migration before starting another.
| Detected state | Required action |
|---|---|
| No NUnit package, namespace, attribute, or constraint remains | Stop, make no changes, and run the existing test command once to prove the already-MSTest project is healthy. |
| Source uses VSTest | Preserve VSTest. Retain and update an explicit Microsoft.NET.Test.Sdk pin when the repository owns one; do not introduce MTP properties. |
| Source uses MTP | Replace NUnit-specific MTP configuration with MSTest MTP configuration. Prefer MSTest.Sdk; with the metapackage set EnableMSTestRunner=true and OutputType=Exe. |
| NUnit uses its default fixture lifecycle | NUnit normally shares one fixture instance across all test cases; MSTest creates a new class instance per test. Move state that must remain class-shared behind static fields initialized by [ClassInitialize], or prove the state is per-test before leaving it as an instance field. |
NUnit has no Parallelizable configuration | Preserve serial execution. Do not add [assembly: Parallelize]; NUnit and MSTest are both serial by default. |
| NUnit explicitly enables parallel execution | Translate the effective scope and worker count. Never infer method-level parallelism from fixture-level settings. |
For detailed mappings, search references/mapping-cheatsheet.md for constructs present in the project and read only those sections.
For a routine migration, converge in four phases: one batched discovery pass, one edit pass, one dotnet test, and one concise result.
dotnet test is sufficient.global.json, .runsettings, testconfig.json, and NUnit configuration.NUnit, NUnit3TestAdapter, NUnit.Analyzers, NUnit.Framework, NUnit.Framework.Legacy, and using NUnit.Framework.platform-detection only when ambiguous.[TestFixture(...)], [TestFixtureSource], [FixtureLifeCycle], constructors with parameters[TestCase], [TestCaseSource], TestCaseData, [Values], [Range], [Random], [Sequential], [Pairwise], custom data attributes[Theory], [Datapoint], [DatapointSource], automatic bool/enum datapoints, Assume.That[OneTimeSetUp], [OneTimeTearDown], [SetUpFixture], inheritance-based setupAssert.That, Assert.Multiple, Assert.Throws, Assert.Catch, collection constraints[Parallelizable], [NonParallelizable], [LevelOfParallelism], [Order], [SingleThreaded][Apartment], [RequiresThread], [CancelAfter], [Timeout][Culture], [Platform], [SetCulture], [SetUICulture][Explicit], [Repeat], [Retry], [MaxTime], categories, properties, [TestOf][DefaultFloatingPointTolerance], [NonTestAssembly], and deprecated fixture lifecycle aliasesRemove NUnit-specific packages being replaced, including NUnit, NUnit3TestAdapter, NUnit.Analyzers, NUnit console runner packages, and NUnit-specific MTP adapters.
Default to the current stable MSTest v4 metapackage resolved from the configured package source:
<PackageReference Include="MSTest" Version="4.4.0" />
The pin is illustrative for the current release; during a real migration resolve and pin the current stable version. Preserve an explicit Microsoft.NET.Test.Sdk dependency for VSTest when the source project owns one. When preserving MTP, prefer MSTest.Sdk; otherwise use EnableMSTestRunner=true and OutputType=Exe.
Do not change TargetFramework. Remove NUnit .runsettings adapter settings only after translating relevant behavior.
| NUnit | MSTest |
|---|---|
[TestFixture] or fixture with tests | [TestClass] |
[Test] | [TestMethod] |
[TestCase(...)] | [TestMethod] + [DataRow(...)] |
[TestCaseSource(nameof(Cases))] | [TestMethod] + [DynamicData(nameof(Cases))] |
[SetUp] / [TearDown] | [TestInitialize] / [TestCleanup] |
[OneTimeSetUp] / [OneTimeTearDown] | static [ClassInitialize] / [ClassCleanup] |
[Category(value)] | [TestCategory(value)] |
[Property(key, value)] | [TestProperty(key, value)] |
[Ignore("reason")] | [Ignore("reason")] plus [TestMethod] |
[Timeout(ms)] | [Timeout(ms)] plus [TestMethod] |
[Retry(n)] | [Retry(n - 1)] plus [TestMethod] when n > 1; remove it when n = 1 |
Remove using NUnit.Framework; and using NUnit.Framework.Legacy;. Add using Microsoft.VisualStudio.TestTools.UnitTesting; when using the metapackage; MSTest.Sdk supplies an implicit global using.
Do not mechanically seal classes or flatten inherited setup methods.
Load the mapping cheatsheet for every high-risk construct found in Step 1. These rules are mandatory:
LifeCycle.SingleInstance differs from MSTest's per-test class instances. Preserve class-shared fields explicitly.[OneTimeSetUp] and [OneTimeTearDown] become static MSTest methods. Move any instance state they use to a static holder rather than merely adding static.Assert.Throws<T> and Throws.TypeOf<T> require an exact exception type and map to Assert.ThrowsExactly<T>. NUnit Assert.Catch<T> and Throws.InstanceOf<T> permit derived types and map to Assert.Throws<T>.Is.TypeOf<T> maps to Assert.IsExactInstanceOfType<T>; Is.InstanceOf<T> maps to Assert.IsInstanceOfType<T>.Assert.AreSequenceEqual on MSTest 4.3+ or CollectionAssert.AreEqual with materialized lists; never use reference-based Assert.AreEqual for sequences.TestCase(ExpectedResult=...) and TestCaseData.Returns(...) require rewriting the target test to assert the expected result.TestDataRow<T> from DynamicData when needed. NUnit row properties have no direct TestDataRow<T> equivalent and require a custom data source or an explicit metadata decision.[Combinatorial], [Values], [Range], and [Random]; add using Microsoft.VisualStudio.TestTools.UnitTesting.Combinatorial;. Constructor semantics differ, so translate NUnit ranges and random bounds explicitly. [Sequential] still requires explicit rows or a custom data source.[Pairwise] has no MSTest built-in. Preserve the exact generated rows in DynamicData or use a verified pairwise ITestDataSource; full Cartesian combinations change test counts and execution cost.[Theory], [Datapoint], and [DatapointSource] into explicit DynamicData or combinatorial sources. Preserve automatic bool/enum values and the rule that a theory fails when every row violates its assumptions.[Explicit], [Repeat], parameterized fixtures, fixture sources, and Assert.Multiple have no behavior-identical mechanical mapping. Rewrite deliberately or report manual follow-up; never approximate silently.[Retry(n)] counts the initial attempt, while MSTest [Retry(n)] counts retries after the initial attempt. Subtract one and review NUnit RetryExceptions filters separately.[CancelAfter(ms)] maps to [Timeout(ms, CooperativeCancellation = true)]. Under VSTest, remove NUnit's injected CancellationToken parameter and use an injected or property-based TestContext.CancellationToken; VSTest otherwise treats it as missing data. Retain a method token only when the preserved runner is proven to support injection. Expand fixture-level defaults to every affected test and lifecycle method.[Apartment(ApartmentState.STA)] maps to [STATestClass] or [STATestMethod]. Set UseSTASynchronizationContext = true when async continuations must remain on the STA thread. MTA is the MSTest default. [RequiresThread] and [SingleThreaded] guarantee thread identity that MSTest attributes do not generally preserve; use a custom executor or report manual follow-up.OSCondition, ArchitectureCondition, or a MemberCondition helper. Map SetCulture and SetUICulture to setup/cleanup that saves and restores the original culture.[DefaultFloatingPointTolerance] into explicit deltas on every affected assertion. Preserve method-over-fixture-over-assembly precedence.[SetUp] and [TearDown] remain per-test lifecycle methods.[ClassInitialize] and released by [ClassCleanup].[FixtureLifeCycle(LifeCycle.InstancePerTestCase)] already matches MSTest class instantiation; remove the attribute and keep per-test instance state.[SetUpFixture] is namespace-scoped in NUnit. MSTest assembly initialization is assembly-wide. Use [AssemblyInitialize] only when the NUnit setup already covers the whole assembly; otherwise move setup into the affected classes or a shared helper without widening scope.TestContext.WriteLine to an injected or property-based MSTest TestContext.WriteLine. Translate directory, test-name, and attachment APIs individually.NUnit and MSTest both run serially by default. Do not add parallelization for an unconfigured NUnit project.
When NUnit explicitly opts in:
[Parallelizable(ParallelScope.Fixtures)] -> [assembly: Parallelize(Workers = N, Scope = ExecutionScope.ClassLevel)][Parallelizable(ParallelScope.Children)] or method-level parallelism -> method-level MSTest parallelization only after confirming shared instance state is safe[NonParallelizable] -> [DoNotParallelize] when parallelization is enabled[LevelOfParallelism(N)] -> Workers = N[ResourceLock("key")] when it preserves a narrower lock than [DoNotParallelize]NUnit [Order] is not general dependency semantics. Use MSTest 4.4 [DependsOn] only when the source truly expresses a prerequisite; otherwise remove ordering by making tests independent or report manual follow-up.
DataRow, DynamicData, combinatorial, or row metadata conversionParallelize, DoNotParallelize, worker count, or resource locksIgnore, Explicit, row-level ignore, or retry behaviorUse this final response shape:
Run migrate-vstest-to-mtp separately if the user also wants MTP. Use writing-mstest-tests only after parity is established.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.
日本語の概要は準備中です。原文の説明を表示しています。
Use a repo-root `.editorconfig` to configure free .NET analyzer and style rules. Use when a .NET repo needs rule severity, code-style options, section layout, or analyzer ownership made explicit. USE FOR: the repo needs a root .editorconfig; analyzer severity and style ownership are unclear; the team wants one source of truth for rule configuration. DO NOT USE FOR: choosing analyzers with no config change; formatting-only execution with no config ownership question. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
日本語の概要は準備中です。原文の説明を表示しています。
Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.
日本語の概要は準備中です。原文の説明を表示しています。
Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java/Kotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.
日本語の概要は準備中です。原文の説明を表示しています。
Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift/Objective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.
日本語の概要は準備中です。原文の説明を表示しています。
Design or review .NET solution architecture across modular monoliths, clean architecture, vertical slices, microservices, DDD, CQRS, and cloud-native boundaries without over-engineering. USE FOR: .NET architecture choices; layer and domain boundary review; service decomposition; clean architecture, vertical slice, DDD, CQRS, and modular monolith decisions. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
日本語の概要は準備中です。原文の説明を表示しています。