telemetry

作者: openai

Add lightweight runtime telemetry and debug instrumentation to macOS apps, then verify those events after building and running. Use when wiring `Logger` /…

npx skills add https://github.com/openai/plugins --skill telemetry

Telemetry

Quick Start

Use this skill to add lightweight app instrumentation that helps debug behavior without turning the codebase into a logging landfill. Prefer Apple's unified logging APIs and verify the events after a build/run loop.

Core Guidelines

  • Prefer Logger from the OSLog framework for structured app logs.
  • Give each feature a clear subsystem/category pair so runtime filtering stays easy.
  • Log meaningful user and app lifecycle events: window opening, sidebar selection changes, menu commands, menu bar extra actions, sync/load milestones, and unexpected fallback paths.
  • Keep info logs concise and stable. Use debug logs for noisy state details.
  • Do not log secrets, auth tokens, personal data, or raw document contents.
  • Add signposts only when measuring timing or performance spans; do not overinstrument by default.

Minimal Logger Pattern

import OSLog

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

@MainActor
func selectItem(_ item: SidebarItem) {
  logger.info("Selected sidebar item: \(item.id, privacy: .public)")
  selection = item.id
}

Use feature-specific categories like Windowing, Commands, MenuBar, Sidebar, Sync, or Import so logs can be filtered quickly.

Workflow

  1. Identify the behavior that needs observability.

    • Window open/close
    • Sidebar or inspector selection changes
    • Menu or keyboard command actions
    • Menu bar extra actions
    • Background load/sync/import events
    • Error and recovery paths
  2. Add the smallest useful instrumentation.

    • Create one Logger per feature area or type.
    • Log action boundaries and key state transitions.
    • Prefer one high-signal line per user action over noisy value dumps.
  3. Build and run the app.

    • Use build-run-debug for the build/run loop.
    • If script/build_and_run.sh exists, prefer ./script/build_and_run.sh --telemetry for live telemetry checks or ./script/build_and_run.sh --logs for broader process logs.
    • Exercise the UI or command path that should emit telemetry.
  4. Read runtime logs and verify the event fired.

    • Use Console.app with a process/subsystem filter when that is the fastest manual check.
    • Use log stream --style compact --predicate 'process == "AppName"' for live terminal verification.
    • Prefer tighter predicates when you know the subsystem/category: log stream --style compact --predicate 'subsystem == "com.example.app" && category == "Sidebar"'
  5. Tighten or remove instrumentation.

    • If the event fires, keep only the logs that remain useful for future debugging.
    • If it does not fire, move the log closer to the suspected control path and rerun.

Verification Checklist

  • The app builds after telemetry changes.
  • The relevant action emits exactly one clear log line or a small bounded sequence.
  • The log can be filtered by process, subsystem, or category.
  • No sensitive payloads are written to unified logs.
  • Noisy temporary debug logs are removed or demoted before finishing.

Guardrails

  • Do not use print as the primary app telemetry mechanism for macOS app code.
  • Do not leave a dense trail of permanent debug logs around every state mutation.
  • Do not claim an event is wired correctly until you have a concrete verification path through Console, log stream, or captured process output.
  • If the debugging task is mostly about crash/backtrace analysis rather than action telemetry, switch to build-run-debug.

来自 openai 的更多技能

user-context
openai
加载或管理数据分析插件的持久化源路由偏好、引导逻辑、设置进度及语义层注册表。
official
notion-research-documentation
openai
研究Notion内容,并将其综合成带有引用的结构化简报、报告或对比。通过定向查询搜索并获取Notion页面,然后按主题组织发现,附带内联来源引用和参考文献部分。根据范围和用户目标,从四种输出格式(快速简报、研究摘要、对比、综合报告)中选择。使用内置模板创建和更新Notion页面;直接链接来源,并在新信息到达时跟踪变更...
official
rcsb-pdb-skill
openai
提交紧凑的RCSB PDB请求以获取核心元数据、Search API查询和FASTA下载。当用户需要简洁的RCSB摘要时使用;保存原始JSON或…
official
pdf
openai
PDF的读取、创建与验证,支持可视化渲染与程序化生成。使用Poppler(pdftoppm)将PDF页面渲染为PNG,以便在交付前直观检查布局、间距与排版;通过reportlab程序化生成PDF,确保格式可靠;利用pdfplumber或pypdf提取文本与元数据。执行质量标准:无文本裁剪、元素重叠、表格损坏或渲染伪影;仅使用ASCII连字符,引用内容需可读。使用...
official
test-coverage-improver
openai
改进OpenAI Agents JS mon
official
playwright
openai
基于终端驱动的浏览器自动化,支持元素快照与交互式UI工作流。通过playwright-cli包装脚本运行(需npx),支持无头模式与有头模式进行可视化调试。核心工作流:打开页面、获取快照以稳定元素引用、使用引用进行交互、在导航或DOM变更后重新快照。包含表单填写、点击、输入、多标签页管理、截图/PDF捕获及用于流程调试的追踪记录。元素引用(如e3、e15)...
official
ukb-topmed-phewas-skill
openai
通过接受rsID、GRCh37或GRCh38输入并解析为所需的GRCh38查询,获取单个变体的紧凑型UKB-TOPMed PheWAS摘要。当需要…时使用。
official
code-review-context
openai
模型可见上下文
official