shell-scripts
Skill0 starsChanged yesterdayMITView on GitHub
Standards for Bash and PowerShell scripts and one-liners: structure, strict error handling, argument parsing, validation, and output streams. Use when writing, refactoring, or reviewing a .sh/.bash or .ps1 script or a terminal one-off.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- travissmithv1/claude-skillstheir own version, first seen Nov 16, 2026
- profdorly/ultimate-dev-skillstheir own version, first seen Nov 8, 2026
- hiromaily/go-crypto-wallettheir own version, first seen Oct 9, 2026
- masonhuemmer/dopstheir own version, first seen Mar 24, 2026
- rundops/dopstheir own version, first seen Mar 24, 2026
Used with
Projects with it also use git-workflow.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- hiromaily/go-crypto-wallet★ 128same name
- masonhuemmer/dops★ 3same name
- rundops/dops★ 3same name
- profdorly/ultimate-dev-skills★ 0same name
- travissmithv1/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-contextSkill
- agent-pluginsSkill
- architecture-decisionsSkill
- brand-identitySkill
- browser-controlSkill
- cross-harnessSkill
- efficient-tool-callsSkill
- git-historySkill
- github-actionsSkill
- gitignore-standardsSkill
- html-reportSkill
- java-developmentSkill
- mermaid-diagramsSkill
- meta-workspaceSkill
- product-designSkill
- project-backlogSkill
- project-setupSkill
- project-upgradeSkill
- python-developmentSkill
- refinement-tribunalSkill
- session-handoffSkill
- software-architectureSkill
- technical-documentationSkill
- test-designSkill
- typescript-developmentSkill
- web-auth-bridgeSkill
- worktree-isolationSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Write shell code in one of two modes, in the language the target system runs.
- Distinctive: line 21
Default to FullScript when the ask is ambiguous.
- Distinctive: line 25
Follow the user's ask or the repository's existing scripts.
- Distinctive: line 34
Do not hard-code paths or configurable values.
- Distinctive: line 35
Keep business logic out of top-level code.
- Very specific: line 38
Write temp files with mktemp or New-TemporaryFile, and remove them on exit.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shell scripts
Write shell code in one of two modes, in the language the target system runs.
Pick the mode
| Mode | Use when | Output |
| OneOff | A one-liner, quick command, ad-hoc check, or terminal snippet | Snippet: Bash 1-5 lines (max 10), PowerShell 1 line (max 5). No file unless asked. |
| FullScript | A script file, reusable CLI tool, or multi-step workflow | One file built from the template |
Default to FullScript when the ask is ambiguous.
Pick the language
- Follow the user's ask or the repository's existing scripts.
- Otherwise use Bash for Linux and macOS targets, and PowerShell 7 for Windows targets. When a script must run on both, write both, or suggest Python instead.
- Bash scripts assume Bash 4+. macOS ships 3.2 at
/bin/bash, so say so when a script uses Bash 4 features.
Rules for both languages
- Validate all inputs before any work. Use guard clauses and keep nesting to three levels.
- Send primary output to stdout. Send logs, status, warnings, and errors to stderr (PowerShell:
Write-Verbose,Write-Information,Write-Error; neverWrite-Hostfor diagnostics). - Fail fast. Never ignore a non-zero exit or swallow an error without a comment saying why it is safe.
- Do not hard-code paths or configurable values. Use parameters or named constants.
- Keep business logic out of top-level code. Top level holds only declarations, setup, and one call to
main(Main). - Give errors enough to act on: what was being done, what failed, and how to fix it.
- In a OneOff that deletes or changes things, show a preview first (
-print,--dry-run,-WhatIf) and leave the destructive form for the user to run. - Write temp files with
mktemporNew-TemporaryFile, and remove them on exit.
FullScript essentials
Bash (bash.md, template template.sh):
#!/usr/bin/env bash, a header comment (description, usage, changelog), thenset -euo pipefail.readonlyconstants,localvariables in functions, integer0/1flags, namedE_*exit codes.die,log_*,usage,parse_args(usinggetoptswith a leading:), andmain, defined last.- Traps for
EXIT(idempotent cleanup),INT(exit 130), andTERM(exit 143).
PowerShell (powershell.md, template template.ps1):
- Comment-based help first (
.SYNOPSIS,.DESCRIPTION,.PARAMETERfor each parameter,.EXAMPLE,.NOTES), then[CmdletBinding()],param(), andSet-StrictMode -Version Latest. - Validation attributes on every parameter. Business logic in documented classes. A
Mainfunction, defined last and invoked once. - Return objects, not formatted text. Use
SupportsShouldProcessfor destructive actions. #regionblocks for Constants, Classes, Helpers, and Main.
Checklist
- Mode and language match the ask.
- FullScript follows the template's section order.
- Bash passes
shellcheckandbash -n. PowerShell passesInvoke-ScriptAnalyzerwhen available. -h/Get-Helpshows usage. Invalid arguments exit with the usage error code.
References
- bash.md: read when writing or reviewing a Bash FullScript.
- powershell.md: read when writing or reviewing a PowerShell FullScript.
- template.sh, template.ps1: copy to start a FullScript.
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.

