grade-tests
Skill này làm gì
Skill này chấm điểm một danh sách test đã chọn về độ sẵn sàng và chất lượng, đồng thời giải thích cần cải thiện điều gì ở từng test. Dành cho lập trình viên và người review muốn có báo cáo ngắn gọn, rõ ràng về các test cụ thể, chẳng hạn trong một pull request.
Khi nào nên dùng
- ✓Khi người review muốn có điểm chất lượng cho các test cụ thể trong một pull request.
- ✓Khi bạn muốn kiểm tra xem một test được đặt tên có đủ tin cậy để dựa vào hay không.
- ✓Khi một nhóm test mới hoặc đã thay đổi cần báo cáo riêng cho từng test kèm gợi ý cải thiện.
Liên kết skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/grade-tests/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy chấm điểm ba test mới trong pull request này và cho tôi biết cần cải thiện điều gì ở từng test.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc từng test được cung cấp và đoạn code mà test đó kiểm tra, áp dụng một bộ tiêu chí chấm điểm cố định, rồi báo cáo kết quả cùng điểm chữ và các thay đổi gợi ý cho từng test.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Nó có tự tìm test không?
Không. Nó chỉ chấm các test hoặc phần thay đổi có giới hạn mà bạn đưa vào, nên danh sách do bạn hoặc quy trình review của bạn quyết định.
Điểm chữ có phải là kết quả chính không?
Không. Kết quả chính là Đạt, Không đạt, Chưa chắc hoặc Không áp dụng. Điểm chữ chỉ là phần phụ.
Nó có sửa test của tôi không?
Không. Đây là đánh giá chỉ đọc, nên nó chỉ báo cáo những gì cần thay đổi chứ không tự chỉnh sửa test.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14631
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
create-custom-agent
5.8kGiúp agent của bạn tạo file custom agent cho VS Code, với các tool, hướng dẫn và handoff riêng sang agent khác.
create-skill
5.8kGiúp agent của bạn tạo một agent skill mới với tên hợp lệ, mô tả kích hoạt rõ ràng và file SKILL.md đúng tiêu chuẩn.
csharp-scripts
5.8kGiúp agent của bạn chạy một chương trình C# nhỏ dưới dạng một file duy nhất bằng công cụ dòng lệnh .NET, không cần tạo project đầy đủ.
dotnet-pinvoke
5.8kGiúp agent của bạn gọi các thư viện native C hoặc C++ từ .NET đúng cách, gồm khai báo chữ ký, xử lý chuỗi, bộ nhớ và safe handle.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.