audit
Audits one or more .NET repositories for build, package and analyzer problems and separates certain fixes from judgment calls. Use for repository or fleet build-policy audits, shared SDK/package consistency and cross-repository version rollouts. Focused MSTest setup, execution and test-quality reviews belong to mstest-extensions.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- audit
- license
- Apache-2.0
- description
- Audits one or more .NET repositories for build, package and analyzer problems and separates certain fixes from judgment calls. Use for repository or fleet build-policy audits, shared SDK/package consistency and cross-repository version rollouts. Focused MSTest setup, execution and test-quality reviews belong to mstest-extensions.
02 资源文件 1
- 参考文档references/mstest-routing.md2.0 KB
03 SKILL.md 正文
.NET repository audit
Read-only until the report is accepted. The output is a ledger; every line can be checked by someone opening the cited file.
1. Scope
- Name the repositories and their default-branch state:
git -C <repo> status -sb, and whether the working tree has someone else's uncommitted work (never touch it). - For a fleet audit, start with an inventory table: repository,
global.json(sdk.version,rollForward,msbuild-sdks), SDK used by the projects, shared-package versions and where each is set, release mechanism. Include test-platform observations when requested, using the MSTest routing table.
2. Passes
Invoke only installed skills for the requested passes; do not reach into sibling skill files. Mark a missing specialist as unverified and continue independent passes. When the environment supports subagents, give each pass (or each repository) to its own subagent with the rulebook named in the prompt and a read-only instruction, then merge the ledgers. Otherwise run the passes in sequence.
| Pass | Rulebook | Looks at |
|---|---|---|
| Versions | ancplua-dotnet:nuget-versions |
global.json, Version.props, Directory.Packages.props, csproj versions, Renovate annotations, stale overrides |
| Build | ancplua-dotnet:msbuild |
csproj, props, targets, slnx, CI build steps |
| Analyzers | ancplua-dotnet:analyzers |
how analyzers arrive, analysis modes, every suppression, stale IDs |
| MSTest, when in scope | Companion skill routing | delegate project setup, execution, extensions and test-quality analysis to their focused owners |
| Release | ancplua-dotnet:release |
publish workflows, gates, credentials model, tag hygiene |
| Runtime cost, when requested | ancplua-dotnet:performance |
existing measurements or source hypotheses; retain the audit's read-only scope |
| Constants/dead code, when requested | ancplua-dotnet:csharp-refactoring |
complete declaration/caller inventory, indirect production uses, disposition and measured cost |
Useful searches (ripgrep; skip bin/, obj/, artifacts/, node_modules/, TestResults/):
rg -n --glob '*.{csproj,props,targets}' '<NoWarn>|WarningsNotAsErrors|TreatWarningsAsErrors|AnalysisMode|RunAnalyzers'
rg -n --glob '{.editorconfig,*.globalconfig}' 'dotnet_diagnostic\.[A-Z]+[0-9]+\.severity'
rg -n --glob '*.cs' '#pragma warning disable|SuppressMessage\('
rg -n --glob '*.{csproj,props,targets}' 'Version="[0-9]|VersionOverride|LangVersion|<Nullable>'
3. Classify every finding
- Certain: objectively wrong, with exactly one correct fix that changes no intended behavior.
Examples: a suppression of a rule ID that no longer exists, an override equal to SDK truth,
msbuild-sdksentries for packages that aren't MSBuild SDKs. - Judgment call: several reasonable fixes, or the fix changes behavior someone may rely on (raising a severity, deleting a blanket suppression that hides real diagnostics, changing an import contract). Give your recommended option and the reason, and don't apply it without agreement.
- Veracity gate: demonstrate the failure in an affected supported environment or configuration. State that scope; a platform-specific defect is still a defect. Treat an unverified failure mechanism as a risk rather than claiming reproduction.
4. Ledger format
One block per repository, then a cross-repository table:
<repo>
certain: file:line | rule | evidence | fix
judgment: file:line | rule | evidence | options -> recommended (why)
ok: what was checked and found correct (one line per pass)
Totals per category must equal the number of lines listed. When the audit leads to fixes, apply certain fixes per repository in one commit each, verify (build, tests), and list what changed beyond the request as side effects.
04 同仓库更多 Skills
csharp-union-types
Design, review and implement C# 15 unions and closed hierarchies in .NET 11 code. Use for union declarations, custom [Union] types, exhaustive matching, default/null handling and union serialization. Do not upgrade earlier frameworks or replace working inheritance merely because unions exist.
release
Releases .NET NuGet packages through a layered chain (library, MSBuild SDK, analyzers, consumers) without breaking restore. Use when publishing a package, bumping a lower-layer dependency in its consumers, moving a .NET SDK pin across repositories, choosing tag-driven versus push-driven publishing, setting up NuGet trusted publishing, or waiting for nuget.org to index a version before consumers restore it.
performance
Investigate .NET runtime performance using logs, metrics, traces, spans and profiles; collect crash/hang diagnostics. Use for CPU, GC, allocation or latency problems, hot-path reviews and BenchmarkDotNet comparisons. MSBuild timing belongs to msbuild; MSTest execution belongs to mstest-extensions.
nuget-versions
Manage .NET package and SDK versions, CPM migrations, Version.props ownership, global.json pins, isolated SDK installations and Renovate updates. Use for package bumps, conflicting or missing versions, NuGet restore errors and SDK selection. MSTest runner/profile semantics belong to mstest-extensions.
msbuild
Writes and reviews MSBuild evaluation, properties, items, imports, custom targets and build/buildTransitive package assets for SDK-style .NET repositories. Use for ignored or empty properties/items, generated files, analyzer/build-asset packaging, build-file reviews, binlog diagnosis and incremental-build problems. Focused MSTest project setup, runner configuration and test commands belong to mstest-extensions.
csharp-refactoring
Refactor C# and reconcile stale constants, dead checks and abandoned code, including indirect production uses. Use for renames, moves, deduplication, exhaustive cleanup, generated declarations and runtime/API contracts. MSTest test design and review belong to mstest-extensions.