# AGENTS.md — Bash

Drop this in your repository root and symlink CLAUDE.md to it:

    ln -s AGENTS.md CLAUDE.md

Then delete every line that is not true of YOUR repository, and add the
corrections you have had to make to an agent twice. Under 100 lines is the
target — every line competes for attention with every other line.

From Bash at https://learn-bash.net/ai/ — free to use, MIT.

---

Bash 5. All scripts live in scripts/ and are checked by shellcheck.

## Every script starts with this
    #!/usr/bin/env bash
    set -Eeuo pipefail
    IFS=$'\n\t'
    trap 'echo "failed at line $LINENO: $BASH_COMMAND" >&2' ERR

## Commands
- Lint:   `shellcheck -S warning scripts/*.sh`
- Format: `shfmt -w -i 2 -ci -bn scripts/`
- Test:   `bats test/`

## Conventions
- Quote every expansion. "$var", "${arr[@]}", "$(cmd)".
- Use `--` before user-controlled arguments: `rm -- "$f"`.
- Never parse the output of ls. Glob instead, and handle the no-match case.
- jq for JSON. Never sed or grep on JSON.
- Destructive operations need an explicit flag (--i-mean-it) or a dry run.
- cd with a check: verify a marker file exists before doing anything.
- Over ~100 lines, or the moment you need real data structures: rewrite it
  in Python or Go.

## Never
rm -rf on an unvalidated variable. curl | sh. eval on anything interpolated.
