Add composable multi-language linting and formatting system

PostToolUse hook auto-formats files after Edit/Write/MultiEdit with
git-blob checkpoints for safe revert. Pre-commit hook for staged files.
Canonical formatter scripts for py, sh, ts, sql, json (+ symlinks for
js, yaml, md). Install and setup scripts for project opt-in.

Includes best-practices/linting.md, HOOKS.md docs, README.md, and
session log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-03-13 11:50:36 +13:00
parent a463dc0793
commit d3a92326de
18 changed files with 700 additions and 5 deletions

10
TODO.md
View File

@@ -2,9 +2,9 @@
Prioritised by impact and effort. Each item references its detailed topic file in `improvements/`.
## 1. Configure PostToolUse auto-formatting hook
**Impact: High | Effort: Low**
Auto-format code after every Edit/Write. Removes all formatting rules from CLAUDE.md, saves tokens, and guarantees consistent output. Start with `shfmt` for shell and expand.
## 1. ~~Configure PostToolUse auto-formatting hook~~ → DONE
**Impact: High | Effort: Low**
Composable multi-language linting system implemented. Canonical formatters in `formatters/` (py, sh, ts, sql, json + symlinks for js, yaml, md). PostToolUse dispatcher hook with checkpoint/revert. Pre-commit hook. Setup scripts. `/linter` skill for auditing.
See: [hooks-and-automation.md](improvements/hooks-and-automation.md)
## 2. ~~Create global `~/.claude/CLAUDE.md`~~ → DONE (parent symlink)
@@ -61,3 +61,7 @@ See: [planning-and-workflow.md](improvements/planning-and-workflow.md)
- **Parent CLAUDE.md symlink** — `~/dev/claude/CLAUDE.md` → claude-foundations, all projects inherit automatically.
- **PreCompact transcript backup hook** — `~/.claude/hooks/pre-compact-backup.sh` with auto+manual matchers.
- **claude-foundations Gitea repo** — Created under skynet org, pushed.
## Completed (2026-03-13)
- **PostToolUse auto-formatting hook** — Composable multi-language linting system: 5 formatter scripts + 3 symlinks, PostToolUse dispatcher with git-blob checkpoints, pre-commit hook, setup scripts, `/linter` skill, `best-practices/linting.md`.