AG-UI .NET SDK Code Review
Encodes the AG-UI .NET SDK's house rules so a reviewer flags real violations a
generic C# reviewer misses. Authoritative sources: sdks/dotnet/AGENTS.md
(house rules) and sdks/dotnet/docs/architecture.md (design boundaries). Each
rule cites a real enforcement example in the repo; full BAD→GOOD examples and
per-rule exceptions live in references/rules.md. The
change-footprint and test rules below distil the minimize-change-footprint,
ensure-test-coverage, and ensure-test-quality review conventions for this SDK.
Reviewer discipline
- High signal-to-noise. Only flag a genuine violation of a rule below, tied
to its cited convention. Don't invent nits or restate analyzer output.
- Verify before flagging. Read the actual changed code and confirm the rule
applies. Automated reviewers have high false-positive rates.
- Scope. Review only files under
sdks/dotnet/. Skip generic style already
enforced by TreatWarningsAsErrors, nullable, and EditorConfig.
- Blast radius. Fix nothing — this skill only reports. Local convention
violations get a finding; codebase-wide concerns are noted as out-of-scope
follow-ups, not per-line nits.
- Severity: ❌ must fix (breaks AOT/wire/build/boundary); ⚠️ should fix
(convention drift); 💡 optional polish.
The review process
Step 0 — Ground truth & file classification. Derive the package map from
AGUI.slnx; skim AGENTS.md + docs/architecture.md. Classify each changed
file: production | test | sample | proto | csproj | public-api | docs. Rules
are gated by class.
Step 1 — Determine and summarize the change set. Resolve what is under
review, in order: an explicit target (PR number / branch / commit range); else
the current branch vs. its tracking/base branch (git merge-base <base> HEAD);
plus staged, unstaged, and untracked working-tree changes. Then write a short
summary of what the diff does — new types, wire/protocol changes, public-surface
changes, new dependencies, src-vs-sample placement. This frames every phase and
catches scope creep early.
Step 2 — Walk the rules, phase by phase (A→G). For each phase, check every
applicable changed file against every rule in that phase. Write each finding
immediately: file:line, rule ID, severity, one-line fix. Verify the code first.
Step 3 — Self-validation. Dedupe; confirm each finding cites a real rule and
a real line; confirm no rule was applied to the wrong file class; drop anything
not verifiable in the actual diff.
Step 4 — Emit the review summary (see below) — a single human-readable comment,
findings grouped by severity with a verdict and coverage line.
Phase A — Scope / scenarios
NET-SCOPE-01 Every change traces to a spec requirement or issue [⚠️]
NET-SCOPE-02 No unrequested capability, configurability, or dependency [⚠️]
NET-SCOPE-03 A wire/protocol change carries compatibility coverage [❌]
NET-SCOPE-04 Sample-only behavior stays out of src/ [⚠️]
NET-SCOPE-05 Minimal footprint — every diff line serves the task; no unrelated
refactor, speculative abstraction, or cosmetic churn [⚠️]
Phase B — Design / architecture
From docs/architecture.md "Architectural constraints".
NET-ARCH-01 No src/ project references Microsoft.AspNetCore.App [❌] —
git grep "Microsoft.AspNetCore" -- sdks/dotnet/src must be empty.
NET-ARCH-02 Correct package placement (wire→Abstractions, SSE→Formatting,
proto→Protobuf, client/transport→Client, hosting→Server) [❌]
NET-ARCH-03 Dependency direction — Client and Server never reference each
other [❌]. Cite: src/AGUI.Server/AGUI.Server.csproj.
NET-ARCH-04 IChatClient is the only integration point — no bespoke agent
abstraction [💡]
NET-ARCH-05 Every type has a single reason to change [⚠️]
NET-ARCH-06 No interface without multiple implementations or a test-double need [⚠️]
NET-ARCH-07 Make invalid states unrepresentable (enums/types over bool/string) [⚠️]
NET-ARCH-08 One class per file; file name matches the type [⚠️]
Phase C — Implementation / correctness
From AGENTS.md "JSON serialization" / "Code style".
NET-IMPL-01 Every serializable type registered in AGUIJsonSerializerContext
via [JsonSerializable(typeof(T))] [❌]. Cite:
src/AGUI.Abstractions/Serialization/AGUIJsonSerializerContext.cs.
NET-IMPL-02 No JsonSerializer.Serialize<object> and no reflection-based
serialization — go through the source-gen context [❌]
NET-IMPL-03 Polymorphic JSON uses a hand-written discriminator JsonConverter<T> [❌].
Cite: src/AGUI.Abstractions/Events/BaseEventJsonConverter.cs.
NET-IMPL-04 Property attribute kit present: explicit [JsonPropertyName],
[JsonIgnore(WhenWritingNull)] on optionals, required strings = string.Empty,
collections = [] [⚠️]. Cite: src/AGUI.Abstractions/Events/RunStartedEvent.cs.
NET-IMPL-05 ConfigureAwait(false) on every await in src/ [⚠️]. Cite:
src/AGUI.Client/AGUIChatClient.cs.
NET-IMPL-06 [EnumeratorCancellation] on the token of any IAsyncEnumerable<T>
method [⚠️]. Cite: src/AGUI.Formatting/SseEventStreamFormatter.cs.
NET-IMPL-07 ArgumentNullException.ThrowIfNull(...) for public-API argument
validation [⚠️]
NET-IMPL-08 Validate external input at the boundary, not deep in the stack [⚠️]
NET-IMPL-09 Guard every code path — no silent default/fallthrough [⚠️]
NET-IMPL-10 No swallowed exceptions (empty or log-only catch) [⚠️]
NET-IMPL-11 Never log or expose sensitive data in errors [❌]
NET-IMPL-12 No dead, commented-out, or impossible-condition defensive code [⚠️]
NET-IMPL-13 No logic duplicated across the changeset — extract a shared helper
at 3+ uses (Rule of Three; don't extract for 1–2) [⚠️]
NET-IMPL-14 Prefer BCL/platform APIs over hand-rolled equivalents [⚠️] —
exception: deliberate AOT-safe hand-written paths (the JsonElement↔Value
bridge, the discriminator converters) are intentional, not violations.
Phase D — Wire compatibility
NET-WIRE-01 Protocol types match the TS reference — honor the
// Keep in sync with sdks/typescript/... markers [❌]. Cite:
src/AGUI.Abstractions/Events/RunStartedEvent.cs.
NET-WIRE-02 Events are additive — unknown types round-trip via RawEvent;
don't remove or repurpose existing fields [⚠️]
NET-WIRE-03 Protobuf parity preserved for the supported event set [❌]
Phase E — PublicAPI analyzer
NET-API-01 Any public-surface change updates that project's
PublicAPI.Unshipped.txt (build fails RS0016 otherwise) [❌]. Cite:
sdks/dotnet/Directory.Build.targets, src/AGUI.Abstractions/PublicAPI.Unshipped.txt.
NET-API-02 A new event type completes the full checklist (class in Events/
deriving BaseEvent; Type → AGUIEventTypes constant; [JsonSerializable];
read case in BaseEventJsonConverter; PublicAPI.Unshipped.txt; round-trip
test) [⚠️]
Phase F — Style / naming
From AGENTS.md "Code style" / "Naming" (not all analyzer-enforced).
NET-STYLE-01 sealed on every non-abstract class [⚠️]
NET-STYLE-02 No record types — use sealed class with properties [❌]
NET-STYLE-03 No tuples in public APIs — define a named type [⚠️]
NET-STYLE-04 Braces always on if/for/foreach/while [⚠️]
NET-STYLE-05 Naming: events {Name}Event; discriminators SCREAMING_SNAKE_CASE
constants in AGUIEventTypes; outcome/role constants lowercase (never enums);
options AGUI{Purpose}Options; extensions {Target}Extensions; tests
{TypeUnderTest}Test [⚠️]
NET-STYLE-06 DI-extension types use the Microsoft.Extensions.DependencyInjection
namespace; all other types use the project RootNamespace with no sub-namespaces [⚠️]
NET-STYLE-07 No XML docs (///) on internal/private members [⚠️]
NET-STYLE-08 Don't reformat code you didn't otherwise change [⚠️]
Phase G — Tests
From AGENTS.md "Running tests"; coverage/quality rules distilled from
ensure-test-coverage and ensure-test-quality.
SDK-specific:
NET-TEST-01 Serialization tests assert concrete JSON property names via
JsonDocument — not via the deserialized object [⚠️]
NET-TEST-02 No full-JSON-string comparisons — assert individual properties [❌]
NET-TEST-03 No reflection to enumerate types or verify membership [❌]
NET-TEST-04 Wire-affecting change ⇒ compatibility fixture + round-trip in
tests/AGUI.Abstractions.UnitTests/Compatibility/ [⚠️]
NET-TEST-05 New public behavior ⇒ unit test; server-pipeline change ⇒
integration test (tests/AGUI.Hosting.AspNetCore.IntegrationTests/) [⚠️/💡]
Coverage:
NET-TEST-06 A new/changed class with branching logic has a test covering happy
path, primary error path, and boundary values (null/empty/zero/single) [⚠️]
NET-TEST-07 Don't test trivial code — DTOs/records with no logic, one-line
delegations, constant returns [💡]
NET-TEST-08 Test through DI + InternalsVisibleTo, not members made public
for tests [⚠️]
Quality:
NET-TEST-09 Every test asserts a specific observable value — no assertion-free
tests, no bare Assert.NotNull/True/NotEmpty standing in for the real value [❌]
NET-TEST-10 Deterministic and isolated — no Thread.Sleep/Task.Delay for
synchronization, no execution-order dependence, side effects cleaned up
(files/ports/env) [❌]
NET-TEST-11 Test behavior, not implementation — prefer hand-written fakes over
mock.Verify(Times.*) (unless the call count is the spec'd behavior); [Theory]
for data variation, [Fact] for behavior; AAA visible inline with factory
helpers (not shared mutable fixtures) below the tests; no // TODO or empty
test bodies [⚠️]
Self-validation
Common pitfalls
| Pitfall |
Solution |
| Restating analyzer/EditorConfig output |
Only flag rules above that tooling does not enforce |
| Flagging a "missing" registration without checking the context |
Open AGUIJsonSerializerContext.cs and confirm |
Treating a sample's ASP.NET usage as a src/ violation |
NET-ARCH-01 applies to src/ only |
| Calling an additive new event a wire break |
NET-WIRE-02 — additive is allowed |
| Nitpicking style in files with substantive changes |
Focus on the substantive change |
Review summary
Produce a single human-readable Markdown comment — a reviewer's summary the author
can read top to bottom. Lead with the verdict, then the findings grouped by
severity (most severe first), each one self-contained.
## AG-UI .NET SDK code review
**Verdict:** <Request changes | Comment | Looks good> — <one-sentence reason>
**Change set:** <branch vs base, e.g. `feat/x` vs `main`> · <N files reviewed>
(+<U untracked>) · **Findings:** ❌ <a> · ⚠️ <b> · 💡 <c>
<One short paragraph: what the change does and the overall read.>
### ❌ Must fix
- **`src/AGUI.Abstractions/Events/FooEvent.cs:42`** · `NET-IMPL-01` — new event type
isn't registered in `AGUIJsonSerializerContext`; it fails under AOT.
**Fix:** add `[JsonSerializable(typeof(FooEvent))]`.
### ⚠️ Should fix
- **`src/AGUI.Client/AGUIChatClient.cs:88`** · `NET-IMPL-05` — bare `await` in
library code. **Fix:** append `.ConfigureAwait(false)`.
### 💡 Optional
- **`src/AGUI.Server/StreamAdapter.cs:17`** · `NET-ARCH-04` — bespoke agent
abstraction; the SDK integrates via `IChatClient`. **Fix:** drop the wrapper.
### Coverage
Phases checked: A–G. No findings in: **B Design**, **D Wire**, **E PublicAPI**.
Rules for the summary:
- Order findings by severity (❌ → ⚠️ → 💡), then by file. One bullet per finding:
bold
file:line, the RULE-ID, a plain-language description, and an italic
Fix: with a one-line remedy. The reader can look the ID up in
references/rules.md.
- Omit empty severity sections. Always include the Coverage line so the
author sees which phases were clean versus untouched.
- Clean diff: skip the severity sections and write a single line —
✅ No violations of the AG-UI .NET house rules — checked phases A–G across N files.
- Verdict mapping: any ❌ → Request changes; only ⚠️/💡 → Comment; none →
Looks good. The skill never approves or blocks automatically — the verdict is
advisory and the author decides.
Source: ag-ui-protocol/ag-ui → .github/skills/agui-dotnet-code-review/SKILL.md
1---2name: agui-dotnet-code-review3description: "> Review C#/.NET code changes to the AG-UI .NET SDK (sdks/dotnet/) against its specific conventions and architectural rules — AOT serialization, the \"no ASP.NET in src/\" boundary, the PublicAPI analyzer workflow, wire compatibility with the TypeScript reference, and the house style (sealed/no-records/ConfigureAwait). Runs a phased, rule-by-rule review. USE FOR: reviewing a PR, diff, or branch that touches sdks/dotnet/; checking a new event/message type; verifying serialization, package placement, or public-API changes in the .NET SDK. DO NOT USE FOR: generic C# style nits already enforced by analyzers/EditorConfig; reviewing the TypeScript SDK (sdks/typescript/) or Python SDK (sdks/python/); writing new features (only flag violations, never rewrite code)."4category: engineering-core5source_repo: ag-ui-protocol/ag-ui6source_path: ".github/skills/agui-dotnet-code-review/SKILL.md"7source_url: https://github.com/ag-ui-protocol/ag-ui/blob/HEAD/.github/skills/agui-dotnet-code-review/SKILL.md8metadata:9 source: https://skillmd.com/skills/ag-ui-protocol/agui-dotnet-code-review10---1112# AG-UI .NET SDK Code Review1314Encodes the AG-UI .NET SDK's house rules so a reviewer flags real violations a15generic C# reviewer misses. Authoritative sources: `sdks/dotnet/AGENTS.md`16(house rules) and `sdks/dotnet/docs/architecture.md` (design boundaries). Each17rule cites a real enforcement example in the repo; full BAD→GOOD examples and18per-rule exceptions live in [`references/rules.md`](references/rules.md). The19change-footprint and test rules below distil the `minimize-change-footprint`,20`ensure-test-coverage`, and `ensure-test-quality` review conventions for this SDK.2122## Reviewer discipline2324- **High signal-to-noise.** Only flag a genuine violation of a rule below, tied25 to its cited convention. Don't invent nits or restate analyzer output.26- **Verify before flagging.** Read the actual changed code and confirm the rule27 applies. Automated reviewers have high false-positive rates.28- **Scope.** Review only files under `sdks/dotnet/`. Skip generic style already29 enforced by `TreatWarningsAsErrors`, nullable, and EditorConfig.30- **Blast radius.** Fix nothing — this skill only reports. Local convention31 violations get a finding; codebase-wide concerns are noted as out-of-scope32 follow-ups, not per-line nits.33- **Severity:** ❌ must fix (breaks AOT/wire/build/boundary); ⚠️ should fix34 (convention drift); 💡 optional polish.3536## The review process3738**Step 0 — Ground truth & file classification.** Derive the package map from39`AGUI.slnx`; skim `AGENTS.md` + `docs/architecture.md`. Classify each changed40file: `production | test | sample | proto | csproj | public-api | docs`. Rules41are gated by class.4243**Step 1 — Determine and summarize the change set.** Resolve what is under44review, in order: an explicit target (PR number / branch / commit range); else45the current branch vs. its tracking/base branch (`git merge-base <base> HEAD`);46plus **staged, unstaged, and untracked** working-tree changes. Then write a short47summary of what the diff does — new types, wire/protocol changes, public-surface48changes, new dependencies, src-vs-sample placement. This frames every phase and49catches scope creep early.5051**Step 2 — Walk the rules, phase by phase (A→G).** For each phase, check every52applicable changed file against every rule in that phase. Write each finding53immediately: `file:line`, rule ID, severity, one-line fix. Verify the code first.5455**Step 3 — Self-validation.** Dedupe; confirm each finding cites a real rule and56a real line; confirm no rule was applied to the wrong file class; drop anything57not verifiable in the actual diff.5859**Step 4 — Emit the review summary** (see below) — a single human-readable comment,60findings grouped by severity with a verdict and coverage line.6162## Phase A — Scope / scenarios6364- `NET-SCOPE-01` Every change traces to a spec requirement or issue `[⚠️]`65- `NET-SCOPE-02` No unrequested capability, configurability, or dependency `[⚠️]`66- `NET-SCOPE-03` A wire/protocol change carries compatibility coverage `[❌]`67- `NET-SCOPE-04` Sample-only behavior stays out of `src/` `[⚠️]`68- `NET-SCOPE-05` Minimal footprint — every diff line serves the task; no unrelated69 refactor, speculative abstraction, or cosmetic churn `[⚠️]`7071## Phase B — Design / architecture7273From `docs/architecture.md` "Architectural constraints".7475- `NET-ARCH-01` No `src/` project references `Microsoft.AspNetCore.App` `[❌]` —76 `git grep "Microsoft.AspNetCore" -- sdks/dotnet/src` must be empty.77- `NET-ARCH-02` Correct package placement (wire→Abstractions, SSE→Formatting,78 proto→Protobuf, client/transport→Client, hosting→Server) `[❌]`79- `NET-ARCH-03` Dependency direction — `Client` and `Server` never reference each80 other `[❌]`. Cite: `src/AGUI.Server/AGUI.Server.csproj`.81- `NET-ARCH-04` `IChatClient` is the only integration point — no bespoke agent82 abstraction `[💡]`83- `NET-ARCH-05` Every type has a single reason to change `[⚠️]`84- `NET-ARCH-06` No interface without multiple implementations or a test-double need `[⚠️]`85- `NET-ARCH-07` Make invalid states unrepresentable (enums/types over bool/string) `[⚠️]`86- `NET-ARCH-08` One class per file; file name matches the type `[⚠️]`8788## Phase C — Implementation / correctness8990From `AGENTS.md` "JSON serialization" / "Code style".9192- `NET-IMPL-01` Every serializable type registered in `AGUIJsonSerializerContext`93 via `[JsonSerializable(typeof(T))]` `[❌]`. Cite:94 `src/AGUI.Abstractions/Serialization/AGUIJsonSerializerContext.cs`.95- `NET-IMPL-02` No `JsonSerializer.Serialize<object>` and no reflection-based96 serialization — go through the source-gen context `[❌]`97- `NET-IMPL-03` Polymorphic JSON uses a hand-written discriminator `JsonConverter<T>` `[❌]`.98 Cite: `src/AGUI.Abstractions/Events/BaseEventJsonConverter.cs`.99- `NET-IMPL-04` Property attribute kit present: explicit `[JsonPropertyName]`,100 `[JsonIgnore(WhenWritingNull)]` on optionals, required strings = `string.Empty`,101 collections = `[]` `[⚠️]`. Cite: `src/AGUI.Abstractions/Events/RunStartedEvent.cs`.102- `NET-IMPL-05` `ConfigureAwait(false)` on every `await` in `src/` `[⚠️]`. Cite:103 `src/AGUI.Client/AGUIChatClient.cs`.104- `NET-IMPL-06` `[EnumeratorCancellation]` on the token of any `IAsyncEnumerable<T>`105 method `[⚠️]`. Cite: `src/AGUI.Formatting/SseEventStreamFormatter.cs`.106- `NET-IMPL-07` `ArgumentNullException.ThrowIfNull(...)` for public-API argument107 validation `[⚠️]`108- `NET-IMPL-08` Validate external input at the boundary, not deep in the stack `[⚠️]`109- `NET-IMPL-09` Guard every code path — no silent `default`/fallthrough `[⚠️]`110- `NET-IMPL-10` No swallowed exceptions (empty or log-only `catch`) `[⚠️]`111- `NET-IMPL-11` Never log or expose sensitive data in errors `[❌]`112- `NET-IMPL-12` No dead, commented-out, or impossible-condition defensive code `[⚠️]`113- `NET-IMPL-13` No logic duplicated across the changeset — extract a shared helper114 at 3+ uses (Rule of Three; don't extract for 1–2) `[⚠️]`115- `NET-IMPL-14` Prefer BCL/platform APIs over hand-rolled equivalents `[⚠️]` —116 exception: deliberate AOT-safe hand-written paths (the `JsonElement`↔`Value`117 bridge, the discriminator converters) are intentional, not violations.118119## Phase D — Wire compatibility120121- `NET-WIRE-01` Protocol types match the TS reference — honor the122 `// Keep in sync with sdks/typescript/...` markers `[❌]`. Cite:123 `src/AGUI.Abstractions/Events/RunStartedEvent.cs`.124- `NET-WIRE-02` Events are additive — unknown types round-trip via `RawEvent`;125 don't remove or repurpose existing fields `[⚠️]`126- `NET-WIRE-03` Protobuf parity preserved for the supported event set `[❌]`127128## Phase E — PublicAPI analyzer129130- `NET-API-01` Any public-surface change updates that project's131 `PublicAPI.Unshipped.txt` (build fails RS0016 otherwise) `[❌]`. Cite:132 `sdks/dotnet/Directory.Build.targets`, `src/AGUI.Abstractions/PublicAPI.Unshipped.txt`.133- `NET-API-02` A new event type completes the full checklist (class in `Events/`134 deriving `BaseEvent`; `Type` → `AGUIEventTypes` constant; `[JsonSerializable]`;135 read case in `BaseEventJsonConverter`; `PublicAPI.Unshipped.txt`; round-trip136 test) `[⚠️]`137138## Phase F — Style / naming139140From `AGENTS.md` "Code style" / "Naming" (not all analyzer-enforced).141142- `NET-STYLE-01` `sealed` on every non-abstract class `[⚠️]`143- `NET-STYLE-02` No `record` types — use `sealed class` with properties `[❌]`144- `NET-STYLE-03` No tuples in public APIs — define a named type `[⚠️]`145- `NET-STYLE-04` Braces always on `if`/`for`/`foreach`/`while` `[⚠️]`146- `NET-STYLE-05` Naming: events `{Name}Event`; discriminators `SCREAMING_SNAKE_CASE`147 constants in `AGUIEventTypes`; outcome/role constants lowercase (never enums);148 options `AGUI{Purpose}Options`; extensions `{Target}Extensions`; tests149 `{TypeUnderTest}Test` `[⚠️]`150- `NET-STYLE-06` DI-extension types use the `Microsoft.Extensions.DependencyInjection`151 namespace; all other types use the project `RootNamespace` with no sub-namespaces `[⚠️]`152- `NET-STYLE-07` No XML docs (`///`) on `internal`/`private` members `[⚠️]`153- `NET-STYLE-08` Don't reformat code you didn't otherwise change `[⚠️]`154155## Phase G — Tests156157From `AGENTS.md` "Running tests"; coverage/quality rules distilled from158`ensure-test-coverage` and `ensure-test-quality`.159160SDK-specific:161- `NET-TEST-01` Serialization tests assert concrete JSON property names via162 `JsonDocument` — not via the deserialized object `[⚠️]`163- `NET-TEST-02` No full-JSON-string comparisons — assert individual properties `[❌]`164- `NET-TEST-03` No reflection to enumerate types or verify membership `[❌]`165- `NET-TEST-04` Wire-affecting change ⇒ compatibility fixture + round-trip in166 `tests/AGUI.Abstractions.UnitTests/Compatibility/` `[⚠️]`167- `NET-TEST-05` New public behavior ⇒ unit test; server-pipeline change ⇒168 integration test (`tests/AGUI.Hosting.AspNetCore.IntegrationTests/`) `[⚠️/💡]`169170Coverage:171- `NET-TEST-06` A new/changed class with branching logic has a test covering happy172 path, primary error path, and boundary values (null/empty/zero/single) `[⚠️]`173- `NET-TEST-07` Don't test trivial code — DTOs/records with no logic, one-line174 delegations, constant returns `[💡]`175- `NET-TEST-08` Test through DI + `InternalsVisibleTo`, not members made `public`176 for tests `[⚠️]`177178Quality:179- `NET-TEST-09` Every test asserts a specific observable value — no assertion-free180 tests, no bare `Assert.NotNull`/`True`/`NotEmpty` standing in for the real value `[❌]`181- `NET-TEST-10` Deterministic and isolated — no `Thread.Sleep`/`Task.Delay` for182 synchronization, no execution-order dependence, side effects cleaned up183 (files/ports/env) `[❌]`184- `NET-TEST-11` Test behavior, not implementation — prefer hand-written fakes over185 `mock.Verify(Times.*)` (unless the call count is the spec'd behavior); `[Theory]`186 for data variation, `[Fact]` for behavior; AAA visible inline with factory187 helpers (not shared mutable fixtures) below the tests; no `// TODO` or empty188 test bodies `[⚠️]`189190## Self-validation191192- [ ] The change set was resolved (target / tracking branch / working tree) and summarized193- [ ] Every applicable changed file was walked against every phase's rules194- [ ] Each finding cites a real rule ID, file, and line, and was verified in the diff195- [ ] No rule applied to the wrong file class; no duplicates196- [ ] Clean diffs are reported as clean — no padding197198## Common pitfalls199200| Pitfall | Solution |201|---------|----------|202| Restating analyzer/EditorConfig output | Only flag rules above that tooling does not enforce |203| Flagging a "missing" registration without checking the context | Open `AGUIJsonSerializerContext.cs` and confirm |204| Treating a sample's ASP.NET usage as a `src/` violation | `NET-ARCH-01` applies to `src/` only |205| Calling an additive new event a wire break | `NET-WIRE-02` — additive is allowed |206| Nitpicking style in files with substantive changes | Focus on the substantive change |207208## Review summary209210Produce a single human-readable Markdown comment — a reviewer's summary the author211can read top to bottom. Lead with the verdict, then the findings grouped by212severity (most severe first), each one self-contained.213214```markdown215## AG-UI .NET SDK code review216217**Verdict:** <Request changes | Comment | Looks good> — <one-sentence reason>218**Change set:** <branch vs base, e.g. `feat/x` vs `main`> · <N files reviewed>219(+<U untracked>) · **Findings:** ❌ <a> · ⚠️ <b> · 💡 <c>220221<One short paragraph: what the change does and the overall read.>222223### ❌ Must fix224- **`src/AGUI.Abstractions/Events/FooEvent.cs:42`** · `NET-IMPL-01` — new event type225 isn't registered in `AGUIJsonSerializerContext`; it fails under AOT.226 **Fix:** add `[JsonSerializable(typeof(FooEvent))]`.227228### ⚠️ Should fix229- **`src/AGUI.Client/AGUIChatClient.cs:88`** · `NET-IMPL-05` — bare `await` in230 library code. **Fix:** append `.ConfigureAwait(false)`.231232### 💡 Optional233- **`src/AGUI.Server/StreamAdapter.cs:17`** · `NET-ARCH-04` — bespoke agent234 abstraction; the SDK integrates via `IChatClient`. **Fix:** drop the wrapper.235236### Coverage237Phases checked: A–G. No findings in: **B Design**, **D Wire**, **E PublicAPI**.238```239240Rules for the summary:241- **Order** findings by severity (❌ → ⚠️ → 💡), then by file. One bullet per finding:242 bold `file:line`, the `RULE-ID`, a plain-language description, and an italic243 **Fix:** with a one-line remedy. The reader can look the ID up in244 [`references/rules.md`](references/rules.md).245- **Omit empty severity sections.** Always include the **Coverage** line so the246 author sees which phases were clean versus untouched.247- **Clean diff:** skip the severity sections and write a single line —248 `✅ No violations of the AG-UI .NET house rules — checked phases A–G across N files.`249- **Verdict mapping:** any ❌ → *Request changes*; only ⚠️/💡 → *Comment*; none →250 *Looks good*. The skill never approves or blocks automatically — the verdict is251 advisory and the author decides.252253---254255**Source:** [`ag-ui-protocol/ag-ui`](https://github.com/ag-ui-protocol/ag-ui) → `.github/skills/agui-dotnet-code-review/SKILL.md`