Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.99 KB

AGENTS.md

File metadata and controls

59 lines (41 loc) · 1.99 KB

Minimizer Agent Instructions

Product

Minimizer is a native macOS menu-bar app. It has no Dock icon and uses a global hotkey plus status item controls to minimize every normal window to the Dock, then restore those windows and return focus to the originally active window.

Tech Stack

  • Swift 5.9 package for CLI builds.
  • AppKit application target generated by XcodeGen.
  • Carbon global hotkey registration.
  • Accessibility API for window minimize, restore, and focus control.
  • ServiceManagement SMAppService for Launch at Login.
  • No third-party UI component libraries.

Build Paths

Keep both paths working:

  • SwiftPM: swift build -c release && ./build_app.sh
  • Xcode: xcodegen generate, then xcodebuild -project Minimizer.xcodeproj -scheme Minimizer -configuration Release -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build

After adding or removing source files, run xcodegen generate.

Engine Rules

The minimize/restore engine is direct AX:

AXUIElementSetAttributeValue(window, kAXMinimizedAttribute, true/false)

Do not reintroduce NSRunningApplication.hide(), NSApplication.hideOtherApplications, or Mission Control Show Desktop triggers. Keep App Nap protection and stable signing.

Code Conventions

  • Prefer small AppKit controllers and plain Swift helpers.
  • Keep UI work on the main thread.
  • Keep AX minimize/restore work serialized through axQueue.
  • Use named helper types for testable logic.
  • After adding source files, regenerate Minimizer.xcodeproj from project.yml.
  • Do not leave temporary diagnostics, debug logs, or print statements in shipping code.

Verification

Before closing a task, run:

swift test
swift build -c release
./build_app.sh
xcodegen generate
xcodebuild -project Minimizer.xcodeproj -scheme Minimizer -configuration Release -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build

For runtime checks, kill existing instances, open Minimizer.app, and confirm pgrep -lf "MacOS/Minimizer" shows one runtime instance.