SkillAgentSearch skills...

filter-syntax

Reference-only filter syntax for VSTest and MTP with MSTest, NUnit, xUnit v3, and TUnit. Load only after the platform/framework is known and a consumer needs to create or translate a filter. Do not load for unfiltered runs or platform detection.

Install / Use

npx skills add dotnet/skills --skill filter-syntax

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

91/100

Supported Platforms

Universal

Tags

Our assessment of filter-syntax

filter-syntax scores 91/100 on our quality scale, 1026th of 4,698 Development & Engineering skills we index (top 22%).

Its SKILL.md is 5.8 KB long, well organised into 26 sections with 8 code examples: a solid amount of guidance for an agent.

With 5,471 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
26/30
Structure
20/20
Description
15/15
Adoption
16/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so filter-syntax is actively maintained.
  • Our last check on 2026-10-28 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-27. Automated pattern scan on 2026-09-27. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

filter-syntax compared with similar skills

All 4 of these similar skills score higher than filter-syntax; compare them before choosing.

SkillScoreStarsUpdatedFormat
filter-syntax (this skill)by dotnet915.5k53d agoSKILL.md
taste-skillby Leonxlnx100116.8k8d agoCLAUDE.md
ai-job-searchby ai-job-search-dev10072.1ktodayCLAUDE.md
claude-howtoby luongnv8910047.3k2d agoCLAUDE.md
lobehubby lobehub10085.6ktodayMCP Server

Frequently asked questions

How do I install filter-syntax?
Run npx skills add dotnet/skills --skill filter-syntax. The install tabs above show the steps for each supported agent.
Which AI agents does filter-syntax work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is filter-syntax safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is filter-syntax still maintained?
The repository was last updated about 2 months ago, so filter-syntax is actively maintained.

name: filter-syntax description: "Reference-only filter syntax for VSTest and MTP with MSTest, NUnit, xUnit v3, and TUnit. Load only after the platform/framework is known and a consumer needs to create or translate a filter. Do not load for unfiltered runs or platform detection. Used by run-tests and mtp-hot-reload; never invoke directly." user-invocable: false disable-model-invocation: true license: MIT

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) |

Related Skills

View on GitHub
GitHub Stars5.5k
CategoryDevelopment
Updated1mo ago
Forks418

Languages

C#

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions
filter-syntax — Universal Skill: Install & Safety Check | SkillAgent