Add formatters, hooks, memory entries and context-load improvements

- formatters/js, md, yaml: new/updated formatter scripts
- hooks/set-wezterm-profile.sh: new hook for WezTerm profile switching
- scripts/context-load: improvements from recent sessions
- HOOKS.md, MEMORY.md: updated documentation and index entries
- memory/log, memory/reference-infrastructure-docs.md: session logs and reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-03-19 10:54:49 +13:00
parent 9d747199fc
commit c3557a3d97
9 changed files with 200 additions and 3 deletions

View File

@@ -1 +0,0 @@
ts

25
formatters/js Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Formatter: TypeScript/JavaScript — biome format + biome check
# Contract: $1 = absolute file path, format in place, lint, exit 0 if clean / 1 if errors
# Missing tools: exit 0 silently
FILE="$1"
[ -z "$FILE" ] && exit 0
[ -f "$FILE" ] || exit 0
command -v biome >/dev/null 2>&1 || exit 0
# Format in place
biome format --write "$FILE" 2>/dev/null
# Auto-fix what we can
biome check --fix "$FILE" 2>/dev/null
# Final lint pass — remaining errors go to stderr
ERRORS=$(biome check "$FILE" 2>&1)
if [ $? -ne 0 ]; then
echo "$ERRORS" >&2
exit 1
fi
exit 0

View File

@@ -1 +0,0 @@
json

19
formatters/md Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Formatter: JSON/YAML/Markdown — prettier
# Contract: $1 = absolute file path, format in place, lint, exit 0 if clean / 1 if errors
# Missing tools: exit 0 silently
FILE="$1"
[ -z "$FILE" ] && exit 0
[ -f "$FILE" ] || exit 0
command -v prettier >/dev/null 2>&1 || exit 0
# Format in place (prettier auto-detects parser from extension)
ERRORS=$(prettier --write "$FILE" 2>&1)
if [ $? -ne 0 ]; then
echo "$ERRORS" >&2
exit 1
fi
exit 0

View File

@@ -1 +0,0 @@
json

19
formatters/yaml Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Formatter: JSON/YAML/Markdown — prettier
# Contract: $1 = absolute file path, format in place, lint, exit 0 if clean / 1 if errors
# Missing tools: exit 0 silently
FILE="$1"
[ -z "$FILE" ] && exit 0
[ -f "$FILE" ] || exit 0
command -v prettier >/dev/null 2>&1 || exit 0
# Format in place (prettier auto-detects parser from extension)
ERRORS=$(prettier --write "$FILE" 2>&1)
if [ $? -ne 0 ]; then
echo "$ERRORS" >&2
exit 1
fi
exit 0