macos-window-management
Skill4.3k starsChanged 5 months agoMITView on GitHub
Customize macOS SwiftUI windows and scene behavior. Use when tuning window chrome, drag regions, placement, restoration, launch behavior, or borderless windows.
1 other project uses a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- robinebers/skillsword for word, first seen Jun 25, 2026
Who's talking about robinebers/openusage
- A Hacker News story“OpenUsage: Track all your AI usage, in one panel”Hacker News · Apr 30, 2026 · 2 points
- @github-trending-js.bsky.social“📦 robinebers / openusage ⭐ 1,831 (+53) 🗒 JavaScript Burning through your subscriptions too fast? Paying …”Bluesky · Apr 12, 2026 · 1 likes
- @mikestaub2.bsky.social“This is a useful too to track your AI agent usage: github.com/robinebers/o...”Bluesky · Feb 3, 2026 · 1 likes
- XusBadia/altillo“Upstream openusage: cambios en proveedores”GitHub · Oct 5, 2026
- sudosubin/agents.nix“agent-skills.github.robinebers.openusage: 0.7.12 → 0.7.13”GitHub · Oct 3, 2026
The biggest 5 of 26 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 26
Talked about on GitHub, Bluesky and Hacker News (26 times).
On GitHub · 23
- Oct 5, 2026Upstream openusage: cambios en proveedores — XusBadia/altillo0 reactions
- Oct 3, 2026agent-skills.github.robinebers.openusage: 0.7.12 → 0.7.13 — sudosubin/agents.nix0 reactions
- Oct 3, 2026Z.ai GLM Coding Plan detected but usage resources are empty — LuigiElleBalotta/AIUsage.NET0 reactions
- Oct 1, 2026agent-skills.github.robinebers.openusage: init at 0.7.12 — sudosubin/agents.nix0 reactions
- Sep 26, 2026[quota-watch] 2026-09-26 — Claude'un oauth/usage'ı artık User-Agent'a göre dallanıyor (cedar_ember); Codex refresh token'ının tek kullanımlık olduğu doğrulandı — erayendes/mimir0 reactions
18 more on GitHub
- Sep 24, 2026usage API が 429 を返し続けると、入札も回復待ちの判定も効かなくなり、自動の着手が止まり、走っている run も stall として止められうる — maimuzo/continuo0 reactions · 130 comments
- Sep 19, 2026[quota-watch] 2026-09-19 — Claude CLAUDE_CONFIG_DIR hiç okunmuyor; Codex kendi auth.json'a token yazıyor; yeni bir oauth/profile ucu var — erayendes/mimir0 reactions · 4 comments
- Sep 16, 2026feat(cursor): Cursor card — plan usage by session token — Rast53/usage-board0 reactions · 1 comment
- Sep 13, 2026[P2][RELIABILITY][DOCUMENTATION] Complete or retire the expired Prometheus counter migration — Reese-max/lobsterpulse0 reactions · 2 comments
- Sep 9, 2026feat(muse) - Add muse-code from Meta as provider — janekbaraniewski/openusage0 reactions · 5 comments
- Sep 5, 2026[quota-watch] 2026-09-05 — Antigravity grup-kota alan adları iki bağımsız rakipte doğrulandı; Claude web endpoint'i Cloudflare engeline takılabiliyor — erayendes/mimir0 reactions · 1 comment
- Aug 29, 2026[quota-watch] 2026-08-29 — Codex 5 saatlik pencere Plus için canlıya geçti; Antigravity grup-kota alan adlarında olası uyuşmazlık — erayendes/mimir0 reactions · 3 comments
- Aug 28, 2026feat(providers): add grok quota monitoring — medokin/ReservePane0 reactions
- Aug 26, 2026feat(providers): add OpenCode Go quota monitoring — medokin/ReservePane0 reactions
- Aug 13, 2026Document OpenCode Go Rate limits from GET /zen/go/v1/usage — lidge-jun/opencodex0 reactions · 4 comments
- Aug 10, 2026[quota-watch] 2026-08-10 — Antigravity: olası app/bundle adı değişikliği ve RetrieveUserQuotaSummary'de auth race raporu (düşük güven) — erayendes/mimir0 reactions · 3 comments
- Aug 4, 2026feat(ai): add Cursor personal usage reporting — can1357/oh-my-pi0 reactions
- Jul 13, 2026openusage: 0.6.13 -> 0.7.5, add Br1ght0ne to maintainers — NixOS/nixpkgs0 reactions
- Jun 26, 2026Wire SQLite reader into getSummary() to fix usage accuracy drift (#23 root cause) — ltmoerdani/opencode-copilot-chat0 reactions · 1 comment
- Apr 30, 2026[feature]: Opencode Go without workspace ID and auth cookie — slkiser/opencode-quota0 reactions · 4 comments
- Apr 10, 2026Upstream merge — Rana-Faraz/usage-tray-windows0 reactions · 1 comment
- Apr 7, 2026limit what provider models show up (includes PR) — Rana-Faraz/usage-tray-windows0 reactions · 1 comment
- Apr 5, 2026openusage: init at 0.6.13 — NixOS/nixpkgs0 reactions · 2 comments
On Bluesky · 2
- Apr 12, 2026📦 robinebers / openusage ⭐ 1,831 (+53) 🗒 JavaScript Burning through your subscriptions too fast? Paying for stuff you never use? Stop… — @github-trending-js.bsky.social1 likes and repost
- Feb 3, 2026This is a useful too to track your AI agent usage: github.com/robinebers/o... — @mikestaub2.bsky.social1 likes and repost
On Hacker News · 1
- Apr 30, 2026OpenUsage: Track all your AI usage, in one panel2 points
Other versions1 project uses a version of this.
Word for word · 1
- robinebers/skills★ 48100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/openusage-preview-launch.mdcCursor rule
- appkit-interopSkill
- build-and-run-macos-appSkill
- build-run-debugSkill
- fix-codesign-errorSkill
- liquid-glassSkill
- macos-appkit-interopSkill
- macos-build-run-debugSkill
- macos-liquid-glassSkill
- macos-packaging-notarizationSkill
- macos-signing-entitlementsSkill
- macos-swiftpmSkill
- macos-swiftui-patternsSkill
- macos-telemetrySkill
- macos-test-triageSkill
- macos-view-refactorSkill
- packaging-notarizationSkill
- pricing-updateSkill
- release-swiftSkill
- signing-entitlementsSkill
- swiftpm-macosSkill
- swiftui-patternsSkill
- telemetrySkill
- test-macos-appSkill
- test-triageSkill
- view-refactorSkill
- window-managementSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
37 rules. About 0 are common, 16 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use this skill to tailor each SwiftUI window to its job.
- Distinctive: line 15
Prefer scene and window modifiers over ad hoc AppKit bridges when SwiftUI offers the behavior directly.
- Distinctive: line 29
If the toolbar background or entire toolbar is hidden, make sure the window still has a usable drag region.
- Very specific: line 37
If SwiftUI scene/window modifiers are not enough, switch to macos-appkit-interop for a narrow NSWindow bridge rather than spreading AppKit …
- Very specific: line 43
Use .toolbar(removing: .title) when the window title should stay associated with the window for accessibility and menus, but not be visibly …
- Very specific: line 46
Use .toolbarBackgroundVisibility(.hidden, for: .windowToolbar) when large media or hero content should visually extend to the top edge of …
- Very specific: line 48
If the window still needs close/minimize/full-screen controls, remove only the title and toolbar background.
- Distinctive: line 51
Remove custom toolbar backgrounds and manually painted titlebar fills before layering new SwiftUI toolbar APIs on top.
- Distinctive: line 53
Keep the window's logical title meaningful even if hidden.
- Very specific: line 58
If a toolbar background is hidden or the toolbar is removed entirely, use WindowDragGesture() to extend the draggable area into your …
- Very specific: line 70
Use .containerBackground(.thickMaterial, for: .window) when a utility window or About window should replace the default window background …
- Distinctive: line 73
Prefer system materials for stylized windows instead of hardcoded translucent colors.
- Distinctive: line 75
Use this especially for fixed-content utility windows where a softer backdrop is part of the design.
- Very specific: line 80
Use .windowMinimizeBehavior(.disabled) for always-reachable utility windows such as a custom About window where minimizing adds little …
- Very specific: line 84
Use .restorationBehavior(.disabled) for windows that should not reopen on next launch, such as About panels, transient support/info …
- Distinctive: line 87
Keep state restoration enabled for primary document or navigation windows when reopening prior size and position is desirable.
- Very specific: line 92
Use .defaultLaunchBehavior(.presented) for windows that should appear first on launch, such as a welcome window, and choose that behavior …
- Very specific: line 98
Use .defaultWindowPlacement { content, context in ...
- Very specific: line 102
Read context.defaultDisplay.visibleRect to get the display's usable region after accounting for the menu bar and Dock.
- Very specific: line 107
Use .windowIdealPlacement { content, context in ...
- Distinctive: line 111
Treat default placement and ideal placement as separate policies:
- Distinctive: line 112
default placement controls where a new window first appears,
- Distinctive: line 114
Always consider external displays and rotated/narrow screens when sizing player windows or document windows from content dimensions.
- Very specific: line 119
Use .windowStyle(.plain) for borderless or highly custom chrome windows, but make sure the content still provides a clear drag/move …
- Distinctive: line 124
Keep one clear path back to regular window management if the plain style makes the window feel invisible or hard to move.
- Very specific: line 141
Default and ideal placement use content.sizeThatFits(.unspecified) and context.defaultDisplay.visibleRect when content/display size matters.
- Very specific: line 148
Do not use .toolbar(removing: .title) just to hide a title you forgot to set.
- Distinctive: line 149
Keep the underlying window title meaningful.
- Distinctive: line 150
Do not hide the toolbar background or the whole toolbar without replacing the lost drag affordance.
- Distinctive: line 152
Do not disable restoration on the main document/navigation window unless the user explicitly wants a fresh-start app every launch.
- Distinctive: line 154
Do not hardcode one monitor size or assume a single-display setup when sizing player windows.
- Very specific: line 156
Do not reach for NSWindow mutation before checking whether .windowMinimizeBehavior, .restorationBehavior, .defaultWindowPlacement, …
- Distinctive: line 160
Do not leave a plain borderless window without any obvious drag or close path.
- Very specific: line 164
Use macos-swiftui-patterns for broader scene, commands, settings, sidebar, and inspector architecture.
- Very specific: line 166
Use macos-liquid-glass when the main question is modern macOS visual treatment, Liquid Glass, or system material adoption.
- Very specific: line 168
Use macos-appkit-interop if a custom window behavior truly requires NSWindow, NSPanel, or responder-chain control.
- Very specific: line 170
Use macos-build-run-debug to launch and verify the resulting windows.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Window Management
Overview
Use this skill to tailor each SwiftUI window to its job. Start by identifying
which scene owns the window (Window, WindowGroup, or a dedicated utility
scene), then customize the toolbar/title area, background material, resize and
restoration behavior, and initial or zoomed placement.
Prefer scene and window modifiers over ad hoc AppKit bridges when SwiftUI offers the behavior directly. Keep each window purpose-built: a main browser window, an About window, and a media player window usually want different chrome, resizability, restoration, and placement rules.
These APIs are macOS 15+ SwiftUI window/scene customizations. For older deployment targets, expect to use more AppKit bridging or availability guards.
Workflow
- Inspect the relevant scene declaration and classify the window role: main app navigation, inspector/detail utility, About/support window, media playback window, welcome window, or a borderless custom surface.
- Adjust toolbar and title presentation to match the content.
- If the toolbar background or entire toolbar is hidden, make sure the window still has a usable drag region.
- Refine window behavior for that role: minimize availability, restoration, resize expectations, and whether the window should appear at launch.
- Set default placement for newly opened windows and ideal placement for zoom behavior when content and display size matter.
- Build and launch the app with
macos-build-run-debugto verify the result in a real foreground.appbundle. - If SwiftUI scene/window modifiers are not enough, switch to
macos-appkit-interopfor a narrowNSWindowbridge rather than spreading AppKit through the view tree.
Toolbar And Title
- Use
.toolbar(removing: .title)when the window title should stay associated with the window for accessibility and menus, but not be visibly drawn in the title bar. - Use
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar)when large media or hero content should visually extend to the top edge of the window. - If the window still needs close/minimize/full-screen controls, remove only the
title and toolbar background. If the toolbar should disappear entirely, use
.toolbarVisibility(.hidden, for: .windowToolbar)instead. - Remove custom toolbar backgrounds and manually painted titlebar fills before layering new SwiftUI toolbar APIs on top.
- Keep the window's logical title meaningful even if hidden; the system can still use it for accessibility and menu items. These are visual changes only.
Drag Regions
- If a toolbar background is hidden or the toolbar is removed entirely, use
WindowDragGesture()to extend the draggable area into your content. - Attach the gesture to a transparent overlay or non-interactive header region that does not steal gestures from real controls.
- For a media player with custom playback controls, insert the drag overlay between the video content and the controls so AVKit or transport controls keep receiving input.
- Pair the drag gesture with
.allowsWindowActivationEvents(true)so clicking and immediately dragging a background window still activates and moves it.
Background And Materials
- Use
.containerBackground(.thickMaterial, for: .window)when a utility window or About window should replace the default window background with a subtle frosted material. - Prefer system materials for stylized windows instead of hardcoded translucent colors.
- Use this especially for fixed-content utility windows where a softer backdrop is part of the design.
Window Behavior
- Use
.windowMinimizeBehavior(.disabled)for always-reachable utility windows such as a custom About window where minimizing adds little value. - Disable the green zoom control through fixed sizing or window constraints when the window's content has one intended size.
- Use
.restorationBehavior(.disabled)for windows that should not reopen on next launch, such as About panels, transient support/info windows, or first-run welcome surfaces. - Keep state restoration enabled for primary document or navigation windows when reopening prior size and position is desirable.
- By default, SwiftUI respects the user's system-wide macOS state restoration
setting. Use
restorationBehavior(...)only when a specific window should intentionally opt into or out of that system behavior. - Use
.defaultLaunchBehavior(.presented)for windows that should appear first on launch, such as a welcome window, and choose that behavior intentionally rather than relying on side effects from scene creation order.
Window Placement
- Use
.defaultWindowPlacement { content, context in ... }to control the initial size and optional position of newly opened windows. - Inside the placement closure, call
content.sizeThatFits(.unspecified)to get the content's ideal size. - Read
context.defaultDisplay.visibleRectto get the display's usable region after accounting for the menu bar and Dock. - Return
WindowPlacement(size: size)with a size clamped to the visible rect when media or document content may be larger than the display. If no position is provided, the window is centered by default. - Use
.windowIdealPlacement { content, context in ... }to control what happens when the user chooses Zoom from the Window menu or Option-clicks the green toolbar button. For media windows, preserve aspect ratio and grow to the largest size that fits the display. - Treat default placement and ideal placement as separate policies:
- default placement controls where a new window first appears,
- ideal placement controls how large a zoomed window should become.
- Always consider external displays and rotated/narrow screens when sizing player windows or document windows from content dimensions.
Borderless And Specialized Windows
- Use
.windowStyle(.plain)for borderless or highly custom chrome windows, but make sure the content still provides a clear drag/move affordance and visible context. - For a borderless player, HUD, or welcome window, decide upfront whether losing standard titlebar affordances is worth the custom presentation.
- Keep one clear path back to regular window management if the plain style makes the window feel invisible or hard to move.
For concrete window modifier examples, read references/api-snippets.md.
Review Checklist
- The scene type matches the window's role and lifecycle.
- Hidden titles still leave a meaningful logical title for accessibility and menus.
- Toolbar background removal is intentional and does not hurt titlebar legibility or window control placement.
- Windows with hidden or removed toolbars still have a reliable drag region and support click-then-drag activation from the background.
- Utility windows have restoration/minimize behavior that matches their purpose.
- Restoration overrides are used only when a scene should intentionally differ from the user's system-wide setting.
- Default and ideal placement use
content.sizeThatFits(.unspecified)andcontext.defaultDisplay.visibleRectwhen content/display size matters. - Media windows preserve aspect ratio and fit on small or rotated displays.
- Borderless windows still have a usable move/drag affordance.
Guardrails
- Do not use
.toolbar(removing: .title)just to hide a title you forgot to set. Keep the underlying window title meaningful. - Do not hide the toolbar background or the whole toolbar without replacing the lost drag affordance.
- Do not disable restoration on the main document/navigation window unless the user explicitly wants a fresh-start app every launch.
- Do not hardcode one monitor size or assume a single-display setup when sizing player windows.
- Do not reach for
NSWindowmutation before checking whether.windowMinimizeBehavior,.restorationBehavior,.defaultWindowPlacement,.windowIdealPlacement,.windowStyle, or.defaultLaunchBehavioralready solve the problem. - Do not leave a plain borderless window without any obvious drag or close path.
When To Use Other Skills
- Use
macos-swiftui-patternsfor broader scene, commands, settings, sidebar, and inspector architecture. - Use
macos-liquid-glasswhen the main question is modern macOS visual treatment, Liquid Glass, or system material adoption. - Use
macos-appkit-interopif a custom window behavior truly requiresNSWindow,NSPanel, or responder-chain control. - Use
macos-build-run-debugto launch and verify the resulting windows.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

