MSTest、NUnit、xUnit v3、TUnitにおけるVSTestとMTP間のテストフィルター作成および変換用のリファレンス構文を提供します。
- GitHubスター
- 5,942
- ファイル
- 1
- 最終コミット
- 2026年11月11日
- ライセンス
- MIT
- 許可されたツール
- —
filter-syntax skillは何をしますか
filter-syntaxはAgent Skillsです。 MSTest、NUnit、xUnit v3、TUnitにおけるVSTestとMTP間のテストフィルター作成および変換用のリファレンス構文を提供します。.
skillのSKILL.mdから生成された要約。
filter-syntax skill について
このSKILLは、.NETテストフレームワーク用のテストフィルターの作成および変換を可能にします。VSTestまたはMTP環境向けに特定のコマンドライン式を構築する必要がある開発者にリファレンスを提供します。このツールは、特定のプラットフォームやフレームワークが特定された後にのみロードされるように設計されており、直接呼び出すのではなく、run-testsやmtp-hot-reloadなどのツールのルックアップとして機能します。
ユーザーは、MSTest、NUnit、xUnit v3、およびTUnitの構文ルールにアクセスできます。完全一致、contains、およびANDやORなどの論理結合子といった演算子の使用方法が詳細に記載されています。また、このSKILLは、VSTestからMTPへフィルターを移行するための変換ロジックも提供しており、特に汎用的な式を、--filter-classやTUnitで使用されるパスベースの--treenode-filterといったフレームワーク固有のフラグに変換する際に役立ちます。
エージェントができること
- 1VSTestフィルター式の構築MSTestまたはNUnitを使用して、特定のカテゴリのテストを実行するコマンドを生成します。
- 2複雑なxUnitクエリの実行アセンブリ、名前空間、およびトレイトによってテストをフィルタリングするためのパスセグメントクエリを構築します。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
filter-syntax skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。プラグインにfilter-syntax skillをインストールする
/plugin marketplace add dotnet/skills /plugin install dotnet-test@dotnet-agent-skills
Claude Codeにfilter-syntax skillをインストールする
~/.claude/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.claude/skills/filter-syntaxClaude Code (project)にfilter-syntax skillをインストールする
.claude/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax .claude/skills/filter-syntaxCodexにfilter-syntax skillをインストールする
~/.agents/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.agents/skills/filter-syntaxGemini CLIにfilter-syntax skillをインストールする
~/.gemini/skills/filter-syntax/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.gemini/skills/filter-syntaxClaude.aiにfilter-syntax skillをインストールする
npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax filter-syntax && zip -r filter-syntax.zip filter-syntax # claude.ai → Customize → Skills → + → Create skill → Upload a skill → filter-syntax.zip
自動チェック
実行日 2026年11月15日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。エージェントに実行させる前にスクリプトを読んでください。 チェックの仕組み · 点数を上げるための改善点
- ソースリポジトリがリンクされており、アクセス可能dotnet/skills/plugins/dotnet-test/skills/filter-syntax is public and reachablegithub.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skill ↗合格
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit 2026-11-11github.com/dotnet/skills/commits ↗合格
- スクリプトにダウンロード実行や認証情報の窃取がないNo scripts in the skill folder合格
- SKILL.md に隠れた指示がないNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗合格
- 事前許可ツールが限定されているNo pre-approved tools; the agent asks before using onegithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗合格
- SKILL.md が Agent Skills の形式に従っているthe description does not say when to use the skillgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗検出事項
SKILL.md
GitHubで表示Test Filter Syntax Reference
Filter syntax depends on the platform and test framework.
VSTest filters (MSTest, xUnit v2, NUnit on VSTest)
dotnet test --filter <EXPRESSION>
Expression syntax: <Property><Operator><Value>[|&<Expression>]
Operators:
| Operator | Meaning |
|---|---|
= |
Exact match |
!= |
Not exact match |
~ |
Contains |
!~ |
Does not contain |
Combinators: | (OR), & (AND). Parentheses for grouping: (A|B)&C
Supported properties by framework:
| Framework | Properties |
|---|---|
| MSTest | FullyQualifiedName, Name, ClassName, Priority, TestCategory |
| xUnit | FullyQualifiedName, DisplayName, Traits |
| NUnit | FullyQualifiedName, Name, Priority, TestCategory |
An expression without an operator is treated as FullyQualifiedName~<value>.
Examples (VSTest):
# Run tests whose name contains "LoginTest"
dotnet test --filter "Name~LoginTest"
# Run a specific test class
dotnet test --filter "ClassName=MyNamespace.MyTestClass"
# Run tests in a category
dotnet test --filter "TestCategory=Integration"
# Exclude a category
dotnet test --filter "TestCategory!=Slow"
# Combine: class AND category
dotnet test --filter "ClassName=MyNamespace.MyTestClass&TestCategory=Unit"
# Either of two classes
dotnet test --filter "ClassName=MyNamespace.ClassA|ClassName=MyNamespace.ClassB"
MTP filters — MSTest and NUnit
MSTest and NUnit on MTP use the same --filter syntax as VSTest (same properties, operators, and combinators). The only difference is how the flag is passed:
# .NET SDK 8/9 (after --)
dotnet test -- --filter "Name~LoginTest"
# .NET SDK 10+ (direct)
dotnet test --filter "Name~LoginTest"
MTP filters — xUnit (v3)
xUnit v3 on MTP uses framework-specific filter flags instead of the generic --filter expression:
| Flag | Description |
|---|---|
--filter-class "name" |
Run all tests in a given class |
--filter-not-class "name" |
Exclude all tests in a given class |
--filter-method "name" |
Run a specific test method |
--filter-not-method "name" |
Exclude a specific test method |
--filter-namespace "name" |
Run all tests in a namespace |
--filter-not-namespace "name" |
Exclude all tests in a namespace |
--filter-trait "name=value" |
Run tests with a matching trait |
--filter-not-trait "name=value" |
Exclude tests with a matching trait |
Multiple values can be specified with a single flag: --filter-class Foo Bar.
# .NET SDK 8/9
dotnet test -- --filter-class "MyNamespace.LoginTests"
# .NET SDK 10+
dotnet test --filter-class "MyNamespace.LoginTests"
# Combine: namespace + trait
dotnet test --filter-namespace "MyApp.Tests.Integration" --filter-trait "Category=Smoke"
xUnit v3 query filter language
For complex expressions, use --filter-query with a path-segment syntax:
/<assemblyFilter>/<namespaceFilter>/<classFilter>/<methodFilter>[traitName=traitValue]
Each segment matches against: assembly name, namespace, class name, method name. Use * for "match all" in any segment. Documentation: https://xunit.net/docs/query-filter-language
# xUnit.net v3 MTP — using query language (assembly/namespace/class/method[trait])
dotnet test -- --filter-query "/*/*/*IntegrationTests*/*[Category=Smoke]"
MTP filters — TUnit
TUnit uses --treenode-filter with a path-based syntax:
--treenode-filter "/<Assembly>/<Namespace>/<ClassName>/<TestName>"
Wildcards (*) are supported in any segment. Filter operators can be appended to test names for property-based filtering.
| Operator | Meaning |
|---|---|
* |
Wildcard match |
= |
Exact property match (e.g., [Category=Unit]) |
!= |
Exclude property value |
& |
AND (combine conditions) |
| |
OR (within a segment, requires parentheses) |
Examples (TUnit):
# All tests in a class
dotnet run --treenode-filter "/*/*/LoginTests/*"
# A specific test
dotnet run --treenode-filter "/*/*/*/AcceptCookiesTest"
# By namespace prefix (wildcard)
dotnet run --treenode-filter "/*/MyProject.Tests.Api*/*/*"
# By custom property
dotnet run --treenode-filter "/*/*/*/*[Category=Smoke]"
# Exclude by property
dotnet run --treenode-filter "/*/*/*/*[Category!=Slow]"
# OR across classes
dotnet run --treenode-filter "/*/*/(LoginTests)|(SignupTests)/*"
# Combined: namespace + property
dotnet run --treenode-filter "/*/MyProject.Tests.Integration/*/*/*[Priority=Critical]"
VSTest → MTP filter translation (for migration)
MSTest, NUnit, and xUnit.net v2 (with YTest.MTP.XUnit2): The VSTest --filter syntax is identical on both VSTest and MTP. No changes needed.
xUnit.net v3 (native MTP): xUnit.net v3 does NOT support the VSTest --filter syntax on MTP. Translate filters using xUnit.net v3's native options:
VSTest --filter syntax |
xUnit.net v3 MTP equivalent | Notes |
|---|---|---|
FullyQualifiedName~ClassName |
--filter-class *ClassName* |
Wildcards required for substring match |
FullyQualifiedName=Ns.Class.Method |
--filter-method Ns.Class.Method |
Exact match on fully qualified method |
Name=MethodName |
--filter-method *MethodName* |
Wildcards for substring match |
Category=Value (trait) |
--filter-trait "Category=Value" |
Filter by trait name/value pair |
| Complex expressions | --filter-query "expr" |
Uses xUnit.net query filter language (see above) |
このスキルのファイル
1filter-syntax skillに関する質問
Claude Codeにfilter-syntax skillをインストールするには
npx degit dotnet/skills/plugins/dotnet-test/skills/filter-syntax ~/.claude/skills/filter-syntaxを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
filter-syntax skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
VSTestを使用して特定のカテゴリのテストを実行するにはどうすればよいですか?
TestCategoryプロパティと完全一致演算子を使用できます。例:dotnet test --filter "TestCategory=Integration"
MTP上のxUnit v3は標準のVSTestフィルター構文をサポートしていますか?
いいえ、MTP上のxUnit v3は標準のVSTest --filter構文をサポートしていません。フレームワーク固有のフラグまたは--filter-queryオプションを使用する必要があります。
TUnitのツリーノードフィルターの構文は何ですか?
TUnitはパスベースの構文を使用します:--treenode-filter "/<Assembly>/<Namespace>/<ClassName>/<TestName>"。ワイルドカードもサポートされています。