shell-traps
Skill2 starsChanged 18 days agoMITView on GitHub
Use when writing or debugging shell scripts, pipelines, or compound command chains - verified traps a strong model misses, each of which exits 0 or silently matches nothing while the script looks fine.
In this repository40 other files it gives its agents.
- android-debloatSkill
- arch-linux-cachyosSkill
- beansSkill
- chezmoi-workflowsSkill
- coding-rulesSkill
- communicationSkill
- context7Skill
- docker-compose-setupSkill
- domain-modelingSkill
- audioSkill
- deploymentSkill
- ecsSkill
- game-loopSkill
- inputSkill
- physicsSkill
- renderingSkill
- resourcesSkill
- ebitenSkill
- ebook-convertSkill
- email-inbox-triageSkill
- gitSkill
- go-browser-testsSkill
- go-devSkill
- go-htmx-frontendSkill
- go-setupSkill
- go-testsSkill
- grillingSkill
- interactive-browser-testingSkill
- keep-on-goingSkill
- mcpcSkill
- obsidian-vault-triageSkill
- pixellabSkill
- playwright-mcpSkill
- port-parity-testingSkill
- public-repo-maturitySkill
- researchSkill
- retroSkill
- shell-startup-filesSkill
- skill-craftSkill
- web-admin-uiSkill
The file
Files
Shell traps
Each trap below was verified live: the script exits 0 or prints nothing while doing the wrong thing.
awkis byte-based under mawk: emoji regexes silently match zero lines. Pre-filter withgrepor move the step topython3.grep "$pattern"with a dash-prefixed variable swallows the pattern as flags. Pass--before the pattern.PIPESTATUSis consumed by each assignment: capture all codes in one array assignment, not one variable per read.- Emoji variation selectors break
=~matching. Usegrep -qF -ewith a list of exact strings instead. makeandjustpre-parse recipe lines: heredocs and backslash continuations inside a recipe corrupt before the shell runs. Pipe throughprintfor call a script file, and runjust --listafter renaming recipes.- Bare
timeouton a script returns 126: pass the interpreter (timeout 10 python3 script.py). sed -iwith a pattern that matches nothing exits 0 and changes nothing. Write patterns against actual file content, then grep-assert the landed token.git mvflatten-plus-overwrite keeps the OLD index content: after moving onto an existing path, diff the index, not the worktree.- Multi-line commit messages go through a file (
git commit -F), never-mwith escaped newlines; same forgh --body. pkill -fmatches the probe's own command line. Bracket one character (pkill -f "[s]erver") to exclude the probe.- Importing a script runs its module-level code: write every input file the consumer reads before launching it, not after.
- Tilde never expands after
=; write$HOMEin assignments. - Hyphenated python package directories fail import with no hint: import errors from a hyphenated dir are a directory-name bug.
- Sourced env files set nothing exported: run
set -abefore sourcing (orexportafter) or downstream processes see nothing. - A casual
git stashinside a compound chain relocates untracked work mid-chain; stash by name and inspectstash showbefore popping.
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.

