winui-app
它能做什么
这项技能帮助创建和改进用 WinUI 3 与 C# 构建的 Windows 桌面应用。适合构建现代 Windows 应用、并希望获得设置和设计指导的开发者。
适用场景
- ✓当你想为 Windows 创建一个新的 WinUI 3 桌面应用的时候。
- ✓当你需要为 WinUI 开发准备一台 Windows 电脑的时候。
- ✓当你想检查或修复现有 WinUI 应用中 XAML 和控件的时候。
技能链接
https://github.com/openai/skills/blob/main/skills/.curated/winui-app/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用 C# 新建一个 WinUI 3 应用,带有导航侧边栏和设置页面。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体检查电脑的设置情况,可以运行随附的配置,开启开发者模式并安装所需的 Visual Studio 组件,然后按照微软当前的模式创建项目并构建页面。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
WinUI App
Use this skill for WinUI 3 and Windows App SDK work that needs grounded setup guidance, app bootstrap, modern Windows UX decisions, or concrete implementation patterns.
Required Flow
- Classify the task as environment/setup, new-app bootstrap, design, implementation, review, or troubleshooting.
- If the task is about preparing a machine for WinUI, auditing readiness, or creating a brand new app, start with the bundled setup-and-scaffold flow in this skill before broader design, implementation, or troubleshooting work:
- Pick the app name when the request is for a new app.
- Use the exact name the user gave when it is already a safe folder name.
- If the user did not give a name, derive a short PascalCase name from the request and state what you chose.
- Create the project in the user's current workspace unless they asked for another location.
- Do not use
--forceunless the user explicitly asked to overwrite existing files. - Run the bundled WinGet configuration from the skill directory so the relative path stays exactly
config.yaml:
winget configure -f config.yaml --accept-configuration-agreements --disable-interactivity
- Treat the configuration as intended to enable Developer Mode, install or update Visual Studio Community 2026, and install the Managed Desktop, Universal, and Windows App SDK C# components needed for WinUI development.
- Assess the configuration result before continuing. Continue on success. If it fails, inspect the output instead of guessing. If the
winuitemplate is already available and the toolchain is usable, note the partial failure and continue. If prerequisites are still missing, stop and report the blocker clearly. - Verify the template is available before scaffolding:
dotnet new list winui
- For diagnostics-only environment requests, explain that the bundled bootstrap may change the machine and get confirmation before running it. If the user declines changes, use the manual verification guidance in
references/foundation-environment-audit-and-remediation.mdand summarize readiness underpresent,missing,uncertain, andrecommended optional tools. - For a brand new app, scaffold with
dotnet new winui -o <name>. Add template options only when the user asked for them. Supported options:-f|--framework net10.0|net9.0|net8.0,-slnx|--use-slnx,-cpm|--central-pkg-mgmt,-mvvm|--use-mvvm,-imt|--include-mvvm-toolkit,-un|--unpackaged,-nsf|--no-solution-file,--force. Do not invent unsupported flags. If the user asks for packaged behavior, pass--unpackaged false. Otherwise keep the template default. - Verify a new scaffold by confirming the expected project file exists and running
dotnet buildagainst the generated.csproj. - Launch a newly scaffolded app through the correct path for its actual packaging model and confirm there is a real top-level window instead of relying only on the launcher process exit code.
- Read
references/_sections.md, then load only the reference files that match the task. - Make the packaging model explicit before creating or refactoring the app. Default to packaged for Store-like product workflows and Visual Studio deploy/F5 flows. Default to unpackaged when the user expects repeatable CLI build-and-run loops or direct
.exelaunches after each change. - When the task is an opaque XAML compiler failure such as
MSB3073orXamlCompiler.exe, readreferences/foundation-template-first-recovery.mdand simplify back toward the currentdotnet new winuiscaffold for the chosen packaging model before inventing custom recovery structure. - For any work that creates or changes a WinUI app, make a complete but minimal edit set, then build the app and run it before responding to the user. Do this by default even when the user did not explicitly ask for verification. If a running app instance locks the output while more work remains, stop it, rebuild, relaunch, and continue verification. When the work is complete and launch verification succeeds, leave the final verified app instance running for the user unless they explicitly asked you not to.
- Treat launch verification as incomplete until the app shows objective success signals such as a responsive top-level window, expected window title, or other clear startup behavior. A spawned process by itself is not enough.
- Prefer Microsoft Learn for requirements, API expectations, and
常见问题
它会在我的电脑上安装软件吗?
会。当你要求设置时,它会运行随附的配置,安装 Visual Studio 组件并开启开发者模式。
它使用哪种语言和框架?
它使用 C# 搭配 Windows App SDK 和 WinUI 3。
它能帮助已有的应用吗?
可以。它涵盖 WinUI 3 应用的审查、重构和故障排查。
详情
作者的原始描述
Bootstrap, develop, and design modern WinUI 3 desktop applications with C# and the Windows App SDK using official Microsoft guidance, WinUI Gallery patterns, Windows App SDK samples, and CommunityToolkit components. Use when creating a brand new app, preparing a machine for WinUI, reviewing, refactoring, planning, troubleshooting, environment-checking, or setting up WinUI 3 XAML, controls, navigation, windowing, theming, accessibility, responsiveness, performance, deployment, or related Windows app design and development work.
repo: openai/skills
热度
- GitHub 星标
- 28k
- 排名
- #9862
- 许可证
- —
- 更新时间
- 2026/10/28
评论
- …
同一仓库的更多技能
aspnet-core
28k帮你的智能体构建、审阅或升级 ASP.NET Core 网络应用,选择合适的应用类型,并遵循微软针对 .NET 的最新指导。
chatgpt-apps
28k帮你的智能体构建一个将 MCP 服务器与小组件界面配对的 ChatGPT 应用,涵盖工具设计、界面资源、元数据和本地设置。
cli-creator
28k帮你的智能体把 API 文档、规范或现有脚本转化为可复用的命令行工具,可在任何文件夹中运行,并返回稳定的 JSON。
define-goal
28k帮你的智能体在开始工作前,把模糊的意图转化为清晰、可衡量的目标,并明确成功标准、范围和停止条件。