Skip to main content
Search first. Put any script in a real file with a real extension. Inlined logic in a YAML run: step, a Markdown copy-paste block, or a heredoc smuggling a Bash loop is the worst of every world. No test or lint covers it, and nobody can find it. The rules below apply to every repo across the org.

Iron law

Scripts must live in .sh, .py, .ts, .js, .rb, or .pl files under one of:
  • scripts/
  • .github/scripts/
  • .claude/hooks/
  • tests/
  • plugins/<name>/hooks/
Never inlined elsewhere.

Banned in non-script files

  • YAML run: with control flow (if, for, while, case) or 4+ lines
  • Multi-line Bash control flow in a single command
  • Heredocs carrying logic (bash <<EOF, python <<EOF, generated commit bodies)
  • Inline interpreters: python -c, node -e, perl -e, ruby -e, multi-line bash -c
  • Markdown copy-paste-execute blocks with logic

Allowed

  • Single-line pipelines (|, &&, xargs)
  • 1–3 line YAML run: without control flow
  • One-line heredocs feeding static prose
Before writing any new script, search every tier. Log one line per tier (<tier>: <tool> — found / not-found, reason). Empty rows reject the search.
  1. Native features and builtins (jq, gh, git, curl, and features of software already in use)
  2. Ecosystem primitives (Ansible modules, OpenTofu resources, marketplace Actions, pre-commit)
  3. Maintained third-party tools (Homebrew, apt, pip, npm, cargo)
  4. Maintained projects to fork (GitHub projects, official plugins, awesome-* lists)
Hook blocks are terminal denials. Do not route around them by moving the logic to a different non-script file.

Worked examples

Pull request behavior follows PR conventions.

Multi-line Bash control flow

Wrong:
Right:

Heredoc smuggling logic

Wrong: git commit -m "$(cat <<'EOF' ... $(if ...) ... EOF)" Right: git commit -m "feat: standard release" (generate the body in a script file if it needs computation)

Inline interpreters

Wrong: python -c "import json; print(json.load(open('x.json'))['key'])" Right: jq -r .key x.json

What this connects to

Commit conventions

How commit and PR shapes interact with release-please.

CI/CD policy

Marketplace actions and reusable workflows that replace most ad-hoc scripts.

OpenTofu check placement

The canonical example of the four-tier search applied to a real domain.