filter-syntax

filter-syntax is a skill for Claude Code from managedcode/dotnet-skills. It costs 75 tokens per session (1,608 once invoked), scanned A, a copy of filter-syntax, MIT.

A reference for writing test filters for VSTest and Microsoft.Testing.Platform, the tools that select which automated tests to run. It covers MSTest, NUnit, xUnit v3, and TUnit filter formats.

In plain words
What is it for?
Creating or translating commands that run tests by name, class, namespace, category, trait, or other supported property.
Why use it?
Test filters differ between runners and frameworks, so an incorrect expression can run the wrong tests or none at all. This reference provides the supported fields, operators, and examples.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Creating or translating commands that run tests by name, class, namespace, category, trait, or other supported property.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/filter-syntax
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add managedcode/dotnet-skills --skill filter-syntax
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for filter-syntax

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/filter-syntax/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/filter-syntax)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/filter-syntax"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/filter-syntax/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for filter-syntax

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/filter-syntax"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/filter-syntax.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,608 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.01608
Opus 5.5 $0.00030 $0.00643
Sonnet 5.5 $0.00015 $0.00322
Haiku 4.5 $0.00007 $0.00161

Measured 2mo ago against content hash 64c294d0fc2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

filter-syntax scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to filter-syntax — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Testing/Official-DotNet-Test/skills/filter-syntax/SKILL.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on 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

Read the full file on GitHub · 175 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 175 lines · 75 tokens per session scan A 64c294d0fc2d

Subscribe to this mod's changes

filter-syntax is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 75 tokens to every session and 1,608 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to filter-syntax, differing in 0 lines, and is treated as a copy.

Related

filter-syntax compared with skills from other repositories

filter-syntax next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
filter-syntaxmanagedcode/dotnet-skillsSkill52716d agoMITA75Claude Code
rust-developmentnavikt/copilotSkill65yesterdayMITA27Claude Code, Codex
infra-testsrnichols/plan-forgeSkill625d agoMITA43Claude Code
test-sweepsrnichols/plan-forgeSkill625d agoMITA38Claude Code
precommitsd0xdev/sd0x-harnessSkill1965d agoMITA15Claude Code
loom-ccosmix/loomSkill66todayMITA25Claude Code, Codex
finding-filesSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A28Claude Code, Codex