agentleFS
ukorvlukorvl/web-of-flaws/.github/scripts/AGENTS.md

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.

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
  1. Very specific:

    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 …

    line 9
  2. Very specific:

    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 …

    line 10
  3. Very specific:

    When you change a script in .github/scripts/, also update its Bats test to cover the new behavior.

    line 11
  4. Distinctive:

    When you create/edit tests for a script, ensure that they are essential and cover all the important scenarios.

    line 12
  5. Distinctive:

    Test meaningful boundary and failure cases, especially missing required inputs, empty results, malformed data, and unsafe input handling.

    line 13
  6. Very specific:

    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.

    line 14
  7. Distinctive:

    Use descriptive kebab-case filenames.

    line 16
  8. Distinctive:

    Prefer [[ ... ]] over [ ...

    line 19
  9. Distinctive:

    Use "${array[@]}" when passing array arguments.

    line 20
  10. Distinctive:

    Never execute arbitrary input as shell code.

    line 21
  11. Distinctive:

    Treat environment variables, filenames, branch names, PR metadata, and GitHub context as untrusted input.

    line 22
  12. Distinctive:

    Never silently ignore command failures.

    line 24
  13. Distinctive:

    Keep output concise but easily understandable by humans.

    line 25
  14. Distinctive:

    Prefer resolving repository root explicitly instead of assuming $PWD.

    line 26
  15. Distinctive:

    Use functions for meaningful logical units.

    line 27
  16. Distinctive:

    Keep main/top-level execution easy to read.

    line 28
  17. Distinctive:

    Prefer early exits over deeply nested conditionals.

    line 29
  18. Distinctive:

    Avoid dynamic imports from repository-controlled paths.

    line 30
  19. Distinctive:

    Keep scripts independently runnable locally where practical.

    line 31
  20. Distinctive:

    Keep scripts small; split them when responsibilities diverge.

    line 34
  21. Distinctive:

    Prefer read-only behavior by default.

    line 36
  22. Distinctive:

    Every script should be deterministic, testable, fail-safe, and locally reproducible.

    line 37
  23. Distinctive:

    Never interpolate untrusted ${{ ...

    line 38
  24. Distinctive:

    Never build shell commands by string concatenation.

    line 39
  25. Very specific:

    Use mktemp for temporary files/directories and clean them with trap.

    line 40
  26. Very specific:

    Use -- before path or untrusted positional arguments where supported.

    line 41
  27. Very specific:

    Avoid for x in $(command) and parsing ls.

    line 42
  28. Very specific:

    Prefer while IFS= read -r or arrays for command output.

    line 43

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 pipefail at 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 mktemp for temporary files/directories and clean them with trap.
  • Use -- before path or untrusted positional arguments where supported.
  • Avoid for x in $(command) and parsing ls.
  • Prefer while IFS= read -r or arrays for command output.

Required Checks

shellcheck .github/scripts/*.sh
bats .github/scripts/tests

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.