Skip to content

Add maui-coding-guardrails and maui-current-apis skills#379

Open
jfversluis wants to merge 9 commits intodotnet:mainfrom
jfversluis:dev/jfversluis/maui-guardrails-skills
Open

Add maui-coding-guardrails and maui-current-apis skills#379
jfversluis wants to merge 9 commits intodotnet:mainfrom
jfversluis:dev/jfversluis/maui-guardrails-skills

Conversation

@jfversluis
Copy link
Member

@jfversluis jfversluis commented Mar 16, 2026

What

Adds two always-on guardrail skills to the dotnet-maui plugin that prevent the most common mistakes AI coding agents make with .NET MAUI.

maui-coding-guardrails

Prevents architectural mistakes and obsolete pattern usage:

  • Layout rules with mechanism explanations: why ScrollView inside StackLayout breaks (infinite height), why AndExpand is a no-op, why nested layouts hurt performance
  • Control rules: Border over Frame, CollectionView over ListView, Background over BackgroundColor, .png over .svg references
  • Navigation rules: don't mix Shell with NavigationPage (competing navigation stacks), set MainPage once
  • Handler architecture: Mapper methods (AppendToMapping/PrependToMapping/ModifyMapping) instead of legacy renderers
  • Compiled bindings: x:DataType for 8–20× performance improvement
  • Reference file: references/control-reference.md with full control quick-reference tables

maui-current-apis

Prevents deprecated/obsolete API usage with version-aware guidance:

  • Key rules with WHY explanations: e.g. DependencyService is a service locator anti-pattern, MessagingCenter leaked subscriptions, Device class was split into focused services
  • Complete deprecated API tables for .NET MAUI 10 (inline — controls, gestures, navigation, animation, Device APIs, XAML, safe area, accessibility, NuGet packages)
  • MauiReactor v3+ guidance: feature-switch hot reload, State<T>/Props<T>
  • Blazor Hybrid guidance: BlazorWebView, JS interop deadlocks, safe area CSS double-padding
  • Version detection: TFM → MAUI version mapping, CommunityToolkit compatibility matrix
  • Reference file: references/deprecated-apis-net10.md with supplementary detail

Why

Without these guardrails, AI coding agents frequently suggest deprecated APIs like ListView, Device.RuntimePlatform, BackgroundColor, renderers, and Xamarin.Forms namespaces. These two skills correct default LLM behavior and serve as the foundation for all future MAUI skills.

Design Decisions

  • Explain WHY, not just WHAT: Every rule includes mechanism explanations so the model internalizes the reasoning rather than following instructions mechanically (per Anthropic skill-creator best practices)
  • De-duplicated: coding-guardrails owns architecture/layout patterns, current-apis owns API deprecation tables — no overlap
  • API tables inline: Moved tables to references/ initially, but evals showed timeouts from the extra file-read round-trip. Restored inline for direct context access.
  • Trigger keywords in descriptions: Added specific API names (Device.RuntimePlatform, SYSLIB, MessagingCenter, etc.) to improve agent skill activation

Sources

Adapted from dotnet/maui#34429 (RFC by @jfversluis), which consolidates work from:

Reformatted to match dotnet/skills conventions. Content reviewed against the Anthropic skill-creator guide by Claude Sonnet 4, GPT-5.1, and Claude Opus 4.5.

Eval Results

Both skills show strong quality improvements with green overfitting scores:

Skill Overfitting Best Scenarios
maui-coding-guardrails 0.13 ✅ ListView 3.0→5.0, Frame→Border 3.0→5.0, Image ref 4.3→5.0
maui-current-apis 0.11 ✅ Device APIs 4.0→5.0, Animation 3.0→5.0, MessagingCenter 4.0→5.0

Zero timeouts. Failed verdicts are efficiency-only (guardrail skills add tokens when the baseline was already perfect).

This is the first of several batches porting MAUI skills from the RFC.

@jfversluis jfversluis requested a review from Redth as a code owner March 16, 2026 11:39
Copilot AI review requested due to automatic review settings March 16, 2026 11:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new always-on guardrail skills to the dotnet-maui plugin to steer agents away from deprecated/obsolete MAUI APIs and common layout/control pitfalls, plus eval coverage to validate the behavior.

Changes:

  • Added maui-coding-guardrails skill documentation with MAUI “never rules” and best-practice guidance.
  • Added maui-current-apis skill documentation with a version/TFM reasoning framework and a deprecated API table.
  • Added new eval scenarios (5 each) to validate guardrail behavior for both skills.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/dotnet-maui/maui-current-apis/eval.yaml New eval suite for deprecated API detection/replacement and TFM-aware guidance.
tests/dotnet-maui/maui-coding-guardrails/eval.yaml New eval suite for MAUI control/layout guardrails and anti-pattern prevention.
plugins/dotnet-maui/skills/maui-current-apis/SKILL.md New always-on skill doc for API currency and migration guardrails.
plugins/dotnet-maui/skills/maui-coding-guardrails/SKILL.md New always-on skill doc for baseline MAUI coding/layout guardrails.
plugins/dotnet-maui/plugin.json Updated plugin description to reflect new guardrail capabilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@jfversluis
Copy link
Member Author

/evaluate

@github-actions

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings March 16, 2026 12:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two always-on guardrail skills to the dotnet-maui plugin to steer agents away from deprecated MAUI APIs and common MAUI layout/control anti-patterns, backed by eval scenarios and reference tables.

Changes:

  • Adds new skills maui-coding-guardrails and maui-current-apis with structured SKILL guidance and references.
  • Adds eval scenarios for both skills under tests/dotnet-maui/ to validate guardrail behavior.
  • Updates dotnet-maui plugin description to reflect the expanded scope.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/dotnet-maui/maui-current-apis/eval.yaml Adds eval coverage for deprecated API detection/replacement and TFM-aware guidance.
tests/dotnet-maui/maui-coding-guardrails/eval.yaml Adds eval coverage for layout/control guardrails (ListView/Frame/renderers/SVG, etc.).
plugins/dotnet-maui/skills/maui-current-apis/references/deprecated-apis-net10.md Adds a categorized deprecated API reference table for MAUI 10.
plugins/dotnet-maui/skills/maui-current-apis/SKILL.md Defines rules for MAUI API currency and version/package detection guidance.
plugins/dotnet-maui/skills/maui-coding-guardrails/references/control-reference.md Adds a quick reference for MAUI controls and resource conventions.
plugins/dotnet-maui/skills/maui-coding-guardrails/SKILL.md Defines always-on layout/control/navigation/handler guardrails and pitfalls.
plugins/dotnet-maui/plugin.json Updates plugin description to mention guardrails and API currency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@jfversluis
Copy link
Member Author

/evaluate

@github-actions

This comment was marked as outdated.

@jfversluis
Copy link
Member Author

/evaluate

@github-actions

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings March 17, 2026 09:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new .NET MAUI “always-on” guardrail skills to the dotnet-maui plugin, along with evaluation scenarios to validate behavior around deprecated APIs and common MAUI architectural/layout pitfalls.

Changes:

  • Added maui-coding-guardrails skill content + control quick-reference.
  • Added maui-current-apis skill content + .NET MAUI 10 deprecated API reference + eval scenarios.
  • Updated dotnet-maui plugin description to reflect the new skill coverage.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/dotnet-maui/maui-current-apis/eval.yaml New eval scenarios to validate deprecated API avoidance/replacements and version-aware guidance.
tests/dotnet-maui/maui-coding-guardrails/eval.yaml New eval scenarios to validate layout/control/navigation/handler guardrails.
plugins/dotnet-maui/skills/maui-current-apis/SKILL.md New skill instructions and inline deprecation tables; includes version detection guidance.
plugins/dotnet-maui/skills/maui-current-apis/references/deprecated-apis-net10.md Supplemental deprecated API tables/reference content for .NET MAUI 10.
plugins/dotnet-maui/skills/maui-coding-guardrails/SKILL.md New always-on guardrail rules for layout/control/navigation/handlers/compiled bindings.
plugins/dotnet-maui/skills/maui-coding-guardrails/references/control-reference.md Control quick-reference tables and resource directory conventions.
plugins/dotnet-maui/plugin.json Expanded plugin description to include guardrails and API currency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@jfversluis
Copy link
Member Author

/evaluate

@github-actions

This comment was marked as outdated.

@jfversluis jfversluis force-pushed the dev/jfversluis/maui-guardrails-skills branch from 1052ec5 to 07c5642 Compare March 17, 2026 10:07
Copilot AI review requested due to automatic review settings March 17, 2026 10:12
@jfversluis
Copy link
Member Author

/evaluate

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new .NET MAUI “guardrail” skills to the dotnet-maui plugin to steer agents away from deprecated APIs and common MAUI architecture/layout pitfalls, along with eval scenarios to validate the behavior.

Changes:

  • Introduces maui-coding-guardrails skill (layout/control/navigation/handlers/compiled bindings guidance) plus a control quick-reference.
  • Introduces maui-current-apis skill (version-aware deprecated API guidance for MAUI 8/9/10, plus MauiReactor/Blazor Hybrid notes).
  • Adds eval coverage for both skills and updates the plugin description to reflect the new capabilities.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/dotnet-maui/maui-current-apis/eval.yaml Adds evaluation scenarios to verify deprecated API avoidance and version-aware guidance.
tests/dotnet-maui/maui-coding-guardrails/eval.yaml Adds evaluation scenarios covering common MAUI layout/control/handler guardrails.
plugins/dotnet-maui/skills/maui-current-apis/SKILL.md Defines the “current APIs” skill rules and inline deprecation tables for MAUI 10.
plugins/dotnet-maui/skills/maui-coding-guardrails/references/control-reference.md Adds a control quick-reference document for the guardrails skill.
plugins/dotnet-maui/skills/maui-coding-guardrails/SKILL.md Defines the “coding guardrails” skill rules and examples (layout, controls, handlers, bindings).
plugins/dotnet-maui/plugin.json Updates plugin description to include guardrails and API currency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions

This comment was marked as outdated.

@jfversluis

This comment was marked as off-topic.

@github-actions

This comment was marked as outdated.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general wording looks good to me, but we should try to get the eval tests green.

@jfversluis
Copy link
Member Author

/evaluate

@github-actions
Copy link
Contributor

Skill Validation Results

Skill Scenario Quality (Isolated) Quality (Plugin) Skills Loaded Overfit Verdict
maui-current-apis Replace deprecated Device class APIs 4.7/5 → 5.0/5 🟢 4.7/5 → 5.0/5 🟢 ✅ maui-current-apis; tools: report_intent, skill / ✅ maui-current-apis; tools: skill ✅ 0.11 [1]
maui-current-apis Fix deprecated animation methods for .NET 10 2.0/5 → 4.7/5 🟢 2.0/5 → 4.7/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.11
maui-current-apis Replace Xamarin patterns with MAUI dependency injection 4.3/5 → 5.0/5 🟢 4.3/5 → 4.7/5 🟢 ✅ maui-current-apis; tools: report_intent, skill / ✅ maui-current-apis; tools: report_intent, skill ✅ 0.11 [2]
maui-current-apis Use SafeAreaEdges instead of UseSafeArea 1.0/5 → 3.3/5 🟢 1.0/5 → 3.0/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.11
maui-current-apis Replace MessagingCenter with WeakReferenceMessenger 4.0/5 → 5.0/5 🟢 4.0/5 → 5.0/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.11
maui-coding-guardrails Prevent ListView usage in new MAUI app 3.0/5 → 5.0/5 🟢 3.0/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-current-apis; maui-coding-guardrails; tools: report_intent, skill ✅ 0.18
maui-coding-guardrails Fix AndExpand layout that does nothing 5.0/5 → 5.0/5 5.0/5 → 5.0/5 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; tools: report_intent, skill ✅ 0.18 [3]
maui-coding-guardrails Replace Frame with Border in card layout 3.0/5 → 5.0/5 🟢 3.0/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; maui-current-apis; tools: skill, report_intent ✅ 0.18
maui-coding-guardrails Handler customization instead of renderer 4.3/5 → 5.0/5 🟢 4.3/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-current-apis; maui-coding-guardrails; tools: report_intent, skill ✅ 0.18 [4]
maui-coding-guardrails Image reference and Background property guidance 2.3/5 → 4.7/5 🟢 2.3/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; tools: report_intent, skill ✅ 0.18

[1] (Isolated) Quality improved but weighted score is -8.7% due to: tokens (11567 → 25942), tool calls (0 → 2), time (10.1s → 15.0s)
[2] (Plugin) Quality improved but weighted score is -1.4% due to: tokens (11670 → 26743), tool calls (0 → 2)
[3] (Plugin) Quality unchanged but weighted score is -3.6% due to: tokens (11640 → 26371), tool calls (0 → 2)
[4] (Isolated) Quality improved but weighted score is -3.6% due to: tokens (11918 → 25700), tool calls (0 → 2)

Model: claude-opus-4.6 | Judge: claude-opus-4.6

Full results

Copilot AI review requested due to automatic review settings March 18, 2026 14:18
@jfversluis
Copy link
Member Author

/evaluate

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new .NET MAUI skills (API currency + coding guardrails) along with evaluation scenarios, and updates the dotnet-maui plugin description to reflect the expanded scope.

Changes:

  • Introduces maui-current-apis skill content and corresponding eval scenarios focused on deprecated/removed API replacements.
  • Introduces maui-coding-guardrails skill content and corresponding eval scenarios focused on preferred layout/control/handler patterns.
  • Updates plugins/dotnet-maui/plugin.json description to include the new skill areas.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/dotnet-maui/maui-current-apis/eval.yaml New evaluation scenarios validating guidance for replacing deprecated/removed MAUI APIs.
tests/dotnet-maui/maui-coding-guardrails/eval.yaml New evaluation scenarios enforcing recommended MAUI UI/control/handler guardrails.
plugins/dotnet-maui/skills/maui-current-apis/SKILL.md New skill defining rules and replacement guidance for current MAUI APIs across versions.
plugins/dotnet-maui/skills/maui-coding-guardrails/SKILL.md New skill defining layout/control/handler guardrails and compiled bindings guidance.
plugins/dotnet-maui/plugin.json Expands plugin description to reflect the added skills.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Contributor

Skill Validation Results

Skill Scenario Quality (Isolated) Quality (Plugin) Skills Loaded Overfit Verdict
maui-current-apis Replace deprecated Device class APIs 5.0/5 → 5.0/5 5.0/5 → 5.0/5 ✅ maui-current-apis; tools: report_intent, skill / ✅ maui-current-apis; tools: report_intent, skill ✅ 0.14 [1]
maui-current-apis Fix deprecated animation methods for .NET 10 1.0/5 → 5.0/5 🟢 1.0/5 → 5.0/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.14
maui-current-apis Replace Xamarin patterns with MAUI dependency injection 4.3/5 → 4.0/5 🔴 4.3/5 → 4.7/5 🟢 ✅ maui-current-apis; tools: report_intent, skill / ✅ maui-current-apis; tools: report_intent, skill ✅ 0.14
maui-current-apis Use SafeAreaEdges instead of UseSafeArea 1.0/5 → 3.0/5 🟢 1.0/5 → 3.0/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.14
maui-current-apis Replace MessagingCenter with WeakReferenceMessenger 3.7/5 → 5.0/5 🟢 3.7/5 → 5.0/5 🟢 ✅ maui-current-apis; tools: skill / ✅ maui-current-apis; tools: skill ✅ 0.14
maui-coding-guardrails Prevent ListView usage in new MAUI app 3.3/5 → 5.0/5 🟢 3.3/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; maui-current-apis; tools: report_intent, skill ✅ 0.17
maui-coding-guardrails Fix AndExpand layout that does nothing 5.0/5 → 5.0/5 5.0/5 → 5.0/5 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; tools: report_intent, skill ✅ 0.17 [2]
maui-coding-guardrails Replace Frame with Border in card layout 3.0/5 → 5.0/5 🟢 3.0/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; tools: report_intent, skill ✅ 0.17
maui-coding-guardrails Handler customization instead of renderer 5.0/5 → 5.0/5 5.0/5 → 5.0/5 ✅ maui-coding-guardrails; tools: skill / ✅ maui-coding-guardrails; maui-current-apis; tools: report_intent, skill ✅ 0.17 [3]
maui-coding-guardrails Image reference and Background property guidance 2.7/5 → 5.0/5 🟢 2.7/5 → 5.0/5 🟢 ✅ maui-coding-guardrails; tools: report_intent, skill / ✅ maui-coding-guardrails; tools: report_intent, skill ✅ 0.17

[1] (Isolated) Quality unchanged but weighted score is -8.3% due to: tokens (11581 → 25858), tool calls (0 → 2), time (13.5s → 17.6s)
[2] (Plugin) Quality unchanged but weighted score is -4.2% due to: tokens (11639 → 26158), tool calls (0 → 2), time (12.2s → 15.9s)
[3] (Isolated) Quality unchanged but weighted score is -27.9% due to: judgment, quality, tokens (11878 → 25487), tool calls (0 → 1)

Model: claude-opus-4.6 | Judge: claude-opus-4.6

Full results

jfversluis and others added 9 commits March 20, 2026 15:34
Add two always-on guardrail skills for .NET MAUI development:

- maui-coding-guardrails: Prevents use of obsolete controls (ListView,
  TableView, Frame), deprecated patterns (renderers, BackgroundColor),
  and common architectural mistakes (ScrollView inside StackLayout,
  mixing Shell with NavigationPage). Includes control reference tables,
  compiled bindings guidance, and handler customization patterns.

- maui-current-apis: Prevents use of deprecated APIs across .NET MAUI
  versions. Includes a reasoning framework for detecting project TFM
  and library versions, comprehensive deprecated API tables for .NET
  MAUI 10, and guidance for MauiReactor and Blazor Hybrid scenarios.

Both skills include eval scenarios for validation.

Sourced from dotnet/maui#34429 (RFC by jfversluis), which consolidates
work from davidortinau/maui-skills and github/awesome-copilot.

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

- Add output_not_contains for Frame, TableView in product list scenario
- Fix StackLayout assertion to match tags with attributes (<StackLayout vs <StackLayout>)
- Tighten MainThread assertion to require full MainThread.BeginInvokeOnMainThread
- Add output_not_contains for Device.BeginInvokeOnMainThread
- Add output_not_contains for DisplayAlertAsync/FadeToAsync in .NET 8 TFM scenario
- Remove references to maui-performance and maui-unit-testing skills (not yet added)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Applied improvements identified by Claude Sonnet 4, GPT-5.1, and Claude
Opus 4.5 reviewing against the Anthropic skill-creator best practices:

maui-coding-guardrails:
- Explain WHY behind every rule (mechanism, not just 'obsolete')
  e.g. ScrollView in StackLayout: infinite height prevents scrolling
- De-duplicate: removed deprecated control details that belong in
  maui-current-apis, added cross-reference instead
- Reorganized from flat NEVER table to themed sections (Layout,
  Controls, Navigation, Handler Architecture, Compiled Bindings)
- Moved control quick-reference to references/control-reference.md
- Softened tone: 'Avoid X because Y' instead of 'NEVER use X'
- Added trigger keywords to description for better agent activation

maui-current-apis:
- Replaced 26-line Reasoning Framework with 3-line summary (the LLM
  already knows how to read a csproj; it needs to know THAT it should)
- Moved full deprecated API tables to references/deprecated-apis-net10.md
- Kept top-10 most common mistakes inline with WHY column
- Added trigger keywords (Device.RuntimePlatform, SYSLIB, etc.)
- Added WHY explanations (e.g. DependencyService is service locator
  anti-pattern, MessagingCenter leaked subscriptions)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous commit moved deprecated API tables to references/, but CI
evals showed the model was timing out loading reference files. Inlining
the tables keeps them in direct context — the model doesn't need an
extra round-trip to read them.

Kept the improved descriptions, WHY column, key rules with reasoning,
and trigger keywords from the rewrite. Only change is tables are back
inline instead of references-only.

The references/deprecated-apis-net10.md file is retained as supplementary
detail.

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

- Halve frontmatter descriptions for both skills to reduce token count
- Add ⚠️ DO NOT USE Frame heading in maui-coding-guardrails SKILL.md
- Add ⚠️ DO NOT USE Frame callout in control-reference.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All API tables are inline in SKILL.md (required for eval performance —
reference file loading caused timeouts). Remove the orphaned supplementary
file to avoid drift.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Compressed both SKILL.md files per reviewer feedback to reduce token cost
in eval verdicts:

maui-coding-guardrails: 197→122 lines, ~1856→~1031 tokens (-44%)
maui-current-apis: 154→112 lines, ~1854→~1097 tokens (-41%)

Changes:
- Remove When to Use/Not sections (redundant with frontmatter description)
- Merge subsection headers into bold inline text
- Compress prose without losing mechanism explanations
- Collapse redundant table columns and merge small tables
- Condense MauiReactor/Blazor sections to compact bullets

All rules, code examples, and WHY explanations are preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaced scenarios where baseline already scored 5.0 (no room for skill
to improve), and simplified scenarios that caused timeouts.

Changes per multi-model review (Sonnet 4, GPT-5.1, Opus 4.5):

maui-coding-guardrails:
- REPLACED ScrollView (baseline 5.0) → AndExpand no-op detection
  (LLMs don't know AndExpand is silently ignored in MAUI)
- MODIFIED Handler: Entry→Picker, added ExportRenderer mention in prompt,
  added AppendToMapping assertion
- MODIFIED Image: added BackgroundColor→Background check (LLMs miss this)

maui-current-apis:
- REPLACED TFM detection (baseline 5.0) → SafeAreaEdges (.NET 10 API
  that LLMs don't know about)
- MODIFIED Device APIs: simplified from 5 to 2 replacements to avoid
  timeouts
- MODIFIED Xamarin.Forms: added concrete DependencyService code snippet,
  tighter DI assertions
- MODIFIED MessagingCenter: changed framing to 'won't compile' not just
  'deprecated', added 'internal' assertion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Further token reduction to improve eval efficiency verdicts:

- maui-coding-guardrails: 1031→881 tokens (-15%), compressed prose
- maui-current-apis: 1097→1030 tokens (-6%), compressed prose
- Deleted control-reference.md (-895 tokens): duplicated main skill
  content and added runtime overhead without eval benefit

Total token savings: ~1100 tokens per skill invocation.

Prose compressed per Sonnet 4 / GPT-5.1 recommendations:
- Merged multi-line sentences into single lines
- Cut filler words (strictly, silently, etc.)
- Shortened table cells
- Removed redundant reference pointer

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis jfversluis force-pushed the dev/jfversluis/maui-guardrails-skills branch from 87fa7b3 to 868e908 Compare March 20, 2026 14:35
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now, if we are OK with the eval results.

(I don't know what they mean 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants