New: gotchas-skills.md (non-ASCII frontmatter, per-profile skill dirs). Updated: gotchas-bash.md (+((var++)) with zero), decisions.md (+python3 for JSON), process-lessons.md (+cat -A diagnostic). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
1.3 KiB
Markdown
18 lines
1.3 KiB
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 `cat -A` to diagnose invisible character issues
|
|
|
|
When a file looks correct but tooling rejects it, `cat -A` reveals non-printing characters (e.g., `M-bM-^@M-^T` for em dashes that appear identical to regular dashes). Essential for debugging YAML frontmatter, config files, and any context where encoding matters.
|
|
|
|
## 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.
|