scaffold-test-files — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited scaffold-test-files (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Given a .NET source file, automatically create matching unit test and integration test directories and files under the test project, following the project's existing conventions and clean DI patterns.
improve-test-coverage insteadrun-coverageanalyze-coverage-gaps| Input | Required | Description |
|---|---|---|
sourceFilePath | Yes | Full path to the .cs source file to create tests for |
testTypes | No | Comma-separated list: unit, integration, or both (default: both) |
Read the source file to extract:
MainProject.Subproject.Services)ExampleService)IRepository, ILogger<T>)Scan the solution for test projects:
glob **/*Test*.csproj
glob **/*Tests*.csprojDetermine the layout:
UnitTests.csproj and IntegrationTests.csproj exist separately → use each.csproj with folders like Unit/ and Integration/ inside → use subfoldersMap the source path to test paths by mirroring the subfolder structure:
Source: MainProject/Subproject/Services/ExampleService.cs
Separate projects:
TestProject.UnitTests/Subproject/Services/ExampleServiceTests.csTestProject.IntegrationTests/Subproject/Services/ExampleServiceIntegrationTests.csSingle project:
TestProject/UnitTests/Subproject/Services/ExampleServiceTests.csTestProject/IntegrationTests/Subproject/Services/ExampleServiceIntegrationTests.csCreate any missing directories.
Before generating boilerplate, read 2–3 existing test files in the test project to learn:
Mock<T>), NSubstitute (Substitute.For<T>), or FakeItEasy[TestFixture], [SetUp], [Test] (NUnit)MethodName_Condition_Result or other patternsServiceCollection or WebApplicationFactory is configuredIf no existing test files, use NUnit defaults with clean DI patterns.
Based on test type being generated:
references/unit.md for rulesreferences/integration.md for rulesApply these rules when generating the boilerplate.
Create the unit test file with boilerplate matching the project's conventions:
[TestFixture] class[SetUp] creating mocks for all injected interfacesimprove-test-coverage)Create the integration test file with clean DI + in-memory infrastructure:
[TestFixture] class[SetUp] building a real ServiceCollection with:UseInMemoryDatabase) if EF Core DbContext is usedServiceProvider built and class under test resolved from DICRITICAL: If you created a new test project or added NuGet packages (Moq, NUnit, Microsoft.NET.Test.Sdk, etc.), you MUST run dotnet restore before any test execution. When calling RunTestsWithCoverage after scaffolding, set forceRestore=true on the first run.
If the target repository's .gitignore does not already contain .mcp-coverage/, add it. This directory holds session-scoped coverage state files generated by the MCP server.
List all created directories and files with their paths.
| Pitfall | Solution |
|---|---|
| No test project found | Inform user to create a test .csproj first |
| Mixed conventions in existing tests | Follow the most common pattern (majority wins) |
| Source class has no constructor injection | Still create the test file; note it may use static methods or new directly |
| EF Core not used but integration test requested | Use ServiceCollection without in-memory DB; register real services with mocked external dependencies |
| Namespace mismatch | Always derive test namespace from the test project root namespace + mirrored subfolder path |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.