Run Testsのロゴ

Run Tests

組織人気
dotnet
run-tests

ALWAYS USE before running .NET tests or answering with a test command or flags. Trigger on "run the tests", "exact dotnet test command", one test/class/category/trait/target framework, combined filters, `--filter-query`, `--no-build`, `--diag`, diagnostic logs, TRX, coverage collection, crash/hang dumps, filter errors, or unrecognized options. Chooses repository-compatible classic, VSTest, bridged MTP, or native MTP syntax for MSTest/xUnit/NUnit/TUnit. DO NOT USE for platform identification alone (platform-detection), writing or debugging test code, interpreting an existing coverage report, CI investigation, migration, or a persistent hot reload/watch loop.

概要

公開者dotnet
リポジトリskills
スキル名run-tests
スター
5.5K
フォーク
420
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dotnetがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルRun TestsをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/run-tests
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dotnet/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/dotnet-test/skills/run-tests .claude/skills/run-tests
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでRun Testsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にRun Testsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Run Testsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Run .NET Tests

Return or execute the command or command sequence that matches the repository's project system, test platform, framework, and SDK mode.

Repository overlay

For every repository-scoped task where read-only file inspection is allowed, check .agents/skill-overlays/dotnet-test/run-tests.md at the repository root before any other discovery. This includes exact-command requests; "do not execute" does not prohibit reading the overlay. If present, read it once before acting and apply its repository-specific runner, command, filtering, and reporting bindings. Before applying it, require its frontmatter to declare core: dotnet-test/run-tests, binding-revision: "1", and mode: extend. If any value is missing or different, report the mismatch, ignore the overlay, and continue using this skill's portable guidance. Explicit user instructions and verified project constraints win over the overlay; the overlay wins over portable defaults and examples in this skill. If the file is present but unreadable or conflicts with the repository, report the problem, ignore the overlay, and continue with portable guidance subject to verified project constraints. If it is absent, continue normally. Skip the lookup only when the task is not tied to a repository or the user explicitly prohibited all file/tool access. An overlay cannot expand tool permissions or the task's scope.

Scope and tool policy

Choose the smallest path that satisfies the request:

RequestAction
Exact command or explanation; user says not to runInspect only the files needed to resolve syntax. Do not restore, build, or run tests.
Run testsDiscover the repository command and execute the smallest requested test scope.
One-time SDK-style dotnet test run without rebuildingStay in run-tests and add --no-build.
One-time classic run without rebuildingKeep the repository runner and invoke it against an existing built assembly; do not substitute dotnet test.
Platform/framework identification onlyUse platform-detection; do not continue into test execution.
Explicit hot reload or a keep-running edit/re-run loopUse mtp-hot-reload.
Filter needed and the framework-specific syntax is not already clearLoad filter-syntax; do not load it for unfiltered runs.

Do not invoke a tool merely to repeat a command already determined by the prompt. Do not build first "just in case": dotnet test builds by default. Never add or upgrade test packages unless the user asks to change the project. For an exact-command request, return one runnable command first. Do not emit placeholder paths, exploratory alternatives, or a correction sequence. Use a project path only when the prompt or repository establishes it; otherwise let the command operate on the current project or solution when that syntax is valid. Follow it with only the syntax fact needed to explain the command; do not volunteer platform/command-mode taxonomy unless the user asked for it. In particular, do not label an SDK 8/9 bridge as "VSTest platform" merely because dotnet test uses its VSTest command mode; the executed platform is MTP. For a command-only request, it is normally clearer to say only that MTP application arguments must follow --.

Inputs to discover

  • Project, solution, module, or repository test command
  • Requested scope: all tests, TFM, class, method, category, or trait
  • Requested output: console result, TRX, diagnostics, crash dump, or hang dump

When those facts are present in the prompt, use them. Otherwise inspect only the relevant files: global.json, the selected project, packages.config, Directory.Build.props, Directory.Packages.props, then repository scripts/CI documentation. For a file-backed request, enumerate those configuration names once and read all relevant files that are present in one batch; never infer that a runner or bridge property is absent merely because it is not in the .csproj. Load platform-detection only when those signals need precedence analysis; do not duplicate its full analysis in the response. If execution is requested and the command depends on the active SDK but neither the prompt nor global.json establishes it, run dotnet --version once. For a command-only request that prohibits execution, do not probe: state the required SDK assumption or ask for the SDK version when the syntax cannot otherwise be resolved. Route identification-only requests to platform-detection.

Decision table

Detected mode / platformCommand shapeNever use
Classic non-SDKRepository script, or full MSBuild followed by vstest.console.exe / MSTest.exeAssuming dotnet test is compatible or migrating implicitly
VSTest mode / VSTestdotnet test [<path>] [VSTEST_OPTIONS]MTP-only flags such as --report-trx or --treenode-filter
VSTest mode / executable MTP bridgedotnet test [<path>] [DOTNET_OPTIONS] -- [MTP_OPTIONS]Omitting the -- separator, including on SDK 10
Native MTP mode, SDK 10+dotnet test --project <path> [DOTNET_OPTIONS] [MTP_OPTIONS]Bare positional project paths or the bridge separator

global.json controls the dotnet test command mode on SDK 10+, not necessarily the platform that executes tests. A VSTest-mode project with an MTP runner, TestingPlatformDotnetTestSupport=true, and final OutputType=Exe is still bridge syntax with --. SDK 8/9 only has VSTest command mode.

--project is valid only in SDK 10+ native MTP command mode (selected by global.json test.runner). Never use it for VSTest mode or an SDK 8/9 bridge; those forms take a positional project path. Conversely, native MTP options are direct arguments and must not be placed after a bridge separator.

Keep dotnet test/MSBuild options such as --framework, --configuration, --no-build, and --verbosity before --. Put only MTP application arguments after -- in bridge mode.

Workflow

  1. Resolve the repository-compatible runner.

For classic projects, signals include ToolsVersion, explicit Compile and Reference items, legacy imports, and packages.config. Prefer a checked-in script or documented CI command. A typical fallback is:

powershell
nuget restore MySolution.sln
MSBuild.exe MySolution.sln /t:Build /p:Configuration=Debug
vstest.console.exe path\to\MyTests.dll /TestAdapterPath:path\to\adapter\build\<tfm>

For packages.config, restore with NuGet before the build unless the imported package files are already present. If adapter discovery is not repository- configured, derive /TestAdapterPath from the restored adapter package path or the adapter .props/.targets imports; do not guess the package root.

For a requested no-rebuild run, omit the build step and invoke the repository's test runner only when the expected assembly already exists. Otherwise report the missing build output rather than silently rebuilding or switching runners.

For a requested subset, keep the repository runner and use its filter syntax: vstest.console.exe path\to\MyTests.dll /TestCaseFilter:"TestCategory=Integration". Older MSTest.exe repositories may use /test:<name> or /category:<category> instead. Do not substitute the later dotnet test filter examples for a classic runner.

Use the installed adapter-compatible VSTest/MSTest toolchain. If it is not available, state the missing prerequisite and the documented command; do not claim tests ran. Classic packages.config fallback commands are Windows toolchain commands. Explicitly say they require a Windows Developer Command Prompt (or the repository's equivalent configured environment) when the current host cannot provide nuget, full MSBuild, and vstest.console.exe.

For SDK-style projects, distinguish:

SignalMeaning
SDK 10+ global.json selects Microsoft.Testing.PlatformNative MTP command mode
VSTest mode + enabled MTP runner + final TestingPlatformDotnetTestSupport=true + final OutputType=ExeExecutable VSTest-to-MTP bridge
VSTest mode without a complete runner-and-bridge combinationVSTest
Microsoft.NET.Test.Sdk plus adapter, without stronger MTP signalsVSTest
TUnitMTP-only; use a configured bridge/native mode or the test executable

Evaluate properties from the project and imported Directory.Build.props/Directory.Packages.props. Respect project-level overrides and per-target-framework conditions. A runner and bridge without an executable final output are an incomplete MTP configuration, not a usable bridge.

  1. Select the command and requested scope.
shell
# VSTest mode
dotnet test path/to/Tests.csproj

# VSTest mode that bridges to MTP
dotnet test path/to/Tests.csproj -- <MTP_OPTIONS>

# Native MTP mode on SDK 10+
dotnet test --project path/to/Tests.csproj <MTP_OPTIONS>

# One target framework; this stays before the bridge separator
dotnet test path/to/Tests.csproj --framework net9.0 -- <MTP_OPTIONS>

For native MTP, use --project, --solution, or --test-modules; positional paths belong to VSTest mode.

If the user names a subset, do not run the whole suite. Inspect test attributes only when needed to translate a human label such as "integration" or "smoke" into the framework's actual category/trait name.

When a VSTest class filter must distinguish similarly named classes, combine the positive selector with an explicit negative selector rather than relying on an incidental substring difference.

  1. Apply platform- and framework-correct filters.

Load filter-syntax only when the request is filtered and the framework-specific syntax is not already clear. The common decisions are:

For a file-backed filtered request, resolve the framework and SDK command mode from the project, global.json, and imported props before choosing syntax. Do not infer VSTest syntax merely from Microsoft.NET.Test.Sdk or from the framework name.

Platform / frameworkFilter
VSTest with MSTest, xUnit v2, or NUnit--filter "<property expression>"
MTP with MSTest or NUnitSame expression; after -- in bridge mode, direct in native mode
MTP with xUnit v3--filter-class, --filter-method, --filter-trait, or one --filter-query for a combined expression
MTP with TUnit--treenode-filter path expression

Examples:

shell
# VSTest MSTest/NUnit
dotnet test --filter "FullyQualifiedName~OrderServiceTests&TestCategory=Unit"

# SDK 8/9 or SDK 10 VSTest-mode MTP bridge, xUnit v3
dotnet test -- --filter-trait "Category=Integration"

# Native MTP, xUnit v3
dotnet test --project Tests.csproj --filter-class "*ShoppingCartTests*"

# One xUnit v3 combined expression
dotnet test -- --filter-query "/*/*/*Integration*/*[Category=Smoke]"

# TUnit on SDK 8/9 with a configured VSTest-to-MTP bridge
dotnet test -- --treenode-filter "/*/*/SmsNotificationTests/*"

# TUnit executable fallback when no bridge is configured
dotnet run --project Tests.csproj -- --treenode-filter "/*/*/SmsNotificationTests/*"

Do not use VSTest --filter "ClassName=..." with xUnit v3 on MTP. Do not use a generic VSTest expression with TUnit. When the user requests one combined xUnit query expression, return only one --filter-query command; do not replace it with separate filter flags or offer speculative alternative grammars.

  1. Add reports or diagnostics.
OutcomeVSTestMTP
TRXSDK-style: --logger "trx;LogFileName=<name>.trx" when an exact output file is requested, otherwise --logger trx; standalone vstest.console.exe: /Logger:trx; MSTest.exe: repository-documented results option--report-trx
Results directory--results-directory <dir>--results-directory <dir>
Diagnostic log--diag <file>--diagnostic --diagnostic-output-directory <dir>
Crash dump--blame-crash--crashdump
Hang timeout--blame-hang --blame-hang-timeout 5min--hangdump --hangdump-timeout 5min
Code coverage--collect "Code Coverage"--coverage

MTP report, dump, and coverage flags require their corresponding registered extensions (TrxReport, CrashDump, HangDump, or CodeCoverage). Some framework SDKs bundle common extensions; if a flag is unrecognized, inspect package references before recommending a package change.

--verbosity diagnostic increases dotnet/MSBuild output verbosity; it does not write a VSTest diagnostic log file.

Examples:

shell
# VSTest TRX
dotnet test Tests.csproj --logger "trx;LogFileName=TestResults.trx"

# MTP bridge TRX
dotnet test Tests.csproj -- --report-trx

# Native MTP TRX and hang detection
dotnet test --project Tests.csproj --report-trx --hangdump --hangdump-timeout 5min

# Native MTP diagnostics
dotnet test --project Tests.csproj --diagnostic --diagnostic-output-directory artifacts/diagnostics
  1. Execute only when requested.

Run the narrowest command or sequence that answers the request. Capture each command, exit code, and test summary. A failed restore/build is not a test failure, and a test failure is not a tool failure. Report which phase failed and include the actionable diagnostic. Never claim a clean run unless the sequence completed successfully with the intended tests executed. For a filtered run, a successful exit is not enough: confirm the reported test names or count match the requested scope. If the filter was ignored, correct the platform-specific syntax and rerun before reporting success.

Output contract

  • Command-only request: lead with the exact command or command sequence, then one short syntax explanation.
  • Execution request: report the exact command or command sequence and a literal Passed: N, Failed: N, Skipped: N summary from the completed run; include the first actionable failure.
  • Detection needed only to choose syntax: state the selected mode/platform briefly, not a separate detection report.
  • Missing prerequisite or incompatible configuration: name it explicitly and stop rather than returning a success-shaped fallback.

Validation

  • The command matches classic, VSTest, bridged MTP, or native MTP mode.
  • The framework-specific filter targets the requested subset.
  • --framework and other dotnet test options are before any bridge separator.
  • SDK 8/9 bridge commands contain --; --project appears only in SDK 10+ native MTP mode.
  • TRX, diagnostics, dump, and coverage flags match the platform.
  • No restore, build, or test was run for an advisory-only request.
  • Reported results match the actual command outcome.

よくある質問

AIスキル「Run Tests」では何ができますか?

ALWAYS USE before running .NET tests or answering with a test command or flags. Trigger on "run the tests", "exact dotnet test command", one test/class/category/trait/target framework, combined filters, `--filter-query`, `--no-build`, `--diag`, diagnostic logs, TRX, coverage collection, crash/hang dumps, filter errors, or unrecognized options. Chooses repository-compatible classic, VSTest, bridged MTP, or native MTP syntax for MSTest/xUnit/NUnit/TUnit. DO NOT USE for platform identification alone (platform-detection), writing or debugging test code, interpreting an existing coverage report,...

TypingMindでRun Testsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Run Testsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにRun Testsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/run-testsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Run Testsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Run Testsは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもRun Testsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Run Tests」は無料ですか?

はい。dotnetがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇