.NET 코드 커버리지 보고서를 분석하여 라인, 분기, 조건 메트릭을 해석하고 CRAP 점수를 통해 리팩터링 안전성을 평가합니다.
- GitHub 스타
- 5,942
- 파일
- 8
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- MIT
- 허용된 도구
- —
coverage-analysis skill은 무엇을 하나요?
.NET 코드 커버리지 보고서를 분석하여 라인, 분기, 조건 메트릭을 해석하고 CRAP 점수를 통해 리팩터링 안전성을 평가합니다.
skill의 SKILL.md에서 생성된 요약입니다.
coverage-analysis skill 정보
.NET 프로젝트를 진행하는 개발자는 이 SKILL을 사용하여 코드 커버리지 메트릭을 해석하고 리팩터링 작업의 안전성을 평가할 수 있습니다. 라인, 분기, 조건 커버리지 데이터를 처리하여 프로젝트가 특정 커버리지 목표에 도달하지 못하는 원인을 파악합니다. Cobertura 보고서를 분석함으로써 커버리지 격차를 설명하고, 정체 구간을 식별하며, 목표 달성을 위해 정확히 몇 라인을 더 커버해야 하는지 계산하여 보여줍니다.
에이전트는 커버리지 증거가 제공되거나 사용자가 분석을 위해 .NET 커버리지 수집을 명시적으로 요청할 때 이 SKILL을 로드해야 합니다. 보고서가 없는 경우, 이 SKILL은 SDK 스타일 프로젝트에 대한 Cobertura 데이터를 생성하기 위해 run-tests 도구를 트리거할 수 있습니다. 주로 해석에 집중하지만, 사용자가 복잡도 가중 우선순위(complexity-weighted priority) 또는 리팩터링 안전성 분석을 구체적으로 요청하면 리스크 핫스팟의 순위를 매기고 프로젝트 전체의 CRAP 점수를 계산할 수도 있습니다. 공식 보고서 파일이 요청되지 않는 한, 전체 대시보드보다는 직접적인 답변과 요약된 테이블을 제공하도록 설계되었습니다.
agent가 수행할 수 있는 작업
- 1리팩터링 안전성 계산복잡도와 커버리지 메트릭을 결부터 고위험 핫스팟을 찾아 리팩터링 위험을 평가합니다.
- 2누락된 커버리지 데이터 수집워크스페이스에 커버리지 보고서가 없는 경우 테스트 실행을 자동으로 트리거하여 보고서를 생성합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
coverage-analysis skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 coverage-analysis skill 설치
/plugin marketplace add dotnet/skills /plugin install dotnet-test@dotnet-agent-skills
Claude Code에 coverage-analysis skill 설치
~/.claude/skills/coverage-analysis/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis ~/.claude/skills/coverage-analysisClaude Code (project)에 coverage-analysis skill 설치
.claude/skills/coverage-analysis/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis .claude/skills/coverage-analysisCodex에 coverage-analysis skill 설치
~/.agents/skills/coverage-analysis/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis ~/.agents/skills/coverage-analysisGemini CLI에 coverage-analysis skill 설치
~/.gemini/skills/coverage-analysis/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis ~/.gemini/skills/coverage-analysisClaude.ai에 coverage-analysis skill 설치
npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis coverage-analysis && zip -r coverage-analysis.zip coverage-analysis # claude.ai → Customize → Skills → + → Create skill → Upload a skill → coverage-analysis.zip
자동 검사
2026년 11월 15일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 보안 감사는 아닙니다. 에이전트가 실행하기 전에 스크립트를 읽어 보세요. 검사 방식
- 소스 저장소 연결 및 접근 가능dotnet/skills/plugins/dotnet-test/skills/coverage-analysis is public and reachablegithub.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skill ↗통과
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit 2026-11-11github.com/dotnet/skills/commits ↗통과
- 스크립트에 다운로드 후 실행이나 자격 증명 탈취가 없음3 scripts read; no download-and-run, remote eval, base64 execution or credential upload통과
- SKILL.md에 숨겨진 지침 없음No override phrases, safeguard switches, credential requests or hidden charactersgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗통과
- 사전 허용 도구가 제한됨No pre-approved tools; the agent asks before using onegithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗통과
- SKILL.md가 Agent Skills 형식을 따름Valid name and description; says when to use it; 200 linesgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗통과
SKILL.md
GitHub에서 보기Coverage Analysis
Purpose
Explain what .NET coverage evidence proves, reconcile target arithmetic, and identify the code blocking progress. Add complexity/CRAP ranking only when the user explicitly asks for risk hotspots, CRAP, priorities by risk, or refactoring safety.
When to Use
Use this skill for interpreting supplied .NET line/branch/condition evidence, coverage gaps and plateaus, target arithmetic, or explicit project-wide coverage-backed risk analysis.
When Not to Use
- Named method, class, or file CRAP/refactoring-safety analysis — use the
crap-scoreskill instead - Static source-to-test pairing or listing files with no tests — use
find-untested-sources - Behavioral or pseudo-mutation gaps in existing tests — use
test-gap-analysis - Test trait/category distributions or coverage shape by test type — use
test-tagging - Writing or generating tests — this skill identifies where tests are needed, not write them
- General test execution unrelated to coverage or CRAP analysis
- Only collecting .NET coverage or printing a raw percentage with no diagnosis — use
run-tests; use native tooling for non-.NET coverage collection or analysis. Interpreting .NET line/branch gaps remains in scope here
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
| Project/solution path | No | Current directory | Path to the .NET solution or project |
| Line coverage threshold | No | 80% | Minimum acceptable line coverage |
| Branch coverage threshold | No | 70% | Minimum acceptable branch coverage |
| Existing Cobertura path | No | Discover only if not supplied | Preferred input; never rerun tests when usable |
| CRAP threshold | No | 30 | Used only for explicit risk/CRAP requests |
| Hotspot count | No | 3 | Explicit risk requests only; cap at 10 unless the user asks for more |
Discover optional inputs from the workspace. Do not ask for a project path when the current directory or a supplied report is sufficient.
Choose the smallest matching path
| User intent | Required work | Do not do |
|---|---|---|
| Explain a supplied excerpt, condition, or summary | Answer directly from the supplied evidence | Tools, CRAP, discovery, report files |
| Interpret a supplied Cobertura path or diagnose a plateau | Read that report, reconcile totals, name all material gaps, answer directly | Rerun tests, install tools, compute CRAP, or generate files unless explicitly requested |
| Rank risk hotspots, compute project-wide CRAP, or assess refactoring safety | Use the supplied/existing report, read references/guidelines.md, and compute CRAP before ranking |
Coverage-only ranking or a full report template unless requested |
| Analyze coverage when no report exists | Invoke run-tests to collect coverage with the repository-compatible runner, then analyze the generated report |
Choose or execute a test command independently; CRAP unless risk was requested |
| Produce a full markdown/HTML/CSV report | First deliver the direct answer; then read references/output-format.md or references/report-generation.md |
Report generation before the answer |
Words such as analyze coverage, what is blocking coverage, or why is coverage stuck do not by themselves request CRAP. Explicit signals include risk hotspot, CRAP, complexity-weighted priority, safe to refactor, or an equivalent request to combine complexity with coverage.
Existing-data fast path
When the user supplies a coverage excerpt, summary, or valid Cobertura path:
- Treat it as authoritative input and start there.
- Do not discover the solution or test projects unless source mapping is necessary.
- Do not run
dotnet test, install ReportGenerator, add a coverage package, or readreferences/setup-discovery.mdorreferences/report-generation.md. - Do not write
coverage-analysis.mdor create a report directory unless the user requested a saved/full report. - For interpretation and plateau questions, parse only the evidence needed to
answer. For explicit project-wide risk requests, use the bundled scripts as
described in
references/guidelines.md.
A failed read/view operation is not proof that a named path does not exist. Classify the failure, then make one targeted existence probe and use a normalized path or alternate reader only for confirmed tool availability, transport, or path-normalization failures and only after verifying the canonical path remains inside the workspace. Stop on content-exclusion, permission/policy, workspace-boundary, or unknown failures. Report a missing path only when the independent probe also fails; do not broaden the search or substitute another artifact.
Collection path
Use this path only when no usable coverage evidence exists and the user asked for analysis that requires it.
- Read
references/setup-discovery.md. - Prefer existing Cobertura discovered under the requested root.
- If none exists, invoke
run-testsfor repository overlay, platform, runner, and command selection, and have it collect Cobertura once per entry point. - Analyze the resulting Cobertura. Compute CRAP only if risk analysis was explicitly requested.
When the workspace contains the project/test manifests needed by this path,
perform discovery directly and delegate collection to run-tests. Do not ask
the user to attach files or pre-run coverage that the current workspace lets
you inspect and generate.
Do not modify production code. Any incidental test-project change needed for
collection is owned by run-tests; include that change and its revert command
in the final analysis.
The automatic collection path is for SDK-style projects. For classic non-SDK or
packages.config projects, use only a repository-owned coverage command. If none
exists, stop and request Cobertura XML. Never migrate the project, inject an
SDK-style provider, create a wrapper project, or report substitute coverage from
another assembly.
Interpretation and arithmetic invariants
- A line hit proves execution, not both decision outcomes.
condition-coverage="50% (1/2)"proves one reported outcome ran, but not which one. Recommend forcing the opposite outcome. Without source, never invent likely predicates or claim whether true or false is missing. State that compound predicates need independently exercised operands and short-circuit combinations when applicable; do not infer the exact combinations without source or fuller XML.- Derive overall totals from Cobertura's covered/valid line counts. For target
T, required covered lines areceiling(valid lines × T). - Projected coverage is
(current covered lines + newly covered distinct lines) / valid lines. State assumptions such as fully covering a method. - When asked whether one member can reach a target, show its maximum projected total and at least one concrete sufficient combination of supplied members or line gains. If no supplied combination is sufficient, say so.
- For a multi-member target, name the exact combination and resulting covered / valid total; saying only "combine it with another member" is incomplete.
- Reconcile member gaps against project totals. Method line ranges can overlap or omit class-level lines, so do not sum method counts as project truth.
- Never call one member the sole, entire, or all remaining gap unless its distinct uncovered lines exactly reconcile with the project total and no other below-threshold member remains.
- Name every supplied or extracted below-threshold member, but keep detail proportional: lead with the blockers, summarize the remainder in one sentence or a compact table.
Response contract
Answer the user's question in the first 2–4 sentences.
- Excerpt or arithmetic question: one explanation plus the next test or member priority. No dashboard.
- Existing-report interpretation or plateau: overall line/branch coverage, blocking members, reconciled target impact, and 1–3 recommendations. Use at most one compact table.
- Explicit risk/CRAP request: top 3 actual hotspots by default, supporting complexity/coverage/CRAP values, remaining flagged count, and 1–3 priorities. Exclude fully covered low-risk methods from the hotspot table. Never exceed 10 rows unless the user requests a larger count. For refactoring safety, rank risky methods by CRAP rather than raw coverage alone, then name comparatively safe well-covered methods separately.
- Explicit full report request: read
references/output-format.md. Save the report only then.
Report only artifacts that exist. Do not announce inaccessible output paths or failed optional file writes when no file was requested.
Optional reports
HTML/CSV/markdown files are not part of normal analysis. Generate them only when the user explicitly requests report files or a CI artifact.
- Deliver the direct coverage/risk answer first.
- For a full markdown report, read
references/output-format.mdand save it. - For HTML/CSV, then read
references/report-generation.md. Do not install ReportGenerator before the direct answer, and do not retry a failed install.
Validation
- Confirm a supplied report was used without test execution or tool installation.
- Reconcile covered, valid, and uncovered line totals before projecting impact.
- Confirm every stated blocker comes from supplied or extracted evidence.
- If CRAP was requested, spot-check one score using
references/guidelines.md. - If files were requested, verify they exist before reporting their paths.
Common Pitfalls
- Existing report triggers setup work — stop. Analyze the named artifact first.
- Generic analysis triggers CRAP — stop. CRAP requires explicit risk intent.
- One method is called the entire gap — reconcile distinct uncovered lines and the full below-threshold set first.
- A small request gets a dashboard — scale down to a direct answer or one table.
- No Cobertura from collection — report the collection failure; do not invent substitute coverage.
- Compiler-generated method names — verify suspicious async, lambda, or local function names against source before presenting them as user-authored members.
- Test exit code 1 — coverage may still exist; proceed with a warning. Other nonzero build failures stop the collection path.
이 스킬의 파일
8coverage-analysis skill 질문
Claude Code에 coverage-analysis skill을 어떻게 설치하나요?
npx degit dotnet/skills/plugins/dotnet-test/skills/coverage-analysis ~/.claude/skills/coverage-analysis를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
coverage-analysis skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
이 도구로 커버리지 수집을 위한 테스트를 실행할 수 있나요?
현재 사용 가능한 보고서가 없는 경우 run-tests를 호출하여 Cobertura 커버리지를 수집할 수 있지만, 테스트를 다시 실행하기보다 기존 보고서를 직접 분석하는 것을 선호합니다.
커버리지 분석을 요청하면 CRAP 점수도 자동으로 포함되나요?
아니요, CRAP 및 리스크 핫스팟 분석은 사용자가 'risk hotspot' 또는 'complexity-weighted priority'와 같은 용어를 사용하여 명시적으로 요청할 때만 수행됩니다.
특정 메서드의 CRAP 점수를 분석하려면 어떻게 해야 하나요?
특정 메서드나 클래스와 같이 이름이 지정된 단일 대상을 분석하려면 crap-score SKILL을 사용해야 합니다.