Macos telemetry probe

From Xopoko/build-swift-apps · View interactive version

Macos telemetry probe is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. macOS runtime telemetry: add and verify privacy-safe Logger/OSLog events, log stream filters, and signposts; not crash diagnosis.

How to use this skill

Skill file

macOS Telemetry Probe

Before invoking Apple-only binaries, confirm the execution context is macOS. From Windows or Linux, run those steps in a Mac SSH project or through an already configured remote transport; do not retry missing Apple binaries locally.

Add high-signal app instrumentation without leaving noisy permanent logs. Prefer Apple's unified logging and verify events after build/run.

Rules

import OSLog

private let logger = Logger(
  subsystem: Bundle.main.bundleIdentifier ?? "SampleApp",
  category: "Sidebar"
)

@MainActor
func selectItem(_ item: SidebarItem) {
  selection = item.id
  logger.info("Sidebar selection changed")
}

Use feature categories like Windowing, Commands, MenuBar, Sidebar, Sync, or Import.

Workflow

  1. Identify the behavior needing observability.
  2. Add one useful log per action boundary or key state transition.
  3. Build/run with macos-runtime-debugger; if present, prefer ./script/build_and_run.sh --telemetry or --logs.
  4. Exercise the UI/command path.
  5. Verify through Console or:

```bash

log stream --level info --style compact --predicate 'subsystem == "com.example.app" && category == "Sidebar"'

```

  1. Keep useful logs; remove or demote temporary noise.

Verification

Confirm the app builds, the relevant action emits exactly one clear line or bounded sequence, logs filter by process/subsystem/category, no sensitive payloads are written, and temporary debug noise is gone. If the task is mainly crash/backtrace work, switch to macos-runtime-debugger.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.