Skip to content

Instantly share code, notes, and snippets.

View johnlindquist's full-sized avatar
💭
Educating 👨🏻‍🏫

John Lindquist johnlindquist

💭
Educating 👨🏻‍🏫
View GitHub Profile
@johnlindquist
johnlindquist / workflow-devkit-demos.md
Created February 25, 2026 20:29
Workflow DevKit Interactive Demos — 21 patterns on v0

Workflow DevKit Interactive Demos

Interactive demos for Vercel Workflow DevKit — each showcasing a different durable workflow pattern built with Next.js 16, React 19, and the workflow package.

# Demo Pattern v0 Link
1 Approval Gate Human-in-the-loop with timeout Open in v0
2 Onboarding Drip 7-day email drip in 6 lines Open in v0
3 Saga Step 3 fails — compensating rollbacks Open in v0
4 Cancellable Export Cancel a batch mid-flight Open in v0
@johnlindquist
johnlindquist / 10-tier-optimizations.md
Created February 24, 2026 15:50
Turborepo Performance Optimization Plans (17 research iterations with Oracle/GPT-5.2 sessions inlined)

Current State

Turborepo has already landed the big algorithmic win — topological-wave parallel task hashing (commit b3c0f46da8) — but several implementation details are now the bottleneck:

  • Parallelism is re-serialized by shared locks + deep clones: TaskHashTrackerState uses one RwLock guarding 6 independent HashMaps (crates/turborepo-task-hash/src/lib.rs:226-242), so any insert_hash() write blocks all concurrent reads. The visitor's wave-hashing funnels results through Arc<Mutex<HashMap>> with per-wave serialization (crates/turborepo-lib/src/task_graph/visitor/mod.rs:233-303).

  • Allocation hot-loops dominate hash & dispatch: DetailedMap (3 nested HashMaps) deep-cloned on every env_vars() read (line 622). EnvironmentVariableMap cloned per task at line 388. Repeated regex compilations for env patterns (4 per task in hashable_task_env) and glob patterns (O(packages) recompilations). SCM hashing allocates 10,000+ hex Strings inside parallel loops.

  • **I/O paths lea

@johnlindquist
johnlindquist / openclaw-cron-pairing-report.md
Created February 20, 2026 16:19
OpenClaw Cron in Vercel Sandbox: The Pairing Wall — Root Cause Analysis & Fix

OpenClaw Cron in Vercel Sandbox: The Pairing Wall

The User Story

You deploy OpenClaw (an AI gateway) inside a Vercel Sandbox and connect it to Telegram. Users chat with the bot. Everything works great — until someone says:

"Text me a silly joke every 5 minutes"

The bot tries to create a scheduled task (a cron job). It fails:

Status Update

tl;dr for boss

Locked in

  • OpenClaw on Vercel — all-in, nights/weekends, building messaging channels + dashboard
  • Workflow — 5 PRs, changelog, and X campaign demos nearly done; hitting weekly goals
  • ADX Club — will make time, sharing knowledge is non-negotiable for me
  • Open Plugin Spec — strong fit, already have the spec/alignment/leaderboard plan, ready to engage partners

Reconnecting Messaging Users to Stopped OpenClaw Sandboxes

tl;dr

  • Sandboxes stop after 10min idle — when a Telegram/Slack user sends a message, the bot is dead until it restarts
  • Sandbox URLs change on every restore, but our stable subdomain proxy ({key}.basedomain.com) already solves that
  • Option A (simpler): Enable OpenClaw's built-in channels — remove --skip-channels, use long polling mode so the Gateway polls Telegram itself. No webhook URLs needed. Downside: bot appears offline when sandbox is stopped, no way to send "booting up..." messages to users
  • Option B (better UX): Build our own webhook adapter — keep --skip-channels, add /api/webhooks/telegram on our always-on Next.js app. Queue messages in Redis, trigger restore, send "booting up..." progress messages, drain queue once sandbox is live. More code but full control over cold-start experience
  • Either way we need a wake-up mechanism to restore stopped sandboxes when messages arrive
  • OpenClaw natively supports 14+ platfor

Messaging Cold-Start UX Plan

tl;dr

  • Users messaging OpenClaw bots via Telegram/Slack hit stopped sandboxes — current proxy returns HTML waiting pages, which webhooks can't use
  • URL stability is already solved: stable subdomain proxy ({key}.basedomain.com) survives sandbox restarts
  • Build dedicated /api/webhooks/telegram (and /slack) endpoints that return 200 OK immediately and queue messages in Redis
  • Send "booting up..." progress messages via platform API, editing them every ~30s until sandbox is ready
  • Call OpenClaw directly via sandbox.domain(3000) + gateway token — skip the proxy and password gate entirely
  • Add a cron-based messaging pump to send progress updates and drain queues
@johnlindquist
johnlindquist / xorloop-xtodoloop-explainer.md
Last active February 16, 2026 17:00
How xorloop and xtodoloop work — autonomous AI loop explainers with Mermaid diagrams

xorloop & xtodoloop — How They Work

Two autonomous overnight loops from the AI Swarm DSL that discover, plan, and implement code improvements using Oracle (GPT-5.2) and Codex swarms (GPT-5.3).


High-Level Pipeline

flowchart TD
@johnlindquist
johnlindquist / codex-swarm-before-after.md
Created February 11, 2026 22:13
codex-swarm SKILL.md improvements: before/after behavior guide (4 critical + 4 high)

codex-swarm SKILL.md — Before/After Behavior Guide

CRITICAL 1: File Reads Rule

Before: "ZERO file reads" — absolute ban on all file reads. After: "NO source file reads" — nuanced rule with explicit allowlist.

Scenario Before (broke rule) After (legitimate)
git diff --stat after workers finish ❌ Violated "ZERO file reads" ✅ Explicitly allowed
@johnlindquist
johnlindquist / report.html
Created February 8, 2026 03:22
Claude Code Insights Report
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Claude Code Insights</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: #f8fafc; color: #334155; line-height: 1.65; padding: 48px 24px; }
.container { max-width: 800px; margin: 0 auto; }

The Great Split: 197 Rust Files Under 500 Lines

TL;DR

We enforced a strict 500-line maximum on every .rs file in the Script Kit GPUI codebase — a 328,000-line Rust project — using a swarm of 25 autonomous Codex agents working in parallel.


The Numbers