executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
lov-normalize-tauri-app-icon校准 Tauri macOS Dock 图标的可见外框、圆角安全区与运行时嵌入链路;适用于“Dock 图标太大”“统一 Tauri app icon”或“normalize Tauri app icon”等请求,并输出可复核的资源与运行时证据。
Independent GitHub snapshot · Automated classification · Original documentation governs
name: lov-normalize-tauri-app-icon description: > 校准 Tauri macOS Dock 图标的可见外框、圆角安全区与运行时嵌入链路;适用于“Dock 图标太大”“统一 Tauri app icon”或“normalize Tauri app icon”等请求,并输出可复核的资源与运行时证据。 license: MIT allowed-tools:
把 Tauri macOS 应用图标校准到与参考图标相同的视觉外框,并验证当前运行的原生进程确实嵌入了新图标。完成标准是 Dock 中的实际显示尺寸与资源、构建产物和运行时证据一致。
Every invocation reads the shared user-profile/v1 contract declared in
skill.yaml. Resolve current request, project context, Skill records, shared
preferences, and shared user/brand data in that order. Keep the source
portable: do not copy local paths, logos, or private project details into it.
When a user explicitly asks to retain a future calibration choice (for example,
a reference icon or preferred visible-envelope ratio), save it under
records.* with scripts/profile_store.py record --confirm and report the
saved Profile path. Do not persist inferred values, image contents, credentials,
or private paths. See references/user-profile.md.
Read references/skill-composition.md
before selecting adjacent Logo, SVG, Tauri-install, or release Skills. They are
optional artifact-level handoffs, never hidden runtime dependencies of this
Skill. This Skill owns the final visual-envelope and runtime-embedding
acceptance criterion.
Follow these steps in order. Do not call a resource change complete from a source-image inspection alone.
src-tauri/tauri.conf.json, icon source,
generated icon directory, src-tauri/build.rs, and the currently running
native executable if one exists.references/tauri-icon-runtime.md before making a runtime conclusion.references/skill-composition.md and follow its single-owner handoff
rule before invoking a related Skill.When running the bundled CLI manually, set the Skill root first:
export SKILL_DIR="/path/to/lov-normalize-tauri-app-icon"
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" --help
Use alpha bounds to compare the non-transparent silhouette. A 512px canvas does not establish that two icons look the same size in Dock.
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" measure --input TARGET.png
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" measure --input REFERENCE.png
Record the visible_side, visible_ratio, corner alpha, and the screenshot
pixel bounds when available. If the target has opaque square corners but the
requested result needs a rounded macOS silhouette, correct the artwork first;
the normalizer preserves the supplied alpha shape and does not invent a logo.
Prefer an approved reference icon. The normalizer centers the visible alpha
envelope on a square transparent canvas and scales it to the reference ratio.
It refuses to overwrite an output unless --force is explicit.
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" normalize \
--input TARGET.png \
--reference REFERENCE.png \
--output normalized-icon.png
If no reference asset exists, use a measured target ratio and state where it came from:
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" normalize \
--input TARGET.png \
--target-visible-ratio 0.805 \
--output normalized-icon.png
Re-run measure on the output and report both ratios. Do not silently round a
ratio or claim visual equivalence without a tolerance.
Generate the platform set from the normalized canonical source rather than editing only one PNG. Use the project’s existing Tauri CLI and output layout:
pnpm tauri icon normalized-icon.png -o src-tauri/icons/<icon-set>
Update bundle.icon in src-tauri/tauri.conf.json so macOS points to the
generated .icns and Unix/default-window paths point to the generated PNGs.
Keep any other platform entries coherent with the project’s current bundle
contract. Review generated asset alpha bounds at the largest available size.
Tauri macOS development builds can embed an application icon into the native
executable. A later on-disk .icns replacement is insufficient if Cargo did
not rerun the build script.
Inspect the generated Tauri context or build output to identify the actual development app-icon input.
Ensure src-tauri/build.rs declares each embedded icon input, for example:
println!("cargo:rerun-if-changed=icons/<icon-set>/icon.icns");
println!("cargo:rerun-if-changed=icons/<icon-set>/icon.png");
tauri_build::build()
Verify the declarations without mutating source:
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" verify-build-watch \
--build-rs src-tauri/build.rs \
--watch icons/<icon-set>/icon.icns \
--watch icons/<icon-set>/icon.png
Respect the project’s active development flow. Do not launch a competing GUI process or seize foreground control. Let the existing dev runner rebuild or use the project’s native restart path.
After the new binary exists, prove the compiled build output contains the
same raw .icns bytes:
python3 "$SKILL_DIR/scripts/tauri_app_icon.py" verify-embed \
--source-icns src-tauri/icons/<icon-set>/icon.icns \
--build-out src-tauri/target/debug/build
verify-embed returning no match means the result is resource-only, not a
verified Dock fix.
Compare target and reference in the same Dock state, display scale, and zoom level. Prefer a user-provided screenshot or a non-intrusive capture. Do not use input automation to bring another app to front solely to reveal the Dock.
Accept visual alignment only when both the measured screenshot envelope and the source ratio are within an agreed tolerance (normally one Dock pixel or one point). If the source and embedded icon match but the Dock still differs, separate system presentation/cache behavior from resource and build evidence before changing the artwork again.
Report:
verify-build-watch and verify-embed outcomes;resource_ready, runtime_embedded, or
dock_visually_verified.For CLI failures, include the script’s copyable context_id, field name, and
safe diagnostic details. Do not expose secrets or unrequested private paths.
Pillow>=9.0 for deterministic RGBA/alpha-bound measurement and PNG outputscripts/validate_skill.py