Pre-flight Desktop Auditor
Boost productivity using this sends, native, desktop, notification. Includes structured workflows, validation checks, and reusable patterns for monitoring.
Pre-flight Desktop Auditor
Audits desktop application builds for resource usage, window management, and platform compliance before deployment.
When to Use This Hook
Attach this hook when you need to:
- Validate Electron, Tauri, or native desktop app builds meet resource budgets before release
- Check that window dimensions, menu structures, and tray icons conform to OS guidelines
- Audit memory footprint and startup time metrics against defined thresholds
Consider alternatives when:
- Your application is purely web-based with no desktop packaging
- You already run comprehensive platform-specific CI pipelines for desktop validation
Quick Start
Configuration
name: pre-flight-desktop-auditor type: hook trigger: PostToolUse category: monitoring
Example Trigger
# Hook triggers after a desktop app build command completes npm run build:electron # Hook output:
Example Output
Desktop Audit: Analyzing build artifacts...
Binary size: 84MB (budget: 120MB) ............. PASS
Startup time estimate: 1.8s (budget: 3s) ...... PASS
Window min dimensions: 800x600 ................ PASS
Code signing: valid signature detected ......... PASS
Native module audit: 3 modules, all compatible . PASS
Desktop pre-flight audit completed: 5/5 checks passed
Core Concepts
Audit Dimensions Overview
| Aspect | Details |
|---|---|
| Binary Size | Measures packaged app size against platform budgets |
| Startup Performance | Estimates cold-start time from main process initialization |
| Platform Compliance | Validates menu bar, dock icon, and tray requirements per OS |
| Native Modules | Checks N-API compatibility and architecture matching |
| Code Signing | Verifies signatures for macOS notarization and Windows SmartScreen |
Audit Workflow
Build Completes
|
Locate Artifacts
|
┌───┴───┐
| |
Size Signing
Check Check
| |
└───┬───┘
|
Platform Compliance
|
Native Module Scan
|
Generate Report
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
max_binary_size_mb | number | 120 | Maximum allowed binary size in megabytes |
max_startup_ms | number | 3000 | Maximum acceptable startup time in milliseconds |
platforms | string[] | ["darwin","win32","linux"] | Target platforms to validate against |
require_signing | boolean | true | Whether code signing is mandatory |
native_module_check | boolean | true | Scan for native module compatibility issues |
Best Practices
-
Set Platform-Specific Budgets - macOS, Windows, and Linux have different user expectations for app size and startup time. Configure separate budgets per platform rather than using a single global threshold.
-
Audit Before Notarization - Run the desktop auditor before submitting to Apple notarization or Windows Store. Catching issues pre-submission saves hours of waiting for rejection feedback.
-
Track Binary Size Trends - Log binary sizes over time to detect gradual bloat. A 2MB increase per release compounds quickly into a sluggish download experience.
-
Validate Auto-Update Payloads - If your app uses delta updates, audit the update payload size separately from the full installer to keep update times reasonable.
-
Test Minimum Window Sizes - Ensure your UI remains functional at the declared minimum window dimensions. The auditor checks declarations but manual smoke testing validates real behavior.
Common Issues
-
Architecture Mismatch on Native Modules - Building on x64 but targeting arm64 causes native module failures. Ensure your build matrix matches your audit targets and use cross-compilation flags.
-
False Code Signing Failures - Expired or self-signed certificates trigger audit failures. Keep certificates rotated and use environment variables for signing credentials in CI.
-
Inflated Size from Dev Dependencies - Development dependencies bundled into production builds inflate binary size. Verify your bundler config excludes devDependencies and test fixtures.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Pre-Commit Security Scanner
Pre-commit hook that scans staged files for hardcoded secrets, API keys, passwords, and sensitive data patterns before allowing commits.
Agents Md Watcher
Streamline your workflow with this automatically, loads, agents, configuration. Includes structured workflows, validation checks, and reusable patterns for automation.
Automated Build Inspector
Boost productivity using this automatically, trigger, build, processes. Includes structured workflows, validation checks, and reusable patterns for automation.