Steve Yegge
1bb61c5ffe
refactor: Break up 275-line runCook into focused helpers (bd-8zbo)
Extracted 5 helper functions from the monolithic runCook function:
- parseCookFlags: Parse and validate command-line flags (~40 lines)
- loadAndResolveFormula: Parse, resolve, apply transformations (~60 lines)
- outputCookDryRun: Display dry-run preview (~60 lines)
- outputCookEphemeral: Output resolved formula as JSON (~30 lines)
- persistCookFormula: Create proto bead in database (~45 lines)
Main runCook function reduced from ~275 to ~65 lines with clear flow:
1. Parse flags → 2. Validate store → 3. Load formula
4. Extract metadata → 5. Handle mode (dry-run/ephemeral/persist)
Benefits:
- Each helper is single-responsibility and testable
- Added cookFlags struct for type-safe flag passing
- Error handling uses proper error returns instead of os.Exit
- Clear separation of concerns
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:37:30 -08:00
..
2025-12-28 10:05:16 -08:00
2025-12-23 22:40:16 -08:00
2025-12-27 22:33:05 -08:00
2025-12-24 00:06:41 -08:00
2025-12-23 04:16:26 -08:00
2025-12-28 10:06:08 -08:00
2025-12-27 16:21:08 -08:00
2025-12-27 16:21:08 -08:00
2025-12-28 01:56:53 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 16:23:45 -08:00
2025-12-22 21:15:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-23 01:56:19 -08:00
2025-12-28 13:52:21 -08:00
2025-12-24 00:08:10 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 00:06:41 -08:00
2025-12-25 18:40:15 -08:00
2025-12-28 16:37:30 -08:00
2025-12-23 12:06:42 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 16:34:24 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 02:11:13 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 00:06:41 -08:00
2025-12-22 21:30:57 -08:00
2025-12-28 16:34:24 -08:00
2025-12-24 00:06:41 -08:00
2025-12-27 16:02:15 -08:00
2025-12-24 12:43:18 -08:00
2025-12-27 16:02:15 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 13:52:21 -08:00
2025-12-27 16:02:15 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 13:03:27 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-23 01:56:19 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:59:02 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-25 13:56:19 -08:00
2025-12-24 00:07:52 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-23 01:56:19 -08:00
2025-12-22 21:15:41 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-24 00:06:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-22 21:15:41 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-23 01:56:19 -08:00
2025-12-28 10:05:16 -08:00
2025-12-22 23:30:08 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 02:11:13 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-23 03:57:08 -08:00
2025-12-28 02:11:13 -08:00
2025-12-28 16:34:24 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 17:23:45 -08:00
2025-12-27 17:23:45 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 21:33:01 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 13:52:21 -08:00
2025-12-27 22:24:19 -08:00
2025-12-27 22:24:19 -08:00
2025-12-27 16:21:08 -08:00
2025-12-27 16:02:15 -08:00
2025-12-24 00:06:41 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-22 21:30:57 -08:00
2025-12-24 00:10:14 -08:00
2025-12-24 00:10:14 -08:00
2025-12-25 12:05:46 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 16:34:24 -08:00
2025-12-28 10:05:16 -08:00
2025-12-24 23:33:34 -08:00
2025-12-28 10:05:16 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:08:34 -08:00
2025-12-27 16:02:15 -08:00
2025-12-27 16:02:15 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 10:59:02 -08:00
2025-12-27 21:27:44 -08:00
2025-12-28 10:05:16 -08:00
2025-12-28 01:07:38 -08:00
2025-12-27 16:02:15 -08:00