Agent Skills › zheznanohana/nekodrop › create-theme

create-theme

GitHub

用于设计、打包和验证 nekodrop 应用的自定义主题包,支持 macOS/Win98 等风格及资源定制。

.agents/skills/create-theme/SKILL.md zheznanohana/nekodrop

触发场景

创建新主题 模仿特定 UI 风格 调试主题对比度

安装

npx skills add zheznanohana/nekodrop --skill create-theme -g -y
更多选项

非标准路径

npx skills add https://github.com/zheznanohana/nekodrop/tree/main/.agents/skills/create-theme -g -y

不安装直接使用

npx skills use zheznanohana/nekodrop@create-theme

指定 Agent (Claude Code)

npx skills add zheznanohana/nekodrop --skill create-theme -a claude-code -g -y

安装 repo 全部 skill

npx skills add zheznanohana/nekodrop --all -g -y

预览 repo 内 skill

npx skills add zheznanohana/nekodrop --list

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

  1. ID & metadata: id must 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 bilingual name and description (zh + en) when possible.
  2. Contrast & surface safety:
    • Keep DialogSurface opaque (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/Text2 on Card/DialogSurface/Window, and OnAccent on Accent.
    • When supplying art.windowBackground or art.radarOverlay, keep opacity moderate (0.15–0.40) or ensure Card has a translucent scrim so text stays effortless to read.
  3. 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 optional xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework" ONLY for shell: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-memory ThemeAsset:* resources.
    • Never use ObjectDataProvider, x:Code, x:Class, x:Static, arbitrary clr-namespace:, MergedDictionaries, event handlers (Click=), DTDs, or http:///file:// URIs — they are strictly rejected.

3. Package the .nekotheme file

  • Single JSON: save UTF-8 JSON (no BOM, <= 256 KB) as <id>.nekotheme.
  • ZIP pack: zip theme.json, optional styles.xaml, assets/..., fonts/... at the archive root (no extra outer wrapper folder) and rename the .zip to <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) in app/client/Themes/, add the ID to Theme.ReservedIds, and add assertions in app/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.png menu rows, settings-general.png toggles/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>.nekotheme file 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-theme output and confirm visual snapshot inspection across key screens.

版本历史

  • f8d0f9c 当前 2026-12-06 04:00

同 Skill 集合

.agents/skills/add-wifi-card/SKILL.md
.claude/skills/add-wifi-card/SKILL.md
.claude/skills/create-theme/SKILL.md

元信息

文件数
0
版本
f8d0f9c
Hash
3ab93e86
收录时间
2026-12-06 04:00

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-06 04:41
浙ICP备14020137号-1