create-theme
GitHub用于设计、打包和验证 nekodrop 应用的自定义主题包,支持 macOS/Win98 等风格及资源定制。
Trigger Scenarios
Install
npx skills add zheznanohana/nekodrop --skill create-theme -g -y
SKILL.md
Frontmatter
{
"name": "create-theme",
"description": "Design, port, package, validate, and visually verify a custom or built-in `.nekotheme` theme pack (v1 JSON or v2 ZIP with custom art assets, fonts, window chrome, geometry, and sandboxed `styles.xaml`) for nekodrop. Use when a user wants to create a new theme, mimic another OS\/UI style (macOS Liquid Glass, Win98\/XP, pixel art, anime\/illustration, Catppuccin, Nord, Gruvbox, Cyberpunk), bundle custom art\/icons\/backgrounds, customize menus or controls, or debug theme contrast and packaging."
}
Create or adapt a theme pack for nekodrop (Theme Pack v2)
nekodrop loads both built-in themes and user-installed themes through one unified .nekotheme interface (app/client/Theme.cs + app/client/ThemeXamlSandbox.cs). Built-in references live in app/client/Themes/, including macos.nekotheme + macos.styles.xaml, comic.nekotheme, and ink.nekotheme.
Users install any .nekotheme file (single JSON or ZIP theme pack) simply by dragging it into Settings → General (applies immediately) or onto the main / Finder window (confirms, then installs to %LocalAppData%\nekodrop\themes\<id>.nekotheme).
Read token-reference.md for the full v2 schema, chrome/geometry/art slots, sandboxed styles.xaml rules, overrideable style keys (including TrayMenuPanel, TrayMenuItem, WinContextMenu, WinMenuItem, WinToggle, WinButton, WinPrimary, Pivot, Segment, WinCard), and starter templates. See also docs/THEMES.md.
1. Choose the package format & visual architecture
Decide whether the theme needs a single JSON .nekotheme (fast color/geometry/chrome theme) or a ZIP .nekotheme pack (when bundling custom artwork, fonts, or custom control/menu styles.xaml):
my-theme.nekotheme (ZIP archive, <= 16 MB, <= 64 entries)
├── theme.json # Required manifest (schemaVersion: 2)
├── styles.xaml # Optional sandboxed WPF ResourceDictionary overriding ANY control/menu!
├── assets/ # Optional art assets (PNG/JPG/WEBP/GIF/BMP/ICO, <= 4 MB each)
│ ├── bg.png # Window / radar background artwork
│ ├── brand.png # Custom brand logo (header, tray menu, floating pill)
│ ├── hub.png # Custom radar center "This PC" artwork
│ └── devices/ # Custom peer device icons (phone, tablet, laptop, desktop, default)
└── fonts/ # Optional bundled .ttf / .otf fonts (referenced as font://File.ttf#Family)
Pick the structural knobs in theme.json:
| Layer | Key fields | What it unlocks |
|---|---|---|
Window chrome (chrome) |
titleBar: "windows" | "macos"backdrop: "mica" | "acrylic" | "tabbed" | "solid"corners: "round" | "roundSmall" | "square" |
Global macOS traffic lights + centered title bar, frosted Acrylic glass, or sharp 90° retro/pixel corners. |
| Base skin | base: "fluent" | "framed", mode: "auto" | "light" | "dark", shadowScale, skinStep, dialogAccentBar |
Soft Win11 base vs crisp ink-outlined base; automatic light/dark polarity or pinned light/dark. |
Geometry (geometry) |
cardRadius, dialogRadius, popupRadius, buttonRadius, inputRadius, segmentRadius, menuItemRadius, buttonBorderThickness, buttonPadding, cardPadding |
Capsule buttons (14/999), sharp Win98 corners (0), spacious or dense padding without writing XAML. |
Art assets (art) |
brandMark, hubIcon, windowBackground, radarOverlay, devices.{phone,tablet,laptop,desktop,default} |
Plug in custom drawn logos, illustrations, textures, and device icons across Radar, List, Grid, Finder, and TrayMenu. |
Control & menu templates (styles.xaml) |
Any global key: WinCard, WinButton, WinPrimary, WinToggle, Pivot, Segment, SegmentBox, ModeCard, WinTextBox, WinPasswordBox, WinCombo, WinContextMenu, WinMenuItem, TrayMenuPanel, TrayMenuItem, AskBubble, TitleButton, MacTrafficDot, ScrollBar |
Completely redesign menus, toggles, buttons, glass sheen, 3D bevels, pixel borders, and animations inside a strict RCE-free XML AST sandbox. |
2. Design with legibility, art harmony, and sandbox safety
- ID & metadata:
idmust match^[a-z0-9][a-z0-9_-]{0,47}$and not collide with built-in IDs ("",system,auto,default,colourful,blue,indigo,teal,rose,ink,comic,macos). Provide bilingualnameanddescription(zh+en) when possible. - Contrast & surface safety:
- Keep
DialogSurfaceopaque (or high-opacity on solid dark) so modal dialogs and context/tray menus stay legible over busy backgrounds. - Maintain >= 4.5:1 contrast for
Text/Text2onCard/DialogSurface/Window, andOnAccentonAccent. - When supplying
art.windowBackgroundorart.radarOverlay, keepopacitymoderate (0.15–0.40) or ensureCardhas a translucent scrim so text stays effortless to read.
- Keep
- Writing sandbox-compliant
styles.xaml:- Root must be
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">(plus optionalxmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"ONLY forshell:WindowChrome.IsHitTestVisibleInChrome="True"). - Reference bundled images ONLY with
asset://rel/path.png(e.g.<Image Source="asset://stickers/cat.png"/>or<ImageBrush ImageSource="asset://bg.png"/>) — the sandbox rewrites them to preloaded in-memoryThemeAsset:*resources. - Never use
ObjectDataProvider,x:Code,x:Class,x:Static, arbitraryclr-namespace:,MergedDictionaries, event handlers (Click=), DTDs, orhttp:///file://URIs — they are strictly rejected.
- Root must be
3. Package the .nekotheme file
- Single JSON: save UTF-8 JSON (no BOM, <= 256 KB) as
<id>.nekotheme. - ZIP pack: zip
theme.json, optionalstyles.xaml,assets/...,fonts/...at the archive root (no extra outer wrapper folder) and rename the.zipto<id>.nekotheme:Compress-Archive -Path .\my-theme-src\* -DestinationPath .\my-theme.zip -Force Move-Item .\my-theme.zip .\my-theme.nekotheme -Force - Built-in theme PR: place
<id>.nekotheme(and optional<id>.styles.xaml) inapp/client/Themes/, add the ID toTheme.ReservedIds, and add assertions inapp/client/ThemeSelfTest.cs.
4. Validate and visually verify every window
From the repository root on Windows (.NET 8 SDK):
dotnet build .\app\client\NekoDrop.csproj -c Release
$exe = ".\app\client\bin\Release\net8.0-windows10.0.19041.0\win-x64\nekodrop.exe"
# 1. Offline schema, asset decoding, XAML sandbox & 70+ token check (light + dark)
& $exe --validate-theme .\path\to\my-theme.nekotheme
# 2. Core theme engine + sandbox security self-tests
& $exe --theme-selftest
# 3. Render 35 off-screen window snapshots (main, settings, tray, confirm, warning, finder, wifi, drag-float...)
& $exe --snapshot .\build\theme-preview-light --theme .\path\to\my-theme.nekotheme --light --lang zh
& $exe --snapshot .\build\theme-preview-dark --theme .\path\to\my-theme.nekotheme --dark --lang zh
Inspect the rendered PNGs — especially main.png, main-list.png, settings-general.png, tray.png, finder.png, confirm.png, warning.png, drag-float-staged.png, and wifi.png. Check:
- Title bar alignment (Windows right-close vs macOS left traffic lights)
- Custom art cropping/sizing (brand mark, hub icon, device icons, background overlay)
- Custom menu & control templates (
tray.pngmenu rows,settings-general.pngtoggles/tabs/buttons/cards) - Hover/selected/disabled contrast in both light and dark modes (if
mode: "auto")
5. Deliver to the user
- Hand over the ready-to-install
<id>.nekothemefile path and explain that dragging it onto Settings → General installs and applies it immediately (or dragging onto Main/Finder window prompts to install). - Report
--validate-themeoutput and confirm visual snapshot inspection across key screens.
Version History
- f8d0f9c Current 2026-12-06 04:00


