Compression Session
ForgeKit · June 18, 2026 · ForgeKit · Infrastructure
No features shipped. The engine got smarter. Session compiler, trends generator, Armory index, quick-ref summaries, core principle named. Every future session is cheaper because of this one.
Chapter 1
Session Compiler
JSON → HTML build-log pipeline
Chapter 2
Token Refactors
Quick-refs · Armory index · Trends generator
Chapter 3
Core Principle
Named · encoded · shipped to the website
Chapter 1
Session Compiler — JSON to HTML
What Shipped
scripts/build-session.mjs
- Takes sessions/<slug>.json, outputs public/build-log/<slug>.html
- Auto-prepends card to app/build-log/page.tsx sessions array
- npm run build:session sessions/<slug>.json
sessions/armory-showup-2026-06-18.json
- First session data file — defines the schema
- Chapters with shipped / spins / wins arrays
- Rules, quote, nextItems, stats, timeline
- ~50 lines of data → 448 lines of HTML
Token savings
- Old: read 1,100-line HTML template + write 300 lines of markup
- New: write 50–80 lines of JSON data only
- ~10x reduction in output tokens per retro
- No template read required — schema is the contract
What Worked Well
📉
Data-driven generation eliminates the template read
The biggest token cost wasn't writing the HTML — it was reading the existing HTML to understand the format. The JSON schema makes the format implicit. I never need to read a prior session page again to write a new one.
Chapter 2
Token Refactors — Three High-ROI Cuts
What Shipped
build-playbook.md — QUICK REF table
- 14-row summary table added at line 1
- ~50x token reduction for the common case
- Full detail still below for debugging reference
reusable-patterns.md — QUICK REF table
- 23-row pattern index added at line 1
- All confirmed patterns scannable in one read
- ~9x reduction vs reading all pattern entries
docs/armory/armory-index.json
- All 18 Armory files summarized in one 3k JSON
- 62k → 3k for the lookup case
- Individual files pulled only when working on that module/pack
scripts/build-trends.mjs
- Reads all sessions/*.json, writes trends/page.tsx
- Derives totals, spin categories, and observations automatically
- npm run build:trends — run after every new session file
build-playbook.md retro format — archived
- Old markdown retro template replaced with pointer to JSON schema
- No more conflicting instructions between the playbook and actual workflow
Where We Spun
TypeScript errors in generated trends page
build-trends.mjs generated TSX with untyped array callbacks. tsc --noEmit caught 9 errors at deploy time. Root cause: empty spinCategories array inferred as undefined[] instead of SpinCategory[].
Emit explicit type annotations on array declarations in the generator. Empty arrays need the type: const x: SpinCategory[] = [] — not const x = [].
What Worked Well
🔍
npx tsc --noEmit before deploying caught the generator bug
The type errors only existed in generated code — nothing in the editor would have flagged them. Running tsc as a pre-deploy check is what caught it. This is now in the playbook.
📊
Measuring before refactoring
Ran PowerShell to count chars across all the files before deciding what to refactor. build-playbook.md at 15k and reusable-patterns.md at 14k were the clear winners. The Armory at 62k total was the biggest single cut. Numbers first, decisions second.
Chapter 3
Core Principle — Named and Encoded
What Shipped
The principle
- "Every session makes the engine smarter."
- "Build something. Compress what you learned. The next session starts ahead of where this one did."
- Named as a belief, not a process step
HOW_TO_WORK_WITH_ZEB.md
- Core Principle section added above the ForgeKit Method
- ForgeKit Method updated to 6 steps — Compress added as step 4
- Principle noted as one that shapes over time
CLAUDE.md
- Core Principle added with operational checklist
- Harvest prompt updated to reference quick-ref tables
- Retro workflow: JSON → build:session → build:trends → update quick-refs
forgekit-website/app/about/page.tsx
- Forge Loop updated from 5 to 6 steps
- 'Improve it' replaced with 'Compress it' + 'Reuse it'
- Grid fixed from md:grid-cols-5 to md:grid-cols-3 lg:grid-cols-6
What Worked Well
🧠
The retro is not step 5 — it is the loop itself
Framing compression as maintenance (step 5: extract) undersells it. It's the mechanism that makes ForgeKit compound. A session without a retro is half a session. That reframe changed how the principle is encoded in every doc.
🌱
Core principles should be able to evolve
Zeb named this explicitly: the principle is a belief, not a rule. The expression of it changes as the engine changes. Encoding it that way — with the belief separate from the method — means the method can update without losing the intent.
Rules Added to Playbook
1
Run npx tsc --noEmit before every deploy
Generated code (scripts that emit TSX) won't be caught by the editor. TypeScript errors in generated files only surface at build time — or pre-build if you run tsc manually. Make it a habit before every vercel --prod.
2
Empty typed arrays need explicit annotations
const x = [] infers undefined[] when there are no elements. const x: MyType[] = [] is unambiguous. Always annotate empty arrays in generated TypeScript.
3
Measure file sizes before deciding what to refactor
Token cost is proportional to file size. Run a char count across candidate files before picking what to compress. The numbers tell you where the ROI is — don't guess.
4
The retro belongs to the session it documents — write it now
Deferring the retro to next session means writing it cold, from memory, with less accuracy. The session JSON takes 10 minutes while the details are fresh. Do it before closing.
No features shipped. The engine got smarter.
Compression Session · ForgeKit · Medina OH · 2026-06-18
Next Session — Start Here
ShowUp: Build Starts Now
New Product
ShowUp — product definition + first screen — Named and committed. Next session: data model, stack decisions, first working SMS reminder loop. Write the ShowUp Armory pack card before the first line of code.
Backfill
Backfill older sessions as JSON files — Six hand-written HTML session pages have no JSON backing. Backfilling them feeds the trends generator with real spin/rule data. Low priority — do one per session as warmup.
Blocker
A2P 10DLC approval — Carrier SMS still blocked for Forge. Applies to ShowUp too — any new Twilio number needs registration. Check Twilio console. Plan 2–4 weeks lead time.
Deploy
About page + PWA manifest — Committed since June 17. Already deployed in this session as part of the batch. Verify live at forgekits.build/about.