swiftui-platform-rules

Enforce macOS and iOS UI conventions and XCUITest reliability rules.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/smykla-skalski/harness --skill swiftui-platform-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-platform-rules
Source: https://github.com/smykla-skalski/harness/tree/main/.claude/skills/swiftui-platform-rules
Command: npx skills add https://github.com/smykla-skalski/harness --skill swiftui-platform-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a concise, actionable set of platform conventions and UI testing patterns to prevent inconsistent macOS/iOS UI behavior and brittle XCUITest suites, reducing UI regressions and slow flaky tests.

Core Features & Use Cases

  • Platform Conventions: Defines menu order, traffic light placement, window chrome sizes, toolbar/sidebar placement, settings scene behavior, dock/notification expectations, and standard keyboard shortcuts for macOS and aspirational iOS guidance.
  • XCUITest Reliability: Prescribes animation suppression layers, mandatory use of .firstMatch, coordinate-based taps for non-hittable elements, single-launch test design, targeted wait strategies, and scroll helpers like dragUp.
  • Use Case: Use when implementing or reviewing macOS window/menu/toolbar/settings code or when authoring HarnessMonitorUITests to ensure consistent UX and fast, deterministic UI tests.

Quick Start

Apply these platform and XCUITest rules when reviewing or authoring macOS window, menu, toolbar, settings code or UI tests to enforce conventions and improve test reliability.

Frequently Asked Questions about swiftui-platform-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix flaky XCUITest suites in iOS and macOS apps?

Fix flaky XCUITest suites by enforcing single-launch test design, using .firstMatch queries, applying animation suppression layers, and using coordinate-based taps for non-hittable elements to ensure deterministic UI test execution.

What macOS UI conventions should I follow when implementing window menus and toolbars?

Follow macOS UI conventions by enforcing standard menu ordering, correct traffic light placement, precise window chrome measurements, proper toolbar and sidebar placements, and standard keyboard shortcuts across your SwiftUI application.

Why does my XCUITest fail to find hittable UI elements during automation?

XCUITest fails to find hittable elements when animations are active or queries return multiple matches. Resolve this by suppressing animations, using .firstMatch to isolate elements, and falling back to coordinate-based taps for non-hittable elements.

Can I use this to enforce iOS safe area and touch target rules in SwiftUI?

Yes, you can enforce iOS safe area and touch target rules alongside aspirational iOS UI guidance. The rules apply to platform conventions including sidebar placements, safe area measurements, and touch target sizing for SwiftUI components.

What's the best way to structure XCUITest wait strategies and scroll helpers?

Structure XCUITest wait strategies by applying targeted wait expectations rather than generic sleeps, and implement scroll helpers like dragUp to navigate views reliably during single-launch test design execution.

When should I use coordinate-based taps instead of standard element taps in XCUITest?

Use coordinate-based taps in XCUITest when dealing with non-hittable elements that cannot be interacted with through standard element taps, ensuring reliable automation when standard queries and .firstMatch fail to trigger actions.