dotnet-efficient-validationlisted
Install: claude install-skill dougcunha/TokenHound
# Efficient .NET validation
## When to use
Use this skill before any execution of:
- `dotnet build`;
- test discovery or execution with VSTest or Microsoft.Testing.Platform (MTP);
- `dotnet publish`;
- `dotnet run`;
- validation of a C# solution, project, or test.
## Procedure
1. Identify the directly affected project or solution. For tests, determine the runner under **Runner detection** before choosing arguments.
2. Prefer the most specific test. In VSTest, use `--filter`; for MTP, read [references/mtp.md](references/mtp.md) in full before listing or running tests.
3. If restore assets are missing or package references changed, restore once:
```powershell
rtk dotnet restore <project-or-solution> --nologo --verbosity:minimal
```
4. With updated assets, build without restore only when a valid build does not already exist:
```powershell
rtk dotnet build <project-or-solution> --no-restore --nologo --verbosity:minimal
```
5. Reuse the build only for the same code, configuration, framework, and runtime. In **VSTest**, run without rebuilding or restoring:
```powershell
rtk dotnet test <project-or-solution> --no-build --no-restore --nologo --logger "console;verbosity=minimal"
```
To discover names or investigate a filter with no matches, add `--list-tests` and check the listed tests. Listing does not replace execution. In MTP, use the command for the mode identified in the reference.
6. Run `dotnet publish` only when the published artifact