agentleFS
r3bl-orgr3bl-org/r3bl-open-core/.agents/skills/test-cross-platform/SKILL.md

test-cross-platform

Skill486 starsChanged 15 days agoApache-2.0View on GitHub

Synchronize repository changes to remote test fleet (Linux, macOS, Windows) and execute the full test suite across all platforms concurrently.

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the full test suite across the remote cross-platform fleet (Linux on nazmul-mobile.local, macOS, and Windows) to verify compatibility, …

    line 8
  2. Very specific:

    After modifying cross-platform code, platform-specific #[cfg(...)] gates, or PTY logic.

    line 13
  3. Distinctive:

    Before merging pull requests or finalizing release milestones.

    line 14
  4. Very specific:

    When the user runs /test-cross-platform or asks to test across platforms/fleet.

    line 15
  5. Very specific:

    If you are in ~/github/roc, $FOLDER_NAME is roc.

    line 31
  6. Very specific:

    Ensure the target folder exists on each remote fleet machine, then synchronize the current worktree (always excluding .git and target/ so …

    line 74
  7. Distinctive:

    All sync operations can run in parallel.

    line 94
  8. Very specific:

    Run the full test suite across all three platforms concurrently using non-blocking background tasks (run_command with async tasks, or …

    line 98
  9. Very specific:

    When testing specific subsystems (like core::pty) during active refactoring rather than the entire workspace:

    line 119
  10. Distinctive:

    Wait for all three runs to conclude (via reactive task completion messages).

    line 127
  11. Distinctive:

    If any test fails, extract the failure diagnostics and failing test names for triage.

    line 137

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cross-Platform Fleet Testing

Run the full test suite across the remote cross-platform fleet (Linux on nazmul-mobile.local, macOS, and Windows) to verify compatibility, platform gates, and asynchronous I/O behavior.

When to Use

  • After modifying cross-platform code, platform-specific #[cfg(...)] gates, or PTY logic.
  • Before merging pull requests or finalizing release milestones.
  • When the user runs /test-cross-platform or asks to test across platforms/fleet.

Worktree & Folder Detection

The skill dynamically detects whether you are in the primary repository or a git worktree:

# Fish syntax:
set -l REPO_ROOT (git rev-parse --show-toplevel)
set -l FOLDER_NAME (basename "$REPO_ROOT")

# Bash syntax:
REPO_ROOT=$(git rev-parse --show-toplevel)
FOLDER_NAME=$(basename "$REPO_ROOT")

If you are in ~/github/roc, $FOLDER_NAME is roc. If you are in a worktree such as ~/github/roc-fix-shift-home-lockup, $FOLDER_NAME is roc-fix-shift-home-lockup. Remote fleet machines mirror this folder under their respective repository parent paths.

Worktree Portability & Relative Paths (worktree.useRelativePaths)

Linked git worktrees store administrative pointer files:

  • Inside the worktree: .git (file containing gitdir: <path_to_main_repo>/.git/worktrees/<name>)
  • Inside the main repo: .git/worktrees/<name>/gitdir (file containing <path_to_worktree>/.git)

By default, Git writes absolute paths (/home/nazmul/... on Linux vs /Users/nazmul/... on macOS). If worktrees or their .git files are mirrored across systems with different home directory roots, Git will fail on the remote host with:

fatal: not a git repository: (null)

which causes any tests or tools that invoke git (such as cargo-rustdoc-fmt validation tests in build-infra) to fail.

To prevent this:

  1. Always enable relative worktree paths globally:
    git config --global worktree.useRelativePaths true
    Or explicitly pass --relative when creating a worktree:
    git worktree add --relative ../<worktree_folder> <branch>
  2. To repair existing worktrees with absolute path mismatches:
    cd ~/github/roc
    git config worktree.useRelativePaths true
    git worktree repair
    Git will detect the absolute path mismatch and convert all linked worktrees to relative paths in place.

Fleet Overview

PlatformHost AddressShellRepository PathTest Runner
Linuxnazmul-mobile.localfish~/github/<folder_name>./check.fish --test
macOSnazmul-mac.localfish~/github/<folder_name>./check.fish --test
Windowsnazmul-win.localnu (Nushell)github/<folder_name>cargo test

Workflow

Step 1: Fleet Synchronization

Ensure the target folder exists on each remote fleet machine, then synchronize the current worktree (always excluding .git and target/ so git worktree files and platform binaries are not overwritten):

  1. Linux (nazmul-mobile.local):
    ssh nazmul-mobile.local "mkdir -p ~/github/$FOLDER_NAME"
    rsync -av --delete --exclude='.git' --exclude='target' "$REPO_ROOT/" nazmul-mobile.local:"github/$FOLDER_NAME/"
  2. macOS (nazmul-mac.local):
    ssh nazmul-mac.local "mkdir -p ~/github/$FOLDER_NAME"
    rsync -av --delete --exclude='.git' --exclude='target' "$REPO_ROOT/" nazmul-mac.local:"github/$FOLDER_NAME/"
  3. Windows (nazmul-win.local):
    ssh nazmul-win.local "powershell -NoProfile -Command 'New-Item -ItemType Directory -Force -Path github/$FOLDER_NAME'"
    tar -cz -C "$REPO_ROOT" --exclude=.git --exclude=target . | ssh nazmul-win.local "tar -xz -C github/$FOLDER_NAME"

All sync operations can run in parallel.

Step 2: Concurrent Test Execution

Run the full test suite across all three platforms concurrently using non-blocking background tasks (run_command with async tasks, or delegated via invoke_subagent with TypeName: "self", Model: "inherit") so the active conversation remains responsive:

  1. Linux (nazmul-mobile.local):
    ssh nazmul-mobile.local "cd ~/github/$FOLDER_NAME && ./check.fish --test"
    (Alternatively: ssh nazmul-mobile.local "cd ~/github/$FOLDER_NAME && cargo test")
  2. macOS (nazmul-mac.local):
    ssh nazmul-mac.local "cd ~/github/$FOLDER_NAME && ./check.fish --test"
    (Alternatively: ssh nazmul-mac.local "cd ~/github/$FOLDER_NAME && cargo test")
  3. Windows (nazmul-win.local):
    ssh nazmul-win.local "cd github/$FOLDER_NAME; cargo test"

Step 3: Targeted Subsystem Testing (Optional)

When testing specific subsystems (like core::pty) during active refactoring rather than the entire workspace:

  • Linux: ssh nazmul-mobile.local "cd ~/github/$FOLDER_NAME && cargo test -p r3bl_tui core::pty"
  • macOS: ssh nazmul-mac.local "cd ~/github/$FOLDER_NAME && cargo test -p r3bl_tui core::pty"
  • Windows: ssh nazmul-win.local "cd github/$FOLDER_NAME; cargo test -p r3bl_tui core::pty"

Step 4: Result Aggregation & Reporting

  1. Wait for all three runs to conclude (via reactive task completion messages).
  2. Extract summary lines (test result: ok. <X> passed; <Y> failed; ...).
  3. Present results in a markdown summary table:
PlatformHost / MachineResultTests PassedTests FailedDuration
Linuxnazmul-mobile.localPASSED5300.01s
macOSnazmul-mac.localPASSED5300.02s
Windowsnazmul-win.localPASSED5500.46s
  1. If any test fails, extract the failure diagnostics and failing test names for triage.
  2. Emit attention beep signal:
    fish -c "beep"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.