Memory files for decisions, bash gotchas, and process lessons. Updated MEMORY.md index and README.md with new scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14 lines
1013 B
Markdown
14 lines
1013 B
Markdown
# Process Lessons
|
|
|
|
## Start reporting/read-only scripts without `set -e`
|
|
|
|
Debugging `set -e` failures in scripts that aggregate data from multiple sources (git repos, file stats, etc.) consumed significant time — the script worked in isolated tests but failed silently on real data. Begin without `-e` and add it only for scripts that perform destructive actions where fail-fast is critical.
|
|
|
|
## Spec-driven testing catches real bugs early
|
|
|
|
The spec → implement → test workflow caught real bugs during development (grep flag parsing, `local` keyword misuse, binary detection false positives). Writing tests that exercise dryrun against spec expectations is an effective pattern for this project.
|
|
|
|
## Use `git diff --numstat` for binary detection instead of `file`
|
|
|
|
The `file` command is unreliable for distinguishing binary from text files (marks shell scripts as "executable"). `git diff --numstat` shows `-` for binary files and is more reliable since git already has its own binary detection heuristics.
|