grade-tests
它能做什么
这项技能为你选定的测试列表评定就绪度和质量,并说明每个测试需要改进的地方。适合希望针对特定测试(例如拉取请求中的测试)获得简短、清晰报告的开发者和审阅者。
适用场景
- ✓当审阅者需要拉取请求中特定测试的质量等级时。
- ✓当你想检查某个指定的测试是否可以放心依赖时。
- ✓当一组新增或修改的测试需要逐个测试的报告和改进建议的时候。
技能链接
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/grade-tests/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为这个拉取请求中的三个新测试评级,并告诉我每个测试需要改进什么。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会阅读你提供的每个测试及其覆盖的代码,应用固定的评分标准,并为每个测试给出结果、字母等级和建议修改。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Grade Tests
Assess a curated list of test methods and produce a compact, PR-comment-friendly report. The primary result is one of Pass, Failed, Uncertain, or Not applicable; an A-F quality grade remains secondary diagnostic information. The skill does not discover tests on its own — the caller (typically a PR automation workflow or a human reviewer holding a specific list) provides the tests or a bounded diff to assess.
After Step 0 admits a bounded scope, enforce these grading invariants:
- With production context, load
test-gap-analysisby name once before scoring, inper-test-read-onlycaller context. Read its owned composition reference; do not compute mutation evidence from this grading rubric or run its standalone workflow. Report N/A / unverified only when the dependency, reference, or required context is actually unavailable. - Any reported mutation inference must use Likely killed (inferred) or Candidate survivor (unverified), even when explained in prose.
- Apply only the rubric below, not extra heuristics such as a duplicate-test penalty. Do not use sibling tests to alter the individual assessment.
- A B quality grade does not require a Failed result; a complete focused test may have no actionable change.
Language-specific guidance: Read the caller-provided matching extension file, or the runtime-listed
test-analysis-extensionscatalog and its matching language file. The reference-only helper is not an invocable skill. If its files are absent, use the embedded rubric and pinned framework APIs; mark an essential unresolved framework construct Uncertain instead of guessing or searching installation directories.
Why a Decision Result Plus Quality Detail
PR reviewers need a simple answer to does this test need follow-up? The four-state result provides that decision; the existing A-F rubric explains its quality and severity.
When to Use
- A PR automation workflow needs to post a decision on the tests introduced or modified in a pull request.
- A reviewer has a specific list of tests (a file, a class, a method list, or a diff hunk) and wants per-test follow-up decisions rather than a suite report.
- A maintainer wants to triage which of N tests in a contribution deserve follow-up improvements, with quality grades for resolved tests.
When Not to Use
- The caller wants a full suite audit or comparative metrics — use
test-anti-patterns(pragmatic) ortest-smell-detection(formal) and let thetest-engineeragent orchestrate its internal quality specialist. - The caller wants to write new tests — use
test-engineer(any language) orwriting-mstest-tests(MSTest specifically). - The caller wants to measure code coverage or CRAP scores — use
coverage-analysisorcrap-score(.NET only). - The caller wants to fix issues directly in test code — invoke the appropriate editing skill.
- No specific list of tests is provided. Do not try to grade every test in the workspace; ask the caller for an explicit list or scope.
Inputs
| Input | Required | Description |
|---|---|---|
| Test methods | Yes | A scope to grade. Provide one of: (a) an explicit list of test method names (fully-qualified, e.g. Namespace.ClassName.TestMethodName); (b) one or more file paths plus an explicit instruction to grade every test declared in those files; or (c) a diff hunk / PR identifier whose changed tests should be graded. File paths are recommended but optional when method names are unambiguous in the workspace. Ambiguous requests like "grade my tests" with no scope are rejected up-front (see Step 0); this skill is for curated input and does not auto-grade an entire workspace. |
| Test bodies / spans | Recommended | The exact source lines for each test method. If omitted, read them from the listed files. |
| Production code | No | The code under test, for judging whether assertions cover the claimed behavior. When unavailable, mark the mutation assessment N/A / unverified rather than guessing or deducting. |
| Language reference | No | A host-supplied path to the matching bundled test-analysis-extensions file. Read it directly instead of invoking its reference-only loader; do not substitute unverified framework guidance. |
| Diff context | No | When grading PR changes, the unified diff for each test method helps focus on what actually changed. |
Step 0: Validate the input
Before
常见问题
它会自行查找测试吗?
不会。它只评定你提供的测试或限定范围的差异,因此列表由你或你的审阅流程选定。
字母等级是主要结果吗?
不是。主要结果是通过、失败、不确定或不适用,字母等级是次要的。
它会修改我的测试吗?
这是只读评估,因此它会报告应改动的内容,而不是直接编辑测试。
详情
作者的原始描述
Grade curated individual tests for readiness, A-F quality and improvements. ALWAYS USE FOR: grade tests, review only a named test, per-test readiness or quality bands for supplied methods, bodies, file spans or bounded PR diffs, including existing tests. Return Pass/Failed/Uncertain/Not applicable; unresolved/empty scopes omit grades. Compose read-only per-test evidence. Polyglot. DO NOT USE FOR: suite audits (test-engineer/test-anti-patterns), concrete fix/feature detection proof (test-value-evidence), writing/fixing tests, or coverage.
repo: dotnet/skills
热度
- GitHub 星标
- 5.8k
- 排名
- #14631
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-custom-agent
5.8k帮你的智能体创建 VS Code 自定义智能体文件,为每个智能体设置专属工具、指令以及向其他智能体的交接。
create-skill
5.8k帮你的智能体创建新的智能体技能,包括有效的名称、清晰的触发描述,以及符合标准的 SKILL.md 文件。
csharp-scripts
5.8k帮你的智能体通过 .NET 命令行工具以单个文件运行小型 C# 程序,无需创建完整项目。
dotnet-pinvoke
5.8k帮你的智能体在 .NET 中正确调用原生 C 或 C++ 库,涵盖函数签名、字符串处理、内存和安全句柄。