Evaluate PR Tests
dotnet/maui
Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.
Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file.
$ npx skills add microsoft/testfx --skill crap-score -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/testfx crap-score --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/crap-score .claude/skills/crap-score && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .claude/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-scoreType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add microsoft/testfx --skill crap-score -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/testfx crap-score --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/crap-score .agents/skills/crap-score && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .agents/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/testfx --skill crap-score -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/testfx crap-score --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/crap-score .cursor/skills/crap-score && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .cursor/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/microsoft/testfx.git --path .agents/skills/crap-score--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add microsoft/testfx --skill crap-score -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/testfx crap-score --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/crap-score .gemini/skills/crap-score && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .gemini/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install microsoft/testfx crap-scoreInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add microsoft/testfx --skill crap-score -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/crap-score .github/skills/crap-score && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .github/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/testfx --skill crap-score -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install microsoft/testfx crap-score --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/testfx.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/crap-score .opencode/skills/crap-score && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "crap-score" agent skill from https://github.com/microsoft/testfx/tree/main/.agents/skills/crap-score into .opencode/skills/crap-score/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "crap-score", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
crap-scoreCalculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file.
Crap Score is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file. Use when the user explicitly asks to compute CRAP scores or assess risky untested code for a specific target, combining Cobertura coverage data with cyclomatic complexity analysis. DO NOT USE FOR: project-wide coverage analysis, coverage plateau or "stuck coverage" diagnosis, what's blocking coverage, or where to add tests across a project (use coverage-analysis); writing tests; running tests without…
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Test coverage. It works with .NET. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 7c7d590. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dotnetFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Crap Score loads about 1.9k tokens when it runs. Until then it costs about 136 tokens; SKILL.md has 843 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from microsoft/testfx at commit 7c7d590, republished under its MIT licence (© microsoft). 843 words, ~1,927 tokens.
.claude/skills/crap-score/SKILL.md (or your agent's skills folder).Calculate CRAP (Change Risk Anti-Patterns) scores for .NET methods to identify code that is both complex and undertested.
The CRAP score combines cyclomatic complexity and code coverage into a single metric:
$$\text{CRAP}(m) = \text{comp}(m)^2 \times (1 - \text{cov}(m))^3 + \text{comp}(m)$$
Where:
| CRAP Score | Risk Level | Interpretation |
|---|---|---|
| < 5 | Low | Simple and well-tested |
| 5-15 | Moderate | Acceptable for most code |
| 15-30 | High | Needs more tests or simplification |
| > 30 | Critical | Refactor and add coverage urgently |
A method with 100% coverage has CRAP = complexity (the minimum). A method with 0% coverage has CRAP = complexity^2 + complexity.
run-tests skill)writing-mstest-tests skill or general coding assistance)| Input | Required | Description |
|---|---|---|
| Target scope | Yes | Method name, class name, or file path to analyze |
| Test project path | No | Path to the test project. Defaults to discovering test projects in the solution. |
| Source project path | No | Path to the source project under analysis |
If no coverage data exists yet (no Cobertura XML available), always run dotnet test with coverage collection first and mention the exact command in your response. Do not skip this step -- CRAP scores require coverage data.
Check the test project's .csproj for the coverage package, then run the appropriate command:
| Coverage Package | Command | Output Location |
|---|---|---|
coverlet.collector | dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults | Typically under TestResults/<guid>/coverage.cobertura.xml. Search recursively under the results directory (for example, TestResults/**/coverage.cobertura.xml) or use any explicit coverage path the user provides. |
Microsoft.Testing.Extensions.CodeCoverage (.NET 9) | dotnet test -- --coverage --coverage-output-format cobertura --coverage-output ./TestResults | --coverage-output path |
Microsoft.Testing.Extensions.CodeCoverage (.NET 10+) | dotnet test --coverage --coverage-output-format cobertura --coverage-output ./TestResults | --coverage-output path |
Analyze the target source files to determine cyclomatic complexity per method. Count the following decision points (each adds 1 to the base complexity of 1):
| Construct | Example |
|---|---|
if | if (x > 0) |
else if | else if (y < 0) |
case (each) | case 1: |
for | for (int i = 0; ...) |
foreach | foreach (var item in list) |
while | while (running) |
do...while | do { } while (cond) |
catch (each) | catch (Exception ex) |
&& | if (a && b) |
|| (OR) | if (a || b) |
?? | value ?? fallback |
?. | obj?.Method() |
? : (ternary) | x > 0 ? a : b |
| Pattern match arm | x is > 0 and < 10 |
Base complexity is 1 for every method. Each decision point adds 1.
When analyzing, read the source file and count these constructs per method. Report the breakdown.
Parse the Cobertura XML to find each method's line-rate attribute under the target <class> element. If line-rate is not available at method level, compute it from the <lines> elements:
$$\text{cov}(m) = \frac{\text{lines with hits} > 0}{\text{total lines}}$$
Method names in Cobertura may differ from source (async methods, lambdas). Match by line ranges when names don't align.
For each method in scope, apply the formula:
$$\text{CRAP}(m) = \text{comp}(m)^2 \times (1 - \text{cov}(m))^3 + \text{comp}(m)$$
Present a sorted table (highest CRAP first):
| Method | Complexity | Coverage | CRAP Score | Risk |
|---------------------------------|------------|----------|------------|----------|
| OrderService.ProcessOrder | 12 | 45% | 28.4 | High |
| OrderService.ValidateItems | 8 | 90% | 8.1 | Moderate |
| OrderService.CalculateTotal | 3 | 100% | 3.0 | Low |Include:
For high-CRAP methods, suggest one or both:
Calculate the coverage needed to bring a method below a CRAP threshold of 15:
$$\text{cov}_{\text{needed}} = 1 - \left(\frac{15 - \text{comp}}{\text{comp}^2}\right)^{1/3}$$
This formula only applies when comp < 15. When comp >= 15, the minimum possible CRAP score (at 100% coverage) is comp itself, which already meets or exceeds the threshold. In that case, coverage alone cannot bring the CRAP score below the threshold -- the method must be refactored to reduce its cyclomatic complexity first.
Report this as: "To bring ProcessOrder (complexity 12) below CRAP 15, increase coverage from 45% to at least 72%." For methods where complexity alone exceeds the threshold, report: "ComplexMethod (complexity 18) cannot reach CRAP < 15 through testing alone -- reduce complexity by extracting sub-methods."
*.Designer.cs, *.g.cs) from analysis unless explicitly requested.© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/crap-score of microsoft/testfx.
Open the folder on GitHubat commit 7c7d590
Crap Score next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Crap Score this skillmicrosoft/testfx | 1k | — | ~1.9k | Automated safety check: Pass | MIT | |
| Evaluate PR Testsdotnet/maui | 23k | — | ~2.9k | Automated safety check: Pass | MIT | |
| Find Untested Sourcesdotnet/skills | 5.6k | 1 repos | ~3.3k | Automated safety check: Pass | MIT | |
| Coverage Analysisrunceel/ReactiveProperty | 944 | — | ~5.9k | Automated safety check: Warn | MIT | |
| Stryker Dotnetardalis/RiverBooks | 135 | — | ~1.9k | Automated safety check: Pass | None | |
| Coverage Analysis for .NETdotnet/skills | 5.6k | 1 repos | ~2.8k | Automated safety check: Pass | MIT |
dotnet/maui
Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.
dotnet/skills
Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.
runceel/ReactiveProperty
Automated, project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects with existing unit tests.
ardalis/RiverBooks
Run Stryker.NET mutation testing against a specific .NET source file.
dotnet/skills
Interprets .NET coverage reports to explain line and branch gaps, target arithmetic and, on request, CRAP-based risk hotspots, without rerunning tests.
Log2n-io/Typhon
Run code coverage analysis, track class-level results, and generate trend reports
microsoft/testfx
Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.
microsoft/testfx
Analyze MSBuild binary logs to diagnose build failures. An agent skill from microsoft/testfx.
microsoft/testfx
Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.
microsoft/testfx
Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.
microsoft/testfx
Guide for modernizing and migrating MSBuild project files to SDK-style format.
microsoft/testfx
Catalog of MSBuild anti-patterns with detection rules and fix recipes.
Works with
Categories
Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file. Crap Score is an agent skill from microsoft/testfx, published by the product's own GitHub organization.NET method, class, or single source file.
Crap Score fits situations like: the user explicitly asks to compute CRAP scores; assess risky untested code for a specific target; combining Cobertura coverage data with cyclomatic complexity analysis; : project-wide coverage analysis.
Run `npx skills add microsoft/testfx --skill crap-score -a claude-code`. Or copy the skill folder (.agents/skills/crap-score in microsoft/testfx) into .claude/skills/crap-score in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/testfx --skill crap-score -a codex`. Or copy the skill folder (.agents/skills/crap-score in microsoft/testfx) into .agents/skills/crap-score in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/testfx --skill crap-score -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/crap-score, .gemini/skills/crap-score, .github/skills/crap-score and .opencode/skills/crap-score in your project.
Going by SKILL.md and its folder, Crap Score needs the command-line tools its instructions call (dotnet).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Crap Score is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Crap Score: Evaluate PR Tests (dotnet/maui, 23k stars), Find Untested Sources (dotnet/skills, 5.6k stars), Coverage Analysis (runceel/ReactiveProperty, 944 stars) and Stryker Dotnet (ardalis/RiverBooks, 135 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 8, 2026.
Source: microsoft/testfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.