cmux-testing
cmux testing rules for Swift Testing, test target compilation, and package/refactor validation. Use when adding or changing tests, touching package/refactor code, or deciding whether reload.sh is enough validation.
Security Assessment
About cmux-testing
cmux-testing encodes the cmux project's testing rules for Swift Testing, test-target compilation, and package/refactor validation. It applies when adding or changing tests, touching package or refactor code, or deciding whether running reload.sh is sufficient validation. It solves a concrete correctness problem: ensuring that tests genuinely exercise runtime behavior and that changes don't silently break the test target while the app still builds.
The skill sets several policies. A regression-test commit policy uses a two-commit structure — commit 1 adds only the failing test (CI goes red), commit 2 adds the fix (CI goes green) — so the PR proves the test catches the bug. A test-quality policy forbids tests that only assert on source text, method signatures, AST fragments, grep patterns, or checked-in metadata files like Info.plist, project.pbxproj, or .xcconfig; tests must verify observable runtime behavior through executable paths, preferring the built app bundle or a runtime seam for metadata changes. Swift Testing is the default for all unit and integration tests (import Testing, @Test, @Suite, #expect, try #require, @Test(arguments:), .serialized, .tags), while UI tests stay on XCTest/XCUITest under cmuxUITests. A migration guide maps XCTest constructs to Swift Testing equivalents (XCTestCase to @Suite struct, XCTAssertEqual to #expect(a == b), XCTUnwrap to try #require, setUp/tearDown to init/deinit).
It targets contributors working on the cmux macOS codebase. It warns that reload.sh builds only the cmux scheme and does not compile the test target, so package/refactor changes should build the cmux-unit scheme (with -derivedDataPath /tmp/cmux-<tag> and, for cmuxApp/AppDelegate churn, a GlobalISel workaround flag) or rely on the tests CI job. It also documents a deterministic remote-tmux live-layout fuzz harness driven by scripts/remote-tmux-fuzz-host.sh, remote-tmux-fuzz-marathon.sh, and remote-tmux-live-fuzz.sh using the cmux-fuzzhost alias, with seed-based reproducible runs and detailed setup-failure fixes. Deeper guidance lives in references such as swift-testing-migration.md, regression-and-quality.md, and local-vs-ci-validation.md.
FAQ
Is running reload.sh enough to validate a change?
No. reload.sh builds only the cmux scheme and does not compile the test target, so a green reload.sh says nothing about whether cmuxTests/cmuxUITests still compile. For package/refactor changes, build the cmux-unit scheme or let the tests CI job gate it.
Which test framework should new tests use?
Default to Swift Testing for all unit and integration tests (import Testing, @Test, @Suite, #expect, try #require). UI tests stay on XCTest/XCUITest under cmuxUITests. Every new test target starts on Swift Testing.
How should I structure a regression test for a bug fix?
Use two commits: commit 1 adds only the failing test so CI goes red, and commit 2 adds the fix so CI goes green. This makes it visible in the PR UI that the test genuinely fails without the fix.
What kinds of tests are disallowed?
Tests that only verify source text, method signatures, AST fragments, or grep-style patterns, and tests that read checked-in metadata (Info.plist, project.pbxproj, .xcconfig) just to assert a key or snippet exists. Tests must verify observable runtime behavior; for metadata, verify the built app bundle or dependent runtime behavior.
How do I reproduce a remote-tmux fuzz failure?
Seeds are deterministic, so "seed 3, iteration 1" is a complete repro. Stand up the host with scripts/remote-tmux-fuzz-host.sh cmux-fuzzhost, then replay with scripts/remote-tmux-live-fuzz.sh cmux-fuzzhost <seed> <iters>. Use the cmux-fuzzhost alias (not cmux-srvA/cmux-srvB) and run it once to completion outside a tmux session.
Install cmux-testing
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
manaflow-ai/cmux