本文へ移動
cccskills
無料GitHub で公開

cmux-debugging

Debug logging, Debug menu, runtime pitfalls, typing-latency-sensitive paths, SwiftUI list snapshot boundaries, OS-version repros, and local visual iteration for cmux. Use when adding debug probes, diagnosing UI/runtime issues, touching terminal rendering, tab/sidebar list views, drag/drop UTTypes, or using the Debug menu.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md4.4 KB
  • agents/openai.yaml358 B
  • references/debug-event-log.md1.0 KB
  • references/runtime-pitfalls.md3.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

cmux Debugging

Debug event log

Put debug event instrumentation (keys, mouse, focus, splits, tabs) in the unified DEBUG build log. This is not a requirement to log every new code path; most probes belong to a dogfood debug loop and are removed before merge.

tail -f "$(cat /tmp/cmux-last-debug-log-path 2>/dev/null || echo /tmp/cmux-debug.log)"
  • Untagged Debug app logs to /tmp/cmux-debug.log; tagged (./scripts/reload.sh --tag <tag>) to /tmp/cmux-debug-<tag>.log.
  • reload.sh writes the current log path to /tmp/cmux-last-debug-log-path and the selected dev CLI path to /tmp/cmux-last-cli-path, and points /tmp/cmux-cli and $HOME/.local/bin/cmux-dev at that CLI.
  • Implementation: Packages/macOS/CMUXDebugLog/Sources/CMUXDebugLog/DebugEventLog.swift. App shim: Sources/App/DebugLogging.swift. Both are #if DEBUG, so every call site must be wrapped in #if DEBUG / #endif.
  • cmuxDebugLog("message") timestamps and appends in real time. A 500-entry ring buffer backs it; CMUXDebugLog.DebugEventLog.shared.dump() writes the full buffer to file.
  • Key events are logged in AppDelegate.swift (monitor, performKeyEquivalent); mouse/UI events inline in views (ContentView, BrowserPanelView).
  • Stable event prefixes: focus.panel, focus.bonsplit, focus.firstResponder, focus.moveFocus, tab.select, tab.close, tab.dragStart, tab.drop, pane.focus, pane.drop, divider.dragStart.

Profiling

Profile a tagged build by attaching to its pid (xctrace record --attach <pid>, sample <pid>). Never use xctrace --launch or Instruments' launch mode on any cmux bundle, and never quit, kill or relaunch the user's running cmux (com.cmuxterm.app): it holds their live agent sessions, and on 2026-09-26 a suspected profiler relaunch took five of them down.

Debug menu

DEBUG builds get a Debug menu in the macOS menu bar. When the user says "debug menu" or "debug window" they mean this, not defaults write.

Debug > Debug Windows holds panels for tuning layout, colors, and behavior, listed alphabetically with no dividers. To add one: create an NSWindowController subclass with a shared singleton, register it in the "Debug Windows" menu in Sources/cmuxApp.swift, and back it with a SwiftUI view using @AppStorage bindings for live changes.

Runtime pitfalls

  • Custom drag-and-drop UTTypes must be declared in Resources/Info.plist under UTExportedTypeDeclarations.
  • Do not add an app-level display link or manual ghostty_surface_draw loop; rely on Ghostty wakeups/renderer to avoid typing lag.
  • WindowTerminalHostView.hitTest() in Sources/TerminalWindowPortal.swift runs on every event including keyboard. Add no work outside the allowsPortalPointerHitTesting guard in performHitTest.
  • TabItemView in Sources/ContentView.swift uses Equatable plus .equatable() to skip body re-evaluation during typing. Do not add environment/store/binding reads without updating == and keeping .equatable() at the call site.
  • TerminalSurface.forceRefresh() in Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+ForceRefresh.swift runs on every keystroke. No allocations, file I/O, or formatting.
  • SurfaceSearchOverlay must be mounted from GhosttySurfaceScrollView in Sources/GhosttyTerminalView.swift, not from SwiftUI panel containers.
  • Views below a LazyVStack / LazyHStack / List / ForEach boundary receive immutable snapshots plus closures, never an observable store.
  • Functions called from SwiftUI body must not mutate state or schedule store writes.
  • Foundation, SwiftUI, AttributeGraph, and WebKit semantics change between macOS majors. Test on the reporter's macOS before declaring a user repro disproven.

Detailed references

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

cmux

無料

End-user control of cmux topology and routing (windows, workspaces, panes/surfaces, focus, moves, reorder, identify, trigger flash). Use when automation needs deterministic placement and navigation in a multi-pane cmux layout.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

cmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design discipline, testability, and Swift 6 concurrency rules. Use before adding or meaningfully rewriting Swift files, Swift packages, coordinators, services, repositories, or public package APIs.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

Backend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM lifecycle, provider integrations, Postgres, Stack Auth pricing gates, migrations, or provider image build scripts.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

Stripe checkout, pricing, subscription, Pro plan, webhook, and entitlement runbook for cmux billing work. Use when editing or debugging billing, pricing, Stripe Checkout, subscription recording, Pro plan status, webhooks, entitlement metadata, or pricing dev/prod tooling.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page state, and extract data without stealing focus.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

Screenshot or record a cmux window from the CLI, for a pull request, a bug report, or to see what the app actually looks like right now. Use when a change is visual, when a drag or an animation cannot be described in text, or when a reviewer needs evidence rather than a claim.

日本語の概要は準備中です。原文の説明を表示しています。

manaflow-ai/cmux2.8万2026年10月11日 更新

manaflow-ai のスキルをすべて見る

このスキルの問題を報告する