bsd-portability
Skill1 starsChanged 50 days agoMITView on GitHub
Lint shell scripts, Makefiles, CI workflow run blocks, Dockerfiles, expect scripts, and Nushell external-command calls for GNU-coreutils-only or BSD-only syntax that breaks across the fleet's mixed FreeBSD/NetBSD/OpenBSD/macOS/Linux/Windows/Alpine targets. Trigger phrases: "GNU flag", "portable shell", "works on FreeBSD", "stat -c", "bsd portability lint".
In this repository113 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ac-ideateSkill
- ac-listSkill
- ac-roadmapSkill
- agentbridge-mcpSkill
- almanacSkill
- almquist-shellSkill
- ansible-fleetSkill
- apfsSkill
- apple-siliconSkill
- arena-actorsSkill
- asustor-nasSkill
- a-teamSkill
- atem-miniSkill
- at-tuiSkill
- autoresearchSkill
- babysitSkill
- bonzibuddySkill
- bop-brainstormSkill
- bop-catalogSkill
- bop-onSkill
- bop-teamSkill
- bop-workflowSkill
- code-refactoringSkill
- codex-personasSkill
- context-graphSkill
- councilSkill
- datadog-backupSkill
- dd-tagsSkill
- delegateSkill
- deming-pdsaSkill
- deterministic-replaySkill
- dispatch-nuSkill
- durable-commitSkill
- elixir-gastown-opsSkill
- ergo-ircSkill
- esp32-tang-bridgeSkill
- fleet-evalSkill
- fleet-ircSkill
- freebsd-build-vmSkill
- freebsd-piSkill
- freebsdSkill
- ganttSkill
- gastown-opsSkill
- gastown-slingSkill
- gh-authSkill
- gitea-releaseSkill
- gitea-runnerSkill
- henshuSkill
- irclaw-cluster-opsSkill
- irclaw-research-teamSkill
- irc-taskSkill
- jail-factorySkill
- jjSkill
- jobcard-systemSkill
- kubernetesSkill
- leptosSkill
- loreSkill
- lower-bound-reviewSkill
- macvlan-netSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Before merging any script destined to run on more than one fleet OS.
- Very specific: line 68
Never add a || true / 2>/dev/null catch-all that converts a missing-flag error into a silently wrong result — several fleet incidents …
- Very specific: line 78
Run with nu tests/lint-test.nu from the skill directory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
bsd-portability
Fleet runtime environments in play: FreeBSD 15 (Pis, VMs, build host), NetBSD 10/11 (Pis, VMs), OpenBSD 7.8 (Pi 5 target), macOS (studio, laptops), Ubuntu 20.04/22.04/24.04 Pis, Pop!_OS workstations, Windows (2 hosts), GitHub ubuntu-latest and macos-latest runners, Alpine/busybox in some QEMU agent specs, and Docker images in vibecode-webgui/fleet-ops.
A shell idiom that "just works" on the author's dev machine (usually macOS or an Ubuntu Pi) routinely fails silently or loudly on one of the other seven runtime families. This skill's job is to catch that class of bug via static lint before it ships.
When to use this
- Reviewing or writing any
*.sh,Makefile*, GitHub Actions / Gitea Actionsrun:block,Dockerfile,*.exp(expect script), or Nushell script that shells out via^cmd. - Someone says "works on FreeBSD", "portable shell", "GNU flag", "stat -c", "bsd portability lint", or reports a script that behaves differently on a BSD host than on Linux/macOS.
- Before merging any script destined to run on more than one fleet OS.
How to use it
nu ~/.claude/skills/bsd-portability/lint.nu <path> [--json] [--fix-suggestions]<path>— file or directory to scan. Directories are scanned recursively for*.sh,Makefile*,*.yml/*.yaml(workflow run blocks only),Dockerfile*,*.exp, and*.nu(only^cmdexternal-call lines).--json— machine-readable output (default; JSON is always emitted, this flag is accepted for explicitness/back-compat).--fix-suggestions— include thefixfield in each finding (on by default; findings always carryfix, this flag is a no-op kept for CLI ergonomics).- Exit code:
1if any findings,0if clean. Output schema:{"schema_version": "v1", "path": ..., "findings": [...], "count": N}. Each finding:{file, line, rule, snippet, fix}.
Ground truth, not vibes
This lint encodes ~20 known GNU-vs-BSD/uutils divergences (see lint.nu's
rules table for the authoritative, versioned list: sed -i, mktemp
templates, stat -c/-f, date -d, realpath -m, timeout, nproc, sha256sum,
cp --reflink, bash shebang, grep -P, find -printf, GNU tar long opts, du/df
flag divergence, env -u, which, sha256 -q, and the Nushell external-redirect
footgun). Each rule carries a message explaining why it breaks and on
which OS family, plus a concrete fix. Do not hand-wave "this might not
be portable" — run the lint and cite the specific rule id.
Fleet-specific fixes preferred, in order
- Nushell builtin (
hash sha256,date,path expand,sys cpu | length,lspipelines) — already the house standard for new scripts, works identically on every target OS with zero forking. - Explicit OS branch (
if $nu.os-info.name == "macos" { ... }) when a builtin doesn't cover the case. - POSIX-portable external command as a last resort, only when both GNU and BSD accept the exact same invocation.
Never add a || true / 2>/dev/null catch-all that converts a missing-flag
error into a silently wrong result — several fleet incidents (smolBSD git,
zam dd/apt-get/zellij, brap/bsd openssl) trace back to exactly that pattern
combined with the Nushell external-redirect footgun (^cmd ... 2>/dev/null
being passed as a literal argv token instead of a real redirect).
Files
lint.nu— the scanner.def main [path: string, --json, --fix-suggestions].tests/lint-test.nu— fixture-based positive/negative test for every rule. Run withnu tests/lint-test.nufrom the skill directory.
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
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.

