Skip to content

Add per-template onboarding READMEs for C# WinUI 3 templates#6491

Open
DinahK-2SO wants to merge 10 commits into
mainfrom
user/DinahK-2SO/template_instructions
Open

Add per-template onboarding READMEs for C# WinUI 3 templates#6491
DinahK-2SO wants to merge 10 commits into
mainfrom
user/DinahK-2SO/template_instructions

Conversation

@DinahK-2SO
Copy link
Copy Markdown
Contributor

@DinahK-2SO DinahK-2SO commented May 20, 2026

Following the discussion in #6407, the blank-app template gets a single onboarding README instead of the originally proposed .github/instructions/ agent-rules folder. The README keeps the WinAppSDK-specific tips a new project owner needs on day one, framed as encouragement rather than enforcement.

The PR also extends the same approach to five sibling templates (class-library, mvvm-app, navigation-app, tabview-app, unit-test), each assembled at build time from a shared section library so the READMEs stay consistent.

The authoring guide is added in: dev/Templates/how-to-create-a-new-csharp-template.md.

Tips intentionally not carried over

Source file Tip dropped Why
winui-best-practices MVVM layering (Model/View/ViewModel/Service) A blank template ships no MVVM scaffolding. Architecture guidance belongs in the mvvm-app template.
CommunityToolkit.Mvvm (ObservableObject, [ObservableProperty], [RelayCommand]) Not a dependency the template adds.
Microsoft.Extensions.DependencyInjection setup Same reason.
Folder layout (Views/, ViewModels/, Services/) Same reason.
NavigationView + Frame + INavigationService Belongs in the navigation-app template; the blank template ships a single MainPage.
Microsoft.UI.Xaml.* vs Windows.UI.Xaml.* namespace pitfall Template already uses the correct namespaces. This is UWP migration guidance, not onboarding.
Window.Current / CoreDispatcher removal notes Same reason. UWP migration guidance.
REGDB_E_CLASSNOTREG recovery via winapp unregister Edge-case troubleshooting. The winapp CLI docs already cover it.
ThemeResource, Mica backdrop, custom title bar, AppWindow.Resize Each is a feature cookbook entry, better placed in WinUI Gallery / docs.
XAML formatting conventions (1 attribute per line, ordering) Team level style preference, not template level.
code-quality Microsoft.CodeAnalysis.NetAnalyzers, StyleCop.Analyzers packages Template ships neither, and pushing readers to add them turns "blank app" into a stylistic statement.
EnableNETAnalyzers, EnforceCodeStyleInBuild, Nullable=enable settings Out of scope for the template's .csproj as it ships.
.editorconfig (file-scoped namespaces, _camelCase, Async suffix) Team level convention.
stylecop.json, naming-convention table, file-organization order Same. Team level.
"Remove unused usings / dead code / empty methods" Generic .NET advice, not WinAppSDK specific.
design-principles DRY, KISS, SOLID (SRP/OCP/LSP/ISP/DIP), YAGNI Framework-agnostic philosophy. Out of scope for a WinAppSDK template README.
testing MSTest / Moq / Microsoft.Windows.Apps.Test stack The companion unit-test template is the right home. README already points to it in Common next steps.
MethodName_Scenario_ExpectedResult naming Same. Belongs in the test template's docs.
AAA (Arrange/Act/Assert) structure Same.
dotnet test --filter for subset runs Same.
Mirrored folder structure for tests Same.
80%+ coverage goal Same.
accessibility WCAG contrast ratios (4.5:1 / 3:1) as literals Covered by following the linked High Contrast docs and running Accessibility Insights. Numeric thresholds felt over specific for a starter doc.
AutomationProperties.AccessibilityView="Raw" for decorative images Niche per-control detail. Covered by the linked "Expose basic accessibility information" page.
Test with Narrator / NVDA Implied by the Accessibility Insights recommendation.
windows-apis Windows AI APIs / Windows ML / Foundry Local overviews Not specific to the blank template. AI Dev Gallery link in Documentation covers discovery.
Agents.md "Default TFM is net10.0; pass --dotnet-version <tfm> to override" Surfaced by dotnet new UX. No need to duplicate in the README.

Delete Agents.md and 9 .instructions.md files. Add a new README.md
covering project layout, prerequisites, and build/run steps. Update
the packaging task to emit README.md.
@DinahK-2SO DinahK-2SO changed the title Add onboarding README to the blank-app template Add per-template onboarding READMEs for C# WinUI 3 templates May 20, 2026
@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DinahK-2SO DinahK-2SO requested review from lei9444 and yeelam-gordon and removed request for lei9444 and yeelam-gordon May 20, 2026 15:42
@DinahK-2SO DinahK-2SO marked this pull request as draft May 20, 2026 15:44
@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

- Rename 13 per-template outline files (6 dotnet + 7 VSIX) from README.md to AGENTS.md via git mv (history preserved).

- Update VSIX twin csprojs <TemplateReadme> paths, dotnet pack inline task (ExpandProjectTemplatePackItems), Directory.Build.targets, .vstemplate ProjectItem entries, .gitignore, validation script, and how-to doc to reference AGENTS.md.

- Preserve dev/Templates/Dotnet/README.md and <PackageReadmeFile>README.md</PackageReadmeFile> (NuGet package landing-page README must stay named README.md).

- Shorten TemplateReadmeSections/*.md to a brief pattern: H2 heading + 3-6 action-oriented bullets + 1 external doc link. No duplication of authoritative external instructions.

- Validated locally with VS Enterprise 2022 MSBuild: all 7 VSIX twin csprojs build clean in Release (0 errors, 0 VSSDK1016, 0 NU5118).
@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

TODO: remove the folder dev/Templates/.review-temp before merge. it shows the instruction files, for reviewers to see what will be generated from our templates.

@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

/azp run

@DinahK-2SO DinahK-2SO marked this pull request as ready for review May 21, 2026 08:59
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@DinahK-2SO
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant