Agent skill

cmux Testing Rules

by disler in disler/learning-cmux-with-agents

Testing rules for the cmux Swift codebase: Swift Testing as the default framework, a two-commit regression policy, and tests that check runtime behavior, not source text.

MITAuto-check passedTesting & QA

Install cmux Testing Rules

skills CLI
$ npx skills add disler/learning-cmux-with-agents --skill cmux-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install disler/learning-cmux-with-agents cmux-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/disler/learning-cmux-with-agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ai_docs/cmux-skills/cmux-testing .claude/skills/cmux-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cmux-testing
GitHub stars
115
Token cost
~1.2k tokens
SKILL.md length
634 words
Files
5 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Testing rules for the cmux Swift codebase: Swift Testing as the default framework, a two-commit regression policy, and tests that check runtime behavior, not source text.

  • Works in 2 steps: Commit 1: Add the failing test only (no… → Commit 2: Add the fix. CI should go green.
  • Adding or changing tests in the cmux repository
  • SKILL.md covers Regression test commit policy, Test quality policy, Test framework and Test target validation, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill sets the testing conventions for the cmux project. Unit and integration tests are written with Swift Testing (import Testing, @Test, @Suite, #expect and try #require), while UI tests stay on XCTest and XCUITest because Swift Testing has no UI support. New Swift package test targets start on Swift Testing from their first commit.

A regression test for a bug fix goes in as two commits: the failing test alone so CI turns red, then the fix so CI turns green, which shows in the pull request that the test really catches the bug. A quality policy rules out tests that only grep source text, signatures or checked-in files such as Info.plist and project.pbxproj; tests should exercise observable behavior, or the built app bundle for metadata changes. When no meaningful test is practical, the agent says so rather than adding a fake one. Reference files cover local versus CI validation, regression and quality, and migrating to Swift Testing.

When your agent uses it

  • Adding or changing tests in the cmux repository
  • Writing a regression test for a bug fix with the two-commit structure
  • Deciding whether reload.sh is enough validation for a refactor
  • Migrating XCTest unit tests to Swift Testing

Example prompts

  • “Add a regression test for the tab-closing bug, with the failing test in its own commit first.”
  • “Convert the CmuxSettings unit tests from XCTest to Swift Testing.”
  • “I refactored the settings package. Is reload.sh enough, or do the test targets need to run?”

Requirements

  • Xcode 16 with Swift 6 for Swift Testing

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Commit 1: Add the failing test only (no fix). CI should go red.
  2. Commit 2: Add the fix. CI should go green.

What it can do on your machine

Read from SKILL.md and the folder at commit 6eaacab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

cmux Testing Rules loads about 1.2k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 57 tokens; SKILL.md has 634 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from disler/learning-cmux-with-agents at commit 6eaacab, republished under its MIT licence (© disler). 634 words, ~1,235 tokens.

Download SKILL.mdSave it as .claude/skills/cmux-testing/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
cmux-testing
description
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.

cmux Testing

Regression test commit policy

When adding a regression test for a bug fix, use a two-commit structure so CI proves the test catches the bug:

  1. Commit 1: Add the failing test only (no fix). CI should go red.
  2. Commit 2: Add the fix. CI should go green.

This makes it visible in the GitHub PR UI that the test genuinely fails without the fix.

Test quality policy

  • Do not add tests that only verify source code text, method signatures, AST fragments, or grep-style patterns.
  • Do not add tests that read checked-in metadata or project files such as Resources/Info.plist, project.pbxproj, .xcconfig, or source files only to assert that a key, string, plist entry, or snippet exists.
  • Tests must verify observable runtime behavior through executable paths (unit/integration/e2e/CLI), not implementation shape.
  • For metadata changes, prefer verifying the built app bundle or the runtime behavior that depends on that metadata, not the checked-in source file.
  • If a behavior cannot be exercised end-to-end yet, add a small runtime seam or harness first, then test through that seam.
  • If no meaningful behavioral or artifact-level test is practical, skip the fake regression test and state that explicitly.

Test framework

Swift Testing is the current Apple-supported primitive for tests on this codebase (shipped with Swift 6 / Xcode 16, supported on the macOS versions we target). Use it for everything that is not a UI test.

  • Default to Swift Testing for all unit and integration tests. import Testing, annotate tests with @Test, group with @Suite, assert with #expect(...) and try #require(...). Do not write new tests with import XCTest unless they are UI tests.
  • UI tests stay on XCTest / XCUITest. Swift Testing does not support UI testing (no XCUIApplication integration). Files under cmuxUITests/ continue to use XCTestCase + XCUIApplication. Do not migrate them and do not try to bridge Swift Testing into UI tests.
  • New test targets start on Swift Testing. Every new Swift package's Tests/<Name>Tests/ directory (e.g. Packages/macOS/CmuxSettings/Tests/CmuxSettingsTests/) should ship with Swift Testing from the first commit. Xcode 16 auto-detects the framework based on the import Testing statement; no extra Package.swift configuration is required.
  • Migration guide when touching an existing XCTest test. Convert in place: XCTestCase subclass becomes a @Suite struct (or final class if you need a reference type); each func testFoo() becomes @Test func foo(); XCTAssertEqual(a, b) becomes #expect(a == b); XCTAssertTrue(cond) becomes #expect(cond); XCTUnwrap(x) becomes try #require(x); XCTFail("msg") becomes Issue.record("msg"). setUp() becomes init() on the suite; tearDown() becomes deinit. Async setup is async init(). Do not bulk-rewrite untouched tests; migrate incrementally as a side effect of editing the file.
  • Parameterized tests use @Test(arguments: [...]). Prefer this over duplicate test methods.
  • Parallelization and shared state. Swift Testing runs tests in parallel by default, including across suites. If a suite genuinely needs ordering or guards shared mutable state, annotate it with .serialized instead of adding locks or sleeps.
  • Tags with @Test(.tags(.something)) (or on a @Suite) let CI and local runs filter selectively.
Show full SKILL.md (148 more words)Show less

Test target validation

reload.sh does not compile the test target. It builds only the cmux scheme, so a green reload.sh says nothing about whether cmuxTests/cmuxUITests still compile. A symbol that is moved or renamed can keep the cmux app building while breaking the test target (real case: a write(to:atomically:) typo and a removed TabManager.CommandResult only surfaced in the tests job). Before pushing package/refactor changes, build the cmux-unit scheme (with -derivedDataPath /tmp/cmux-<tag> and, for cmuxApp/AppDelegate churn, the GlobalISel workaround flag) or let the tests CI job gate it — never treat reload.sh alone as proof the tests build.

Detailed references

© disler, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in ai_docs/cmux-skills/cmux-testing of disler/learning-cmux-with-agents.

  • SKILL.md
  • agents/openai.yaml
  • references/local-vs-ci-validation.md
  • references/regression-and-quality.md
  • references/swift-testing-migration.md

Open the folder on GitHubat commit 6eaacab

Compare with similar skills

cmux Testing Rules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

cmux Testing Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
cmux Testing Rules this skilldisler/learning-cmux-with-agents115—~1.2kAutomated safety check: PassMIT
Shift Left Testingpetrkindlmann/qa-skills165—~6.7kAutomated safety check: PassMIT
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Write Vibe Testsmistralai/mistral-vibe5.1k—~1.2kAutomated safety check: PassApache-2.0
lo2cin4bt Acceptance Reviewlo2cin4/lo2cin4bt288—~1.4kAutomated safety check: PassCustom licence
Dependency Pinscognitivegears/ha-escpos-thermal-printer112—~1.1kAutomated safety check: PassMIT

Similar skills

  • Shift Left Testing

    petrkindlmann/qa-skills

    Move quality earlier in the development lifecycle. An agent skill from petrkindlmann/qa-skills.

    165 GitHub stars~6.7k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Write Vibe Tests

    mistralai/mistral-vibe

    Official

    Guides writing or refactoring tests for the Mistral Vibe CLI agent so they check behavior through stable boundaries, like tool invocation or saved session shape, instead of internal calls.

    5.1k GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Runs a pass, revise or block acceptance review on lo2cin4bt work, checking a deliverable against the request, repo contracts, tests, docs and the public GitHub boundary.

    288 GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Dependency Pins

    cognitivegears/ha-escpos-thermal-printer

    A skill your agent uses when bumping any dependency, upgrading the HA test harness (pytest-homeassistant-custom-component) or HA floor, or handling Dependabot PRs/security alerts — per-package pin…

    112 GitHub stars~1.1k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Dev Review

    FHIR/fhir-codegen

    Performs a two-track code-quality and QA review in the roles of a staff-level Engineering Lead and QA Lead, then synthesizes both critiques into a single analysis.md.

    154 GitHub stars~5k tokensUpdated today
    Testing & QAAuto-check passed

More from disler/learning-cmux-with-agents

  • cmux Browser Automation

    disler/learning-cmux-with-agents

    Drives browser surfaces inside cmux from the command line: open sites, snapshot elements, act on refs, wait for state changes and extract data.

    115 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • cmux Customization

    disler/learning-cmux-with-agents

    Customizes cmux for a user by editing cmux.json actions, workspace layouts, dock controls, tab bar buttons, settings and Ghostty terminal preferences.

    115 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • cmux Contributor Dev Workflow

    disler/learning-cmux-with-agents

    Contributor rules for the cmux repo: tagged Debug builds through reload.sh, first-time setup, Xcode project normalization and per-tag sidebar extension points.

    115 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • cmux Agent Surface Control

    disler/learning-cmux-with-agents

    Drives the cmux terminal multiplexer from natural language to open, inspect, prompt, read and close windows, workspaces, panes, surfaces and agent sessions.

    115 GitHub stars~2.6k tokensUpdated 3 mo ago
    Auto-check: notes

Questions about cmux Testing Rules

What does cmux Testing Rules do?

Testing rules for the cmux Swift codebase: Swift Testing as the default framework, a two-commit regression policy, and tests that check runtime behavior, not source text. This skill sets the testing conventions for the cmux project. Unit and integration tests are written with Swift Testing (import Testing, @Test, @Suite, #expect and try #require), while UI tests stay on XCTest and XCUITest because Swift Testing has no UI support.

When should I use cmux Testing Rules?

cmux Testing Rules fits situations like: adding or changing tests in the cmux repository; writing a regression test for a bug fix with the two-commit structure; deciding whether reload.sh is enough validation for a refactor; migrating XCTest unit tests to Swift Testing.

How do I install cmux Testing Rules in Claude Code?

Run `npx skills add disler/learning-cmux-with-agents --skill cmux-testing -a claude-code`. Or copy the skill folder (ai_docs/cmux-skills/cmux-testing in disler/learning-cmux-with-agents) into .claude/skills/cmux-testing in your project. Claude Code loads it when a task matches its description.

How do I install cmux Testing Rules in Codex?

Run `npx skills add disler/learning-cmux-with-agents --skill cmux-testing -a codex`. Or copy the skill folder (ai_docs/cmux-skills/cmux-testing in disler/learning-cmux-with-agents) into .agents/skills/cmux-testing in your project. Codex loads it when a task matches its description.

Can I use cmux Testing Rules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add disler/learning-cmux-with-agents --skill cmux-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cmux-testing, .gemini/skills/cmux-testing, .github/skills/cmux-testing and .opencode/skills/cmux-testing in your project.

What does cmux Testing Rules need to run?

SKILL.md names no scripts, command-line tools or credentials: cmux Testing Rules is instructions for the agent only. Our summary lists: Xcode 16 with Swift 6 for Swift Testing.

Does cmux Testing Rules access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is cmux Testing Rules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does cmux Testing Rules use?

cmux Testing Rules is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does cmux Testing Rules use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to cmux Testing Rules?

Skills that share tags, products or a category with cmux Testing Rules: Shift Left Testing (petrkindlmann/qa-skills, 165 stars), Test Guard (amElnagdy/guard-skills, 1.3k stars), Write Vibe Tests (mistralai/mistral-vibe, 5.1k stars) and lo2cin4bt Acceptance Review (lo2cin4/lo2cin4bt, 288 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains cmux Testing Rules?

disler (a GitHub user) maintains it in disler/learning-cmux-with-agents, which has 115 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on June 29, 2026.

Source: disler/learning-cmux-with-agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.