swift-buildlisted
Install: claude install-skill spikelab/multiplai-cc-mktplace
# Swift Build Skill
Build and test Swift/iOS/macOS projects transparently, whether running on macOS directly or inside a Docker container that SSHes to a macOS host.
## How It Works
All commands go through a single script: `${CLAUDE_PLUGIN_ROOT}/skills/swift-build/scripts/swift-host.sh`
The script handles environment detection, project detection, and output formatting. You call it; it figures out the rest.
### --package-path Flag
Use `--package-path <dir>` to target a Swift package in a different directory without `cd`:
```bash
# From any directory — works in containers without gateway cd issues
${CLAUDE_PLUGIN_ROOT}/skills/swift-build/scripts/swift-host.sh --package-path /path/to/ios build
${CLAUDE_PLUGIN_ROOT}/skills/swift-build/scripts/swift-host.sh --package-path /path/to/ios test
${CLAUDE_PLUGIN_ROOT}/skills/swift-build/scripts/swift-host.sh --package-path /path/to/ios test --filter MyTests
```
This is the **preferred approach in containers** — it uses `swift build --package-path` / `swift test --package-path` over SSH, which matches the gateway allowlist directly (no `cd` pattern needed).
## Environment Detection
The script detects where it's running:
| Environment | Detected by | Behavior |
|-------------|-------------|----------|
| Local macOS | `uname -s` = `Darwin` | Commands run directly — no SSH config needed |
| Container | `MULTIPLAI_CONTAINER=1` (set by the multiplai container image) or `/.dockerenv` | Commands SSH to the macOS host bridge |
| Plain