app-design-thinking
Design the app mechanism and build pipeline for the produced app — the app-phase analog of [[schema-design]]. Use this skill whenever the knowledge phases are…
When a produced app accepts an input and runs an expensive generation job the end-user waits on — upload → queued → staged generation → progress → download — build the job runtime instead of letting the job live and die inside one HTTP request. Use this skill whenever a produced
$ npx -y skills add kitchen-engineer42/joharnessburg --skill job-runtime --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/job-runtimeContext preview
The summary Claude sees to decide when to auto-load this skill.
When a produced app accepts an input and runs an expensive generation job the end-user waits on — upload → queued → staged generation → progress → download — build the job runtime instead of letting the job live and die inside one HTTP request. Use this skill whenever a produced
name: job-runtime
description: When a produced app accepts an input and runs an expensive generation job the end-user waits on — upload → queued → staged generation → progress → download — build the job runtime instead of letting the job live and die inside one HTTP request. Use this skill whenever a produced app has generation taking more than a few seconds, a progress bar, a job queue, an upload-then-download flow, cancellation, or anything an end-user might refresh the page during. Triggers on "background job", "task queue", "progress tracking", "cancel the job", "resume after refresh", "download the result". This is the produced app's own runtime — NOT John's session endurance ([[context-management]]) and NOT build-time fan-out ([[vertical-workflows]]).
metadata:
triggers:
- job queue
- background job
- long generation
- upload and generate
- progress tracking
- task status
- cancel job
- download artifact
- resume task
- sse progressSome produced apps have the I/O shape: an end-user submits an input, the app runs an expensive generation job — often minutes of staged workerLLM calls — and the user eventually downloads an artifact. The naive build runs that job inside the HTTP request that submitted it. It works in a demo and fails in use, three ways:
1. **The job dies with the request.** Browser disconnect, laptop sleep, a flaky proxy — and minutes of generation are gone. 2. **Refresh loses everything.** There's no task ID to come back to; the user's only option is to start over. 3. **A stuck job eats capacity forever.** One hung generation holds its slot until someone restarts the server.
This skill teaches the runtime that prevents all three: a persistent task registry as the single source of truth, a bounded worker pool with leases, and endpoints whose state derives from the registry rather than from any open connection.
Apply it when generation is expensive enough that an end-user waits on it — multi-stage pipelines, anything past a few seconds, anything with a progress bar. Skip it when it isn't:
The gray zone is a single 5–30 second call. The deciding question: would a user plausibly refresh, navigate away, or submit twice while waiting? If yes, give the job a task ID and a registry row; the rest of the machinery can stay minimal.
John has two kinds of long parallel work, and they live at different layers. Provider-native scale-out plus [[event-log-and-reducer]] orchestrates *build-time* work: subagents fanning out inside the John session to build the app, coordinating through `.john/events/`. The job runtime ships *inside the produced app* and serves its end-users at app runtime — where the build agent, its subagents, and the event log don't exist. Don't reach for build-session orchestration in produced-app code, and don't build a tasks table to coordinate build-time subagents. Same instinct, different layer, different machinery.
Every long-running I/O app reduces to the same five pieces:
1. **A task registry** — a `tasks` table (SQLite by default) holding status, stage, paths, timestamps, lease. Every fact about a job lives in a row, not in process memory; everything else is a projection of it. 2. **A bounded worker pool** — N slots; workers claim queued tasks atomically and heartbeat a lease while running. 3. **A progress channel** — SSE or polling, either way projecting registry state to the browser so reconnect-by-task-ID always works. 4. **Control endpoints** — cancel, requeue, download. Cancellation is a flag the worker observes between stages, not a kill. 5. **A sweeper** — a periodic pass that enforces the budgets: queued too long → `queue_timeout`; lease expired → `interrupted` (recoverable, slot freed); ran too long → `generation_timeout`; artifacts past retention → `expired`.
The decisions to make consciously, each detailed in a reference:
The stages inside a job call workerLLMs using the standard call shape — nothing about it changes. What this skill adds is the budget nesting: per-call timeout × retries must fit inside the stage's share of the generation budget, and the generation budget must exceed the sum of the stage budgets with headroom. Run the lease heartbeat from a side timer so a stage's retry loop keeps the lease alive without sprinkling heartbeat calls through pipeline code.
The default runtime is a SQLite file next to the app, an in-process worker (a thread or asyncio task), and budgets configured through `.env`. No Redis, no message broker, no hosted job service — an external user must be able to clone, configure `.env`, and run. The references describe multi-process scale-ups (Postgres `SKIP LOCKED`
中文版: README_ZH.md John turns unstructured source material into a working knowledge-dense app. It keeps knowledge engineering and app building in one durable run, coordinates large per-entry fan-outs, and leaves auditable events and checkpoints on disk.
Design the app mechanism and build pipeline for the produced app — the app-phase analog of [[schema-design]]. Use this skill whenever the knowledge phases are…
Bundle a finished John workspace from Codex. Use when the user wants to archive, package, hand off, or preserve a John project, or wants the Claude command…
Break parsed markdown into a tree of progressively-disclosed chunks for downstream extraction. Use this skill whenever a phase needs to work on per-chunk…
Apply deterministic quality checks to the code John produces — catch the 80% of issues (leaked API keys, hardcoded prod URLs, broken imports, missing…
Generate John's process scorecard, auditor manifests, and shareable run report from a Codex project using John's provider-neutral scripts. Use when the user…
Activate a Hamster-built or otherwise applied John template for Codex in the current project. Use when a merged template plugin already exists, when the user…