用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/a5c-ai/babysitter --skill wpf-high-dpi-analyzer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Reference for querying the Atlas knowledge graph through its MCP tools — the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.
基于 SOC 职业分类
| name | wpf-high-dpi-analyzer |
| description | Analyze and fix WPF applications for high DPI support, per-monitor DPI awareness, and scaling issues |
| allowed-tools | Read, Grep, Glob, Bash |
| tags | ["wpf","dpi","scaling","accessibility","windows"] |
| graph | {"domains":["domain:software-engineering"],"specializations":["specialization:desktop-development"],"skillAreas":["skill-area:desktop-ui-frameworks","skill-area:performance-monitoring-profiling"],"roles":["role:desktop-developer","role:fullstack-engineer"],"workflows":["workflow:feature-development","workflow:release-management"]} |
Analyze and fix WPF applications for high DPI support. This skill identifies DPI-related issues and provides fixes for per-monitor DPI awareness, bitmap scaling, and layout problems on high-resolution displays.
{
"type": "object",
"properties": {
"projectPath": {
"type": "string",
"description": "Path to the WPF project"
},
"targetDpiMode": {
"enum": ["system", "per-monitor", "per-monitor-v2"],
"default": "per-monitor-v2"
},
"checkCategories": {
"type": "array",
"items": {
"enum": ["manifest", "hardcoded-pixels", "bitmaps", "layouts", "transforms", "fonts"]
},
"default": ["manifest", "hardcoded-pixels", "bitmaps", "layouts"]
},
"generateFixes": {
"type": "boolean",
"default": true
}
},
"required": ["projectPath"]
}
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"dpiMode": { "type": "string" },
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"severity": { "enum": ["critical", "high", "medium", "low"] },
"category":
<!-- app.manifest -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</windowsSettings>
</application>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
<!-- BAD: Hardcoded pixels -->
<Button Width="100" Height="30"/>
<Grid Margin="10,5,10,5"/>
<TextBlock FontSize="12"/>
<!-- GOOD: Use device-independent units or relative sizing -->
<Button MinWidth="80" MinHeight="24" Padding="16,4"/>
<Grid Margin="{StaticResource StandardMargin}"/>
<TextBlock Style="{StaticResource BodyTextStyle}"/>
<!-- BAD: Single resolution bitmap -->
<Image Source="icon.png"/>
<!-- GOOD: Use vector or provide multiple resolutions -->
<Image>
<Image.Source>
<DrawingImage>
<!-- Vector drawing -->
</DrawingImage>
</Image.Source>
</Image>
<!-- Or use BitmapScalingMode for crisp scaling -->
<Image Source="icon.png"
RenderOptions.BitmapScalingMode="HighQuality"/>
// Handle DPI changes at runtime
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// Get current DPI
var dpiScale = VisualTreeHelper.GetDpi(this);
Debug.WriteLine($"DPI: {dpiScale.PixelsPerDip * 96}");
}
protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)
{
base.OnDpiChanged(oldDpi, newDpi);
// Handle DPI change
Debug.WriteLine($"DPI changed from {oldDpi.PixelsPerDip * 96} to {newDpi.PixelsPerDip * 96}");
// Reload high-DPI assets if needed
ReloadAssets(newDpi);
}
private void ReloadAssets(DpiScale dpi)
{
// Load appropriate resolution assets
var scale = dpi.PixelsPerDip;
string suffix = scale >= 2 ? "@2x" : scale >= 1.5 ? "@1.5x" : "";
// Load assets with suffix
}
}
// App.xaml.cs
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
// Enable Per-Monitor V2 DPI awareness (Windows 10 1703+)
if (Environment.OSVersion.Version >= new Version(10, 0, 15063))
{
// Per-Monitor V2 is automatic with manifest, but verify
var awareness = GetProcessDpiAwareness();
Debug.WriteLine($"DPI Awareness: {awareness}");
}
base.OnStartup(e);
}
[DllImport("shcore.dll")]
private static extern int GetProcessDpiAwareness(IntPtr hprocess, out int awareness);
private static int GetProcessDpiAwareness()
{
GetProcessDpiAwareness(IntPtr.Zero, out int awareness);
return awareness;
}
}
// BAD: Manual scaling calculations
var scale = 96.0 / GetSystemDpi();
transform.ScaleX = scale;
transform.ScaleY = scale;
// GOOD: Let WPF handle scaling
// Use device-independent units, WPF handles the rest
<Canvas>
<Rectangle Canvas.Left="10" Canvas.Top="10"
Width="100" Height="50"/>
</Canvas>
<!-- BAD: Hardcoded font size -->
<TextBlock FontSize="14"/>
<!-- GOOD: Use named styles or relative sizing -->
<TextBlock Style="{DynamicResource MaterialDesignBody1TextBlock}"/>
<!-- Or use system font size -->
<TextBlock FontSize="{x:Static SystemFonts.MessageFontSize}"/>
<!-- .csproj -->
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<!-- Enable high DPI support -->
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
</PropertyGroup>
<!-- Include app.manifest -->
<ItemGroup>
<None Update="app.manifest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
# Change display scaling via PowerShell (requires restart)
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "LogPixels" -Value 144 # 150%
# Test with multiple monitors at different DPIs
# Use Windows display settings to set different scales per monitor
wpf-xaml-style-generator - DPI-aware stylesdesktop-accessibility process - Accessibility testingvisual-regression-setup - Visual testing at different DPIswpf-dotnet-expert - WPF expertisedesktop-ux-analyst - UX review