dotnet-test Plugin for AI Agents: Complete Capabilities and Architecture Guide
The dotnet-test plugin provides AI agents with a comprehensive test automation toolkit supporting execution, generation, migration, and quality analysis across multiple programming languages while offering specialized .NET features like hot-reload and static dependency refactoring.
The dotnet-test plugin in the dotnet/skills repository serves as the central hub for test-related operations in AI-driven development workflows. It supplies a rich set of skills and agents that enable assistants to run, generate, migrate, audit, and improve tests across a wide spectrum of languages including C#, Python, TypeScript/JavaScript, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++.
Test Execution and Runtime Optimization
The plugin provides robust test execution capabilities through the run-tests skill, defined in [plugins/dotnet-test/skills/run-tests/SKILL.md](./plugins/dotnet-test/skills/run-tests/SKILL.md). This skill automatically detects whether a project uses VSTest or Microsoft.Testing.Platform (MTP) and invokes dotnet test with the appropriate filter syntax.
For rapid iteration, the mtp-hot-reload skill enables re-running tests after code edits without requiring a full rebuild. This leverages Microsoft.Testing.Platform’s hot-reload feature to minimize feedback loops during test-driven development.
{
"skill": "run-tests",
"inputs": {
"projectPath": "src/MyApp.Tests/MyApp.Tests.csproj",
"filter": "FullyQualifiedName~MyFeature"
}
}
Cross-Language Test Generation
The code-testing-agent skill orchestrates a multi-agent pipeline that generates unit tests for any supported language. Implemented in [plugins/dotnet-test/skills/code-testing-agent/SKILL.md](./plugins/dotnet-test/skills/code-testing-agent/SKILL.md), this capability chains together specialized sub-agents for research, planning, implementation, building, testing, fixing, and linting.
The pipeline works uniformly across languages by loading language-specific markers from extension files. For example, generating tests for a Python module requires specifying the target language and framework:
{
"skill": "code-testing-agent",
"inputs": {
"targetLanguage": "python",
"sourcePath": "src/calculator.py",
"testFramework": "pytest"
}
}
Polyglot Test Quality Analysis
The plugin includes six analysis skills that operate across all supported languages through a catalog-driven architecture. These skills reside in the plugins/dotnet-test/skills/ directory and share a common pattern: they load language-specific extensions, run language-agnostic scans, then map findings back to concrete APIs.
The six core analysis capabilities include:
test-anti-patterns– Detects structural anti-patterns and ranks them by severity.test-smell-detection– Performs academic-grade audit for 19 distinct test smell types.assertion-quality– Measures assertion depth, variety, and specificity.test-gap-analysis– Conducts pseudo-mutation analysis to surface untested execution paths.test-tagging– Adds standardized trait tags to test methods for better categorization.grade-tests– Generates per-test letter grades using a comprehensive scoring rubric.
These skills are coordinated by the test-quality-auditor agent, which can analyze mixed-language repositories in a single run:
{
"skill": "test-quality-auditor",
"inputs": {
"testRoots": ["src/**/*.Tests.cs", "tests/**/*.py", "test/**/*.ts"],
"includeAnalysis": [
"test-anti-patterns",
"test-smell-detection",
"assertion-quality",
"grade-tests"
]
}
}
.NET-Specific Quality and Coverage
While the analysis skills work across languages, the plugin provides .NET-specific capabilities for coverage and testability improvement. The coverage-analysis skill collects project-wide code coverage data, while the crap-score skill computes Change Risk Anti-Patterns (CRAP) scores to identify high-risk hotspots.
For legacy code refactoring, three specialized skills work in sequence:
detect-static-dependencies– Identifies hard-to-test static calls likeDateTime.NoworFile.ReadAllTextin [plugins/dotnet-test/skills/detect-static-dependencies/SKILL.md](./plugins/dotnet-test/skills/detect-static-dependencies/SKILL.md).generate-testability-wrappers– Creates injectable wrapper interfaces for discovered static dependencies.migrate-static-to-wrapper– Rewrites call sites to use the generated abstractions.
{
"skill": "detect-static-dependencies",
"inputs": {
"sourceRoot": "src/MyApp/",
"dependencyPatterns": ["DateTime.Now", "File.", "HttpClient"]
}
}
Test Migration and Modernization
The plugin supports framework migration through the test-migration orchestration layer, referenced in the test-quality-auditor agent documentation. While implemented in a separate dotnet-test-migration plugin, this capability is exposed through the dotnet-test plugin’s agent interface. It handles migrations such as MSTest v1 to v3, xUnit v2 to v3, and transitions from VSTest to Microsoft.Testing.Platform.
Agent Architecture and Orchestration
The plugin exposes three high-level agents that stitch primitive skills together into coherent workflows:
code-testing-generator– Orchestrates the full test generation pipeline from research through linting.test-quality-auditor– Runs the six polyglot analysis skills against specified test roots.testability-migration– Chains the detect, wrap, and migrate skills for systematic dependency refactoring.
These agents reside in the plugins/dotnet-test/agents/ directory and handle the discovery phase automatically, scanning repositories to detect target languages before loading appropriate extension files.
Language Extension System
Polyglot support relies on language-specific extension files located in plugins/dotnet-test/skills/test-analysis-extensions/. Files such as extensions/dotnet.md, extensions/python.md, and extensions/java.md define per-language markers for concepts like sleep calls, mystery guests, or skip patterns. Adding support for a new language only requires creating a new extension file; the core skill logic remains unchanged.
Summary
- The dotnet-test plugin provides end-to-end test lifecycle management for AI agents in the dotnet/skills repository.
- Cross-language capabilities include test generation and six quality analysis skills that work across C#, Python, TypeScript, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++.
- .NET-specific features cover hot-reload execution, coverage analysis, CRAP scoring, and static dependency refactoring.
- Agent orchestration allows high-level agents like
code-testing-generatorandtest-quality-auditorto chain specialized skills into complete workflows. - Extension-based architecture enables rapid language support through declarative marker files without modifying core skill code.
Frequently Asked Questions
What programming languages does the dotnet-test plugin support?
The plugin supports C#, Python, TypeScript/JavaScript, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++. Cross-language capabilities like test generation and quality analysis work uniformly across all supported languages, while .NET-specific features such as coverage analysis and static dependency detection are scoped to C# projects.
How does the test generation pipeline work?
The code-testing-agent skill orchestrates a multi-agent workflow that includes research, planning, implementation, building, testing, fixing, and linting phases. Each phase is handled by a specialized sub-agent (e.g., code-testing-researcher, code-testing-planner), which invokes primitive skills to produce unit tests for the specified target language and framework.
What is the difference between skills and agents in the dotnet-test plugin?
Skills are atomic capabilities defined in individual SKILL.md files (e.g., run-tests, grade-tests) that perform specific operations. Agents are orchestration layers that chain multiple skills together into user-facing workflows. For example, the test-quality-auditor agent coordinates the six analysis skills, while the code-testing-generator agent manages the full test creation pipeline.
Can the quality analysis tools analyze non-.NET code?
Yes. The six analysis skills—test-anti-patterns, test-smell-detection, assertion-quality, test-gap-analysis, test-tagging, and grade-tests—are designed as polyglot capabilities. They use language-specific extension files to understand syntax variations, allowing them to analyze test quality in Python, Java, Go, Rust, and other supported languages using the same underlying logic.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →