Files
Manish Jayaswal 2633d3d482 add a new dotnet11 plugin and a new system text json skill to it. (#535)
* add a new dotnet11 plugin and a new system text json skill to it.

* Update plugins/dotnet11/skills/system-text-json-net11/SKILL.md

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

* added the option to run dotnet11 skills. by default they don't get included

* Update tests/dotnet11/system-text-json-net11/eval.yaml

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

* Add JSON output assertions to system-text-json-net11 eval.yaml

Agent-Logs-Url: https://github.com/dotnet/skills/sessions/8e302f3f-4328-44a0-845d-4eb0c930af63

Co-authored-by: ManishJayaswal <9527491+ManishJayaswal@users.noreply.github.com>

* addressed CR comments

* addressed more CR comments

* fixed agument to pass while enabling dotnet11 skills

* Remove dotnet11-specific filtering from skill-validator and evaluation workflow

Now that .NET 11 is the default SDK for the repo (global.json updated on main),
there is no need for special dotnet11 exclusion logic. The dotnet11 plugin skills
are treated like any other plugin and included in all evaluation runs.

Changes:
- Remove --include-dotnet11 CLI option and filtering logic from EvaluateCommand.cs
- Remove IncludeDotnet11 from ValidatorConfig model
- Remove --dotnet11 flag parsing from evaluation workflow gate job
- Remove dotnet11 exclusion logic from discover job
- Remove conditional .NET 11 preview SDK install step (global.json handles it)
- Remove dotnet11 from excludeFromSchedule list
- Remove all dotnet11-specific warning/status messages
- Remove section 9 from InvestigatingResults.md

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

* address code review comments after rebase

* added the plugin to cursor and added MIT license to skill

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: [Manish Jayaswal] <[manishj@microsoft.com]>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ManishJayaswal <9527491+ManishJayaswal@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-04 12:08:25 -07:00

113 lines
5.1 KiB
YAML

scenarios:
# --- Scenario 1: Serialize JSON in .NET 11 with PascalCase property names ---
# The prompt deliberately does NOT name any specific API. The skill description
# mentions "serializing JSON in .NET 11" and "PascalCase property naming" — those
# are the trigger words the agent should pick up on to load this skill.
- name: "Serialize JSON in .NET 11 with PascalCase property names"
prompt: |
I'm starting a new console app on .NET 11 and I need to serialize this record to JSON:
```csharp
public record Person(string name, int age);
```
In the output JSON the property names should be PascalCase (so `Name` and `Age`,
not `name`/`age` or `firstName` style). I want to use whatever the framework
provides out of the box rather than writing my own naming-policy class.
Please show me the full program targeting `net11.0` and run it so I can see the
JSON output.
assertions:
- type: "exit_success"
- type: "output_matches"
pattern: "JsonNamingPolicy\\.PascalCase"
- type: "output_matches"
pattern: "net11\\.0"
- type: "output_not_matches"
pattern: "class\\s+\\w+\\s*:\\s*JsonNamingPolicy"
- type: "output_matches"
pattern: "\"Name\""
- type: "output_matches"
pattern: "\"Age\""
rubric:
- "Uses the new built-in JsonNamingPolicy.PascalCase static property (added in .NET 11) and does not implement a custom JsonNamingPolicy subclass"
- "Targets net11.0 in the project / file-based app"
- "Actually runs the program and shows JSON output with PascalCase property names (e.g. \"Name\", \"Age\")"
timeout: 180
# --- Scenario 2: Typed metadata access on JsonSerializerOptions in .NET 11 ---
# Trigger words from the skill description: "typed metadata access",
# "JsonSerializerOptions", ".NET 11". The prompt asks for the desired *behavior*
# (type-safe metadata, no exception when missing) rather than naming the API.
- name: "Type-safe JsonTypeInfo access without exceptions in .NET 11"
prompt: |
In a .NET 11 library I'm working on, I have a `JsonSerializerOptions` instance
and I want to get the JSON metadata for a specific type `T` in a strongly-typed
way (i.e. I want back a `JsonTypeInfo<T>`, not a non-generic `JsonTypeInfo` that
I have to cast).
I also need a way to *probe* whether metadata for `T` is available without
having an exception thrown at me if it isn't — so I can branch on "have it"
vs "don't have it". I'd rather not wrap things in try/catch.
Show me a minimal `net11.0` program that demonstrates both: getting the typed
metadata when it's available, and checking-without-throwing for a case where
it might not be. Run the program.
assertions:
- type: "exit_success"
- type: "output_contains"
value: "GetTypeInfo<"
- type: "output_contains"
value: "TryGetTypeInfo<"
- type: "output_matches"
pattern: "out\\s+(var|JsonTypeInfo)"
- type: "output_matches"
pattern: "net11\\.0"
- type: "output_not_matches"
pattern: "\\bcatch\\b\\s*(\\(|\\{)"
- type: "output_matches"
pattern: "(True|False|found|Found|JsonTypeInfo)"
rubric:
- "Uses the new generic JsonSerializerOptions.GetTypeInfo<T>() overload (added in .NET 11) for the typed-access part"
- "Uses the new generic JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>? info) overload (added in .NET 11) for the probing part"
- "Does NOT wrap GetTypeInfo in try/catch as a workaround"
- "Targets net11.0 and actually runs the program"
timeout: 180
# --- Scenario 3: Negative — skill should NOT activate ---
# This is a JSON serialization task on .NET 8, with camelCase naming. None of the
# APIs covered by this skill (PascalCase policy, generic GetTypeInfo<T>/
# TryGetTypeInfo<T>) are relevant. The agent should solve the task without
# loading the system-text-json-net11 skill.
- name: "Non-activation: camelCase JSON serialization on .NET 8"
prompt: |
I have a .NET 8 console app and I need to serialize this record to JSON with
camelCase property names:
```csharp
public record Person(string Name, int Age);
```
Show me a minimal program targeting `net8.0` that produces output like
`{"name":"Jane","age":30}` and run it.
expect_activation: false
assertions:
- type: "exit_success"
- type: "output_matches"
pattern: "net8\\.0"
- type: "output_matches"
pattern: "JsonNamingPolicy\\.CamelCase"
- type: "output_not_matches"
pattern: "JsonNamingPolicy\\.PascalCase"
- type: "output_not_matches"
pattern: "net11\\.0"
- type: "output_matches"
pattern: "\"name\""
- type: "output_matches"
pattern: "\"age\""
rubric:
- "Solves the task using only pre-.NET 11 APIs (JsonNamingPolicy.CamelCase, standard JsonSerializer.Serialize)"
- "Does NOT load or reference the system-text-json-net11 skill — none of its APIs are needed here"
- "Targets net8.0 and produces camelCase JSON output"
timeout: 180