automationlisted
Install: claude install-skill alex-macra/ai-skills-assembly
# Automation
Manual steps are a bug. Anything done more than twice - install, build, test, deploy, backup, restore - gets a script. Anything done on a schedule gets a job runner.
## Principles
- **Idempotent.** Running the script twice should produce the same outcome as running it once.
- **Fail loud.** `set -euo pipefail` in bash; exit non-zero on any unhandled error; never `|| true` to swallow failures.
- **Reproducible from a clean checkout.** No "you also need to install X manually" - that goes in the script.
- **One thing per script.** `build.sh`, `test.sh`, `deploy.sh`. A 600-line `do-everything.sh` is a footgun.
- **Inputs via flags or env, outputs to stdout, errors to stderr.** The Unix way composes; a script that writes to random paths doesn't.
## CI/CD (GitHub Actions)
### Structure
- One workflow per concern: `ci.yml` (build + test), `deploy.yml` (release), `nightly.yml` (slow checks).
- Trigger on `pull_request` and `push` to main; avoid `workflow_dispatch`-only critical jobs.
- Reuse via `workflow_call` or composite actions when ≥2 workflows share steps.
### Performance
- Cache `node_modules` / `.venv` / build artifacts keyed by lockfile hash. Stale caches lie - invalidate aggressively when lockfile changes.
- Matrix only when the matrix is meaningful (multiple OS, multiple runtime versions). Don't matrix `[true, false]` flags.
- Parallel jobs > sequential steps. CI charges per-minute on the wall-clock of the longest job, not the sum.
### Secrets
- Use the