portable-shell
Skill2 starsChanged 10 days agoMITView on GitHub
Use for shell portability across bash, zsh, Linux, and macOS, especially globbing, word splitting, shebangs, or GNU/BSD option differences.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- capability-incident-diagnoserSkill
- context-managementSkill
- goal-workflowSkill
- host-cli-usageSkill
- tool-useSkill
- fast-checksSkill
- filesystem-wizardSkill
- lean-codeSkill
- test-freshnessSkill
- security-boundary-reviewSkill
- process-debuggingSkill
- brokered-git-operatorSkill
- finalize-loopSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Create temporary paths securely, quote cleanup, and remove only paths the invocation owns.
- Distinctive: line 36
Use available shell checks and exercise the affected behavior on reachable targets.
≈ “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
Preserve shell and userland semantics
Establish the target shell and installed utilities where they affect the
command. The login shell, script interpreter, and userland can differ.
macOS can run GNU utilities; Linux can use BusyBox. Do not infer the executable
from the OS or a rejected --version.
Failure-prone differences
- zsh does not split unquoted
$varlike bash, and an unmatched glob normally errors. Use explicit arguments or arrays; quote patterns intended for tools. - zsh can expand a word starting with
=as a command path. Quote literal separators such as'==='. /bin/bashis not universal; macOS's system bash is 3.2. An environment shebang still needs a suitable interpreter inPATH. Avoid associative arrays,mapfile, and${var,,}on that older target.set -eis context-sensitive, not universal failure handling. Handle expected nonzero statuses explicitly and preserve pipeline failures where supported. Do not add strict-mode flags without checking the script's control flow and target shell.- Preserve arbitrary filenames with NUL-delimited processing or
find ... -exec ... {} +; never parsels. Quote expansions and protect leading-dash operands using the command's supported syntax. - Create temporary paths securely, quote cleanup, and remove only paths the invocation owns. Replacing a file can change permissions, links, or metadata.
For sed -i, dates, stat, canonical paths, xargs, checksums, and timeouts,
consult references/gnu-bsd.md for the relevant
difference rather than loading every platform recipe.
Use available shell checks and exercise the affected behavior on reachable targets. Name the tested shell/userland and any untested target; one Linux run does not prove macOS compatibility.
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.

