Commit Graph

45 Commits

Author SHA1 Message Date
YuliiaKovalova dcba4f3d8e Add dotnet-template-engine plugin (#341)
* Add dotnet-template-engine plugin

Add template-engine skills for .NET project scaffolding powered by the
DotnetTemplateMCP MCP server (v1.1.0). Includes three skills and one agent:

Skills:
- template-discovery: find, inspect, and compare templates with intent
  resolution (70+ keyword mappings)
- template-instantiation: create projects with CPM adaptation, latest NuGet
  versions, parameter validation, and multi-template composition
- template-authoring: create templates from existing projects and validate
  template.json for authoring issues

Agent:
- template-engine: expert agent that routes to the appropriate skill based
  on user intent

Also adds CODEOWNERS entries, marketplace.json registration, eval tests,
and .mcp.json for DotnetTemplateMCP server configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback: mcpServers in plugin.json, expect_tools, path fix

- Move MCP server config into plugin.json under mcpServers so SkillValidator
  discovers the template_* tools during evaluation runs
- Add expect_tools constraints to all eval scenarios to verify actual MCP
  tool invocation instead of relying on rubric text alone
- Fix frontmatter path: template.config → .template.config (leading dot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update DotnetTemplateMCP to v1.2.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Include 'dotnet new' in agent description for discoverability

Address review feedback from danmoseley: the frontmatter description
is how the caller decides whether to load the agent tokens, so it
needs to mention 'dotnet new' as a trigger keyword.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove MCP server configuration and references

- Delete .mcp.json MCP server config file
- Remove mcpServers section from plugin.json
- Remove MCP/DotnetTemplateMCP references from agent, skills, and marketplace descriptions
- Skills and eval files remain unchanged

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove ghost tool references and add CLI fallback guidance

- Remove references to 4 non-existent tools: template_compose,
  template_suggest_parameters, template_validate, solution_analyze
- Replace with real alternatives (template_inspect, manual review,
  sequential template_instantiate, direct file inspection)
- Add CLI fallback guidance so LLMs degrade gracefully when
  template tools are unavailable
- Fix authoring eval to not expect template_validate tool

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback: CODEOWNERS naming, claude marketplace, README

- Rename CODEOWNERS header to dotnet-template-engine for consistency
- Mirror plugin entry in .claude-plugin/marketplace.json
- Add plugin to README What's Included table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix PR review comments: align eval rubric with expect_tools and sync marketplace.json

- Updated template-discovery eval.yaml rubric to match expect_tools
  (removed 'or template_search' since expect_tools enforces template_from_intent)
- Made .claude-plugin/marketplace.json byte-for-byte identical to
  .github/plugin/marketplace.json (removed extra trailing newline)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review comments: strengthen eval assertions and fix rubrics

- Add exit_success assertions to all eval scenarios
- Add file_exists and file_contains assertions for template-instantiation
- Add output_contains for shortName and datatype in template-authoring
- Fix rubrics to reference actual tools (skill + dotnet new CLI) instead
  of non-existent MCP tools (template_from_intent, template_inspect,
  template_instantiate) which caused the judge to penalize quality scores
- Update expect_tools from non-existent MCP tools to 'skill'
- Change plugin version from 1.2.0 to 0.1.0 for consistency with other plugins
- Remove extra blank line in README.md after plugin table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rewrite skills and agent to use dotnet new CLI instead of phantom MCP tools

The SKILL.md files and agent.md referenced MCP tools (template_from_intent,
template_inspect, template_instantiate, template_dry_run, etc.) that are
not available at runtime since no MCP server is declared in plugin.json.
This caused the agent to waste tokens attempting to find these tools before
falling back to dotnet new CLI commands.

Changes:
- template-discovery/SKILL.md: Replace MCP tool calls with dotnet new
  search, dotnet new list, dotnet new --help, and dotnet new --dry-run.
  Add intent-to-template keyword mapping table.
- template-instantiation/SKILL.md: Replace template_instantiate with
  dotnet new CLI commands. Add explicit CPM adaptation steps and
  multi-project composition with dotnet sln/dotnet add reference.
- template-authoring/SKILL.md: Replace template_create_from_existing
  with manual template.json creation guidance including example JSON.
  Replace template_dry_run/template_instantiate with CLI equivalents.
- template-engine.agent.md: Replace Available Tools table with CLI
  Commands Reference. Update all workflow steps to use CLI commands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix file assertion paths: remove ./ prefix for glob matcher compatibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
2026-03-18 22:51:20 +01:00
Jeff Handley 646b5d93b0 Add Skill: Convert to Central Package Management (convert-to-cpm) (#75)
* Add convert-to-cpm skill for NuGet Central Package Management conversion

Authoring process:
- Researched the Agent Skills standard at agentskills.io and reviewed repo conventions
- Studied the existing csharp-scripts skill and test structure as a reference implementation
- Studied Microsoft's CPM documentation at learn.microsoft.com
- Authored SKILL.md with a 9-step workflow covering scope determination through validation
- Created 5 test scenarios across simple, moderate, and advanced tiers
- Performed dry-run evaluation against all scenarios, identifying 15 findings
- Applied all 15 fixes (4 gaps, 6 ambiguities, 5 improvements) to SKILL.md
- Re-evaluated: 50 OK, 0 gaps, 0 ambiguities, 1 test fixture improvement
- Updated test fixture to resolve the remaining finding
- Final validation: 254 lines, 0 errors, 0 warnings

Skill implementation (skills/convert-to-cpm/SKILL.md):
- 9-step workflow: scope, CPM check, audit, create/update props, update projects, handle properties, restore/validate, cleanup, summary
- Handles single projects, solutions, and full repositories
- Audits packages with per-project detail table including version conflicts and security advisories
- Flags CVE/security vulnerabilities and recommends patched versions
- Supports MSBuild property-based versioning with inline vs keep decisions
- Covers conditional PackageReference items across target frameworks
- Discovers PackageReference in imported .props/.targets via Import chain scanning
- Provides cross-platform commands (Unix and Windows/PowerShell)
- Documents import order requirements for property references in Directory.Packages.props
- Mentions dotnet new packagesprops as preferred creation method (.NET 8+)
- Includes validation checklist and common pitfalls table

Test scenarios (tests/convert-to-cpm/):
- simple-single-project: 1 project, 3 packages, no conflicts
- simple-solution: 3 projects via .sln, 5 packages, PrivateAssets preservation
- moderate-version-conflicts: 4 projects, System.Text.Json version conflicts with CVE-2024-43485 advisory, AutoMapper major version conflict with VersionOverride
- moderate-msbuild-properties: 2 projects using MSBuild properties for versioning in Directory.Build.props, inline vs keep decisions, property cleanup verification
- advanced-multi-complexity: 5 projects combining version conflicts, MSBuild properties, conditional TFM PackageReference, shared Common.props imports, VersionOverride, and security advisory handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor SKILL.md with references, baseline build, and package comparison

Condensed SKILL.md using progressive disclosure:
- Reduced from 254 lines / ~3937 tokens to 120 lines / ~1778 tokens
- Extracted detailed procedural instructions into 5 focused reference files
- Main file retains workflow decision logic with links to references loaded on demand
- Follows agentskills.io progressive disclosure pattern: metadata -> instructions -> resources

Added baseline build verification (new Step 2):
- Requires clean build (dotnet clean && dotnet build) before any changes
- Captures baseline.binlog for structured build artifact
- Captures baseline-packages.json via dotnet list package --format json
- Blocks conversion if baseline build fails

Added post-conversion baseline comparison (Steps 8 and 10):
- Step 8 produces after-cpm.binlog and after-cpm-packages.json from clean build
- Step 10 compares baseline vs post-conversion package lists per project
- Changes table shows version bumps, VersionOverride entries, added/removed packages
- Unchanged table confirms version-neutral conversion for unmodified packages
- Binlog files produced as artifacts for user review in MSBuild Structured Log Viewer

Reference files created:
- references/audit-complexities.md: 7 complexity categories for package auditing
- references/baseline-comparison.md: dotnet list package comparison procedure, binlog production, artifact guidance, table formats for changes and unchanged packages
- references/directory-packages-props.md: File creation (dotnet new packagesprops), placement rules, conditional versions, VersionOverride patterns
- references/msbuild-property-handling.md: Property usage search, inline vs keep decisions, import order requirements, cleanup verification
- references/validation-and-errors.md: NuGet error codes (NU1008, NU1010, NU1507), clean build validation, multi-TFM guidance, common pitfalls

Workflow is now 10 steps (was 9):
1. Determine scope
2. Establish baseline build (new)
3. Check for existing CPM
4. Audit package references
5. Create or update Directory.Packages.props
6. Update project files
7. Handle MSBuild version properties
8. Restore and validate (now with binlog + package list capture)
9. Clean up obsolete properties
10. Summary and baseline comparison (expanded with diff tables)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replace third-party packages with Microsoft equivalents, add baseline/comparison steps, add .gitignore for test solutions

Package replacements across all skill references and test scenarios:
- Serilog.AspNetCore -> OpenTelemetry.Extensions.Hosting 1.15.0
- Serilog (standalone) -> OpenTelemetry.Extensions.Hosting 1.15.0
- Swashbuckle.AspNetCore -> Microsoft.AspNetCore.OpenApi 8.0.24
- SerilogVersion MSBuild property -> OTelVersion
- DIVersion updated from 8.0.1 to 9.0.0 (DI/Abstractions alignment)
- Microsoft.AspNetCore.OpenApi uses 8.0.24 (not 9.x) for net8.0 compat

Test fixture improvements:
- Added Step 2 (baseline build with binlog) to all 5 with-skill.md files
- Added Step 10 (package comparison table + binlog artifact links) to all 5 with-skill.md files
- Expanded simple-solution without-skill.md with more realistic agent behavior
- Standardized security fix terminology: table markers cite CVEs, prose references CVE IDs
- Removed space-padded table formatting in favor of compact markdown with emojis

Test solution infrastructure:
- Added tests/convert-to-cpm/.gitignore to exclude src/ build artifacts
- Added generation prompt to test README for recreating buildable solutions
- All 5 test solutions verified to restore and build successfully

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback on terminology, placement, and reference accuracy

- Rename Step 10 and validation checklist from 'binlog comparison' to 'package list comparison'
- Rewrite baseline-comparison.md: title to 'Baseline Comparison', lead with dotnet list package as primary comparison mechanism, position binlogs as supplementary artifacts for manual review/troubleshooting
- Add brief definition of binlogs before the artifacts section
- Fix Directory.Packages.props placement guidance: use first common ancestor of all .NET projects instead of assuming repository root (.git), since many repos nest source under src/ or similar
- Update SKILL.md scope input and Step 1 to reference directory-scoped conversion
- Standardize security fix terminology: table markers cite CVEs, prose uses 'security fix for CVE-...'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review findings: sort PackageVersion, add packages.config scenario, fix commands

Review findings addressed:
1. Fixed BlobsVersion grep step description in advanced scenario
2. Sorted PackageVersion entries alphabetically in all Directory.Packages.props outputs
3. Consolidated baseline-comparison.md to single-table format
4. Added solution file arguments and multi-line commands in test fixtures
5. Added Directory.Packages.props placement question for single-project scenario
6. Created simple-packages-config test scenario (packages.config rejection)
7. Use dotnet new packagesprops in simple-single-project workflow
8. Fixed More Info link text to match reference file title

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix test scenario accuracy: sln/slnx mix, package counts, ImplicitUsings

- Use mix of .sln and .slnx across scenarios (simple-solution and
  moderate-msbuild-properties use .sln; moderate-version-conflicts and
  advanced-multi-complexity use .slnx)
- Fix simple-solution package count from 5 to 6
- Fix advanced user response #2 to reference Azure.Storage.Blobs version
- Add ImplicitUsings to advanced Directory.Build.props in audit and cleanup
- Complete the advanced unchanged table with all expected package entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add skill evaluation section to test README

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix Inventory.sln references and make evaluation opt-in

- Fix 4 occurrences of Inventory.sln to Inventory.slnx in
  moderate-version-conflicts/with-skill.md for consistency with the
  scenario README and test solution
- Update test README to only run skill evaluation when the user
  explicitly requests it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Condense SKILL.md with progressive disclosure

- Remove duplicated bash code blocks from Steps 2 and 8, linking to
  baseline-comparison.md instead
- Merge Steps 7 (MSBuild property decisions) and 9 (cleanup) into a
  single step since both reference msbuild-property-handling.md
- Condense Step 10 summary to reference baseline-comparison.md for
  procedure details
- Reduces from 120 to 97 lines (10 steps to 9 steps)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix Enterprise.sln references to Enterprise.slnx in with-skill.md

Address code review feedback: fix 4 occurrences of Enterprise.sln to
Enterprise.slnx in advanced-multi-complexity/with-skill.md for
consistency with the scenario README and test solution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve convert-to-cpm skill: preserve whitespace, save summary report, fix links

- Instruct Step 6 to retain each file's existing indentation style and
  blank lines to keep diffs minimal
- Instruct Step 9 to save the full summary as convert-to-cpm.md alongside
  binlog and JSON artifacts, suggesting its contents for a PR description
- Strip en-us/ from learn.microsoft.com links in SKILL.md and
  validation-and-errors.md to make them culture-agnostic
- Update all with-skill.md test expectations to include the convert-to-cpm.md
  create step and artifact mention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Indicate that the binlog viewer is for the user; not the tool/skill

* Move convert-to-cpm skill and tests to src/dotnet-msbuild layout

Move skill from skills/convert-to-cpm/ to src/dotnet-msbuild/skills/convert-to-cpm/
and tests from tests/convert-to-cpm/ to src/dotnet-msbuild/tests/convert-to-cpm/
to match the repository layout established on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Convert tests from with/without-skill format to eval.yaml

Replace manual test approach (README.md + with-skill.md + without-skill.md)
with automated eval.yaml scenarios containing assertions and rubric items.
Add committed test fixture files (.csproj, .sln, .slnx, .props) for each
scenario with copy_test_files setup, replacing the git-ignored generated
solutions.

6 scenarios converted:
- simple-single-project: basic single project CPM conversion
- simple-solution: multi-project solution conversion
- simple-packages-config: negative test (packages.config rejection)
- moderate-version-conflicts: version conflict resolution
- moderate-msbuild-properties: MSBuild property version handling
- advanced-multi-complexity: combined complexities (conflicts, properties,
  conditionals, shared props)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Consolidate eval.yaml files into single root eval.yaml

Move all 6 scenario definitions from individual subdirectory eval.yaml
files into a single src/dotnet-msbuild/tests/convert-to-cpm/eval.yaml
file, matching the skill-validator discovery convention that expects
{testsDir}/{skillname}/eval.yaml. Scenario prompts updated to reference
subdirectory-prefixed paths since copy_test_files now copies all fixture
subdirectories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reorganize convert-to-cpm into plugins/tests folders

* Add post-conversion reporting rubrics to CPM eval scenarios

Add rubric items for baseline-vs-result comparison reporting, binlog
capture and guidance, version reconciliation, and risk/reassurance
messaging across all conversion scenarios. Increase complex scenario
timeout to 360s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve post-conversion reporting, conflict resolution, and skill activation

SKILL.md:
- Surface binlog capture commands explicitly in Steps 2 and 8
- Expand Step 4 with detailed version conflict presentation and
  resolution workflow
- Restructure Step 9 into 5-section post-conversion report template:
  overview, conflict resolutions, baseline comparison, risk assessment,
  and artifacts/next steps with binlog education
- Broaden activation triggers in description and When to Use to match
  update/bump/upgrade/align/sync terminology from ecosystem PRs
- Add activation for out-of-sync/conflicting/mismatched version scenarios

audit-complexities.md:
- Expand version conflict section with per-conflict presentation format,
  4 resolution options with trade-offs, and risk-level guidance

eval.yaml:
- Pre-specify conflict resolution strategy in prompts to avoid blocking
  on unanswered user prompts during single-turn evaluation
- Add 3 new scenarios testing CPM recommendation when user asks to
  update/align packages without mentioning CPM
- Update rubrics to match directed resolution strategy
- Increase complex scenario timeout to 360s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR feedback from kartheekp-ms

- Use GitHub markdown URL for CPM docs reference (SKILL.md)
- Use dotnet package list (renamed in .NET 10) with backward compat
  note for dotnet list package (SKILL.md, baseline-comparison.md)
- Use dotnet package list --format json for auditing (SKILL.md Step 4)
- Document Directory.Packages.props sub-folder support for test
  projects with different dependencies (directory-packages-props.md)
- Remove security advisory version bumping from CPM conversion scope;
  instead surface advisories as follow-up items in the post-conversion
  report (audit-complexities.md, SKILL.md Step 9 Section 5)
- Add Follow-up items section to report template covering security
  advisories, deprecated packages, version alignment opportunities,
  and test validation (SKILL.md Step 9)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve convert-to-cpm skill activation, artifact preservation, and eval assertions

- Broaden skill description to trigger on version drift/sync scenarios and
  MSBuild property contexts even when CPM is not explicitly mentioned
- Add explicit instructions to preserve binlog and JSON artifacts (not delete)
- Make convert-to-cpm.md report a mandatory deliverable, not optional
- Replace fragile output_contains assertions (ManagePackageVersionsCentrally,
  Directory.Packages.props) with file_contains checks on the actual generated
  files across 5 conversion scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Extend timeouts and add CODEOWNERS entry

* Move convert-to-cpm skill into a new dotnet-nuget plugin

* Fix erroneous plugin msbuild/nuget plugin split change. Add dotnet-nuget to marketplace.

* Add NuGet package management skills to README

* Address PR feedback: clarify CPM sub-folder semantics, remove security-fix example, require explicit conflict strategy

- directory-packages-props.md: Clarify that sub-folder Directory.Packages.props
  files are independent and replace (not extend) the parent; require explicit
  MSBuild Import to chain files
- baseline-comparison.md: Replace security-fix upgrade example with version
  conflict alignment example, consistent with audit guidance that security
  advisories are follow-up items
- SKILL.md: Remove default 'use highest version' conflict strategy; require
  explicit user choice or confirmation when conflicts are detected

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Extend eval timeouts for scenarios hitting time limits

- Convert single project: 180s -> 270s
- Recommend CPM (version conflicts): 180s -> 270s
- Recommend CPM (complex repo): 360s -> 540s
- Convert complex repository: 360s -> 540s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add missing CODEOWNERS for dotnet-nuget plugin. Reorder convert-to-cpm evals and expand timeouts.

* Remove containing skill mentions from reference files; fix ordering

* Replace output_matches with deterministic file assertions in eval.yaml

Convert 6 non-deterministic output_matches assertions to 8 file-based
assertions (file_contains, file_not_contains) across conversion scenarios:

- Scenario 5: Verify PrivateAssets preserved in Tests.csproj
- Scenario 6: Verify OTelVersion/DIVersion removed from Directory.Build.props
- Scenario 7: Verify System.Text.Json and Azure.Identity in Directory.Packages.props
- Scenario 8: Verify System.Text.Json in Directory.Packages.props and
  BlobsVersion/HostingVersion removed from Directory.Build.props

Recommendation-only scenarios and conversational assertions (conflict
detection, conditionals, Common.props awareness) remain as output_matches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reorganize skill description with USE FOR / DO NOT USE FOR markers

Restructure the description to improve activation reliability by
adopting the USE FOR / DO NOT USE FOR pattern used by other skills
in the repo (thread-abort-migration, binlog-failure-analysis).

Key changes:
- Front-load activation cues before capability list
- Add explicit USE FOR / DO NOT USE FOR section markers
- Add .sln/.slnx file extensions for solution-path matching
- Move DO NOT USE exclusions into description (was only in body)
- Use YAML folded scalar for multi-line readability

All existing activation keywords preserved. Length reduced from
882 to 849 chars (max 1024).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix issues for external link references

* Increase timeouts

* Handle packages.config non-activation in convert-to-cpm skill

Set expect_activation: false on the packages.config eval scenario so
non-activation is reported as expected rather than flagged as a warning.

Add a packages.config guard in Step 1 of the skill workflow so that if
the skill is activated for a packages.config project, it stops early and
recommends migrating to PackageReference first.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove leading blank lines from .sln test files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use imperative 'Read' instead of 'See' for reference file links

Ensures the agent explicitly loads and reads reference files rather than
treating them as optional 'see also' links. This aligns with the repo
convention of explicitly instructing agents to load reference content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify dotnet-nuget CODEOWNERS

* Simplify packages.config guard

* Add minimal Program.cs entrypoints to Web/Worker test fixtures

Test fixture projects using Microsoft.NET.Sdk.Web and
Microsoft.NET.Sdk.Worker require a Program.cs entrypoint for dotnet build
to succeed. The skill workflow instructs the agent to run dotnet restore
and dotnet build for validation, so these fixtures must be buildable.

Adds minimal entrypoints (with explicit using directives since
ImplicitUsings is not enabled in these projects) to 6 projects:
- simple-solution/Web
- moderate-version-conflicts/Api, Worker
- moderate-msbuild-properties/Api
- advanced-multi-complexity/Api, Web

Also adds Microsoft.Extensions.Hosting package reference to the Worker
project, matching what the dotnet new worker template produces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2026-03-18 08:41:57 +01:00
Amaury Levé ae0b6a1d86 Add mtp-hot-reload skill for iterative test fixing with MTP hot reload (#389) 2026-03-17 15:53:34 +00:00
YuliiaKovalova 14346ff3b2 Enrich build-perf-diagnostics skill with MSBuild team and community insights (#342)
* Enrich build-perf-diagnostics skill with MSBuild team and community insights

Additions (pure knowledge, no MCP dependency):
- RAR: dotnet/msbuild#2015 context, DisableTransitiveProjectReferences, ReferenceOutputAssembly
- Copy tasks: SkipCopyUnchangedFiles, --artifacts-path, Copy batching (dotnet/msbuild#12884)
- Dev Drive (ReFS): copy-on-write + reduced Defender scans, OrchardCore 7257 Copy tasks benchmark
- Evaluation: NuGetSdkResolver 180-400ms overhead (dotnet/msbuild#4025), EnableDefaultItems
- NuGet: RestoreUseStaticGraphEvaluation (20s+ savings in large builds)
- Project graph shape: wide vs deep (40% faster clean, 20% faster incremental)
- MSBuild Server: MSBUILDUSESERVER=1 for CLI caching
- Inline task overhead: 1s vs 3ms (RoslynCodeTaskFactory vs compiled)
- Misleading ResolveProjectReferences time (dotnet/msbuild#3135)
- Incrementality anti-patterns (dotnet/msbuild#13206)
- Impact categorization (HIGH/MEDIUM/QUICK WINS)
- Quick Wins: expanded to 15 items (from 7)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix minor issues from review comments

- Fix missing closing XML tag for CreateHardLinksForCopyFilesToOutputDirectoryIfPossible in Quick Wins checklist
- Clarify confusing Copy task batching wording per reviewer feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Trim skill to reduce token overhead

Remove standalone sections (MSBuild Server, Inline Tasks,
ResolveProjectReferences, Incrementality Anti-patterns) that add
~1400 extra tokens without benefiting the evaluated scenario.
Consolidate Quick Wins checklist accordingly.

These sections can be contributed as separate skills in follow-up PRs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add separate skills for MSBuild server, inline tasks, and ResolveProjectReferences

Extract content removed from build-perf-diagnostics into standalone skills
to keep each skill focused and avoid token budget bloat:

- msbuild-server: MSBUILDUSESERVER=1 for CLI incremental caching
- inline-task-overhead: RoslynCodeTaskFactory ~1s overhead vs ~3ms compiled
- resolve-project-references: misleading Target Performance Summary time
  (dotnet/msbuild#3135), guides users to Task Performance Summary instead

Incrementality anti-patterns content was not extracted as a separate skill
because the existing incremental-build skill already covers that area.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add github.com/dotnet/msbuild to known-domains.txt

Required by reference scanner for MSBuild issue links in
build-perf-diagnostics and resolve-project-references skills.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Replace full dotnet/msbuild URLs with shorthand notation

The reference scanner reads known-domains.txt from upstream main,
not from the PR branch. Use shorthand 'dotnet/msbuild#NNNN' format
(consistent with the rest of the file) instead of full URLs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review comments and fix reference scanner errors

- Remove https://aka.ms/devdrive URLs that trigger reference scanner
- Soften unsourced benchmark claims (OrchardCore Copy tasks, 20s+
  restore savings, 40%/20% graph shape improvements) per reviewer
  feedback to use workload-dependent language instead

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add eval tests for new skills; remove inline-task-overhead

Add eval.yaml and test fixtures for msbuild-server and
resolve-project-references skills:
- msbuild-server: tests CLI build perf scenario with developer report
- resolve-project-references: tests misleading target perf summary
  with multi-project setup and perf report

Remove inline-task-overhead skill: failed 3 evaluation iterations
(avg +2.7%) because the baseline LLM already knows about
RoslynCodeTaskFactory overhead — the skill doesn't add enough
unique value to meet the 10% improvement threshold.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Address review comments

- Add caveat that DisableTransitiveProjectReferences may require
  adding direct references for consumed types
- Fix escaped quotes in Quick Wins RunAnalyzers checklist item
- Add OutputType=Exe and Main entry point to msbuild-server fixture
- Change 'solution' to 'project' in resolve-project-references report
- Trim trailing spaces in developer-report.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Restore accidentally removed known-domains.txt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix remaining review comments

- Quote -flp argument in resolve-project-references bash example
  to handle semicolons in POSIX shells
- Format LibA/Class1.cs and LibB/Class1.cs across multiple lines
  for consistency with other test fixtures
- Rename msbuild-server/Program.cs to Calculator.cs to match content

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 15:55:44 +01:00
Jan Krivanek 7e7dabd343 [WIP] Improve msbuild skills descriptions (#384)
* Improve msbuild skills descriptions

* Improve descriptions
2026-03-17 14:30:58 +01:00
Amaury Levé c55e4f222b Add MSTest migration skills (v1/v2→v3, v3→v4) (#377)
* Add MSTest migration skills (v1/v2→v3, v3→v4)

New dotnet-test plugin with two step-by-step migration skills:

- migrate-mstest-v1v2-to-v3: covers assembly ref (v1) and NuGet (v2) projects,
  assertion overload changes, DataRow constructors, .testsettings replacement,
  timeout unification, and MSTest.Sdk adoption.
- migrate-mstest-v3-to-v4: covers Execute→ExecuteAsync, CallerInfo constructors,
  ClassCleanupBehavior removal, TestContext.Properties generic change, Assert API
  changes, ExpectedExceptionAttribute removal, dropped <net8.0 TFMs, and
  behavioral changes (DisableAppDomain, TestCase.Id, TreatDiscoveryWarningsAsErrors).

Includes eval.yaml test scenarios and fixtures for both skills, plugin.json,
and CODEOWNERS entries.

* Fixes

* Improve results

* Improve

* Improve description

* Copy fix for path

* Bump timeout
2026-03-17 14:25:45 +01:00
Amaury Levé 92d830ff48 Add writing-mstest-tests skill with eval scenarios (#378)
* Add writing-mstest-tests skill with eval scenarios

Add a new skill for writing modern MSTest 3.x/4.x unit tests covering:
- Test class structure (sealed, AAA pattern, naming conventions)
- Modern assertion APIs (Assert.Throws, IsInstanceOfType, collection asserts)
- Data-driven tests (DataRow, DynamicData with ValueTuples)
- Async tests with cancellation and timeout patterns
- Test lifecycle (constructor init, TestContext injection)
- Anti-pattern detection and modernization

Includes 10 eval scenarios across 4 goal categories with fixture files
for both modern MSTest and legacy anti-pattern test projects.

MSTest.Sdk version is recommended via global.json msbuild-sdks instead of
inline in the project file, ensuring all test projects get bumped together.

* Fixes

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Evangelink

* Apply suggestion from @Evangelink

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 08:26:01 +00:00
Amaury Levé 2a8388dd71 Add VSTest to MTP migration skill (#373)
* Add VSTest to MTP migration skill

New migrate-vstest-to-mtp skill in the dotnet-test plugin covering:

- Framework-specific MTP runner enablement (MSTest, NUnit, xUnit.net)
- Directory.Build.props centralization of OutputType, runner properties
- MSTest.Sdk UseVSTest removal
- NUnit3TestAdapter 5.0.0+ upgrade requirement
- xunit v2 to xunit.v3 upgrade requirement
- dotnet test CLI argument translation (--logger to --report-trx, --collect
  to --coverage, --blame-crash to --crashdump, --blame-hang to --hangdump)
- xUnit.net --filter syntax migration to --filter-class/--filter-trait/
  --filter-query
- global.json native MTP mode (.NET 10+) vs TestingPlatformDotnetTestSupport
  VSTest-bridge mode (.NET 9 and earlier)
- Azure DevOps VSTest@3 to DotNetCoreCLI@2 pipeline migration
- MTP extension NuGet packages (TrxReport, CrashDump, HangDump, CodeCoverage)
- Exit code 8 behavioral difference (--ignore-exit-code 8,
  TESTINGPLATFORM_EXITCODE_IGNORE)

Includes 10 eval scenarios with tiered timeouts (240-360s), 5 fixture
directories, plugin.json, marketplace.json entries, CODEOWNERS, and
README.md updates.

* Fix codeowners

* Improve

* Improve further

* Improve prompt

* Improve further the description

* Address review comments
2026-03-16 23:56:48 +01:00
Amaury Levé 8cb692082a Improve run-tests skill description (#372) 2026-03-16 13:14:42 +01:00
Amaury Levé 1b8f2aa1e4 Address Copilot review comments on test agent/skills (#351)
Follow-up from PR #343 where copilot added review after the PR was merged
2026-03-15 06:45:40 +00:00
Dan Moseley 3f510a8c55 Fix minor review feedback on migrate-dotnet9-to-dotnet10 (#180) (#335)
* Fix post-merge review feedback on #180

- sdk-msbuild: Fix incorrect 'use single quotes' guidance for #r/#load
  directives — the correct fix is to remove the quotes entirely
- serialization: Split dual Animal class declaration into separate
  before/after code blocks so each is valid C#

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/serialization-networking-dotnet9to10.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-12 19:32:32 -06:00
Amaury Levé 7afa81f831 Run tests supports platforms and frameworks (#343) 2026-03-12 21:29:37 +01:00
Jason Malinowski 59241eabcf Add the C# LSP configuration to the 'dotnet' plugin (#298) 2026-03-11 17:23:11 -07:00
Jeff Schwartz 551461a926 dotnet-ai-ml (#177)
* moved from private to public fork

* add code owner

* accomodate feedback

* update eval to make more natural language

* address eval feedback

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* Update plugins/dotnet-ai/skills/technology-selection/SKILL.md

Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>

* update supporting documentation of adding a new plugin

* update claude-plugin

---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Luis Quintanilla <46974588+luisquintanilla@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 15:06:04 -07:00
Dan Moseley 3923c078b9 Add migrate-dotnet9-to-dotnet10 skill (#180)
* Add migrate-dotnet9-to-dotnet10 skill

Adds a new migration skill that guides upgrading .NET 9 projects to .NET 10,
covering TFM updates, NuGet package upgrades, and source-breaking changes
across the full .NET 10 surface area.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback: fix eval/reference consistency and CODEOWNERS

- Fix ExecuteUpdateAsync rubric: use 'regular lambda/delegate instead of
  expression tree' instead of incorrect 'Func instead of Expression'
- Fix config null binding eval prompt: .NET 9 bound null as empty string,
  not preserving constructor default
- Clarify .NET 10 null binding overwrites constructor default in reference
- Add @ViktorHofer as CODEOWNER for migrate-dotnet9-to-dotnet10

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Suffix reference filenames with -dotnet9to10 to avoid collisions

Rename all reference files under migrate-dotnet9-to-dotnet10/references/
from e.g. efcore.md to efcore-dotnet9to10.md so they don't collide with
reference files from other version migration skills. Update all
references in SKILL.md to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address BrennanConroy review: ForwardedHeaders KnownIpNetworks example and IApiEndpointMetadata guidance

- Show KnownIpNetworks property with UseForwardedHeaders context in example
- Add IApiEndpointMetadata explanation for cookie login redirect behavior
- Link to aspnetcore#62883 for details on influencing the behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shorten skill description to fit 1024-char limit

Reduce description from 1,370 to 1,017 characters by trimming
redundant phrasing while preserving all key search terms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update CODEOWNERS

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-11 14:06:00 -06:00
Dan Moseley db33912b98 Add migrate-dotnet10-to-dotnet11 skill (#181)
* Add migrate-dotnet10-to-dotnet11 skill (Preview 1 coverage)

Adds a new migration skill that guides upgrading .NET 10 projects to .NET 11,
covering TFM updates, NuGet package upgrades, and breaking changes across
the .NET 11 Preview 1 surface area.

Sources:
- https://learn.microsoft.com/en-us/dotnet/core/compatibility/11
- https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-11.0/breaking-changes
- https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2011
- https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-11/overview

Skill coverage:
- C# 15 compiler: Span safe-context, ref readonly InAttribute, nameof(this.),
  with() parsing, dynamic &&/|| with interfaces
- Core libraries: DeflateStream/GZipStream empty payloads, MemoryStream capacity,
  TAR checksum validation, ZipArchive.CreateAsync eager loading,
  Environment.TickCount consistency
- EF Core 11: Cosmos DB sync I/O fully removed
- Cryptography: DSA removed from macOS
- Runtime/JIT: x86-64-v2 minimum, Arm64 LSE requirement on Windows
- SDK: Mono launch target removed for .NET Framework apps

6 reference files loaded based on project type + 7 eval scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add SYSLIB0063 NamedPipeClientStream breaking change to 10→11 skill

Add documentation for the NamedPipeClientStream constructor obsoletion
(SYSLIB0063) which was merged in dotnet/runtime#120328 for .NET 11 but
not yet documented on learn.microsoft.com. The isConnected parameter
overload is obsoleted, and projects with TreatWarningsAsErrors will
fail to build.

Changes:
- core-libraries.md: Add Obsoleted APIs section with SYSLIB0063
- SKILL.md: Add to description, Step 1 assessment, Step 3 patterns

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Tune skill description and eval prompts for activation

- Add explicit migration framing to skill description to differentiate
  from csharp-scripts skill (SDK was routing to wrong skill)
- Add 'Use the migrate-dotnet10-to-dotnet11 skill' to eval prompts,
  matching real-world usage where users explicitly invoke migration skills

Eval results (3 runs each, explicit skill invocation):

  Haiku:  6/7 activated, best +1.3 (compression/TAR scenario)
  Sonnet: 7/7 activated, best +0.3 (EF Core, TFM update scenarios)

Skill activates reliably now. Quality gains are modest because the
skill covers only Preview 1 breaking changes (training data already
includes MS Learn docs). Expect larger gains as content grows with
later previews.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update plugins/dotnet/skills/migrate-dotnet10-to-dotnet11/references/csharp-compiler.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Split nameof(this.) example into before/after code blocks

Separate the breaking and fixed code into distinct blocks to avoid
ambiguity about which line to use vs remove.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback: fix code examples and global.json guidance

- SKILL.md: Show global.json as a diff edit preserving existing keys
  (rollForward, other settings) instead of replacing the entire file
- csharp-compiler.md: Fix ref readonly lambda example to use a static
  field instead of a captured local (which won't compile in a lambda)
- csharp-compiler.md: Declare missing local variable x in ref readonly
  local function example
- eval.yaml: Fix ref readonly lambda snippet to use a class with a
  static field, matching the reference file fix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR feedback: add second CODEOWNER, add preview version to EF Core

- Add @ViktorHofer as second owner for migrate-dotnet10-to-dotnet11 and
  migrate-nullable-references paths per CONTRIBUTING.md requirements
- Add Preview 1 annotation to EF Core reference file per reviewer feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Suffix reference filenames with -dotnet10to11 to avoid collisions

Rename e.g. efcore.md to efcore-dotnet10to11.md so names won't collide
with reference files from other version migration skills. Update all
paths in SKILL.md to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove explicit skill name from eval prompts to reduce overfitting

The eval prompts were explicitly saying 'Use the migrate-dotnet10-to-dotnet11
skill' which biases baseline runs — the agent wastes time searching for a
nonexistent skill, guaranteeing worse performance. Rephrased all 7 prompts
to describe the migration task naturally without naming the skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback: fix with/when label, add exit_success assertions

- Rename 'with()' to 'when' in switch-expression-arm parsing label
  (SKILL.md and csharp-compiler reference) to match the actual breaking change
- Add exit_success assertion to all 7 eval scenarios to match repo convention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move Japanese Calendar breaking change to core-libraries reference

The globalization change was in the runtime-jit reference, which is only
conditionally loaded for older-hardware deployments. Since this affects
all projects regardless of hardware, move it to core-libraries (always
loaded) so it is not missed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify workflow note: allow local repo inspection, forbid only external sources

The previous wording ("Do not search the filesystem") was too broad —
the agent needs to read .csproj, solution, and source files to determine
which breaking changes apply. Reword to explicitly allow local repository
inspection while forbidding web/external sources for breaking change info.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shorten skill description to fit 1,024-char limit (762 chars)

Remove granular breaking change names (covered in body/references),
drop LOADS REFERENCES (implementation detail), remove unsupported
ASP.NET Core 11 claim (no reference docs shipped), and tighten
DO NOT USE FOR section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update CODEOWNERS to use @dotnet/compat team instead of individual

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move 'when' parsing change from Step 4 to Step 3

The when switch-expression-arm parsing change is a source/compilation
breaking change, not a runtime behavioral change. It belongs in Step 3
(source-breaking changes) alongside other C# 15 compiler changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-11 14:05:03 -06:00
Dan Moseley e9370fe663 Add migrate-dotnet8-to-dotnet9 skill (#182)
* Add migrate-dotnet8-to-dotnet9 skill with references and eval scenarios

Mirrors the structure and approach of the existing migrate-dotnet9-to-dotnet10 skill.

Covers all .NET 8→9 breaking changes organized by technology area:
- C# 13 compiler (InlineArray records, iterator safe context, collection expressions)
- Core libraries (params span overloads, BinaryFormatter removal, BigInteger, TimeSpan)
- SDK/MSBuild (Terminal Logger, version requirements, .NET 7/Standard warnings)
- ASP.NET Core (HostBuilder validation, forwarded headers, middleware constructors)
- EF Core (pending migrations, explicit transactions, Cosmos DB changes)
- Cryptography (X509Certificate2 SYSLIB0057, SafeEvpPKeyHandle)
- Serialization/Networking (BinaryFormatter, JsonDocument null, HttpClientFactory)
- WinForms/WPF (security analyzers, StatusStrip, PictureBox, XmlNamespaceMaps)
- Containers/Interop (zlib removal, CET support)
- Deployment/Runtime (env var precedence, FP-to-int saturation, MonoVM deprecated)

12 eval scenarios covering all technology areas with assertions and rubrics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* BinaryFormatter: stop and ask user for replacement strategy

BinaryFormatter migration is a major architectural decision affecting data
format, backward compatibility, and stored data migration. The skill should
present options and let the user decide rather than picking a serializer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Trim SKILL.md to delegate BinaryFormatter detail to reference

Keep SKILL.md as concise index; full guidance lives in
serialization-networking.md reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Trim SKILL.md: delegate fix details to references, remove BinaryFormatter duplicate

- Remove BinaryFormatter duplicate from Step 4 (already covered in Step 3)
- Delegate inline fix details for EF Core, FP saturation, HttpClientFactory to references
- Collapse niche SYSLIB0055/0056 into one-liner pointing to reference
- Shorten params span and String.Trim entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve eval scenarios: setup files, task-oriented prompts, expect_activation

- Add setup files (csproj, .cs, Dockerfile, etc.) to 10/12 scenarios so agent
  works with real code instead of pure knowledge questions
- Make prompts task-oriented ('Migrate this app to .NET 9') instead of
  knowledge-oriented ('What breaks?')
- Set expect_activation: false on all scenarios — this is a pure knowledge/
  reference skill with no MCP tools, so activation via SkillInvokedEvent is
  unreliable
- Increase timeouts to 420s to avoid penalizing skilled runs that do more work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refocus eval scenarios on Opus blind spots

Replace easy scenarios (BinaryFormatter/X509) where Opus always ties with
harder ones targeting areas where the skill adds measurable value:
- Empty env var behavior on Unix (null vs empty string)
- ZipArchiveEntry UTF-8 bit flag mechanism
- FromKeyedServices no-fallback behavior
- Cosmos DB id format change (discriminator no longer embedded)
- Env var precedence reversal with concrete GC/ThreadPool impact

Keep scenarios where skill consistently helps: Cosmos DB id format,
container zlib removal, CI pipeline net7.0 warnings, WinForms PictureBox.

Increase timeouts to 420s to avoid penalizing skilled runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add forward-chaining guidance to migrate-dotnet8-to-dotnet9 skill

Tell the agent about the migrate-dotnet9-to-dotnet10 skill so it knows
to continue the chain after completing the 8-to-9 migration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix EF Core eval scenarios to start with 8.0.0 package versions

The eval scenarios claim to test a .NET 8 to .NET 9 migration but the
starting csproj files already reference EF Core 9.0.0 packages. This
reduces test signal since the package upgrade step is already done.
Change all EF Core package versions to 8.0.0 in scenarios 4, 5, and 10.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix InlineArray eval to actually exceed 1 MiB size limit

The rubric expects the model to warn about the InlineArray 1 MiB
runtime size limit, but the example was only 8 KiB (InlineArray(1024)
with byte element). Increase to 1,048,577 bytes so the breaking change
is concretely applicable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix non-compiling ConfigurePrimaryHttpMessageHandler in eval

The eval used a non-existent overload of ConfigurePrimaryHttpMessageHandler
with a (handler, _) => {} lambda that doesn't return a handler. Replace
with ConfigureHttpMessageHandlerBuilder which correctly casts
PrimaryHandler to HttpClientHandler -- the pattern that actually breaks
when the default switches to SocketsHttpHandler in .NET 9.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix non-compiling HttpClientFactory example in reference doc

The breaking change example used a non-existent overload of
ConfigurePrimaryHttpMessageHandler. Replace with
ConfigureHttpMessageHandlerBuilder which is the actual API that casts
PrimaryHandler and would break when the default changes to
SocketsHttpHandler. Also fix Option 2 to use the same correct API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove unsafe KnownProxies.Clear() guidance from aspnet-core reference

Clearing KnownProxies and KnownNetworks accepts forwarded headers from
any source, enabling attackers to spoof X-Forwarded-For/Proto/Host
headers. Replace with a warning against this pattern and steer toward
registering only trusted proxy addresses.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove unsafe RedactLoggedHeaders guidance from reference doc

Disabling header redaction globally with RedactLoggedHeaders(_ => false)
logs Authorization tokens, cookies, and other credentials in cleartext.
Replace with guidance to whitelist only specific non-sensitive headers
and add an explicit warning against disabling redaction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove insecure BinaryFormatter re-enablement option from guidance

Replace the unsupported NuGet package option with a clear security
warning that BinaryFormatter deserialization enables remote code
execution and should not be re-enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add security warning against suppressing WFO1000 analyzer

WFO1000 guards against insecure deserialization of WinForms control
properties. Replace the suppression option with a warning explaining
the security risk and recommend the attribute-based fix instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add security warning to CET opt-out guidance

Warn that disabling CET removes hardware-enforced control-flow
integrity (protection against ROP/JOP exploits) and should only
be done when a specific native library is confirmed incompatible.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Label EF Core warning suppressions as temporary workarounds

Add context that suppressing PendingModelChangesWarning risks silent
schema drift and that MigrationsUserTransactionWarning suppression
has transaction safety implications. Both are temporary workarounds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Prioritize behavioral changes and add global.json rollForward guidance

Mark behavioral changes that can cause runtime exceptions with a
warning indicator and move them to the top of the list so agents
address them first. Add rollForward policy guidance to the
global.json update step to prevent SDK resolution issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Split BinaryFormatter code snippet into separate serialize/deserialize blocks

The combined snippet used obj before declaration, which was misleading.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix SYSLIB heading to include full range SYSLIB0054-SYSLIB0057

Previously listed only SYSLIB0054 and SYSLIB0057, omitting 0055 and 0056.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix eval rubric to match setup code: Migrate/MigrateAsync

Setup code uses synchronous Migrate(), not MigrateAsync().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use distinct variable names in X509CertificateLoader examples

Duplicate 'var cert' declarations would cause compilation errors if pasted as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove misleading 'backported from .NET 8' from ForwardedHeaders section

The claim is confusing in an 8-to-9 migration guide context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify GetXmlNamespaceMaps InvalidCastException explanation

Previous wording was logically inconsistent about the direction of the type change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update plugins/dotnet/skills/migrate-dotnet8-to-dotnet9/references/efcore.md

Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>

* Fix ReadOnlySpan<char> String.Trim example and eval scenario

The code example incorrectly used ReadOnlySpan<char> as a static field,
which is impossible (ref struct). The eval scenario used a local
ReadOnlySpan<char> variable which actually compiles fine on .NET 9 GA,
so it didn't demonstrate the breaking change. Updated both to correctly
show the RC2-to-GA overload removal issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add -dotnet8to9 suffix to reference filenames to avoid cross-skill collisions

Other version migration skills (e.g., 9-to-10) have similarly named
reference files. Adding the suffix disambiguates them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shorten skill description to fit 1024-char limit

Remove LOADS REFERENCES section (implementation detail already covered by
the reference loading table in the body) and tighten wording. All USE FOR
activation keywords and DO NOT USE FOR rejection keywords preserved.
Description is now 1006 characters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback

- CODEOWNERS: Replace @ViktorHofer with @jeffschwMSFT for migrate-dotnet8-to-dotnet9
- SKILL.md: Shorten description from 1,400 to 671 chars (max 1,024)
- sdk-msbuild-dotnet8to9.md: Clarify VS 17.11 SDK targeting phrasing
- core-libraries-dotnet8to9.md: Fix cross-reference to serialization-networking-dotnet8to9.md
- serialization-networking-dotnet8to9.md: Replace 'whitelist' with 'allowlist'
- winforms-wpf-dotnet8to9.md: Rename heading to cover both Get/SetXmlNamespaceMaps
- eval.yaml: Use ReadOnlySpan<char> to properly demonstrate String.Trim RC2 breakage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CODEOWNERS: Use solo @danmoseley (consistent with migrate-nullable-references)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update CODEOWNERS to use @dotnet/compat team instead of individual

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback: fix factual errors in references and eval

- Fix URL with %20 spaces to use hyphens (csharp-compiler ref)
- Fix DOTNET_GCConcurrent -> DOTNET_gcConcurrent casing (eval.yaml)
- Remove invalid [StructLayout] combined with [InlineArray] (eval.yaml)
- Move JSON comment outside code fence (deployment-runtime ref)
- Remove confusing preview-era sentence (winforms-wpf ref)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert URL change: %20 encoding is correct for this MS Learn page

The original URL with percent-encoded spaces is the actual working URL;
the hyphenated version returns 404.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve EF Core reference doc to help failing eval scenarios

- Promote HasIndex from Low to Medium Impact with crash detail and
  removal guidance (Scenario 5 missed this causing quality regression)
- Expand id format change section with data migration implications
  and HasRootDiscriminatorInJsonId mitigation (Scenario 5 rubric)
- Add concrete DateTime.UtcNow in HasData before/after example
  (Scenario 4 missed connecting HasData to pending changes exception)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add explicit HasData search action for pending model changes

The agent reads the reference doc but doesn't connect DateTime.UtcNow
in HasData to the pending changes exception. Make the SKILL.md workflow
step prescriptive: search for non-deterministic values and replace them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>
2026-03-11 14:03:42 -06:00
Elinor Fung ba56c936b3 Add binder tracing to dotnet-trace-collect skill (#250)
* Add binder tracing to dotnet-trace-collect skill

* Update plugins/dotnet/skills/dotnet-trace-collect/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* PR feedback

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Jeff Schwartz <jeffschw@microsoft.com>
2026-03-11 09:31:33 -07:00
Gerald Versluis ebe71e2f06 Add dotnet-maui plugin with dotnet-maui-doctor skill (#199)
* Add dotnet-maui-doctor skill and refs

Add a new .agents/skills/dotnet-maui-doctor skill bundle. Includes SKILL.md describing an autonomous workflow to detect and remediate .NET MAUI environment issues and platform-specific reference docs for installation commands, platform requirements, troubleshooting, Microsoft OpenJDK guidance, and a WorkloadDependencies discovery guide that pulls authoritative versions from NuGet. Documents validation/remediation steps for .NET SDK, workloads, JDK, Android SDK, Xcode, and Windows SDK (macOS/Windows/Linux) and includes a temporary recommendation to prefer Microsoft OpenJDK (JDK 21) until manifests are updated.

* MAUI doesn't quite yet support dotnet run

* Add dotnet-maui plugin and dotnet-maui-doctor skill

Introduce the dotnet-maui plugin and move the dotnet-maui-doctor skill under plugins/ layout. Update marketplace, CODEOWNERS, and README accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add comprehensive eval scenarios for dotnet-maui-doctor

10 scenarios covering: macOS/Linux/Windows setup, JDK vendor enforcement,
workload update/repair guardrails, dynamic version discovery, JAVA_HOME
misconception, Android SDK diagnosis, out-of-scope decline, and stale
workload remediation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refine eval scenarios: remove weak scenarios, fix overfitting

Remove 'Resist hardcoding' (penalizes skill — baseline gives more useful
direct answer) and 'Decline runtime bug' (skill makes agent refuse to
help). Rework Android SDK scenario to test CI-oriented package discovery
where baseline lacks knowledge. Replace vocabulary-level NuGet/API
assertions with outcome-focused rubric items across all scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove hardcoded JDK version workarounds in favor of dynamic discovery

Replace temporary JDK 21 workaround notes with guidance to use the
version from WorkloadDependencies.json. Replace hardcoded JDK paths
in troubleshooting.md with {VERSION} placeholders.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve eval scenarios: fix JAVA_HOME timeout, macOS tie, reduce overfitting

- JAVA_HOME: rewrite prompt to request conceptual answer (prevents tool timeout)
- macOS Xcode: add installation source guidance, remove equal-penalty assertion
- Remove irrelevant workload update/repair assertions from 3 off-topic scenarios
- Keep workload assertions in 5 scenarios where workload management is the topic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reframe JAVA_HOME scenario as prevent-harmful-action pattern

Rewrite prompt from conceptual yes/no question (which the agent answered
from wrong general knowledge without activating the skill) to a scenario
where the user is about to apply incorrect Stack Overflow advice. This
mirrors the successful workload guardrail pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reduce overfitting: rephrase assertions and rubric to be outcome-focused

- Replace literal '--version' assertions with broader 'version|pin' pattern
- Rephrase Xcode rubric from skill-specific source to version control risk
- Rephrase version discovery rubric from 'NuGet API' to outcome-focused
- Rephrase workload install rubric from '--version flag' to 'pinned version'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Inline critical JAVA_HOME auto-detection guidance into SKILL.md

The JAVA_HOME eval scenario scored poorly because the agent couldn't read
the reference file (references/microsoft-openjdk.md) and fell back on
general knowledge, which incorrectly says JAVA_HOME must be set.

Changes:
- Task 5: Add inline JAVA_HOME guidance with decision table showing that
  JAVA_HOME is NOT required and MAUI auto-detects JDK installations
- Common Pitfalls: Add 'Unnecessary JAVA_HOME' entry with unset commands

This ensures the agent knows JAVA_HOME is unnecessary even when reference
files can't be loaded. File stays at 210 lines (limit: 500).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Inline JAVA_HOME auto-detection knowledge into SKILL.md

Add JAVA_HOME guidance directly to Task 5, Task 9, and Common Pitfalls
so the agent knows JAVA_HOME is not required even when reference files
can't be read. Based on Redth's original microsoft-openjdk.md reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address code review feedback from Copilot

- Fix cmd.exe syntax in installation-commands.md (use PowerShell $env:)
- Replace hardcoded simulator device/runtime with placeholders
- Add System.IO.Compression.FileSystem assembly load for PS 5.1 compat
- Clarify workload reinstall example is macOS-specific (omit ios on Linux)
- Replace hardcoded android-35 with $API_LEVEL placeholder

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address jonathanpeppers review feedback

- Add Apple Developer login/2FA note for Xcode downloads
- Fix Windows SDK detection: extract KitsRoot10 and version subkeys
  instead of dumping full registry (was outputting noise)
- Replace manual NuGet API approach with dotnet workload search version
  CLI command for discovering workload versions
- Reframe JAVA_HOME guidance: report as anomaly rather than prescribing
  unset/set commands (per jonathanpeppers recommendation)
- Use $env:ProgramFiles instead of hardcoded C:\Program Files paths
  in PowerShell commands
- Update SKILL.md to match: softer JAVA_HOME guidance, improved
  Windows SDK detection command

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address Redth review feedback

- Remove Windows SDK detection commands — installed automatically
  via MAUI workload/VS Installer (per Redth recommendation)
- Use dotnet workload search version --format json --take 1 for
  workload version discovery instead of NuGet search API (per both
  Redth and jonathanpeppers)
- Update workload-dependencies-discovery.md Step 2 to match
- Expand Android SDK detection with known filesystem paths
  instead of relying solely on environment variables

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align eval rubric with reviewer feedback to reduce overfitting

Replace technique-specific rubric items with outcome-focused criteria:
- Replace PowerShell API query check with dotnet CLI discovery check
- Replace manifest extraction check with workload-version-based discovery
- Replace prescriptive version discovery with CLI/docs verification
- Convert workload update/repair regex assertions to rubric criteria
- Remove Invoke-RestMethod assertion (no longer using API queries)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align JAVA_HOME guidance with reviewer consensus, add Xcode download expectations

- Consistently use ⚠️ anomaly approach for non-Microsoft JAVA_HOME across
  microsoft-openjdk.md and troubleshooting.md (matching SKILL.md)
- Remove contradictory Note in microsoft-openjdk.md that conflicted with table
- Reframe unset commands as user's choice, not automatic action
- Add Xcode download size (~12GB) and time expectations per Redth's feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update plugins/dotnet-maui/skills/dotnet-maui-doctor/references/workload-dependencies-discovery.md

Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>

* Update JDK example to version 21 per jonathanpeppers feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: redth <jondick@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
2026-03-09 13:34:19 -07:00
Dan Moseley 8e50fc8558 Add agent and plugin spec conformance validation (#279)
* Add agent and plugin spec conformance validation

Extend the validation pipeline to check .agent.md files and plugin.json
files alongside skills. Previously only SKILL.md files were validated.

Agent validation (AgentProfiler):
- Frontmatter required (error)
- Name and description required (error)
- Name format: same rules as skills (lowercase alphanum + hyphens, 64 max)
- Name must match filename minus .agent.md suffix
- Description max 1024 chars
- Body max 500 lines

Plugin validation (PluginValidator):
- Name required, must match directory name
- Version and description required
- Description max 1024 chars
- Skills path required and must exist
- Agents path warned if specified but missing

Discovery (SkillDiscovery):
- DiscoverAgents() walks up from skill paths to plugin roots,
  scans agents/ directories for .agent.md files
- DiscoverPlugins() finds plugin.json from skill paths

Integration (ValidateCommand):
- Runs after skill discovery, before evaluation
- Errors block with exit code 1 (same as spec_conformance_failure)

All 4 existing agents and 2 plugins pass cleanly.
25 new tests (13 agent, 12 plugin).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Code review fixes: spec comments, ValidateNameFormat, kind-specific messages

- Refactor ValidateName into ValidateNameFormat (format-only) + ValidateName
  (format + directory match) so agent/plugin validation doesn't abuse the
  skill directory-match check by passing name twice.
- Warning messages now say 'Agent name' or 'Plugin name' instead of
  'Skill name' when called from AgentProfiler/PluginValidator.
- Add spec URL comments to AgentProfiler and PluginValidator referencing
  agentskills.io/specification, VS Code agent-plugins docs, and Claude Code
  plugins-reference.
- Add missing agent name edge-case tests: leading/trailing hyphen,
  consecutive hyphens, and message-prefix assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove unused agents path from plugins that have no agents

The dotnet, dotnet-data, and dotnet-upgrade plugins declared an agents
path but had no agents/ directory, producing validation warnings. Remove
the field; it can be added back when agents are actually created.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Promote agent/plugin name validation from warnings to errors

The agentskills.io spec uses 'Must' for all name constraints (length,
character set, no leading/trailing hyphens, no consecutive hyphens).
For a publishing validator these should block, not just warn. Agent
filename mismatch is also promoted since the IDE won't discover the
agent if the name doesn't match.

Skill name validation stays as warnings (lenient loading, not part
of this PR).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback

- Fix FrontmatterRegex: remove RegexOptions.Multiline so a horizontal
  rule (---) in the body is not mistaken for frontmatter. Detection and
  stripping now both anchor to start of string.
- Use filename as fallback identifier in AgentProfile when agent.Name
  is empty, so error output shows [agent:foo.agent.md] not [agent:].
- Add TryGetSafeSubdirectory to PluginValidator: rejects absolute paths
  and parent-directory traversal in skills/agents path fields. Used by
  both PluginValidator and SkillDiscovery.DiscoverAgents.
- Use DirectoryName as fallback for plugin result name when Name is
  empty, so error output shows [plugin:my-dir] not [plugin:].
- Add tests for path traversal rejection and name fallback behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Detect orphaned test directories with no matching plugin/skill

Add FindOrphanedTestDirectories to SkillDiscovery: checks that every
directory under tests/{plugin}/{skill}/ has a corresponding directory
under plugins/{plugin}/skills/{skill}/. Plugin-level orphans (tests/
directory with no matching plugins/ directory) are also flagged.

Integrated into ValidateCommand after plugin/agent validation so it
runs on every validation pass. Errors are blocking (exit 1).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR #279 review feedback

- Use case-sensitive (Ordinal) comparison for agent filename matching
  since agent names are required to be lowercase by spec.
- Replace OrdinalIgnoreCase path-under-root check in TryGetSafeSubdirectory
  with Path.GetRelativePath + '..' prefix check for correct behavior on
  case-sensitive filesystems.
- Let ParsePluginJson throw JsonException on malformed JSON instead of
  silently returning null. ValidateCommand catches it as a blocking error.
- Add test for malformed plugin.json.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Increase eval timeouts for dump-collect and dotnet-trace-collect to 120s

The with-skill runs for these skills were hitting the 60s scenario timeout
in CI, causing the agent to be killed before producing output. Other skills
in the same plugin already use 120s. The 30s decline/negative-test scenario
is left unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix fixture paths in clr-activation-debugging and analyzing-dotnet-performance evals

The source paths referenced tests/dotnet/ but the fixtures live under
tests/dotnet-diag/. This caused file-not-found exceptions at runtime,
which set hasRejections and caused unconditional exit 1 (bypassing
--verdict-warn-only).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Surface execution errors in validation summary

Previously, skills that threw exceptions (e.g. missing fixture files)
were silently excluded from the verdict count. The summary showed
'2/4 skills passed' with no indication that 2 other skills crashed
entirely. Now the summary shows '2/6 skills passed (2 rejected due
to execution errors)' and lists the specific error messages near
the summary rather than buried in the middle of the log.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reduce parallelism for infra-change evaluation runs

When infrastructure changes trigger evaluation of all plugins
simultaneously, the high default parallelism (5x5x5) causes API
rate limits (429s) and scenario timeouts from contention. Reduce
to 2x3x3 for infra-change runs only; regular single-plugin PR
evaluations keep the default 5x5x5.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-08 15:40:06 +01:00
Dan Moseley 042a9d2b2c Reorganize plugins into domain-specific groupings (#274)
* Reorganize plugins per agreed structure (#271)

Split the dotnet plugin into domain-specific plugins per discussion
in #271:

- dotnet: narrowed to common everyday C#/.NET coding tasks
- dotnet-diag: perf investigations, debugging, incident analysis
- dotnet-data: data access and Entity Framework
- dotnet-aspnet, dotnet-wpf, dotnet-winforms, dotnet-maui: scaffolded
  empty to convey intent for future framework-specific skills

Moved skills, tests, and CODEOWNERS entries accordingly.
No file content was changed; all skill/test moves are pure renames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve dotnet-diag and dotnet-winforms descriptions

- dotnet-diag: add '.NET' qualifier to clarify scope
- dotnet-winforms: use official 'Windows Forms (WinForms)' name

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add .NET qualifier to dotnet-data description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove empty plugins; list them in CONTRIBUTING.md as future options

Remove the four empty placeholder plugins (dotnet-aspnet, dotnet-wpf,
dotnet-winforms, dotnet-maui) that had only plugin.json and no skills.

Add a 'Plugin organization' section to CONTRIBUTING.md that describes the
domain-specific plugin groupings introduced in this PR and lists the four
removed plugin names as reserved candidates for future contributions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Create dotnet-upgrade plugin with migration/upgrade skills

Move migrate-nullable-references, thread-abort-migration, and
dotnet-aot-compat from dotnet to the new dotnet-upgrade plugin.

Update CODEOWNERS paths (same owners), CONTRIBUTING.md plugin table,
and fix the thread-abort-migration SKILL.md link in CONTRIBUTING.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:01:52 -08:00
Dan Moseley d5bd687cf6 Fix msbuild spec conformance violations (#247)
- msbuild-antipatterns: Move AP-16 through AP-21 and checklist to
  references/additional-antipatterns.md (body: 384 lines, was 583)
- directory-build-organization: Replace cross-skill reference to
  ../msbuild-antipatterns/SKILL.md with local reference file
  references/targetframework-props-pitfall.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 14:15:50 +01:00
Larry Ewing f7abee2099 Add nuget-trusted-publishing skill (#210)
* Add nuget-trusted-publishing skill

Knowledge-driven skill for setting up NuGet trusted publishing (OIDC)
on GitHub Actions repos, replacing long-lived API keys with short-lived tokens.

Replaces #34 which could not be reopened after history rewrite.

* Address review: move to plugins/tests layout, fix phase sequencing, add CODEOWNERS

- Move skill from src/dotnet/skills/ to plugins/dotnet/skills/nuget-trusted-publishing/
- Move eval from src/dotnet/tests/ to tests/dotnet/nuget-trusted-publishing/
- Fix Phase 3/4 sequencing conflict: clarify that drafting the workflow is OK
  before policy confirmation, but publishing/removing secrets should wait
- Add CODEOWNERS entry for nuget-trusted-publishing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 09:16:27 +01:00
Brian Robbins f4d6d8eea3 Add networking investigation support to dotnet-trace-collect skill (#184)
* Add networking investigation support to dotnet-trace-collect skill

- Add Networking Issues section with System.Net.* EventSource providers
  for modern .NET (Http, NameResolution, Security, Sockets)
- Clarify .NET Framework needs only PerfView /ThreadTime for networking
- Add Kestrel providers to Slow Requests section for ASP.NET Core
- Use /Providers syntax for PerfView command-line examples
- Update reference files with networking provider examples
- Add two networking eval scenarios (HTTP 500s, timeouts)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix networking trace commands to explicitly specify --profile when using --providers

When --providers is specified, it overrides the default profiles. Updated the
dotnet-trace collect command to include --profile dotnet-common,dotnet-sampled-thread-time
and the collect-linux command to include --profile dotnet-common,cpu-sampling,thread-time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix dotnet-trace reference to show correct default profiles

The default profiles are dotnet-common and dotnet-sampled-thread-time,
not CPU sampling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 15:09:33 -08:00
Larry Ewing 0978c88159 Improve dotnet-pinvoke skill: stop signals, routing, inline anti-patterns (#72)
* Improve dotnet-pinvoke skill: add stop signals, When to Use, inline anti-patterns

- Reformat description to USE FOR/DO NOT USE FOR structured keywords
- Add 'When to Use This Skill' section with 6 trigger scenarios
- Add 'Stop Signals' section to prevent over-investigation on simple tasks
- Add inline anti-patterns near Steps 2, 4, and 5

Tested with multi-model eval (Sonnet 4, GPT-5.1, Haiku 4.5) — avg 4.8/5.
Assessment: https://gist.github.com/lewing/859ab56b0c37601804c03a5c601cfd8d
Training log: https://gist.github.com/lewing/e272e71dca0f4d1036a02a65796b5e1c

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: use YAML block scalar for description to fix frontmatter parsing

Single-line description with 'USE FOR:' / 'DO NOT USE FOR:' colons breaks
YAML parsers that treat them as nested mappings. Switch to > block scalar.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 13:18:19 -06:00
Viktor Hofer 887dafdbb4 Fix typos and grammar in msbuild.agent.md (#191)
* Fix typos and grammar in msbuild.agent.md

- Close unclosed backtick on #tool:web/fetch reference
- Fix 'help user to troubleshoot' -> 'help the user troubleshoot'
- Fix 'nor' -> 'or' (no preceding 'neither')
- Fix 'a sub-agents' -> 'sub-agents'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update plugins/dotnet-msbuild/agents/msbuild.agent.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update plugins/dotnet-msbuild/agents/msbuild.agent.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix incorrect skill reference in build-perf-baseline

Replace non-existent 'analyzer-performance' skill reference with
'build-perf-diagnostics' which contains the analyzer performance guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 14:44:00 +01:00
Andy Gocke 38da20aa3a Add skill for AOT-compatibility (#122)
* Add skill for AOT-compatibility

Also adds a real-world project conversion between the before and after
tests.

* Update skills/dotnet-aot-compat/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improve skill focus

* Move skill into plugin directory and delete tests

* Add references section

* Improve dotnet-aot-compat skill and add eval tests

- Expand SKILL.md with routing signals, severity markers, stop signals,
  triage step, batch-fix strategy, IJsonModel guidance, and sub-agent
  dispatch pattern
- Extract polyfill code block to references/polyfills.md
- Add eval scenario and test fixtures at tests/dotnet/dotnet-aot-compat/
  following repo convention (moved from skills/ to tests/<plugin>/)
- Eval validates at +25-47% improvement across multiple runs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve dotnet-aot-compat skill consistency

- Warn against adding external package types to JsonSerializerContext
  (prevents the ResponseError compile-error trap)
- Strengthen anti-exploration directive with concrete negative examples
- Push sub-agent parallelization after 2 build-fix cycles

Validated with 3-run eval (Opus 4.6): pass, rubric 4.4/5.
Cross-judge rejudge (Sonnet 4.5, GPT-5.1-Codex, Gemini 3 Pro): all pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Steve Pfister <stpfiste@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-03 14:56:22 -08:00
Brian Robbins 2a9a48b982 Add dotnet-trace-collect skill for .NET performance diagnostics (#124)
* Add dotnet-trace-collect skill for .NET performance diagnostics

Add a new skill that guides developers through capturing diagnostic
artifacts for production .NET performance issues. Covers tool selection,
data collection commands, and analysis recommendations across Windows,
Linux, containers, and Kubernetes for both modern .NET and .NET Framework.

Includes eval.yaml with 12 test scenarios covering high CPU, memory leaks,
excessive GC, hangs, slow requests, native call stacks, Windows containers,
long-running repros, and environment-specific tool trade-offs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove overly broad eval assertion.

* Add workload context check to Step 1

Ask whether the agent is running in the context of the workload.
If so, run diagnostic commands directly; otherwise provide guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Prefer console tools over dotnet-monitor in K8s when in workload context

When running in the context of the workload with console access,
prefer dotnet-trace, dotnet-trace collect-linux, and dotnet-dump
over dotnet-monitor to avoid authentication setup. Fall back to
dotnet-monitor when console access is not available or it is
already deployed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update tool reference: prefer console tools over dotnet-monitor in workload context

Update dotnet-counters container comment and dotnet-monitor trade-offs
to note that console tools are preferred when running in the workload
context with console access.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Delegate dump collection to dump-collect skill

This skill focuses on trace collection. All dump collection guidance
and execution is now delegated to the dump-collect skill. References
to dotnet-dump, procdump, createdump, gcore, and Task Manager for
dump collection are replaced with delegation to dump-collect.

Dump analysis rows removed from Step 4 analysis table since dump
artifacts are handled by the other skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove dotnet-dump section and dump references from tool reference

The entire dotnet-dump section is removed since dump collection is
delegated to the dump-collect skill. Also removed dump/gcdump
endpoints from dotnet-monitor REST API examples (replaced gcdump
with GC trace endpoint), and cleaned up remaining procdump/dotnet-dump
references in PerfView and dotnet-monitor trade-offs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update hangs guidance: start with a trace before a dump

Reorder the hangs workflow to capture a trace first. A trace can
reveal livelocks, thread starvation, or partial forward progress.
Only escalate to a dump if the trace does not explain the hang,
which indicates a potential true deadlock.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix dotnet-trace collect profile: use dotnet-sampled-thread-time

cpu-sampling is only available for collect-linux. Replace with
dotnet-sampled-thread-time in the dotnet-trace collect example.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename dotnet-trace section header to dotnet-trace collect

Clarify the section heading to distinguish dotnet-trace collect from
dotnet-trace collect-linux, which has its own dedicated section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Split tool-compatibility.md into per-tool reference files

Split the monolithic tool-compatibility.md (603 lines) into 6
individual reference files, one per tool:
- dotnet-counters.md (47 lines)
- dotnet-trace-collect.md (66 lines)
- dotnet-trace-collect-linux.md (76 lines)
- dotnet-monitor.md (93 lines)
- perfview.md (125 lines)
- perfcollect.md (177 lines)

This reduces context usage since the skill only needs to load 1-2
tool references per scenario (50-250 lines) instead of all 603 lines.
The tool selection logic remains entirely in SKILL.md; references are
only needed after the tool is chosen.

Updated SKILL.md to replace 3 generic tool-compatibility.md links
with an environment-to-reference-file lookup table. Follows the same
pattern used by the dump-collect skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add collect-linux limitations: symbol resolution and cross-namespace

Document two additional limitations for dotnet-trace collect-linux:
- Native symbols must be on disk during capture for resolution
- Cannot trace cross-namespace processes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add aka.ms direct download links for dotnet-trace

Add curl/wget download option using aka.ms links for Linux x64,
Arm64, musl x64, and Windows x64. This avoids the need for a
.NET SDK, which is useful in container environments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove dotnet-trace report from analysis tools table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update evals to cover recent skill changes

Updated existing scenarios:
- Hang diagnosis: expect trace-first (livelock/starvation check)
  before escalating to dump for true deadlocks
- Memory leak (Linux + .NET Framework): expect delegation to
  dump-collect skill instead of direct dotnet-dump commands

Added new scenarios:
- K8s with console access: prefer console tools over dotnet-monitor
- Container without SDK: aka.ms direct download for dotnet-trace
- collect-linux cross-namespace limitation awareness

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove dotnet-counters from skill

dotnet-counters was causing confusion where the skill would recommend
dotnet-counters but download dotnet-trace via aka.ms links. Since traces
provide richer diagnostic data, remove all dotnet-counters references
and focus the skill on trace collection.

- Remove dotnet-counters.md reference file
- Remove dotnet-counters from lookup table, container tools list,
  live monitoring section, and analysis table in SKILL.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update K8s eval to prefer dotnet-trace over dotnet-monitor

The skill recommends console-based tools (dotnet-trace) as the preferred
approach when the user has console access to a container. Update the
High CPU in Kubernetes scenario to match: expect dotnet-trace as
primary, dotnet-monitor as alternative for no-console-access cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add missing context to eval prompts to prevent user prompting

Several eval prompts were missing required inputs (deployment context,
admin privileges, symptom, .NET version) that the skill needs to select
the right tool. This caused the validator to hang waiting for clarifying
questions that never come in eval mode.

Changes:
- Add 'running directly on a VM/server' to non-container scenarios
- Add symptom to .NET 10 native stacks and container installation prompts
- Add .NET version and admin access to slow requests prompt
- Add admin access to PerfView triggers prompt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Strengthen dump-collect delegation language to 'invoke' not 'delegate'

The skill was using passive 'delegate to dump-collect skill' phrasing
which LLMs may interpret as merely mentioning the skill rather than
actually invoking it. Changed all references to use 'invoke the
dump-collect skill' with explicit 'do not provide dump commands directly'
in key sections. Updated eval rubrics to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove mention of dotnet-monitor for Windows Container CPU eval

The result should be completely focused on PerfView usage and not
dotnet-monitor.

* Clarify StopOn triggers must fire on interesting event, not recovery

Strengthened the circular buffer + StopOn guidance to explain WHY
triggering on recovery is wrong: the circular buffer continuously
overwrites old data, so the interesting behavior may be lost by the
time collection stops. Added 'Critical' callout and 'Never trigger
on recovery' in the pitfalls table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Explain why console tools are preferred over dotnet-monitor

When recommending console-based tools over dotnet-monitor in containers,
explicitly state the reason: dotnet-monitor requires authentication
configuration and sidecar deployment, making console tools easier to
set up when you have direct access.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add kernel requirement to cross-namespace eval rubric

The judge was flagging the kernel >= 6.4 with CONFIG_USER_EVENTS=y
detail as oddly specific, but it is accurate per the collect-linux
reference documentation. Add rubric item so the judge recognizes
this as correct.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Scope dump-collect to modern .NET only, provide direct commands for .NET Framework

The dump-collect skill only supports modern .NET (.NET Core 3.0+).
Updated all .NET Framework references to provide dump commands directly
(procdump -ma, Task Manager) instead of invoking dump-collect. Updated
the Memory dumps header, decision matrix, .NET Framework sections, and
the .NET Framework memory leak eval to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove .NET 10 collect-linux cross-namespace eval scenario

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove auth setup rubric from K8s console access eval

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move skill to standard directory structure and update CODEOWNERS

Moved skill from src/dotnet/skills/ to plugins/dotnet/skills/ and
tests from src/dotnet/tests/ to tests/dotnet/ to match the existing
directory structure. Updated CODEOWNERS to add the new skill with
@brianrob as owner.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-03 08:15:32 -08:00
Jared Parsons 4793aa27e9 Replace binlog mcp with replay to textlog (#162)
Co-authored-by: Jan Krivanek <jankrivanek@microsoft.com>
2026-03-02 21:32:23 +01:00
Jeff Schwartz ac12ae8a6a Move android-tombstone-symbolication skill and tests from src/dotnet to plugins/dotnet and tests/dotnet (#157)
Move the android-tombstone-symbolication skill from src/dotnet/skills/ to
plugins/dotnet/skills/ and its tests from src/dotnet/tests/ to tests/dotnet/
to align with the standard plugin directory structure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-02 13:29:00 -05:00
Dan Moseley 63c6ee1eec Nullable reference migration skill (#39)
* Add nullable-reference-migration skill

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance: annotate based on design intent, not warnings

Annotations should reflect the intended nullability contract of each
member. Deciding intent first and then fixing warnings avoids the
common mistake of over-annotating with ? or scattering ! to silence
the compiler.

Learned from dotnet/runtime nullable annotation guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pitfall: ?. (null-conditional) changes behavior unlike ? and !

During nullable migration it is tempting to change obj.Method() to
obj?.Method() to silence a warning. Unlike ? on a type or ! on an
expression, ?. changes the generated IL and silently skips the call
when the value is null, which can introduce subtle regressions.

Learned from dotnet/runtime PR #57418, #65262, #67198 review comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pitfall: adding ? to value types changes the actual type

For reference types, ? is a metadata-only annotation. For value types
(enums, structs, int, etc.), ? wraps the type in Nullable<T>, which
changes the method signature and binary layout. This was caught as a
breaking change in dotnet/runtime PR #65262 when LogLevel was
accidentally made nullable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance: Debug.Assert as compiler hint and reducing ! usage

Debug.Assert(x != null) informs the nullable flow analyzer just like
an if-check, eliminating the need for ! operators in the subsequent
scope. Also adds guidance that if every call site of an internal
method needs !, the parameter should probably be nullable instead.

Learned from dotnet/runtime PR #67198 and PR #67198 review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enhance CS8618 guidance with [MemberNotNull] for helper methods

When a helper method called from the constructor initializes fields,
[MemberNotNull(nameof(field))] tells the compiler those fields are
guaranteed non-null after the call, eliminating CS8618 warnings
without resorting to ! or making fields nullable.

Learned from dotnet/runtime PR #67198 where this pattern eliminated
many suppression operators.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance for struct default fields and post-Dispose state

Struct reference-type fields are null in default(T). Annotate based
on whether default is valid usage: nullable if yes, non-nullable if
not. Also adds guidance that post-Dispose nullability should not
weaken annotations, since post-Dispose use is a contract violation.

Learned from dotnet/runtime PR #528 (struct fields), nullability.md
(InterfaceMapping vs CancellationToken), and PR #65262 (Dispose).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance: prioritize public API annotations over internal code

Public and protected APIs define the contract consumers depend on
and should be annotated first and most carefully. Internal code can
tolerate ! more liberally since it does not affect callers.

Learned from dotnet/runtime PR #67198 review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pitfall: do not remove ArgumentNullException checks

Non-nullable parameters still need runtime null validation because
callers may not have NRT enabled (other languages, older C#,
suppressed warnings). Removing existing checks during migration
can introduce regressions for those callers.

Learned from dotnet/runtime nullability.md guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enhance Try method annotation patterns with specific recipes

Clarifies the distinction between generic and non-generic Try method
out parameters: use [NotNullWhen(true)] out T? for non-generic, and
[MaybeNullWhen(false)] out T for generic. Also notes that
Equals(object?) overrides should use [NotNullWhen(true)].

Learned from dotnet/runtime nullability.md DO guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance for override covariance and IEquatable<T?>

Override return types can be stricter (non-nullable) than the base
even if the base returns T?. Also adds that reference types should
implement IEquatable<T?> and IComparable<T?> since callers commonly
pass null to Equals.

Learned from dotnet/runtime PR #67198 and nullability.md guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add three-pass code review checklist for nullable changes

Nullable PRs need broader review than a typical diff: (1) verify no
behavior/IL changes, (2) review explicit annotation changes for
correct contracts, (3) scan unchanged APIs whose implicit nullability
changed when the nullable context was enabled.

Learned from dotnet/runtime nullability.md Code Review Guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add link to dotnet/runtime nullable annotation guidelines

This is the authoritative internal document used when annotating the
.NET libraries and contains detailed guidance on gray areas, virtual
methods, struct defaults, and attribute usage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Strengthen null validation pitfall: NRTs are compile-time only

Nullable annotations do not prevent null at runtime. Callers using
older C#, other .NET languages, reflection, dynamic, or the !
operator can still pass null. Emphasizes that runtime validation on
public APIs remains essential for correctness and security.

Learned from community blog posts (Maarten Balliauw, JetBrains)
and dotnet/runtime nullability.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Define NRT abbreviation at first use in body text

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Note that [MaybeNull] should be rare — prefer T? when possible

The .NET runtime codebase has only ~7 uses of [MaybeNull]. In most cases
T? is a better choice. Reserve [MaybeNull] for edge cases like
AsyncLocal<T>.Value where T? would incorrectly allow setting to null
when T is non-nullable.

Source: dotnet/runtime nullability guidelines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance to use [NotNullWhen(true)] on Equals overrides

When Equals(object? obj) returns true, the argument is guaranteed
non-null. Annotating with [NotNullWhen(true)] lets callers skip
redundant null checks after equality tests.

Source: dotnet/runtime nullability guidelines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance for widely-overridden virtual return types

For virtual/abstract methods with many overrides, check whether
existing overrides return null in practice. The .NET runtime annotated
Object.ToString() as string? (overrides commonly return null) but
Exception.Message as string (null overrides vanishingly rare).
When in doubt, prefer T?.

Source: dotnet/runtime nullability guidelines (ToString case study)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Prefer multiple [MemberNotNull] attributes over params overload

The params string[] overload of MemberNotNull is not CLS-compliant
and may require #pragma warning disable. Use separate attributes
for each field instead.

Source: dotnet/runtime nullability guidelines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Warn that compiler does not flag misapplied nullable attributes

Attributes like [DisallowNull] on a non-nullable parameter or
[MaybeNull] on a by-value input parameter are silently ignored.
Even Roslyn team members get tripped up by this.

Source: dotnet/roslyn#36073 (jcouv, RikkiGibson)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Warn about false safety from nullable-oblivious libraries

Unannotated dependencies produce no nullable warnings at all,
giving a false sense of safety. Return values from oblivious APIs
should be treated as potentially null.

Source: dotnet/roslyn#44063 (jcouv), dotnet/roslyn#38941

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify Try method annotation: generic vs non-generic out params

Non-generic out params: declare nullable with [NotNullWhen(true)].
Generic out params: keep non-nullable with [MaybeNullWhen(false)].
Using T? on generic params would change value-type signatures to
Nullable<T>.

Source: dotnet/runtime nullability guidelines

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance for unconstrained generics and LINQ null filtering

For generic methods returning default on unconstrained T, use
[return: MaybeNull] T instead of T? to avoid changing value-type
signatures to Nullable<T>.

LINQ Where(x => x != null) does not narrow T? to T. Use a
WhereNotNull() helper (as Roslyn itself does) or OfType<T>().

Source: dotnet/roslyn#30953 (jcouv, roji), dotnet/roslyn#39586 (sharwell)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pitfall: var is always considered nullable by the compiler

The compiler treats var as nullable regardless of the assigned
expression — flow analysis determines the actual null-state. This
can surprise developers who expect var to inherit non-nullability
from the right-hand side.

Learned from Maarten Balliauw's nullable migration blog series.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add strategy guidance: start at the center, work outward

Annotating core domain models, DTOs, and shared utilities first
eliminates cascading warnings across the codebase and gives the
biggest return on effort. Applies to all three rollout strategies.

Learned from Maarten Balliauw's JetBrains 2025 talk and blog series.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add dedicated EF Core section with schema migration warning

EF Core infers column nullability from NRT annotations. Enabling
NRTs can silently generate migrations that make previously nullable
columns required, risking data loss. Consolidates all EF Core
guidance (navigation properties, schema impact, migration review)
into a dedicated section and removes the scattered EF references.

Learned from Maarten Balliauw's JetBrains 2025 talk, Damir Arh's
blog, and EF Core documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* EF Core: warn that #nullable disable warnings is insufficient for entity files

#nullable disable warnings only suppresses compiler diagnostics but leaves
the annotation context active. EF Core reads annotations via reflection,
so properties without ? are still treated as required, potentially altering
database schema. Use #nullable disable to fully opt entity files out.

Source: dotnet/efcore#33245 (confirmed by EF team member roji).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* EF Core: add DbSet<T> initialization guidance

DbSet properties should remain non-nullable since EF Core always
initializes them. EF Core 7.0+ suppresses CS8618 automatically;
older versions can use = null! or expression body => Set<T>().

Source: official EF Core NRT docs page.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* EF Core: expand navigation property guidance with three approaches

Replace single-sentence guidance with the three patterns from the
official EF Core NRT docs: (a) non-nullable with null!, (b) nullable
when code checks load state, (c) non-nullable wrapping nullable
backing field that throws. Also note collection navigations must
always be non-nullable (empty, never null).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* EF Core: add LINQ query guidance for optional navigations

EF Core translates LINQ to SQL so null navigations don't throw at
runtime, but the compiler still warns. Use ! in Where/Include
expressions to suppress false positives. From official EF Core docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ASP.NET Core: MVC treats non-nullable properties as [Required]

When NRTs are enabled, ASP.NET Core MVC/Web API implicitly adds
[Required(AllowEmptyStrings = true)] to every non-nullable reference
type property in DTOs and view models. This can cause previously
accepted requests to return 400 Bad Request. Controllable via
SuppressImplicitRequiredAttributeForNonNullableReferenceTypes.

Source: official ASP.NET Core model validation docs, aspnetcore#22656.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ASP.NET Core: System.Text.Json RespectNullableAnnotations and limits

STJ (.NET 9+) can enforce NRT annotations at serialization time via
RespectNullableAnnotations, but cannot enforce collection element
nullability (List<string> vs List<string?> are indistinguishable in
IL), top-level types, or generic properties. Document the opt-in
and its limitations.

Source: official STJ nullable annotations docs, aspnetcore#57234
(confirmed by eiriktsarpalis and terrajobst).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ASP.NET Core: warn about #nullable disable warnings on model files

Same pitfall as EF Core: #nullable disable warnings only suppresses
compiler diagnostics but leaves annotations active. MVC reads them
via reflection to infer [Required], so model files not yet migrated
must use #nullable disable to fully opt out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Expand rollout strategy guidance and add suppression analysis use case

Add 'analyzing existing suppressions' to When to Use section.
Expand the start-at-center strategy with guidance to work outward
through layers and keep PRs scoped per project or layer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add helper extension methods section with WhereNotNull

Add a Helper Extension Methods section with WhereNotNull for both
reference and value types. This is the pattern used by the Roslyn
compiler codebase to filter nulls with correct type narrowing, which
.Where(x => x != null) cannot provide. Update the inline reference
in Step 3 to link to the new section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add incremental build checkpoints to NRT migration workflow

Add explicit build checkpoint instructions after Steps 2-6 so the
AI builds and checks warning counts after each phase rather than
attempting all fixes blind.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add commit strategy guidance to NRT migration workflow

Tell the AI when to commit during the migration: at each logical
boundary (enable, dereference fixes, annotations, attributes,
cleanup) to keep diffs reviewable and prevent lost work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add 'when to ask the user' guidance for annotation decisions

Tell the AI to ask the user before changing public API contracts,
deciding nullable vs required for ambiguous properties, or choosing
between null checks and suppressions when design intent is unclear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add inline anti-pattern callouts with warning markers

Add prominent ❌ and ⚠️ callouts inline in Steps 3 and 4 where
dangerous mistakes are most likely: using ?. to silence warnings,
sprinkling !, adding ? to value types, letting warnings drive
annotations, and removing existing null argument validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add decision flowchart for resolving nullable warnings

Add a structured decision tree in Step 3 that guides the AI through
each warning: is null valid by design? Can you prove non-null? This
prevents defaulting to ! or over-annotating with ?.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add scope-based prioritization guidance to Step 3

Tell the AI to work in dependency order (core models first, then
consumers) and prioritize public/protected members within each file
to minimize cascading warnings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add verify-before-claiming guidance to validation step

Tell the AI to verify annotations match design intent, check for
accidental ?. operators, confirm no removed null checks, and audit
! usage before reporting the migration as complete.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add conditional behavior guidance based on project type

Tell the AI to tailor its approach based on whether the project is
a library (public API contracts first), application (boundaries
first), or test project (more liberal use of !).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Flag public API methods missing runtime null validation

Tell the AI to check for missing ArgumentNullException guards on
non-nullable public/protected parameters during annotation. Without
runtime checks, null passed at runtime causes NRE instead of ANE.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add Purpose paragraph to match recommended SKILL.md structure

Add a one-paragraph Purpose description under the top-level heading,
describing the outcome of using this skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Couple notes

* Add missing reference links to More Info section

Add links to Nullable reference types overview, C# language reference
page, and null-forgiving operator reference. These are foundational
docs referenced throughout the skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add breaking changes section for library NRT annotations

Warn that incorrect NRT annotations are source-breaking changes for
library consumers. Covers implicit non-nullability, parameters that
should be nullable, return types, and versioning guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add guidance: methods tolerating null should accept nullable params

If a method handles null gracefully (returns null, returns default,
returns a failure result) rather than throwing, the parameter should
be T?, not T. Based on BCL conventions and NodaTime design discussions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make build/test references build-system agnostic

Not all repos use dotnet build/test directly — some use build scripts,
msbuild, cake, nuke, etc. Add build/test command as optional inputs,
update Step 1 to detect the build system, and replace hardcoded
'dotnet build'/'dotnet test' with generic 'build'/'test' in
checkpoints and validation checklist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove cake/nuke from build script examples

These are uncommon enough to not warrant explicit mention. Keep the
list focused on what an agent would actually encounter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Recommend WarningsAsErrors in project file instead of CLI flag

<WarningsAsErrors>nullable</WarningsAsErrors> in the .csproj or
Directory.Build.props permanently prevents nullable regressions,
which is better than relying on a CLI flag that CI might miss.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Track and document breaking changes for public libraries

When annotating a public library, the AI should create a
nullable-breaking-changes.md listing all public API changes that
could affect consumers (return types narrowed/widened, parameters
changed, value type nullability, new guards). This file serves as
a review artifact and basis for release notes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add trigger phrases to skill description for discovery

Add CS8602, CS8618, CS86xx, #nullable enable, annotating APIs, and
null-forgiving operator keywords so agents discover this skill for
a wider range of nullable-related user requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move framework-specific sections to references/ for progressive disclosure

Move EF Core, ASP.NET Core, breaking changes, and helper extension
method content into references/ files. SKILL.md retains one-line
summaries with links so the agent loads detailed content only when
relevant. Reduces SKILL.md from 218 to 194 lines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add NRT readiness scanner script

Add scripts/Scan-NullableReadiness.ps1, a PowerShell Core script that
scans a project or solution and reports NRT migration status: project
settings (Nullable, LangVersion, TargetFramework, WarningsAsErrors)
and source-level counts (#nullable directives, ! operators, #pragma
CS86xx suppressions). Supports -Path, -Json, and -Recurse parameters.

Update SKILL.md Steps 1 and 6 to reference the script as an optional
automation step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix strict mode .Count errors in Scan-NullableReadiness.ps1

Wrap pipeline results in @() before accessing .Count to avoid
'property Count cannot be found' errors under Set-StrictMode -Version Latest
when a pipeline returns a single object instead of an array.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add automated tests for Scan-NullableReadiness.ps1

Test script runs the scanner against three fixture projects:
- nrt-disabled: no <Nullable>, has ! operators and #pragma suppressions
- nrt-enabled: <Nullable>enable, clean code
- nrt-partial: <Nullable>enable but files with #nullable disable and !

Validates JSON output matches expected NRT readiness state (19 assertions).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Recommend clean builds for validation checkpoints

Incremental builds only recompile changed files, hiding nullable
warnings in untouched files. All build checkpoints should use
clean builds (e.g., --no-incremental) to surface all warnings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move nullable-reference-migration to src/dotnet/ layout

Align with upstream repo restructuring that moved skills and tests
under src/dotnet/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve ! operator counting by stripping comments and strings

The scanner now removes block comments, line comments, verbatim strings,
interpolated strings, and regular strings before counting null-forgiving
operators. This eliminates false positives from ! in prose like
'Important!' or 'Value required!'.

Tests updated with exact assertions and fixtures enriched with !
in comments, XML docs, and string literals to verify filtering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix misleading 'var is always nullable' wording

var does not inherently introduce nullability — the inferred type
carries nullability from the right-hand side expression. Updated
the pitfall description to reflect this accurately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make STJ RespectNullableAnnotations limitations more explicit

Clarify that the feature is opt-in, affects both serialization and
deserialization, and explicitly list what it does not cover:
collection elements, dictionary values, top-level types, and
generic type parameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add caveat that Debug.Assert is stripped from Release builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify that required does not enforce during deserialization

The required keyword is a compile-time and object-initializer
constraint. It does not replace runtime validation unless the
serializer explicitly supports it (e.g., STJ with [JsonRequired]).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add explicit version callouts for required, DbSet, JsonRequired

Consistently tag version requirements so the skill adapts across
repos targeting different .NET versions:
- required (C# 11+) on all mentions
- EF Core 7.0+ (.NET 7) for DbSet CS8618 suppression
- [JsonRequired] (.NET 7+)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add DTO vs domain model nullability guidance

DTOs should be nullable by default (they cross trust boundaries),
domain models should prefer non-nullable invariants. This distinction
is where migrations most often go wrong.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add gray area heuristics for parameter nullability decisions

From dotnet/runtime nullability guidelines: when a parameter is
neither validated nor documented for null, check usage patterns
in the codebase, whether null acts as a default/nop, and whether
similar methods accept null. When in doubt, prefer nullable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Never infer nullability intent from usage frequency or naming

Explicit guard against AI hallucination: if intent is not clear
from code or documentation, ask the user rather than guessing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Strengthen serialization bypass warning in pitfalls table

Reworded to anchor the rule: serializers bypass constructors,
non-nullable properties on DTOs do not imply runtime safety.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Stop and ask user if lang version or TFM is insufficient for NRTs

If the project targets C# 7.x or a framework that defaults below
C# 8.0, explicitly inform the user what needs to change and ask
whether to update or abort. Do not silently proceed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add = null! guidance for late-initialized fields in NRT skill

Add recommended technique for CS8618 warnings on fields set after
construction: use = null! on the field declaration instead of adding !
at every use site. Document the pattern in the CS8618 table row, the
annotation decision flowchart, and the Step 3 guidance section.

Motivated by exercising the skill on System.Text.RegularExpressions,
where = null! reduced ! operator count from 423 to 178 compared to
the original 2019 NRT annotation PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Categorize ! operators as null!/default! vs assertions in scanner

Break down the ! operator count into two categories:
- null!/default! initializers (safe, expected for late-initialized fields)
- assertions (value! patterns that warrant scrutiny)

This gives a more nuanced readiness assessment — a project with
30 null! and 5 assertions is in better shape than one with 35
assertions, even though the total is similar.

Update fixtures with null!/default! patterns and add 6 new test
assertions (25 total, up from 19).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add pre-migration effort estimate for CS8618 warnings

Count uninitialised reference-type fields and auto-properties as a
rough predictor of CS8618 warnings before NRT is enabled. Excludes
value types, events, const, and 'required' properties.

Shown only when NRT is not yet enabled, labeled as approximate.
In the corefx regex migration, CS8618 was 47% of all warnings (236
of 502), making this the single most useful pre-migration signal.

Adds 3 test assertions (28 total).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add per-file ! breakdown in scanner output

Show null!/default! vs assertion counts for each flagged file in
both human-readable and JSON output. This helps reviewers quickly
see which files have mostly safe initializers vs genuine assertions
that warrant scrutiny.

Example: 'RegexCompiler.cs: 31 ! (24 null!/default!, 7 assertions)'
tells the reviewer only 7 uses need attention, not 31.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Show per-file uninit fields pre-migration, suppress post-migration

Flag files with >5 uninitialised reference-type fields in 'Files
needing attention' so the pre-migration report shows where the most
CS8618 work will be. Suppress this metric when NRT is already
enabled since it's no longer actionable. Also skip empty lines in
per-file output when a file only triggered the uninit threshold but
NRT is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Context-aware section headings in scanner output

Replace generic 'Files needing attention' with context-dependent labels:
- Pre-migration (NRT not enabled): 'Migration work needed'
- Post-migration with remaining directives: 'Remaining cleanup'
- Post-migration clean: 'Suppression audit (Step 6)' — frames !
  operators as review candidates, not problems

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove Step 6 reference from scanner output to avoid sync issues

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add before/after example output to scanner script header

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Advocate RespectNullableAnnotations as best practice for .NET 9+

Reframe guidance from neutral opt-in to prescriptive best practice,
add motivation for why it matters, and recommend companion setting
RespectRequiredConstructorParameters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add zero-IL-change principle as hard rule for NRT migration

Add prominent top-level principle: NRT migration must never change
runtime behavior or generated IL. Missing null guards should be
flagged as TODO comments (with user consent), not added inline.
Update the existing null validation guidance to align.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add TFM caveat to Debug.Assert null-state guidance

Debug.Assert acts as a nullable flow-analysis hint only on
.NET Core 3.0+ where it has [DoesNotReturnIf(false)]. On
.NET Framework/netstandard2.0 it lacks this annotation and
does not affect null-state analysis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert Debug.Assert TFM caveat

The skill targets .NET Core 3.0+ where Debug.Assert has
[DoesNotReturnIf(false)]. No need to document .NET Framework
behavior since we don't encourage NRTs on older TFMs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add return-type semantic nullability guidance to NRT skill

Round-trip experiment on Dapper (51 files, 984 warnings) revealed the agent
systematically removed ? from 40 public return types (OrDefault, ExecuteScalar)
to satisfy the compiler, but those methods can return null by design. Added
explicit guidance that return types must reflect semantic nullability, not just
compiler satisfaction, with specific patterns to watch for.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Strip string literals before comments in scanner

Reorder the regex passes so strings are removed before comments.
A string like "http://..." contains // that was previously
mis-parsed as a line comment, corrupting downstream text.

Add a URL-in-string test case to the nrt-enabled fixture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add NRT skill guidance from real-world evaluation

Tested the skill against NimblePros/eShopOnWeb (ASP.NET Core + EF Core).
Stripped NRT annotations from 44 files, re-annotated using the skill,
and compared against the originals. Found 3 areas for improvement:

ef-core.md:
- Add guidance to always pair #pragma warning disable CS8618 with
  #pragma warning restore CS8618 to prevent suppression leakage

aspnet-core.md:
- Add Razor Pages [BindProperty] initialization guidance
- Add collection property default initialization guidance
- Call out the ?.+! anti-pattern (contradictory null handling)

SKILL.md:
- Add guard clause library awareness (Ardalis.GuardClauses, Dawn.Guard
  use [NotNull] attributes that narrow null state — avoid redundant !)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename skill to migrate-nullable-references, wire scanner tests into eval.yaml, merge main

- Rename nullable-reference-migration -> migrate-nullable-references per CONTRIBUTING.md naming convention (lead with action verb)
- Update YAML front-matter name field
- Update scanner script and test script references to new directory name
- Add scanner script eval scenario to eval.yaml using test fixtures
- Merge latest main for CI/eval infrastructure updates

Fixes #38

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove en-us locale from learn.microsoft.com URLs in NRT skill

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove scanner eval scenario (script tests stay in Test-ScanNullableReadiness.ps1)

The scanner script scenario doesn't work as an eval scenario because the baseline
run has no access to skill resources (source: files aren't resolved when skill=null).
Scanner tests are validated separately via Test-ScanNullableReadiness.ps1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve eval rubric for correctness and fix code formatting

Replace generic throughput rubric with 5 correctness-focused criteria:
- Value-type avoidance (int, bool, DateTime)
- Nullable return types for FirstOrDefault methods
- Late-init field handling (_header in CsvExporter)
- Interface/implementation consistency
- Zero-warning build

Also fix C# code formatting in setup files (namespace/class
declarations were collapsed onto single lines).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve migrate-nullable-references skill routing and deduplication

- Add structured USE FOR / DO NOT USE FOR / INVOKES to description
- Add multi-project solution migration order note in Step 2
- Deduplicate serialization/DTO pitfall (cross-ref Step 4)
- Shorten redundant ArgumentNullException pitfall row

Multi-model validation: Sonnet 4.8/5, GPT-5.1 4.6/5, Haiku 4.8/5 (avg 4.73)
No regressions detected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add minimal API parameter optionality guidance per halter73 review

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix contradiction in CS86xx fix guidance per eerhardt review

The warning fix table recommended adding null checks/guards, contradicting
the zero-runtime-behavior-change rule in line 35. Reworded to prioritize
annotation-only fixes (? and !) and note that null checks change behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Skill: prefer [NotNullWhen(true)] over ! at call sites

When a boolean-returning helper guarantees a nullable parameter is non-null,
annotating the parameter with [NotNullWhen(true)] is better than sprinkling
! at every call site. This is metadata-only (no behavior change) and gives
the compiler real flow information.

Based on feedback from reviewing skill-guided NRT migration output on
dotnet/roslyn#58107 — the agent used ! without comment instead of annotating
the helper method.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove WhereNotNull helper extensions; refine skill scope

- Delete helper-extensions.md (WhereNotNull was rejected as a BCL API and
  is only used internally in Roslyn)
- Update LINQ guidance to recommend OfType<T>() instead
- Add 'fixing a handful of warnings' to DO NOT USE FOR in description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename Scan-NullableReadiness to Get-NullableReadiness per convention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ASP.NET Core + EF Core eval scenario for NRT migration

Exercises EF Core navigation property nullability, DbSet handling,
and ASP.NET model validation behavior changes when enabling NRTs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add file_not_contains assertion and file-by-file eval scenario

Add file_not_contains assertion type to skill-validator, mirroring
file_contains but asserting the value is absent. Includes 3 tests.

Add eval scenario testing file-by-file NRT migration: agent must
modify only the targeted file while leaving others unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix YAML frontmatter: use block scalar for description with colons

The colons in USE FOR:/DO NOT USE FOR:/INVOKES: caused YAML parse
failures in skill-validator. Use > block scalar syntax per lewing review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Strengthen CS8603 return-type guidance and add return null! anti-pattern

Clarify that non-nullable return type is a promise to callers.
Add explicit warning against return null!/default! pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Extract nullable attributes table to optional reference

Move the System.Diagnostics.CodeAnalysis attributes table from Step 5
inline content to references/nullable-attributes.md, reducing the core
skill by ~500 tokens. The inline step retains a summary listing the
key attribute names so the agent knows what's available and when to
load the reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Tweak ASP.NET/EF eval scenario prompt wording

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move skill to plugins/tests layout, add CODEOWNERS for migrate-nullable-references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review: remove spoon-fed build commands, refocus rubric on skill value

- Remove explicit 'Build with:' lines from eval prompts so the skill's
  Step 1 (discover build command) is actually exercised
- Reword file-by-file rubric to test the skill's migration strategy
  rather than general instruction compliance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2026-03-02 10:12:21 -08:00
Mark Miller 3aa3ddbf1c Skill for debugging .NET Framework runtime activation issues using the activation logs added in the in-proc SxS days. (#152) 2026-03-02 10:11:28 -08:00
Viktor Hofer 29033c459d Reset plugin verisons to 0.1.0 (#145) 2026-02-28 08:38:03 +01:00
Cameron Aavik 4d11e331dd Add microbenchmarking skill (#63)
* Add microbenchmarking skill

* Add eval.yaml

* Merge in latest changes + apply review comments

* Use stronger wording for reference file loading

* Remove DoNotParallelize

* Move skill and tests to new location
2026-02-27 16:02:40 -08:00
Viktor Hofer 4d484a18ce Move src/dotnet content into plugins/ and tests/ (#144)
Move skills from src/dotnet/skills/ to plugins/dotnet/skills/ and
tests from src/dotnet/tests/ to tests/dotnet/, then remove the
now-empty src/ directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:33:08 +01:00
Viktor Hofer 24fa12656b Remove .mcp.json and mcpServers from plugin.json
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 7115c467d7 Move build.ps1 to agentic-workflows and update paths
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 2dacda5600 Remove AGENTS.md and README.md from dotnet-msbuild plugin
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 077ca9155f Remove prompts folder and distribution templates section
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 1e44eef4f1 Remove copilot-extension folder and all references
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 7d0a329aee Move agentic-workflows to repo root
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 20:19:46 +01:00
Viktor Hofer 86cd604ee6 Fix missing agents from dotnet plugin 2026-02-27 20:19:46 +01:00
Viktor Hofer 6e2ad53e88 Move plugin tests out of plugins folder into a root tests/ folder 2026-02-27 20:19:46 +01:00
Viktor Hofer 0b249be6b6 Rename from components to plugins 2026-02-27 20:19:46 +01:00
Viktor Hofer 250b1c2bbc Rename src/ to plugins/ folder 2026-02-27 20:19:46 +01:00