eobrien60/forge/obh-retrofit-jobs
Claude Code and agent skill by eobrien60/forge
- community
Checking that the SKILL.md file is still in the repository.
Use to assess or move slow, scheduled, or background work off the request path onto the OBH jobs queue. Finds cron routes, slow synchronous handlers, and report/import/cleanup tasks and proposes converting each to an idempotent job enqueued inside a transaction (assessment); then scaffolds the queue and worker handlers (implementation). Assessment-only by default; implements on request.
Install
npx vskill@latest install eobrien60/forge/obh-retrofit-jobsSKILL.md
The same SKILL.md was published earlier as eobrien60/forge/obh-retrofit-jobs.
Purpose: get long-running or deferred work out of API request handlers and into durable, retryable jobs (commands). Jobs are commands in snake_case (e.g. send_invoice_email, rebuild_search_index); they are enqueued transactionally and run in the worker.
Assessment (read-only)
- Find candidates. Grep the API for: cron/scheduled routes (
/cron/*,node-cron,setInterval, Vercel cron); handlers doing heavy synchronous work (loops over rows, external HTTP calls, PDF/report generation, bulk email); import/export processing; cleanup/retention tasks; anything that makes the request slow or can fail partway.
- Name each as a command.
snake_caseimperative:generate_monthly_report,import_contacts_csv,purge_expired_sessions,send_welcome_email. One job = one unit of retryable work.
- Design an idempotent handler. Each job must be safe to run more than once (at-least-once delivery). Use a natural idempotency key (resource id + operation, or a dedup column), upserts instead of blind inserts, and guard against double side-effects (e.g. mark-then-send). Define the payload as the minimal input the handler needs — pass ids, re-fetch current state inside the handler.
- Place the enqueue inside a tx. Decide the same transaction as the state change that should trigger each job, so a committed write always has its follow-up queued and a rolled-back write never leaks a job. Where a job should follow a fact, prefer emitting an event (see obh-add-events) and enqueueing the job from a subscriber — events are facts, jobs are the commands they trigger.
Produces the jobs retrofit plan. Nothing above mutates the repo — a valid stopping point when you only need the survey.
Implementation (only after the plan is agreed)
- Install and scaffold. Run
forge add jobs(--dry-runfirst). This adds the queue migration inscripts/migrations.d/*, the@obh/jobsclient (createJobsClient/pgAdapter/runMigrations), and a worker surface. Runpnpm migrate.
- Write the worker handler. Add a consumer under
apps/worker/src/consumers.d/*.tsexportinginit(ctx)/tick(ctx)(auto-loaded). Bind eachsnake_casejob to its handler; keep handlers small, log start/finish, and let the queue handle retry/backoff rather than catching-and-swallowing.
- Retire the old path. Replace the synchronous body of the original route with an enqueue that returns quickly (202/accepted). Remove cron routes once the worker owns the schedule. Keep the old code behind the same function signature during transition if callers depend on it. Then
forge doctor.
Output
Assessment → the jobs retrofit plan: a table of source (route/task) → job_name (snake_case) → payload → idempotency key → enqueue tx site → worker consumer file, plus per-route notes on what the handler returns after enqueue and which cron/synchronous code is removed. Implementation → the forge add jobs + pnpm migrate steps, the authored worker consumers, and the retired synchronous/cron code.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/obh-retrofit-jobs/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/eobrien60/forge/obh-retrofit-jobs)