Skip to content

Instantly share code, notes, and snippets.

@vitorcalvi
Created January 18, 2026 12:42
Show Gist options
  • Select an option

  • Save vitorcalvi/4b247742dd20ef200973bfd4c00d2384 to your computer and use it in GitHub Desktop.

Select an option

Save vitorcalvi/4b247742dd20ef200973bfd4c00d2384 to your computer and use it in GitHub Desktop.
@sisyphus ORCHESTRATOR-MODE — BOILERPLATE BLITZ (GATED + TIMED, MACBOOK BUILDER)

@Sisyphus ORCHESTRATOR-MODE — BOILERPLATE BLITZ (GATED + TIMED, MACBOOK BUILDER) Target coordinator: root@192.168.20.10 (Alpine Linux). MacBook executes all build commands. Goal: Film app Phase 1 (Auth + Movies CRUD) using official CLIs on MacBook, log full dev cycle timings to Alpine Linux.

ORCHESTRATION RULES

  • You are the primary orchestrator; delegate implementation to subagents and integrate results.
  • All shell execution (create-next-app, npm install, etc.) happens ON THE MACBOOK.
  • Alpine Linux coordinates via tmux: manages gate files, logs timings, and monitors progress.
  • MacBook SSHs to Alpine to report completion (create gate files) and write log entries.
  • Use tmux windows on Alpine for monitoring each worker's progress in real time.
  • Use gates (marker files on Alpine) to enforce dependencies between Mac-side steps.
  • Time every step and append to ONE log file on Alpine via SSH from Mac.

ARCHITECTURE OVERVIEW ┌─────────────────┐ SSH Reports ┌──────────────────────┐ │ MACBOOK │ ──────────────────> │ ALPINE LINUX │ │ (Builder) │ - Gate file touch │ (Coordinator) │ │ │ - Log append │ │ │ • Create App │ │ • WORKDIR │ │ • npm install │ │ • SESSION (tmux) │ │ • Prisma setup │ │ • helpers.sh │ │ • Auth/CRUD │ │ • LOG file │ │ • Dev Server │ │ • Gate files │ │ │ │ • Tmux windows │ └─────────────────┘ └──────────────────────┘ Runs Locally Coordinates & Monitors

PHASE 0 — BOOTSTRAP (YOU DO THIS YOURSELF, FIRST)

  1. From MacBook, SSH to Alpine and create:

    • WORKDIR=~/filmapp_
    • SESSION=filmapp_
    • LOG=$WORKDIR/devcycle_.txt Command:
    TIMESTAMP=$(date +%Y%m%d_%H%M%S)
    ssh root@192.168.20.10 "mkdir -p ~/filmapp_$TIMESTAMP && touch ~/filmapp_$TIMESTAMP/devcycle_$TIMESTAMP.txt && tmux new-session -d -s filmapp_$TIMESTAMP"
  2. Create tmux helper scripts on Alpine ($WORKDIR/helpers.sh) containing:

    • log_step() - Append step timing to LOG (called from Mac via SSH)
    • watch_gate() - Continuously poll for gate file creation
    • create_gate() - Create gate file marker
  3. Create tmux windows for monitoring (no commands, just for observation):

    ssh root@192.168.20.10 "tmux new-window -t $SESSION -n 'A-Scaffold' 'watch -n 0.5 \"ls -la $WORKDIR/.ok_scaffold 2>/dev/null || echo Waiting...\"'"
    ssh root@192.168.20.10 "tmux new-window -t $SESSION -n 'B-Deps' 'watch -n 0.5 \"ls -la $WORKDIR/.ok_deps 2>/dev/null || echo Waiting...\"'"
    # ... repeat for all 7 workers

PHASE 1 — DELEGATE WORKERS (SPAWN IMMEDIATELY) Spawn 7 parallel subagents (fresh contexts), each returns: (a) exact commands to run ON MACBOOK, (b) exact files they will create/modify on Mac, (c) SSH command to create their gate file on Alpine.

Worker A — Scaffold (must run first)

  • On MacBook:
    • npx create-next-app@latest film-app --ts --eslint --app --src-dir --import-alias "@/*"
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_scaffold"
  • Log timing:
    • ssh root@192.168.20.10 "echo "[$(date +%s)] Scaffold: s" >> $WORKDIR/devcycle_*.txt"

Worker B — Deps

  • Wait for Alpine .ok_scaffold (poll: ssh root@192.168.20.10 "test -f $WORKDIR/.ok_scaffold")
  • On MacBook:
    • cd film-app && npm install
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_deps"

Worker C — Prisma (SQLite for speed in Phase 1)

  • Wait for Alpine .ok_deps
  • On MacBook:
    • cd film-app && npm install prisma @prisma/client
    • npx prisma init --datasource-provider sqlite
    • Set DATABASE_URL=file:./dev.db in .env
    • Create schema in prisma/schema.prisma (Movie model)
    • npx prisma migrate dev --name init
    • Create seed script (50 movies) and run: npx prisma db seed
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_prisma"

Worker D — Auth (NextAuth + Prisma adapter)

  • Wait for Alpine .ok_prisma
  • On MacBook:
    • cd film-app && npm install next-auth @next-auth/prisma-adapter
    • Create src/app/api/auth/[...nextauth]/route.ts exporting GET/POST from NextAuth handler
    • Configure Prisma adapter in auth options
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_auth"

Worker E — Movies CRUD API

  • Wait for Alpine .ok_auth
  • On MacBook:
    • Create src/app/api/movies/route.ts (GET/POST)
    • Create src/app/api/movies/[id]/route.ts (GET/PATCH/DELETE)
    • Implement session validation for write routes
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_api"

Worker F — UI

  • Wait for Alpine .ok_api
  • On MacBook:
    • Create src/app/login/page.tsx (login form)
    • Create src/app/movies/page.tsx (movies list)
    • Create src/app/movies/add/page.tsx (add movie form)
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_ui"

Worker G — Run + Smoke + Report

  • Wait for Alpine .ok_ui
  • On MacBook:
    • cd film-app && npm run dev (run in background with nohup)
    • Wait for server start (sleep 10)
    • Run curl smoke tests: curl http://localhost:3000/api/movies
    • Run curl smoke test for auth endpoint
  • Gate creation on Alpine:
    • ssh root@192.168.20.10 "touch $WORKDIR/.ok_done"
    • Parse LOG and print top 10 slowest steps

EXECUTION PATTERN (MANDATORY)

  1. Phase 0: Bootstrap Alpine (SSH to Alpine, create directories, tmux session, helpers.sh)
  2. Spawn 7 subagents in parallel to get their command sets
  3. Execute workers sequentially on MacBook, with gate waiting:
    # On MacBook, for each worker:
    start_time=$(date +%s)
    <worker_commands>
    end_time=$(date +%s)
    duration=$((end_time - start_time))
    ssh root@192.168.20.10 "echo \"[$(date +%s)] <worker_name>: ${duration}s\" >> $WORKDIR/devcycle_*.txt"
    ssh root@192.168.20.10 "touch $WORKDIR/.ok_<worker>"
    
    # Wait for dependency gate:
    while ! ssh root@192.168.20.10 "test -f $WORKDIR/.ok_<dependency>"; do sleep 1; done
  4. Use GNU parallel where safe to saturate MacBook CPU (e.g., multiple npm installs if applicable)

FINAL OUTPUT

  • Print:
    • tmux session name on Alpine
    • WORKDIR on Alpine
    • LOG path on Alpine
    • Top 10 slowest steps (seconds + step name) parsed from LOG
  • Then propose 3 concrete improvements based on the slowest steps (cache, concurrency, or removing prompts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment