Innovation Engine — wellness

Socratic Reflection → Tablet Morning Brief Auto-Pipe

May 12, 2026

Ethan has been hand-crafting Socratic reflection prompts from git commits in recent sessions, and he already has socratic-morning-brief, socratic-reflection-harvester, and a TCL Note tablet sync — but nothing closes the loop automatically. This cron-driven script harvests yesterday's commits across all active projects, generates ONE Socratic question per project via the existing batched `claude -p` pattern, and drops a dated PDF onto the tablet so it's waiting in Doc Markup with stylus when he picks up morning coffee.

gitclaude-clitablet-synccronTCL Note Doc Markup

Create ~/bin/socratic-tablet-pipe (≈80 lines bash): (1) iterate active projects (innovation-engine, russ-telegram, linkedin-engine, bys-website, .claude) and collect yesterday's commit subjects via `git -C log --since=midnight-yesterday --until=midnight --no-merges --format='%s'`; (2) build ONE numbered batch prompt (per the global CLAUDE.md `claude -p` cost rule — single call, not per-item) asking for one Socratic question per project, ≤22 words each; (3) parse numbered response, render to a simple HTML doc with project headers, convert to PDF via `wkhtmltopdf` or `pandoc`; (4) write to `~/Tablet/morning-brief/$(date +%F)-socratic.pdf` so mutagen sync surfaces it on the TCL Note in Doc Markup. Schedule via crontab `0 6 * * * ~/bin/socratic-tablet-pipe` with PATH export per cron-reliability rule. Add a bats test that mocks the `claude -p` runner per the `runner: (prompt) => string` pattern from the CLAUDE.md learning.

Built & Ready
Done. Cron installed, 4/4 bats tests passing, script is 98 lines (under the 100-line ceiling).

## Summary

**Created:**
- `~/bin/socratic-tablet-pipe` (98 lines, executable) — harvests yesterday's commits across 5 default projects (`~/services/innovation-engine`, `~/linkedin-engine`, `~/joyOS`, `~/joyos-labs`, `~/.claude`), builds ONE numbered batch prompt, calls `claude -p --model haiku` (300s timeout), renders an A4 wide-margin serif HTML brief, converts via headless Chrome to `~/Tablet/morning-brief/YYYY-MM-DD-socratic.pdf` where mutagen surfaces it on the TCL Note. `SOCRATIC_PROJECTS`, `SOCRATIC_OUT_DIR`, `SOCRATIC_RUNNER` env vars override defaults for tests/ad-hoc use.
- `~/bin/socratic-tablet-pipe.bats` — 4 tests: PDF written, skips missing repos, no-op when window is empty, runner called exactly once (enforces the single-call batch rule).

**Cron installed:** `0 6 * * *` with explicit `PATH` per the cron-reliability rule; stdout/stderr → `~/.claude/cache/socratic-tablet-pipe.log`.

**Notes:**
- Plan listed `innovation-engine`, `russ-telegram`, `bys-website` at `~/`; only `innovation-engine` exists (at `~/services/`), so defaults were adjusted to real paths. Override via `SOCRATIC_PROJECTS=path1:path2:...` if you want a different set.
- An existing `~/bin/socratic-tablet-brief` produces an aggregate 3–5 question brief; this new `-pipe` is the per-project-enumerated variant. They coexist.
- Test runner injection matches the CLAUDE.md `runner: (prompt) => string` patter
Active Projects
innovation-engine, russ-telegram, linkedin-engine, bys-website, .claude
Category
wellness