web-of-flaws / scripts
AGENTS.md8 starsChanged 3 months agoMITView on GitHub
This directory contains Bash helper scripts that are used by GitHub Actions workflows. These scripts are intended to encapsulate logic that is too complex for a single workflow step, or that is reused across multiple workflows.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- catalog/AGENTS.mdAGENTS.md
- .github/actions/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- guides/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
28 rules. About 0 are common, 20 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
If a workflow needs to run a bash script that is not a "one-liner" command, put the script in .github/scripts/ and call it from the …
- Very specific: line 10
When you put a script in .github/scripts/, also add a Bats test in .github/scripts/tests/ to verify that the script runs without syntax …
- Very specific: line 11
When you change a script in .github/scripts/, also update its Bats test to cover the new behavior.
- Distinctive: line 12
When you create/edit tests for a script, ensure that they are essential and cover all the important scenarios.
- Distinctive: line 13
Test meaningful boundary and failure cases, especially missing required inputs, empty results, malformed data, and unsafe input handling.
- Very specific: line 14
Use set -euo pipefail at the top of every bash script to ensure that errors are not ignored and that the script exits on failure.
- Distinctive: line 16
Use descriptive kebab-case filenames.
- Distinctive: line 19
Prefer [[ ... ]] over [ ...
- Distinctive: line 20
Use "${array[@]}" when passing array arguments.
- Distinctive: line 21
Never execute arbitrary input as shell code.
- Distinctive: line 22
Treat environment variables, filenames, branch names, PR metadata, and GitHub context as untrusted input.
- Distinctive: line 24
Never silently ignore command failures.
- Distinctive: line 25
Keep output concise but easily understandable by humans.
- Distinctive: line 26
Prefer resolving repository root explicitly instead of assuming $PWD.
- Distinctive: line 27
Use functions for meaningful logical units.
- Distinctive: line 28
Keep main/top-level execution easy to read.
- Distinctive: line 29
Prefer early exits over deeply nested conditionals.
- Distinctive: line 30
Avoid dynamic imports from repository-controlled paths.
- Distinctive: line 31
Keep scripts independently runnable locally where practical.
- Distinctive: line 34
Keep scripts small; split them when responsibilities diverge.
- Distinctive: line 36
Prefer read-only behavior by default.
- Distinctive: line 37
Every script should be deterministic, testable, fail-safe, and locally reproducible.
- Distinctive: line 38
Never interpolate untrusted ${{ ...
- Distinctive: line 39
Never build shell commands by string concatenation.
- Very specific: line 40
Use mktemp for temporary files/directories and clean them with trap.
- Very specific: line 41
Use -- before path or untrusted positional arguments where supported.
- Very specific: line 42
Avoid for x in $(command) and parsing ls.
- Very specific: line 43
Prefer while IFS= read -r or arrays for command output.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Bash Helper Scripts Guidelines
Scope
This directory contains Bash helper scripts that are used by GitHub Actions workflows. These scripts are intended to encapsulate logic that is too complex for a single workflow step, or that is reused across multiple workflows.
Bash Scripts Coding Rules
- If a workflow needs to run a bash script that is not a "one-liner" command, put the script in
.github/scripts/and call it from the workflow. - When you put a script in
.github/scripts/, also add a Bats test in.github/scripts/tests/to verify that the script runs without syntax errors and returns expected exit codes. - When you change a script in
.github/scripts/, also update its Bats test to cover the new behavior. - When you create/edit tests for a script, ensure that they are essential and cover all the important scenarios. Do not add tests that only follow the script's internal implementation details. Test various inputs, outputs, and error conditions.
- Test meaningful boundary and failure cases, especially missing required inputs, empty results, malformed data, and unsafe input handling.
- Use
set -euo pipefailat the top of every bash script to ensure that errors are not ignored and that the script exits on failure. - One script = one responsibility.
- Use descriptive kebab-case filenames.
- Bash scripts must start with #!/usr/bin/env bash.
- Quote all variable expansions unless intentional splitting is required.
- Prefer [[ ... ]] over [ ... ] in Bash.
- Use "${array[@]}" when passing array arguments.
- Never execute arbitrary input as shell code.
- Treat environment variables, filenames, branch names, PR metadata, and GitHub context as untrusted input.
- Scripts should not install their own runtimes unless installation is their explicit responsibility.
- Never silently ignore command failures. If failure is intentionally ignored, document why.
- Keep output concise but easily understandable by humans.
- Prefer resolving repository root explicitly instead of assuming $PWD.
- Use functions for meaningful logical units.
- Keep main/top-level execution easy to read.
- Prefer early exits over deeply nested conditionals.
- Avoid dynamic imports from repository-controlled paths.
- Keep scripts independently runnable locally where practical.
- Required variables must fail immediately when missing.
- Script behavior must not differ between local and CI without explicit reason.
- Keep scripts small; split them when responsibilities diverge.
- A script must never broaden workflow permissions.
- Prefer read-only behavior by default.
- Every script should be deterministic, testable, fail-safe, and locally reproducible.
- Never interpolate untrusted ${{ ... }} directly into shell code.
- Never build shell commands by string concatenation.
- Use
mktempfor temporary files/directories and clean them withtrap. - Use
--before path or untrusted positional arguments where supported. - Avoid
for x in $(command)and parsingls. - Prefer
while IFS= read -ror arrays for command output.
Required Checks
shellcheck .github/scripts/*.sh
bats .github/scripts/testsDoes 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.

